Compare commits

..

681 Commits

Author SHA1 Message Date
Mauricio Siu
c6569f70e4 Merge pull request #1182 from Dokploy/fix/disable-turn-off-cleanup
fix: turnoff cleanup cache
2025-01-23 00:54:30 -06:00
Mauricio Siu
d5c9338f51 fix: turnoff cleanup cache 2025-01-23 00:53:21 -06:00
Mauricio Siu
dba39b6364 Merge pull request #1180 from Dokploy/feat/add-error-logs-remote-server
Feat/add error logs remote server
2025-01-23 00:50:35 -06:00
Mauricio Siu
22de0fef49 chore: bump version 2025-01-23 00:44:48 -06:00
Mauricio Siu
03e1c17675 feat: add remote logs error when is not reachable 2025-01-23 00:44:31 -06:00
Mauricio Siu
6edd2a81e5 refactor: lint 2025-01-22 23:45:03 -06:00
Mauricio Siu
fe5b8782e9 chore: bump version 2025-01-22 23:44:43 -06:00
Mauricio Siu
71f28fae70 Merge pull request #1176 from wish-oss/feat/refactor-templates
feat:update templates glance and homarr
2025-01-22 23:43:53 -06:00
Mauricio Siu
c44618aa95 Merge pull request #1169 from SHABIN-K/add-malayalam-language
style(i18n) add malayalamlanguage
2025-01-22 23:39:37 -06:00
Mauricio Siu
c7d86dd430 Merge pull request #1178 from Dokploy/1175-preview-deployment-not-found-correctly
fix: set right branch in preview remote deployments
2025-01-22 23:33:29 -06:00
Mauricio Siu
e50bbd1a6a fix: set right branch in preview remote deployments 2025-01-22 23:33:05 -06:00
vishalkadam47
d5ff91563a fix: docker-compose.yaml to docker-compose.yml 2025-01-23 10:08:50 +05:30
vishalkadam47
210fe0759c feat:update templates glance and homarr 2025-01-23 03:43:04 +05:30
Shabin k
edff66900e add malayalam support 2025-01-22 12:26:05 +05:30
Shabin k
4cf2177928 add malayalam support 2025-01-22 12:23:38 +05:30
Shabin k
4a8306b015 Merge branch 'Dokploy:canary' into add-malayalam-language 2025-01-22 12:22:54 +05:30
Shabin k
f92d6693c3 add malayalam support 2025-01-22 12:22:27 +05:30
Mauricio Siu
81248ed03f fix: add continue to process all applications 2025-01-22 00:39:28 -06:00
Mauricio Siu
c7d5900e11 chore: bump version 2025-01-22 00:25:25 -06:00
Mauricio Siu
d0608f43a9 Merge pull request #1166 from rahadi23/bugfix/1165-navigation-items-permissions
fix: filter navigation items based on user's permissions and role
2025-01-22 00:24:55 -06:00
Mauricio Siu
adaf12a9a4 refactor: update 2025-01-22 00:16:00 -06:00
Mauricio Siu
baa2ca20f4 Merge branch 'canary' into bugfix/1165-navigation-items-permissions 2025-01-22 00:15:31 -06:00
Mauricio Siu
537caf02e5 Merge pull request #1167 from Dokploy/fix/creation-users
refactor: make protected instead of admin
2025-01-22 00:14:49 -06:00
Mauricio Siu
02ff507094 refactor: update lint 2025-01-22 00:14:30 -06:00
Mauricio Siu
53df7d969e refactor: make protected instead of admin 2025-01-22 00:13:22 -06:00
Rahadi Jalu
9e6e68558a fix: adjust dialog title based on add/update condition 2025-01-22 11:26:18 +07:00
Rahadi Jalu
a2e9ea2986 fix: add condition to show create project button 2025-01-22 11:26:18 +07:00
Rahadi Jalu
026e1bece6 fix: filter navigation items based on user's permissions and role 2025-01-22 11:26:18 +07:00
Mauricio Siu
51f6e08e16 Merge pull request #1158 from nktnet1/superset-unofficial-template
feat(template): added apache superset (unofficial)
2025-01-21 21:59:04 -06:00
Mauricio Siu
c0f8218ad9 Merge pull request #1161 from nktnet1/volume-file-mount-content-line-clamp
fix(ui): volume file mount content, line clamp and preserve whitespace
2025-01-21 21:51:07 -06:00
Mauricio Siu
35dd6bff7a Merge pull request #1160 from nktnet1/fix-invisible-mount-path
fix(ui): volume mountPath undefined for file mount - meant to display filePath instead?
2025-01-21 21:50:33 -06:00
Mauricio Siu
8dad8fd008 Merge pull request #1162 from mikield/add-ukrainian-language
style(i18n) add ukrainian language
2025-01-21 21:31:33 -06:00
Tam Nguyen
52dbc0d8f1 fix(template): superset healthchecks 2025-01-22 09:14:21 +11:00
Vladyslav G
692f883064 style(i18n) add ukrainian language 2025-01-21 16:21:29 +01:00
Khiet Tam Nguyen
6d90e268f7 fix(ui): volume file mount content, line clamp and preserve whitespace 2025-01-22 01:09:44 +11:00
Khiet Tam Nguyen
1d86f1a0fc fix(template): added analytics tag to superset 2025-01-22 00:05:55 +11:00
Khiet Tam Nguyen
c7338983b8 refactor(ui): clearer ui display condition for volume mount display 2025-01-21 23:45:54 +11:00
Khiet Tam Nguyen
ce06cd42b3 fix(ui): show filePath instead of mountPath for file mounts 2025-01-21 23:41:05 +11:00
Khiet Tam Nguyen
1a44a0ea5a refactor(template): use dokploy mount volume for superset_config.py 2025-01-21 23:14:28 +11:00
Khiet Tam Nguyen
444121f8d8 fix(template): more appropriate tags for superset 2025-01-21 20:40:46 +11:00
Khiet Tam Nguyen
05a75edbec feat(template): added apache superset (unofficial) 2025-01-21 19:03:35 +11:00
Mauricio Siu
f5d81f434c chore: bump package 2025-01-19 13:25:44 -06:00
Mauricio Siu
10353d1f29 Merge pull request #1147 from eltociear/patch-2
chore(logs): update utils.ts
2025-01-19 13:24:54 -06:00
Mauricio Siu
6226c75959 Merge pull request #1148 from Dokploy/fix/clean-cache
Fix/clean cache
2025-01-19 13:24:37 -06:00
Mauricio Siu
42c9cd5901 chore: bump package 2025-01-19 13:24:22 -06:00
Mauricio Siu
49edcdb99e fix: clean cache at the start of deployments 2025-01-19 13:22:23 -06:00
Ikko Eltociear Ashimine
ad71e8b36a chore(logs): update utils.ts
Exemple -> Example
2025-01-20 03:15:02 +09:00
Mauricio Siu
b166cd5bfa refactor: add settings page to user nav 2025-01-19 11:30:44 -06:00
Mauricio Siu
0045608acc chore: remove release title 2025-01-19 11:22:31 -06:00
Mauricio Siu
b140e81210 chore: update release 2025-01-19 11:20:22 -06:00
Mauricio Siu
9298d6c693 Merge pull request #1144 from Dokploy/canary
🚀 Release v0.17.3
2025-01-19 11:11:36 -06:00
Mauricio Siu
23df3fba85 refactor: regenerate migrations 2025-01-19 11:01:41 -06:00
Mauricio Siu
93c7f1ce76 chore: update 2025-01-19 10:56:43 -06:00
Mauricio Siu
1323394589 chore: remove draft 2025-01-19 10:51:05 -06:00
Mauricio Siu
4f11fc2547 chore: remove spaces 2025-01-19 10:49:08 -06:00
Mauricio Siu
6d052ad455 chore: add quotes 2025-01-19 10:47:04 -06:00
Mauricio Siu
60748da144 chore: update 2025-01-19 10:45:51 -06:00
Mauricio Siu
1956836cde refactor: update 2025-01-19 10:45:12 -06:00
Mauricio Siu
7dca4fe430 refactor: update 2025-01-19 10:43:32 -06:00
Mauricio Siu
84690c5f75 chore: update pr 2025-01-19 10:41:44 -06:00
Mauricio Siu
95b67ef2e9 chore: update 2025-01-19 10:36:47 -06:00
Mauricio Siu
3f8bc47ce5 refactor: update 2025-01-19 10:35:07 -06:00
Mauricio Siu
498678c4ae Revert "refactor: update"
This reverts commit 3d602c232d.
2025-01-19 10:21:30 -06:00
Mauricio Siu
3d602c232d refactor: update 2025-01-19 10:19:59 -06:00
Mauricio Siu
94ffa7d578 chore: update 2025-01-19 10:15:28 -06:00
Mauricio Siu
64fc3c7677 chore: remove pr 2025-01-19 10:14:58 -06:00
Mauricio Siu
f27830daf0 refactor: update version 2025-01-19 10:08:53 -06:00
Mauricio Siu
3ec2e2dd1a Revert "chore: bump version"
This reverts commit 1e006cb094.
2025-01-19 10:06:50 -06:00
Mauricio Siu
1e006cb094 chore: bump version 2025-01-19 10:00:54 -06:00
Mauricio Siu
8aa655af2c chore: add pr 2025-01-19 10:00:09 -06:00
Mauricio Siu
65659e27f1 Merge pull request #1137 from Dokploy/feat/github-runners
Feat/GitHub runners
2025-01-19 09:58:27 -06:00
Mauricio Siu
4b6f9108d4 refactor: update 2025-01-19 02:56:08 -06:00
Mauricio Siu
1e4a41a8e3 chore: replace circle with github actions 2025-01-19 02:55:05 -06:00
Mauricio Siu
539aa7a85b refactor: print version 2025-01-19 02:47:14 -06:00
Mauricio Siu
b6ae502b92 refactor: update 2025-01-19 02:38:38 -06:00
Mauricio Siu
e82db47ec4 refactor: add github docker 2025-01-19 02:33:53 -06:00
Mauricio Siu
f9b4f008c2 Merge pull request #1134 from Dokploy/1031-excessive-unused-docker-cache-generated-by-dokploy-deployments
feat: add cleanup cache on deployments
2025-01-19 02:08:48 -06:00
Mauricio Siu
adb204ec1f refactor: add sidebar persistence 2025-01-19 01:44:42 -06:00
Mauricio Siu
5310a559b0 refactor: improve sidebar 2025-01-19 01:29:29 -06:00
Mauricio Siu
43b7db00f9 refactor: add missing values to test 2025-01-19 01:21:03 -06:00
Mauricio Siu
52c83fd6fc refactor: update text 2025-01-19 01:07:41 -06:00
Mauricio Siu
25a8df567e feat: add cleanup cache on deployments 2025-01-19 00:57:42 -06:00
Mauricio Siu
089274492d Merge pull request #1125 from SlavenIvanov/feat/add-couch-db-template
feat: added couchdb template
2025-01-18 17:39:12 -06:00
Mauricio Siu
65c0ea829f Merge branch 'canary' into feat/add-couch-db-template 2025-01-18 17:39:02 -06:00
Mauricio Siu
d060eec465 Update apps/dokploy/templates/couchdb/docker-compose.yml 2025-01-18 17:38:33 -06:00
Mauricio Siu
2dca0d343e Merge pull request #1069 from nktnet1/accessed-typo
chore: typo "accesed" changed to "accessed" for TS code
2025-01-18 17:35:04 -06:00
Mauricio Siu
a8f63bb4d3 Merge pull request #1131 from agustints/fix/db-backups-destination-url
fix: Update link text and destination for db backup settings
2025-01-18 17:34:09 -06:00
Mauricio Siu
cecd371988 Merge pull request #1081 from depado/gotify-notifications
feat(notifications): implement gotify provider
2025-01-18 17:33:55 -06:00
Mauricio Siu
6c4d94cb4f Merge pull request #1118 from izayl/feature/ci-skip
feat: add ci skip check
2025-01-18 17:30:41 -06:00
Mauricio Siu
c4e5c818f3 Merge branch 'canary' into gotify-notifications 2025-01-18 17:23:35 -06:00
Mauricio Siu
31a35d91e8 Merge pull request #1088 from shiqocred/canary
Update telegram message notification
2025-01-18 17:22:50 -06:00
Mauricio Siu
74a2f79a36 Merge pull request #1123 from nktnet1/it-tools-template
feat(template): added it-tools
2025-01-18 11:02:42 -06:00
Mauricio Siu
a8f8a727bd Merge pull request #1128 from TheLetslook/patch-1
feat(style): custom scrollbar styling
2025-01-18 11:00:42 -06:00
Mauricio Siu
e8f2ab35c9 Merge pull request #1121 from thebadking/canary
style: fix tablet and mobile (Create from Template)
2025-01-18 10:52:24 -06:00
depado
9806a5d607 feat(notifications): fix gotify style 2025-01-18 14:23:53 +01:00
depado
e25d0c0c68 feat(notifications): implement notifications for gotify 2025-01-18 14:23:27 +01:00
depado
1f8a476264 chore(lint): run biome 2025-01-18 14:23:27 +01:00
depado
cc473b3e87 feat(notifications): implement gotify provider 2025-01-18 14:23:27 +01:00
Agustin Tornielli
10b3543d39 fix: Update link text and destination for db backup settings 2025-01-18 01:19:33 -03:00
thebadking
0893149db0 style: grid fix 2025-01-17 20:45:17 +00:00
Vasiliy
e257f86194 feat(style): custom scrollbar styling 2025-01-17 21:49:44 +03:00
Slaven Ivanov
a9a0b4cb03 feat: added couchdb template 2025-01-17 18:09:02 +02:00
Khiet Tam Nguyen
c5073c9f30 feat(template): added it-tools 2025-01-18 01:02:39 +11:00
izayl
e69c602d1c chore: enhance deployment skip message to include reason for skipping 2025-01-17 15:47:18 +08:00
izayl
0116d995d9 test: extractCommitMessage 2025-01-17 15:32:59 +08:00
Mauricio Siu
ad479c4be1 Merge pull request #1112 from nktnet1/conduwuit-template
feat(template): added conduwuit
2025-01-16 22:24:46 -06:00
Mauricio Siu
f70192a71c refactor: lint 2025-01-16 22:24:31 -06:00
Mauricio Siu
abff70f081 refactor: lint 2025-01-16 22:24:17 -06:00
Mauricio Siu
9f03faaec2 Merge branch 'canary' into conduwuit-template 2025-01-16 22:24:03 -06:00
Mauricio Siu
1d760bd25f Merge pull request #1104 from nktnet1/cloudflared-template
feat(template): added cloudflared
2025-01-16 22:20:59 -06:00
Mauricio Siu
26a67dd175 Merge pull request #1119 from wish-oss/extrernal-link
refactor: update icon handling and restructure sidebar external links
2025-01-16 22:15:57 -06:00
thebadking
013ee89a56 style: fix tablet and mobile (Create from Template) 2025-01-16 21:12:11 +00:00
vishalkadam47
c3d3c7b96a refactor: update icon handling and restructure sidebar external links 2025-01-16 19:31:55 +05:30
izayl
4e724d88aa feat: add ci skip check 2025-01-16 16:26:28 +08:00
Mauricio Siu
351e4b6103 Merge pull request #1115 from TheLetslook/patch-1
fix: db type typo
2025-01-15 23:30:29 -06:00
Vasiliy
5b633ec6c5 fix: db type typo
Postgres -> Mongo
2025-01-14 23:25:22 +03:00
Khiet Tam Nguyen
ca9552d618 chore: sort conduwuit tags 2025-01-14 17:30:45 +11:00
Khiet Tam Nguyen
23b40c1aa7 feat(template): added conduwuit 2025-01-14 17:21:05 +11:00
Mauricio Siu
5e0b7ba143 Merge pull request #1109 from 190km/fix/sidebar
fix: fixed missing cluster side item
2025-01-13 23:50:02 -06:00
Mauricio Siu
cb1203e302 refactor: exclude cluster from cloud 2025-01-13 23:49:22 -06:00
Mauricio Siu
373c5bc507 Merge pull request #1106 from DJKnaeckebrot/fix/styling-after-sidebar-fixes
fix(style): clean up sidebar related style issue
2025-01-13 23:41:00 -06:00
Mauricio Siu
ee5afa4793 Merge pull request #1110 from szwabodev/fix/wslCheck
fix: isWSL check was not awaited
2025-01-13 22:58:15 -06:00
Mauricio Siu
7b9426586d Merge pull request #1107 from joaotonaco/refactor/improve_sidebar_animation
refactor(sidebar): improve animation
2025-01-13 22:38:41 -06:00
190km
772b24a415 fix: fixed missing cluster side item 2025-01-13 14:12:19 +00:00
UndefinedPony
1922437115 fix: isWSL check was not awaited causing always true 2025-01-13 14:48:13 +01:00
João Gabriel
c5eb8b087d refactor: transition logo size 2025-01-13 09:20:02 -03:00
João Gabriel
94ee5391fb refactor: apply ease-out to sidebar toggle animation 2025-01-13 09:19:32 -03:00
djknaeckebrot
b3ff14f792 style: clean up class names for consistency in dashboard components 2025-01-13 12:09:06 +01:00
djknaeckebrot
b68273c8ca style: adjust grid layout for monitoring card and clean up class names 2025-01-13 12:02:59 +01:00
djknaeckebrot
8b203c48b4 feat: update sidebar with Traefik File System title and add support link 2025-01-13 11:55:58 +01:00
djknaeckebrot
fb33a5b6a5 style: make sure card do use the full width of the div 2025-01-13 11:53:05 +01:00
Khiet Tam Nguyen
b17ab6d8cb feat(template): added cloudflared 2025-01-13 20:02:18 +11:00
Mauricio Siu
30d20bd267 Merge pull request #1101 from Dokploy/canary
v0.17.2
2025-01-13 02:28:37 -06:00
Mauricio Siu
f9b1c2575e refactor: lint 2025-01-13 02:28:00 -06:00
Mauricio Siu
b0b22224c3 revert: add missing installation buttons 2025-01-13 02:27:49 -06:00
shiqocred
2de0e73284 Merge branch 'Dokploy:canary' into canary 2025-01-13 13:31:31 +07:00
shiqocred
537950dd9f Revision notification (#7)
* Update build-success.ts

* Update compose.ts

* Update application.ts

* Update notification.ts

* Update utils.ts

* Update dokploy-restart.ts

* Update docker-cleanup.ts

* Update database-backup.ts

* Update build-success.ts

* Update build-success.ts
2025-01-13 13:13:13 +07:00
Mauricio Siu
f2f3986c56 Merge pull request #1100 from Dokploy/canary
v0.17.1
2025-01-13 00:00:05 -06:00
Mauricio Siu
dd3fccea02 refactor: adjust sizes 2025-01-12 23:59:35 -06:00
Mauricio Siu
5052688aaf Merge pull request #1099 from Dokploy/fix/version
fix: adjust size of cards and add ssh keys
2025-01-12 23:52:58 -06:00
Mauricio Siu
5825b3eae7 Merge pull request #1098 from nktnet1/fix-ssh-keys-create-server
fix: query for ssh keys to show servers, rather than default empty
2025-01-12 23:52:28 -06:00
Mauricio Siu
dbca102178 fix: adjust size of cards and add ssh keys 2025-01-12 23:51:57 -06:00
Tam Nguyen
32a757a247 fix: query for ssh keys to show servers, rather than default empty 2025-01-13 16:44:34 +11:00
Mauricio Siu
8e4d8d68ca Merge pull request #1096 from Dokploy/canary
v0.17.0
2025-01-12 19:07:28 -06:00
Mauricio Siu
48e6c40a38 chore: bump version 2025-01-12 18:29:01 -06:00
Mauricio Siu
0a06c0aa28 refactor: add breadcrumb redis 2025-01-12 15:18:36 -06:00
Mauricio Siu
a965c0e924 fix: add prefix and remove resolution esm flag (#1095)
* fix: add prefix and remove resolution esm flag

* refactor: revert
2025-01-12 15:10:25 -06:00
Khiet Tam Nguyen
ae97595610 feat(template): added Actual Budget, a super fast and privacy-focused app for managing your finances (#1080)
Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
2025-01-12 14:46:11 -06:00
João Gabriel
106a660a2b fix: discord decoration tiny adjustment (#1086) 2025-01-12 14:42:39 -06:00
Alexis Loiseau
c25e7c53aa feat(template): added conduit, a matrix homeserver (#1087)
* feat(template): added conduit, a matrix homeserver

* Update apps/dokploy/templates/conduit/index.ts

* Update apps/dokploy/templates/conduit/index.ts

---------

Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
2025-01-12 14:41:50 -06:00
Vishal kadam
c9308aebc2 style: enhance template selection UI and add view modes toggle (#1094)
* feat: enhance template selection UI and add view modes toggle

* fix: show template tags only in detailed view mode

* refactor: set detailed

---------

Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
2025-01-12 14:34:28 -06:00
sao-coding
c0a2d2c399 feat(i18n): add missing keys and improve wording in Traditional Chinese translations (#1091)
* feat(i18n): add missing keys to Traditional Chinese translation

* feat(i18n): add missing keys to Traditional Chinese translation
2025-01-12 14:31:07 -06:00
Mauricio Siu
a104867ed2 Feat/add sidebar (#1084)
* refactor: add sidebar

* chore: add deps

* refactor: update sidebar

* refactor: another layout

* refactor: update variant

* refactor: change layout

* refactor: change variant

* refactor: enhance sidebar navigation with active state management

* feat: add project button to dashboard

* Merge branch 'canary' into feat/add-sidebar

* refactor: add loader

* refactor: update destinations and refactor

* refactor: ui refactor certificates

* refactor: delete unused files

* refactor: remove unused files and duplicate registry

* refactor: update style registry

* refactor: add new design registry

* refactor: enhance git providers

* refactor: remove duplicate files

* refactor: update

* refactor: update users

* refactor: delete unused files

* refactor: update profile

* refactor: apply changes

* refactor: update UI

* refactor: enhance Docker monitoring UI layout

* refactor: add theme toggle and language selection to user navigation (#1083)

* refactor: remove unused files

* feat: add filter to services

* refactor: add active items

* refactor: remove tab prop

* refactor: remove unused files

* refactor: remove duplicated files

* refactor: remove unused files

* refactor: remove duplicate files

* refactor: remove unused files

* refactor: delete unused files

* refactor: remove unsued files

* refactor: delete unused files

* refactor: lint

* refactor: remove unused secuirty

* refactor: delete unused files

* refactor: delete unused files

* remove imports

* refactor: add update button

* refactor: delete unused files

* refactor: remove unused code

* refactor: remove unused files

* refactor: update login page

* refactor: update login UI

* refactor: update ui reset password

* refactor: add justify end

* feat: add suscriptions

* feat: add sheet

* feat: add logs for postgres

* feat: add logs for all databases

* feat: add server logs with drawer logs

* refactor: remove unused files

* refactor: add refetch when closing

* refactor: fix linter

* chore: bump node-20

* revert

* refactor: fix conflicts

* refactor: update

* refactor: add missing deps

* refactor: delete duplicate files

* refactor: delete unsued files

* chore: lint

* refactor: remove unsued file

* refactor: add refetch

* refactor: remove duplicated files

* refactor: delete unused files

* refactor: update setup onboarding

* refactor: add breadcrumb

* refactor: apply updates

* refactor: add faker

* refactor: use 0 in validation

* refactor: show correct state

* refactor: update

---------

Co-authored-by: vishalkadam47 <vishal@jeevops.com>
Co-authored-by: Vishal kadam <107353260+vishalkadam47@users.noreply.github.com>
2025-01-12 14:29:43 -06:00
Tobias Barsnes
87f4c7b71b refactor: better focus-visible a11y (#1017)
* refactor: better focus-visible a11y

* style: fix tree leaf width

* style: input focus ring size

* refactor: focus a11y on project pages

* fix: project-environment import statement

* style: `ring-border` on input

* refactor: use ring border

---------

Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
2025-01-11 17:42:05 -06:00
shiqocred
d2094d6d76 Update notification.ts (#6)
fix router notification
2025-01-12 02:14:09 +07:00
shiqocred
c0b8a411bd Update build-success.ts (#5)
add format
2025-01-12 02:04:10 +07:00
shiqocred
1d8db07fa1 Add inline button telegram (#4)
* Update utils.ts

add type inline button

* Update dokploy-restart.ts

fixing format massage and adding [] for inline button type

* Update docker-cleanup.ts

fixing telegram message

* Update database-backup.ts

fixing telegram message

* Update build-error.ts

fixing message and adding button logs view

* Update build-success.ts

fixing message, adding domains props, adding inline button

* Update compose.ts

adding get domains compose and send to notif

* Update application.ts

adding get domains and send it to notif

* Update build-success.ts

fix space

* Update dokploy-restart.ts

fixing space
2025-01-12 01:20:39 +07:00
shiqocred
dd3618bfd9 Add inline button telegram (#3)
* Update utils.ts

add type inline button

* Update dokploy-restart.ts

fixing format massage and adding [] for inline button type

* Update docker-cleanup.ts

fixing telegram message

* Update database-backup.ts

fixing telegram message

* Update build-error.ts

fixing message and adding button logs view

* Update build-success.ts

fixing message, adding domains props, adding inline button

* Update compose.ts

adding get domains compose and send to notif

* Update application.ts

adding get domains and send it to notif
2025-01-12 00:55:31 +07:00
Khiet Tam Nguyen
9db979e43f fix(ui): full width for body tag (#1078) 2025-01-10 22:02:40 -06:00
shiqocred
553ae70656 feat(i18n): indonesian language (#1082)
* Update languages.ts

* Create common.json

* Create settings.json
2025-01-10 22:01:53 -06:00
Mauricio Siu
15fd663972 Merge pull request #1066 from szwabodev/fix/localServerTerminal
fix: connection to local server terminal
2025-01-10 00:45:11 -06:00
Mauricio Siu
123605dc0d Merge pull request #1068 from yiiman-dev/canary
Update wordpress version to latest
2025-01-08 22:20:38 -06:00
Mauricio Siu
d3f3265728 Merge pull request #1065 from nktnet1/gotenberg-template
feat(template): added Gotenberg, a Docker-powered stateless API for PDF files
2025-01-08 22:19:10 -06:00
Mauricio Siu
1a956314f8 Update apps/dokploy/templates/gotenberg/docker-compose.yml 2025-01-08 22:17:07 -06:00
Mauricio Siu
15cc8440f2 Merge pull request #1064 from nktnet1/template-generateBase64-import-index.ts
docs(contribution): fix template index.ts
2025-01-08 22:15:21 -06:00
Tam Nguyen
4a9d7225c9 chore: typo "accesed" changed to "accessed" for TS code 2025-01-08 13:44:59 +11:00
Saman Beheshtian (YiiMan)
103654d678 Update wordpress version to latest 2025-01-08 02:07:19 +00:00
Khiet Tam Nguyen
34a375776e docs: added the "tools" tag for gotenberg 2025-01-07 09:23:58 +11:00
Khiet Tam Nguyen
644fb1ef43 fix: switch to using gotenberg "latest" tag 2025-01-07 09:07:38 +11:00
Khiet Tam Nguyen
4e581bae99 fix: updated gotenberg from 8.15.2 -> 8.15.3 2025-01-07 09:03:49 +11:00
UndefinedPony
ee9f4796c3 style: remove spaces from commands 2025-01-06 12:12:23 +01:00
UndefinedPony
41a970c526 feat: add permission grant command when key generation fails 2025-01-06 12:09:54 +01:00
UndefinedPony
76c6d02566 feat: add ssh key comment for auto generated key 2025-01-06 12:09:15 +01:00
UndefinedPony
d0a5427c66 fix: connecting to local server terminal 2025-01-06 11:41:34 +01:00
UndefinedPony
aa3541b67b feat: add utils to get docker host and check if running on WSL 2025-01-06 11:39:19 +01:00
UndefinedPony
c31ed2b2b0 feat: add iproute2 as dependency to dockerfile 2025-01-06 11:38:08 +01:00
Khiet Tam Nguyen
a42b0ba32b docs(template): more concise description for gotenberg 2025-01-06 19:20:40 +11:00
Tam Nguyen
6866da97dd feat(template): added gotenberg, a pdf API service 2025-01-06 15:26:18 +11:00
Tam Nguyen
fdaea01b5b docs(contribution): added missing generateBase64 import for template index.ts 2025-01-06 14:00:43 +11:00
Khiet Tam Nguyen
fa2d81d2e7 docs(contribution): added missing generateBase64 import for template index.ts 2025-01-06 13:50:38 +11:00
Mauricio Siu
332416b7e7 Merge pull request #1054 from kerimovok/canary
feat(i18n): azerbaijani language
2025-01-05 15:34:17 -06:00
Mauricio Siu
7a4ee76eb6 Merge pull request #1039 from CyberHotline/canary
Added GLPI template
2025-01-05 14:50:09 -06:00
Mauricio Siu
0c304bd304 Merge pull request #1053 from SIPC/patch-1
Updated Chinese translation
2025-01-05 14:48:34 -06:00
Orkhan Karimov
8314c1a0a5 fix(indention): tab -> 4 spaces 2025-01-06 00:16:09 +04:00
Mauricio Siu
46a4e31e71 chore: add new sponsors 2025-01-03 16:19:48 -06:00
Mauricio Siu
acd3e0dd7d Merge pull request #1060 from jmsx/canary
fix: Update Vaultwarden version to 1.32.7 [CVE fix]
2025-01-03 14:58:18 -06:00
Mohab Gabber
f4e7a4d79a Merge branch 'canary' into canary 2025-01-03 19:11:33 +02:00
Jose Manuel Gonzalez
c7e5eba086 fix: Update Vaultwarden version to 1.32.7 [CVE fix] 2025-01-03 10:51:42 +01:00
Mauricio Siu
65361d18c2 Merge pull request #1055 from wish-oss/fix/console-error
refactor: remove unnecessary error logging in GPU setup functions
2025-01-02 16:21:04 -06:00
Mohab Gabber
bb5fd9895d fix: update MySQL image reference in docker-compose.yml 2025-01-02 21:28:52 +02:00
vishalkadam47
49a6b72c60 refactor: remove unnecessary error logging in GPU setup functions 2025-01-02 21:01:03 +05:30
Orkhan Karimov
84a88299ea feat(i18n): azerbaijani language 2025-01-02 16:27:57 +04:00
ink
d0fe635620 Update settings.json 2025-01-02 19:43:20 +08:00
Mauricio Siu
41d4ff8489 Merge pull request #1051 from wyattjoh/canary
fix: added unzip to server setup
2025-01-02 01:25:32 -06:00
Mauricio Siu
b9d8a48ae6 Merge pull request #1052 from Dokploy/1050-dokploy-ignore-run-command
refactor: add text for run command
2025-01-01 19:29:48 -06:00
Mauricio Siu
3e8708d2b9 refactor: add text for run command 2025-01-01 19:29:33 -06:00
Mauricio Siu
2b0232a24c Merge pull request #1047 from Pi-Bouf/environment-style-improvement
style: environment style improvement
2025-01-01 19:25:26 -06:00
Mauricio Siu
cbdea7cf48 Merge pull request #1049 from designorant/style/favicon-theme
style: enhance favicon with dark mode support
2025-01-01 19:19:56 -06:00
Mauricio Siu
f042cb720f Merge pull request #1042 from szwabodev/feat/newUpdateModalInNavbar
feat: use check updates modal for update available in navbar
2025-01-01 19:15:12 -06:00
Mauricio Siu
02b977bfc4 Merge pull request #1037 from 190km/feat-shows-req-when-is-active
feat: shows req when is active
2025-01-01 19:05:47 -06:00
Mauricio Siu
9f24f24de3 refactor: improve requests 2025-01-01 19:05:06 -06:00
Mauricio Siu
cbc8c24985 Merge pull request #1038 from 190km/swarm-style-improvement
style: swarm style improvement
2025-01-01 19:02:57 -06:00
Mauricio Siu
b17369264c refactor: remove min-h-screen 2025-01-01 19:02:24 -06:00
Mauricio Siu
9c783177c8 Merge pull request #1033 from DJKnaeckebrot/feature/check-mate-template
feat(template): add checkmate template
2025-01-01 18:57:32 -06:00
Mauricio Siu
f2159a3439 Update apps/dokploy/templates/checkmate/docker-compose.yml 2025-01-01 18:57:27 -06:00
Mauricio Siu
eec0a55212 Update apps/dokploy/templates/checkmate/docker-compose.yml 2025-01-01 18:57:23 -06:00
Mauricio Siu
16bab629de Merge pull request #1030 from DJKnaeckebrot/feature/fix-2fa-style
style(2fa): make pin input centered and make boarder more white to make it more visible
2025-01-01 18:54:49 -06:00
Mauricio Siu
592bf9292e Merge pull request #1032 from DJKnaeckebrot/feature/fix-huly-template
fix(huly-template): resolve issue with wrong domain
2025-01-01 18:54:33 -06:00
Mauricio Siu
b93d26f937 refactor: use shadcn ui classes 2025-01-01 18:53:30 -06:00
Mauricio Siu
c0e7f4ad8c Merge pull request #1029 from wish-oss/refactor/port-mapping-ui
refactor: enhance ManageTraefikPorts with ScrollArea for better UI
2025-01-01 18:52:09 -06:00
Mauricio Siu
05cf51bfb3 Merge pull request #1028 from designorant/feat/complete-polish
feat(i18n): add missing keys to Polish translation
2025-01-01 18:48:10 -06:00
Wyatt Johnson
7cf5cb4032 fix: added unzip to server setup
The installation script for rclone requires unzip to be present
in order to install. This adds this dep to the deps installed
as it's not present on Debian.
2025-01-01 16:44:41 -07:00
Michał Ordon
76787b9056 style: enhance favicon with dark mode support 2025-01-01 17:46:39 +00:00
Pierre B
513b17105e style: environment style improvement 2025-01-01 15:47:47 +01:00
UndefinedPony
187f051484 fix: check health endpoint instead of awaiting service restart to fix update success status 2024-12-31 11:20:59 +01:00
UndefinedPony
2be79304fb refactor: allow using already fetched updateData, remove ping icon 2024-12-31 11:19:22 +01:00
UndefinedPony
29a8cb63c0 refactor: pass update data and use updates modal in navbar 2024-12-31 11:13:58 +01:00
UndefinedPony
ed5936ede7 feat: add health endpoint for frontend app 2024-12-31 11:11:33 +01:00
Mohab Gabber
d4f89425db Added GLPI template 2024-12-30 23:45:59 +02:00
190km
a7983f32a6 style: added gap for cards title & gap for tls status & availability 2024-12-30 20:05:44 +01:00
190km
198ace236b feat: shows req when is active 2024-12-30 19:23:31 +01:00
djknaeckebrot
931f3fc28e feat: add checkmate template 2024-12-30 16:08:04 +01:00
DJKnaeckebrot
a4cc3b619a fix: resolve issue with wrong domain 2024-12-30 11:07:28 +01:00
DJKnaeckebrot
cb5077cfcc style(2fa): make pin input centered and make boarder more white to make it more visible 2024-12-30 10:54:47 +01:00
vishalkadam47
9122a1e4b2 refactor: enhance ManageTraefikPorts with ScrollArea for better UI and port management display 2024-12-30 07:32:34 +05:30
Michał Ordon
b2cf442d9b feat(i18n): add missing keys to Polish translation 2024-12-30 01:52:09 +00:00
Mauricio Siu
973b54408e Merge pull request #1027 from Dokploy/canary
v0.16.1
2024-12-29 18:39:17 -06:00
Mauricio Siu
638fbe17a6 refactor: update paths 2024-12-29 18:23:07 -06:00
Mauricio Siu
75e0d0ba78 refactor: add is cloud validation 2024-12-29 18:14:32 -06:00
Mauricio Siu
0f1b911236 chore: bump version 2024-12-29 18:08:20 -06:00
Mauricio Siu
da148a6c50 Merge pull request #959 from szwabodev/feat/localServerTerminal
feat: local server terminal access
2024-12-29 18:06:32 -06:00
Mauricio Siu
c168648cce Merge pull request #1026 from 190km/fix/missing-norwegian-select
fix: missing norwegian lang in select
2024-12-29 17:40:16 -06:00
190km
efd3ad4102 fix: missing norwegian lang in select 2024-12-30 00:30:57 +01:00
Mauricio Siu
a9577395eb Merge pull request #1025 from Dokploy/998-add-unifi-applicaton
feat: add unifi template
2024-12-29 17:19:33 -06:00
Mauricio Siu
1d02d4308f feat: add unifi template 2024-12-29 17:19:17 -06:00
Mauricio Siu
e93e15a9c8 Merge pull request #995 from 190km/refactor-i18n
feat: i18n displays real lang name
2024-12-29 16:14:03 -06:00
Mauricio Siu
511a9beaa5 Merge pull request #1024 from Dokploy/fix/add-fallback-getIp
refactor: add fallback ipv4
2024-12-29 16:13:48 -06:00
Mauricio Siu
ac8c180ba6 refactor: add fallback ipv4 2024-12-29 16:13:06 -06:00
Mauricio Siu
9a2898ba4f Merge pull request #1023 from Dokploy/1008-s3-provider-dropdown-default-value-reset
fix: add provider value in edit destination
2024-12-29 15:56:50 -06:00
Mauricio Siu
2c258c84eb fix: add provider value in edit destination 2024-12-29 15:56:30 -06:00
Mauricio Siu
36511f34f8 Merge branch 'canary' into refactor-i18n 2024-12-29 15:51:17 -06:00
Mauricio Siu
fee5bbc535 Merge pull request #1022 from Dokploy/fix/cron-jobs
fix: add try catch inside of cron jobs
2024-12-29 15:49:28 -06:00
Mauricio Siu
84ad9a5bb3 refactor: revert notifications 2024-12-29 15:45:54 -06:00
Mauricio Siu
69576988eb Merge pull request #1021 from Dokploy/fix/memory-reservation
Fix/memory reservation
2024-12-29 15:36:14 -06:00
Mauricio Siu
d65d050494 fix: add try catch inside of cron jobs 2024-12-29 15:35:15 -06:00
Mauricio Siu
46a5adf793 refactor: remove muted text 2024-12-29 14:17:15 -06:00
Mauricio Siu
5558ee3248 fix: add tooltip and placeholder values 2024-12-29 14:10:41 -06:00
Mauricio Siu
5d8ebd027e fix: parse correctly numbers 2024-12-29 13:53:38 -06:00
Mauricio Siu
9aa49ce9be Merge pull request #1019 from jocubeit/canary
Spelling and grammar corrections
2024-12-29 13:52:31 -06:00
Mauricio Siu
7bcfc17fe9 Merge pull request #1020 from champ3oy/patch-1
convert email to lower case when loging in
2024-12-29 13:34:27 -06:00
cirlorm
5d2d4104f0 convert email to lower case when loging in
I had an issue signing in to my dashboard only to find out it was because the first letter of my email was in caps.
2024-12-29 17:46:44 +00:00
Dom
2af8d6f565 Spelling and grammar corrections 2024-12-29 22:34:57 +10:00
Mauricio Siu
ba45b27608 Merge pull request #1010 from joaotonaco/canary
feat: prevent layout shifting from scrollbar
2024-12-28 19:31:36 -06:00
Mauricio Siu
5aa1c6efb7 Merge pull request #1011 from joaotonaco/fix/inconsistent-service-card-height
fix: inconsistent service card height
2024-12-28 19:30:42 -06:00
Mauricio Siu
e9dad8f9f8 Merge pull request #1016 from 190km/style/swarm
feat: swarm overview style
2024-12-28 19:30:13 -06:00
Mauricio Siu
0c2a382541 Update apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx 2024-12-28 19:29:51 -06:00
190km
81408985d4 feat: swarm overview style 2024-12-29 01:07:47 +01:00
João Gabriel
d45b558251 fix: inconsistent service card height 2024-12-27 11:08:55 -03:00
João Gabriel
a30b1a0cb8 refactor: prevent layout shifting from scrollbar 2024-12-27 10:51:31 -03:00
João Gabriel
c946e3e01b refactor: prevent layout shifting from scrollbar 2024-12-27 10:50:36 -03:00
Mauricio Siu
eb7bae2ef5 Merge pull request #1006 from Dokploy/canary
v0.16.0
2024-12-26 22:52:02 -06:00
Mauricio Siu
4533b193a4 chore: bump version 2024-12-26 22:32:44 -06:00
Mauricio Siu
c22f744e6c Merge pull request #1000 from faytranevozter/feat/simplify-node-logs
Feat: simplify node service log & add badge color on list service/container
2024-12-26 22:23:43 -06:00
Mauricio Siu
d3663eba6b Merge pull request #1005 from Dokploy/fix/swarm-overview
fix: remove unused parsed
2024-12-26 22:18:52 -06:00
Mauricio Siu
f9e4a71144 fix: remove unused parsed 2024-12-26 22:14:18 -06:00
faytranevozter
985b8bc2e0 refactor: extract badgeStateColor function for reuse across log components 2024-12-27 08:48:36 +07:00
Mauricio Siu
87ef889114 Merge pull request #999 from 190km/logs-typo
fix: typo Logssss > Logs
2024-12-26 13:31:57 -06:00
Mauricio Siu
f3494922be Merge pull request #997 from Barsnes/feat/norwegian-lang
feat(i18n): add Norwegian language support
2024-12-26 13:31:21 -06:00
faytranevozter
27252cf58d feat: add badge component to display container state with color coding 2024-12-27 01:44:46 +07:00
faytranevozter
f69fb7684b fix: normalize state string to lowercase and update filter quotes in docker service functions 2024-12-27 01:44:10 +07:00
faytranevozter
20a7995d73 fix: update docker logs command to conditionally include raw flag for swarm 2024-12-27 01:43:52 +07:00
faytranevozter
6df66c3871 fix: correct typo in logs title 2024-12-27 01:34:20 +07:00
usopp
cbfdda1928 fix: typo Logssss > Logs 2024-12-26 17:20:18 +01:00
Tobias Barsnes
766279f265 fix: add norwegian common.json file 2024-12-26 13:30:29 +01:00
Tobias Barsnes
f6e4ae700a feat(i18n): add Norwegian language support 2024-12-26 13:26:16 +01:00
Mauricio Siu
8c8ffe04a7 Merge pull request #926 from thewilloftheshadow/feat/mongo-replica-sets
feat: mongo replica sets
2024-12-25 23:37:29 -06:00
190km
f242f5c65e chore: lint 2024-12-26 01:29:18 +01:00
190km
46348f43f6 chore: lint 2024-12-26 01:26:53 +01:00
190km
c3476a1fdf refactor: refactored i18n to display real lang name 2024-12-26 00:04:50 +01:00
Mauricio Siu
379ea2ac65 Merge pull request #994 from jmsx/canary
feat(i18n): add Spanish language support
2024-12-25 16:34:24 -06:00
Jose Manuel Gonzalez
a172abaee4 feat(i18n): add Spanish language support 2024-12-25 22:44:31 +01:00
Mauricio Siu
a325b293b6 Merge pull request #990 from Dokploy/986-error-to-save-the-deployment
fix: omit macos files and create folders every time
2024-12-25 13:48:48 -06:00
Mauricio Siu
364c2e192e fix: adjust types 2024-12-25 13:45:24 -06:00
Mauricio Siu
d4a3c5cff9 fix: omit macos files and create folders every time 2024-12-25 04:51:49 -06:00
Mauricio Siu
229a9a3a5e Merge pull request #989 from Dokploy/refactor/add-no-trunc
Refactor/add no trunc
2024-12-25 03:54:51 -06:00
Mauricio Siu
5c1993a647 refactor: exclude dokploy services 2024-12-25 03:54:25 -06:00
Mauricio Siu
64a449a09d refactor: add swarm improvements 2024-12-25 03:45:21 -06:00
Mauricio Siu
e65e6d225f refactor: add no trunc 2024-12-25 03:35:21 -06:00
Mauricio Siu
b4fcdc433e feat: add migration 2024-12-25 03:27:46 -06:00
Mauricio Siu
5ce6172187 Merge branch 'canary' into feat/mongo-replica-sets 2024-12-25 03:27:00 -06:00
Mauricio Siu
0affeea5dd remove 2024-12-25 03:26:06 -06:00
Mauricio Siu
8f76d520c8 feat: add replica sets migration 2024-12-25 03:24:18 -06:00
Mauricio Siu
566d9e0bee Merge pull request #931 from faytranevozter/feature/node-cluster-logs
feat: add support for viewing docker logs in swarm mode
2024-12-25 02:52:49 -06:00
Mauricio Siu
da858e215d refactor: add toggle for normal containers & stack 2024-12-25 02:51:44 -06:00
Mauricio Siu
f672c429c4 Merge branch 'canary' into feature/node-cluster-logs 2024-12-25 02:15:14 -06:00
Mauricio Siu
ce34fe3cd8 Merge pull request #985 from Barsnes/chore/autocomplete-off
fix: turn off `autoComplete` for some inputs
2024-12-25 00:48:36 -06:00
Tobias Barsnes
d8dbdb2b9e fix: turn off autoComplete for some inputs 2024-12-25 03:23:02 +01:00
Mauricio Siu
4065ad4428 Update apps/dokploy/components/dashboard/project/add-database.tsx
Co-authored-by: Dominik Koch <dominik@koch-bautechnik.de>
2024-12-24 15:34:09 -06:00
Mauricio Siu
e035062a10 Merge pull request #971 from drudge/cert-enhancements
fix(certificates): ensure certificates are accessible by traefik
2024-12-24 15:33:26 -06:00
Mauricio Siu
36a1daae4b Merge pull request #984 from Dokploy/feat/add-hide-extra-logs
feat: add hide extra logs
2024-12-24 15:13:18 -06:00
Mauricio Siu
830a254837 Merge pull request #979 from drudge/compose-builder-error
fix: show error message when compose builder throws
2024-12-24 15:10:19 -06:00
Mauricio Siu
b8580d69d6 feat: add hide extra logs 2024-12-24 15:09:57 -06:00
Mauricio Siu
e3f1518b0d Merge pull request #977 from drudge/ports-ui
feat(traefik/ports): improved UI
2024-12-24 14:47:58 -06:00
Mauricio Siu
ce19a42aee refactor: use react hook form 2024-12-24 14:47:42 -06:00
Mauricio Siu
28a2ab9aa5 Merge pull request #974 from drudge/preview-deployments
feat(preview-deployments): new UI
2024-12-24 14:31:37 -06:00
Mauricio Siu
0535d780b1 refactor: add missing running state 2024-12-24 14:31:05 -06:00
Mauricio Siu
e1dd666e24 Merge pull request #972 from drudge/traefik-port
fix(setup): use traefik port/version from env
2024-12-24 14:28:10 -06:00
Mauricio Siu
ce71fa4f4d Merge pull request #962 from joaotonaco/feat/discord-emoji-toggle
feat(notifications): discord decoration toggle
2024-12-24 14:13:09 -06:00
Nicholas Penree
364d04f238 fix: show error message when compose builder throws
(cherry picked from commit 3633e3d66ab73a89382d0a2f079af63f57289419)
2024-12-23 22:13:49 -05:00
Nicholas Penree
0db98c0b92 feat(traefik/ports): improved UI 2024-12-23 21:39:16 -05:00
Nicholas Penree
8410d94283 feat(preview-deployments): new UI 2024-12-23 16:55:13 -05:00
Nicholas Penree
56cfd35e7d feat(certificates): clarify you are selecting the cert provider 2024-12-23 12:37:53 -05:00
Nicholas Penree
e7beb5c75b fix(setup): use traefik port/version from env 2024-12-23 10:32:31 -05:00
Nicholas Penree
9c5a61e42f fix(certificates): show proper placeholder for private key format 2024-12-23 09:17:11 -05:00
Nicholas Penree
0ee5a6f13e fix(certificates): ensure certificates are accessible by traefik 2024-12-23 09:16:10 -05:00
João Gabriel
1d35d218ca Merge branch 'canary' into feat/discord-emoji-toggle 2024-12-23 10:08:56 -03:00
Mauricio Siu
96cdffb5b9 Merge pull request #886 from DJKnaeckebrot/feature/delete-docker-volumes
feat: option to delete docker volumes on service deletion
2024-12-23 02:38:28 -06:00
Mauricio Siu
353effd720 refactor: delete log 2024-12-23 02:37:04 -06:00
Mauricio Siu
8bfe1632fa refactor: remove delete volumes 2024-12-23 02:32:43 -06:00
Mauricio Siu
ed543e5397 refactor: lint 2024-12-23 02:28:40 -06:00
djknaeckebrot
c6892ba188 format: fix formatting 2024-12-23 08:39:50 +01:00
djknaeckebrot
fa710d4855 format: fix formatting 2024-12-23 08:39:11 +01:00
djknaeckebrot
375decebb2 chore: remove application delete volume 2024-12-23 08:36:18 +01:00
djknaeckebrot
be2e70a17e chore: only make this apply to compose files 2024-12-23 08:27:45 +01:00
djknaeckebrot
3b4214e040 Merge remote-tracking branch 'origin/feature/delete-docker-volumes' into feature/delete-docker-volumes 2024-12-23 08:13:57 +01:00
djknaeckebrot
43a493bb5a Merge branch 'canary' into feature/delete-docker-volumes 2024-12-23 08:13:12 +01:00
Mauricio Siu
455cae6b8c Merge pull request #938 from 190km/preview-deployment-view
style(preview-deployment): better preview deployment card
2024-12-23 00:40:51 -06:00
Mauricio Siu
869843d9ac Merge pull request #921 from DJKnaeckebrot/feature/swarm-overview
feat: add swarm overview page
2024-12-23 00:09:09 -06:00
Mauricio Siu
d2b662f547 Merge pull request #904 from acgonzales/fix/api-appname
fix: fixed/improved handling of app names in api
2024-12-23 00:08:40 -06:00
Mauricio Siu
31336152ce Merge pull request #968 from drudge/fix-esc-vi
fix: prevent Esc key from closing terminal modals
2024-12-23 00:07:47 -06:00
Mauricio Siu
6afd443257 feat: add swarm overview for servers 2024-12-23 00:03:30 -06:00
Mauricio Siu
1d023ac9f3 Merge pull request #965 from drudge/fancy-ansi
feat(logs): use fancy-ansi for ansi colors
2024-12-22 23:09:02 -06:00
Devin AI
49616e53ea fix: prevent Esc key from closing terminal modals
Co-Authored-By: Nicholas Penree <nick@penree.com>
(cherry picked from commit ee469d5ac3f72cc8e010728cc7c6273c711875b0)
2024-12-22 23:59:57 -05:00
Mauricio Siu
a32e934969 Merge pull request #967 from 190km/white-theme-notifications
style(notifications): fixed white style
2024-12-22 22:59:49 -06:00
190km
eb495b7b99 style: fixed white style 2024-12-23 03:15:11 +01:00
190km
65ddc22010 refactor: removed useless export 2024-12-23 02:41:08 +01:00
190km
7a5b9e3b76 refactor: deleted separate component, and add it to show preview build 2024-12-23 02:34:50 +01:00
Nicholas Penree
5a302d3c47 feat(logs): use fancy-ansi for ansi colors 2024-12-22 15:20:54 -05:00
DJKnaeckebrot
5c5066bc72 chore: remove server from swarms page 2024-12-22 20:07:48 +01:00
UndefinedPony
228d12a61c refactor: code cleanup 2024-12-22 19:01:02 +01:00
UndefinedPony
fd0a9b8b58 feat: add local server config, add local server support in terminal modal, add fixed terminal container height 2024-12-22 18:46:02 +01:00
UndefinedPony
1ea7d2e1bf feat: enable server translations for servers page 2024-12-22 18:44:38 +01:00
UndefinedPony
7e08c8881e refactor: adapt terminal component to pass local server data and add initialized check 2024-12-22 16:37:26 +01:00
UndefinedPony
e68d867d31 refactor: adapt terminal wss to allow local server connection, add status logs 2024-12-22 16:35:28 +01:00
UndefinedPony
a53929a787 feat: add enter terminal option to server dropdown 2024-12-22 16:32:20 +01:00
UndefinedPony
ec8eaf6249 feat: add util to configure and get private ssh key for local ssh connection 2024-12-22 16:31:52 +01:00
UndefinedPony
0d58935ad1 refactor: translations for common terminal stuff 2024-12-22 16:30:53 +01:00
Mauricio Siu
f7c8324c4b Merge pull request #963 from Dokploy/540-need-more-control-over-docker-compose-command-in-deployments
540 need more control over docker compose command in deployments
2024-12-22 01:55:49 -06:00
Mauricio Siu
c0e9670daf refactor: delete log 2024-12-22 01:53:30 -06:00
Mauricio Siu
a710728e77 feat: add support for custom command 2024-12-22 01:51:05 -06:00
João Gabriel
80bd80b786 refactor: make decoration prop optional at discord tester schema 2024-12-22 01:08:34 -03:00
João Gabriel
6e262cde0d fix: update discord notification decoration 2024-12-22 01:07:29 -03:00
João Gabriel
21b2cce7a0 fix: send decoration prop to notification tester 2024-12-22 01:06:47 -03:00
João Gabriel
870e074825 feat: implement decoration to embeds 2024-12-22 00:44:25 -03:00
João Gabriel
055b59e6fa feat: discord decoration switch 2024-12-22 00:42:00 -03:00
João Gabriel
8c06296503 feat: add decoration column to discord notification 2024-12-22 00:39:18 -03:00
190km
29ce8908ee refactor: remove all the props except id, serverid, isloading, and delete function 2024-12-21 23:11:55 +01:00
Mauricio Siu
839e1c0f9f Merge pull request #961 from Dokploy/canary
v0.15.1
2024-12-21 15:42:19 -06:00
Mauricio Siu
54dd531a26 Merge branch 'main' into canary 2024-12-21 15:36:20 -06:00
Mauricio Siu
7ebf5ad0f9 chore: bump version 2024-12-21 15:28:27 -06:00
Mauricio Siu
b85163d935 refactor: add conditional value 2024-12-21 15:10:00 -06:00
Mauricio Siu
a953e59327 Merge pull request #960 from Dokploy/fix/add-latest-cases
refactor: update digest
2024-12-21 15:00:51 -06:00
Mauricio Siu
b2661e4533 refactor: update 2024-12-21 14:58:58 -06:00
Mauricio Siu
883459624e refactor: update digest 2024-12-21 14:54:14 -06:00
Mauricio Siu
6e2b2d564b refactor: add missing additional ports 2024-12-21 14:11:06 -06:00
Mauricio Siu
065963857c Merge pull request #958 from Dokploy/fix/update-fetch
Fix/update fetch
2024-12-21 13:50:13 -06:00
Mauricio Siu
a0c9df4bd4 refactor: add 7 minutes interval 2024-12-21 13:35:17 -06:00
Mauricio Siu
68c8c70260 refactor: iterate pages 2024-12-21 13:34:50 -06:00
Mauricio Siu
a926f28d30 Merge pull request #930 from lost-end-found/additional-ports-management
feat(ports): implement additional ports management
2024-12-21 13:30:32 -06:00
Mauricio Siu
59c0636fb0 refactor: add is cloud to fn 2024-12-21 13:19:30 -06:00
Mauricio Siu
ae159c5678 refactor: add tag to web server update 2024-12-21 13:13:38 -06:00
Mauricio Siu
0abf62dd52 refactor: prevent update appName in services 2024-12-21 13:10:34 -06:00
UndefinedPony
e2b155280a feat: add enter terminal translation 2024-12-21 20:08:08 +01:00
Mauricio Siu
e42e9bec17 refactor: use schema inline 2024-12-21 12:48:32 -06:00
Mauricio Siu
978324e2bf Merge pull request #957 from drudge/check-for-updates
New Updates UI
2024-12-21 12:47:24 -06:00
Nicholas Penree
8f05f06259 Merge remote-tracking branch 'dokploy/canary' into check-for-updates 2024-12-21 13:47:01 -05:00
Mauricio Siu
392be2cfa2 Merge pull request #951 from szwabodev/checkUpdatesTweaks
feat: automatic check for updates
2024-12-21 12:45:39 -06:00
Mauricio Siu
18e89df9a5 Update apps/dokploy/components/layouts/navbar.tsx 2024-12-21 12:45:14 -06:00
UndefinedPony
4d2a9f8aa7 refactor: use dynamic tag for comparing latest tag digest 2024-12-21 13:35:39 -05:00
Nicholas Penree
d08530d451 feat(updates): clean up light mode 2024-12-21 13:02:58 -05:00
UndefinedPony
6c9b12cee9 refactor: use dynamic tag for comparing latest tag digest 2024-12-21 18:33:22 +01:00
Nicholas Penree
a8ff6c7b3f feat(updates): new update UI 2024-12-21 11:24:19 -05:00
UndefinedPony
8699e024ee refactor: add try catch, add default update data 2024-12-21 10:05:31 +01:00
Mauricio Siu
73782ffd26 Merge pull request #954 from Dokploy/915-daily-docker-cleanup-seems-to-be-doing-nothing
fix: add missing notifications in cron jobs
2024-12-21 02:51:52 -06:00
Mauricio Siu
7a8bb8f71d fix: add missing notifications in cron jobs 2024-12-21 02:45:58 -06:00
UndefinedPony
18eae9f7d7 refactor: use service image sha instead of image itself for checking updates 2024-12-21 09:04:25 +01:00
Mauricio Siu
1aae523a0b refactor: add missing verifyToken 2024-12-21 01:53:39 -06:00
UndefinedPony
f40e802331 fix: pull latest release in case of no image when checking update 2024-12-21 08:47:21 +01:00
Mauricio Siu
d979aa17c2 Merge pull request #948 from 190km/notifications-style
style(notifications): better notification item style
2024-12-20 23:34:57 -06:00
Mauricio Siu
e2d20fb0e3 Merge pull request #929 from drudge/certificate-details
feat(certs): show expiration and chain details
2024-12-20 23:23:33 -06:00
Mauricio Siu
62f59c1f9a Merge pull request #941 from mezotv/bump-plausible
feat(plausible): bump to 2.1.4
2024-12-20 23:17:22 -06:00
Mauricio Siu
93e1071057 Merge pull request #949 from 190km/fix-edit-password
fix(settings/profile): edit profile password fixed
2024-12-20 23:17:07 -06:00
Mauricio Siu
788771c5eb refactor: add password in validation 2024-12-20 23:16:38 -06:00
UndefinedPony
ab9aa56c48 refactor: disable automatic updates for cloud version 2024-12-20 18:57:28 +01:00
UndefinedPony
4565b3d7a2 refactor: add latestVersion information to update data 2024-12-20 18:26:54 +01:00
UndefinedPony
c8514e3a1b refactor: remove unused async 2024-12-20 17:32:10 +01:00
UndefinedPony
a06dd17aa1 feat(navbar): add automatic update checking interval, add update available button 2024-12-20 17:30:14 +01:00
UndefinedPony
256534570b refactor: add image tag helper, refactor update check logic, remove try/catch 2024-12-20 17:29:01 +01:00
UndefinedPony
2804748118 refactor: rename action, move pull to updateServer 2024-12-20 17:27:51 +01:00
UndefinedPony
e6bc40e7fe refactor: adapt to navbar version, move confirm action, add reload info 2024-12-20 17:27:14 +01:00
UndefinedPony
196603126b refactor: move check updates function, use new api 2024-12-20 17:26:31 +01:00
UndefinedPony
a5cd8f18cd feat: show auto check update toggle 2024-12-20 17:23:02 +01:00
UndefinedPony
b842887bc3 feat: add toggle for auto updates checking 2024-12-20 16:43:05 +01:00
UndefinedPony
dd64b06340 style: format with biome 2024-12-20 14:09:05 +01:00
UndefinedPony
d9a1976cc0 fix: check updates message fixes 2024-12-20 14:01:55 +01:00
190km
fdfa927532 feat(settings/profile): reset password form after validating password change 2024-12-20 01:00:16 +01:00
190km
bf2551b0f6 fix(settings/profile): fixed password changing 2024-12-20 00:54:32 +01:00
usopp
ed8be62ff3 chore: lint 2024-12-20 00:24:44 +01:00
usopp
77336a21f9 chore: lint 2024-12-20 00:21:51 +01:00
usopp
e05d01788f style(notifications): better notification item style 2024-12-20 00:11:48 +01:00
Dominik Koch
651e81ce6d feat(plausible): bump to 2.1.4 2024-12-19 11:22:58 +01:00
Mauricio Siu
fac29b70a5 Merge pull request #937 from drudge/fix-custom-registry
fix(docker): fix for custom registry login
2024-12-19 02:14:34 -06:00
Mauricio Siu
95eaab43df Merge pull request #936 from drudge/fix-light-term
fix(term): fix light mode foreground color
2024-12-19 02:14:26 -06:00
Mauricio Siu
abdef13b93 refactor: set current color 2024-12-19 02:14:06 -06:00
Mauricio Siu
65f397e1b1 Merge pull request #939 from 190km/2fa-typo-login
fix(2fa-login): typo - Setup -> Login
2024-12-19 02:08:26 -06:00
Mauricio Siu
1ae96297e8 refactor: update lint 2024-12-19 02:07:08 -06:00
Mauricio Siu
c51b502116 refactor: add path join to prevent concatenate double slash and update the getImageName 2024-12-19 02:05:30 -06:00
Mauricio Siu
5a42b78098 Merge pull request #940 from drudge/wrap-secrets
fix(preview-deployments): wrap long envs
2024-12-19 01:19:01 -06:00
Nicholas Penree
b39c0ef915 fix(preview-deployments): wrap long envs 2024-12-18 23:00:50 -05:00
Nicholas Penree
844d582147 fix(docker): fix for custom registry login 2024-12-18 21:58:22 -05:00
190km
0b51088489 fix: typo - Setup -> Login 2024-12-19 02:10:07 +01:00
usopp
9d1cf3736b chore: lint 2024-12-19 01:58:18 +01:00
usopp
3a95474662 chore: lint 2024-12-19 01:44:20 +01:00
190km
3858205e52 style: better preview deployment card 2024-12-18 22:36:57 +01:00
Nicholas Penree
1dece58cff fix(term): fix light mode foreground color
closes #907
2024-12-18 13:56:09 -05:00
Shadow
06b8c82484 feat: add a toggle for replica sets to be used or not 2024-12-18 11:50:30 -06:00
DJKnaeckebrot
8ea453f444 feat: add application handling 2024-12-18 13:01:09 +01:00
djknaeckebrot
63c0912849 xMerge branch 'canary' into feature/delete-docker-volumes 2024-12-18 12:10:04 +01:00
faytranevozter
6211a19805 feat: add support for viewing docker logs in swarm mode 2024-12-18 16:40:33 +07:00
Larry Ioannidis
d22330f983 feat(ports): implement additional ports management 2024-12-18 09:39:20 +00:00
djknaeckebrot
8642d8235e chore: add seperator and make tittles big 2024-12-18 09:14:10 +01:00
djknaeckebrot
b52f57cb0d chore: remove imports 2024-12-18 08:51:49 +01:00
djknaeckebrot
d4d74d3831 refactor: remove not needed import, move to better folder structure 2024-12-18 08:49:02 +01:00
djknaeckebrot
9d497142db feat: add latest cards 2024-12-18 08:43:07 +01:00
Mauricio Siu
852895c382 Merge pull request #912 from drudge/new-ansi-logs
feat(logs): support ansi codes
2024-12-17 23:55:12 -06:00
Mauricio Siu
20d5913820 Merge pull request #910 from drudge/canary
feat(cluster): use code editor for node config
2024-12-17 23:52:25 -06:00
Mauricio Siu
f1b4a73158 Merge pull request #928 from drudge/discord-notif
feat(discord): remove dots
2024-12-17 23:51:01 -06:00
Mauricio Siu
3830f6c4ee Merge pull request #925 from mohabgabber/canary
Added onedev docker compose
2024-12-17 23:50:33 -06:00
Mauricio Siu
5c8eda2405 Update apps/dokploy/templates/onedev/docker-compose.yml 2024-12-17 23:47:48 -06:00
Mauricio Siu
6bf85bcfa3 Merge branch 'canary' into new-ansi-logs 2024-12-17 23:43:18 -06:00
Mauricio Siu
bc03e718bf Merge pull request #911 from 190km/mutlti-select-fiter-logs
feat(logs): multi select fiter logs & hide/show timestamp
2024-12-17 23:42:50 -06:00
Nicholas Penree
a941efb1ff feat(certs): show expiration and chain details 2024-12-17 23:17:29 -05:00
Nicholas Penree
fe2de6b899 feat(discord): remove dots 2024-12-17 22:03:58 -05:00
djknaeckebrot
752c9f2818 style: remove bg and border 2024-12-17 21:35:32 +01:00
djknaeckebrot
577b126e66 feat: make bg transparent 2024-12-17 21:19:38 +01:00
djknaeckebrot
be237ae4cf chore: comment out refresh for now 2024-12-17 21:07:47 +01:00
djknaeckebrot
3080926a50 feat: add new items 2024-12-17 21:07:30 +01:00
djknaeckebrot
e3ee89104b chore: remove tables and add new cards 2024-12-17 20:48:56 +01:00
djknaeckebrot
f98f18b331 feat: add monitoring card 2024-12-17 20:48:35 +01:00
Shadow
8505236263 feat: mongo replica sets 2024-12-17 12:59:18 -06:00
usopp
b3313cf975 style: better white style 2024-12-17 19:16:40 +01:00
Mohab Gabber
4e31d8ac02 Added onedev to templates.ts and onedev's icon 2024-12-17 18:51:38 +02:00
Mohab Gabber
536507377d Added onedev docker compose 2024-12-17 17:23:26 +02:00
djknaeckebrot
763219e859 refactor: streamline imports and improve code formatting in ShowSwarmNodes component 2024-12-17 12:12:48 +01:00
djknaeckebrot
3fc5bfc5c5 feat: implement fetching of Docker service applications and their details 2024-12-17 12:11:43 +01:00
djknaeckebrot
813da8f811 refactor: clean up code formatting and improve readability in swarm dashboard 2024-12-17 12:06:08 +01:00
djknaeckebrot
5716954665 feat: add components for displaying swarm node details and applications 2024-12-17 12:05:39 +01:00
djknaeckebrot
04d3eb9ec0 feat: add swarm tab and dashboard page for managing Docker swarm 2024-12-17 12:05:02 +01:00
djknaeckebrot
b592a025e4 feat: add swarm router and related Docker service functions 2024-12-17 12:04:49 +01:00
Nicholas Penree
6db9c99080 feat(logs): add number of lines filter 2024-12-16 20:12:05 -05:00
Nicholas Penree
7e8953ff44 chore: lint 2024-12-16 17:18:11 -05:00
Nicholas Penree
81c85ce155 fix: don't trigger if already selected 2024-12-16 17:12:18 -05:00
Nicholas Penree
bd16e03602 chore: lint 2024-12-16 17:07:31 -05:00
190km
87a5ce2053 fix: timestamp width 2024-12-16 22:55:36 +01:00
Nicholas Penree
ca4820940e feat(logs): filter improvements 2024-12-16 16:55:13 -05:00
190km
71fe6de9cb feat(logs): added show/hide timestamp option 2024-12-16 21:27:32 +01:00
Nicholas Penree
9ff4968e61 feat(logs): support ansi codes 2024-12-16 14:59:35 -05:00
190km
2312ae1c12 fix: fixed lint 2024-12-16 19:56:47 +01:00
190km
b03011a94f feat(logs): replaced the log type component with the new 2024-12-16 19:50:13 +01:00
190km
7577e40b25 feat(logs): added filter log type component 2024-12-16 19:49:09 +01:00
Nicholas Penree
75e34285ef feat(cluster): use code editor for node config 2024-12-16 11:51:17 -05:00
Aaron Gonzales
8e5b0988cf fix: fixed/improved handling of app names in api 2024-12-16 18:13:07 +08:00
Mauricio Siu
038df9c8a7 Merge pull request #897 from Dokploy/canary
v0.15.0
2024-12-15 21:49:15 -06:00
Mauricio Siu
829aa2a63c Merge pull request #901 from Dokploy/feat/security
Feat: add remote server audit
2024-12-15 21:38:37 -06:00
Mauricio Siu
91e90fc379 Merge pull request #900 from drudge/canary
chore: clean up page titles
2024-12-15 21:38:28 -06:00
Mauricio Siu
a1e13ee964 refactor: set audit 2024-12-15 21:37:33 -06:00
Mauricio Siu
341af1bd07 feat: add loader to enhance ux/ui 2024-12-15 21:33:10 -06:00
Nicholas Penree
8a274d10eb chore: clean up page titles 2024-12-15 22:21:10 -05:00
Mauricio Siu
6c586f9606 refactor: add experimental advice 2024-12-15 21:18:23 -06:00
Mauricio Siu
dcb1ea37c3 feat: add server audit 2024-12-15 21:16:14 -06:00
Mauricio Siu
58c2ceb355 feat: add security audit 2024-12-15 21:13:37 -06:00
Mauricio Siu
beae03b53d Merge pull request #898 from drudge/canary
feat(server): monospace script editor
2024-12-15 20:48:38 -06:00
Nicholas Penree
55ec25f5e8 feat(server): edit copy on script editor 2024-12-15 21:24:27 -05:00
Nicholas Penree
9382acb40c feat(server): monospace script editor 2024-12-15 21:16:39 -05:00
Mauricio Siu
c0acdc5df1 refactor: add audit 2024-12-15 19:55:45 -06:00
Mauricio Siu
413536a336 chore: bump version 2024-12-15 19:30:05 -06:00
Mauricio Siu
190f45b3a8 Merge pull request #857 from 190km/new-logs
feat(logs): new railway inspired logs
2024-12-15 19:29:26 -06:00
Mauricio Siu
e6c242a064 refactor: set logs no found when the search is empty 2024-12-15 19:24:50 -06:00
Mauricio Siu
c2fe1eed01 fix: remote server search add long buffering 2024-12-15 19:18:41 -06:00
Mauricio Siu
676082fc5b Merge branch 'canary' into new-logs 2024-12-15 19:01:26 -06:00
Mauricio Siu
b676b1a2de Merge pull request #894 from Dokploy/feat/improve-cloud
refactor: remove unused files
2024-12-15 18:50:46 -06:00
Mauricio Siu
5885712c6a Merge pull request #896 from drudge/copy-delete
feat(delete): add quick copy to resource to clipboard in delete modal
2024-12-15 18:49:51 -06:00
Mauricio Siu
afedeede16 feat: add self remove accounts 2024-12-15 18:45:02 -06:00
Nicholas Penree
5f09018199 feat(delete): add quick copy to resource to clipboard in delete modal 2024-12-15 19:17:46 -05:00
Mauricio Siu
9d37876bc4 feat: add reset onboarding 2024-12-15 15:03:25 -06:00
Mauricio Siu
775107ec24 feat: add dokploy cloud modal 2024-12-15 14:54:38 -06:00
DJKnaeckebrot
7725b3ca36 Merge branch 'Dokploy:canary' into feature/delete-docker-volumes 2024-12-15 19:42:34 +01:00
Mauricio Siu
5f297fd984 feat: add react tour 2024-12-15 02:14:43 -06:00
Mauricio Siu
86aba9ce3e refactor: remove cols 2024-12-14 23:12:21 -06:00
Mauricio Siu
c6e512bec1 refåctor: remove files 2024-12-14 23:06:54 -06:00
Mauricio Siu
fc2b0abdb1 Revert "refactor: remove unsued files"
This reverts commit d20f86ffe1.
2024-12-14 23:05:19 -06:00
Mauricio Siu
d20f86ffe1 refactor: remove unsued files 2024-12-14 22:46:01 -06:00
190km
1157e08aa1 fix: log line came out of the div 2024-12-15 04:21:38 +01:00
Mauricio Siu
e643255a67 Merge pull request #893 from Dokploy/510-fractional-cpu-reservation-and-limit
refactor: remove calculation and pass resources as the docker api expect
2024-12-14 20:40:16 -06:00
Mauricio Siu
7521bc8297 refactor: remove calculation and pass resources as the docker api expect 2024-12-14 20:38:33 -06:00
Mauricio Siu
a63981fa15 Merge pull request #892 from Dokploy/680-redirect-to-the-deployment-logs
feat: redirect to deployments when click on deploy
2024-12-14 20:30:15 -06:00
Mauricio Siu
ea0f797d0f feat: redirect to deployments when click on deploy 2024-12-14 20:28:28 -06:00
Mauricio Siu
181a2ca3c9 Merge pull request #891 from Dokploy/769-elasticsearch-new-db-template
769 elasticsearch new db template
2024-12-14 20:18:49 -06:00
Mauricio Siu
3fe057c7f8 refactor: set version 2024-12-14 20:17:38 -06:00
Mauricio Siu
1e834ed1d9 feat: add elastic search 2024-12-14 20:17:20 -06:00
Mauricio Siu
9f84545fc7 Merge pull request #890 from Dokploy/889-search-for-templates-only-takes-into-account-the-template-title-missing-description-matches
refactor: add description on search
2024-12-14 12:38:05 -06:00
Mauricio Siu
690a2e7467 refactor: add description on search 2024-12-14 12:37:50 -06:00
190km
995d9004f3 style: fix text light theme 2024-12-14 18:23:00 +01:00
djknaeckebrot
ef89d05077 Merge branch 'canary' into feature/delete-docker-volumes 2024-12-14 11:07:08 +01:00
Mauricio Siu
0a3ab7ceac Merge pull request #868 from DJKnaeckebrot/feat/page-titles
feat: add page titles
2024-12-14 02:28:31 -06:00
Mauricio Siu
2fd4d580d5 Merge pull request #880 from DJKnaeckebrot/feature/penpot-template
feat: add penpot template
2024-12-14 02:27:01 -06:00
Mauricio Siu
33e2fa3ce3 Merge branch 'canary' into feature/penpot-template 2024-12-14 02:26:35 -06:00
Mauricio Siu
d320847da4 refactor: remove traefik 2024-12-14 02:25:35 -06:00
Mauricio Siu
9e84bf324e Merge pull request #875 from DJKnaeckebrot/feature/huly-template
feat: add huly template
2024-12-14 01:48:11 -06:00
Mauricio Siu
db469e60ad Merge branch 'canary' into feature/huly-template 2024-12-14 01:37:13 -06:00
Mauricio Siu
0f949b3273 Merge pull request #874 from DJKnaeckebrot/feature/langflow-template
feat: add langflow template
2024-12-14 01:36:23 -06:00
Mauricio Siu
166b65c50e refactor: add env variables 2024-12-14 01:34:05 -06:00
Mauricio Siu
274c65cbcd refactor: add unsend 2024-12-14 01:29:39 -06:00
Mauricio Siu
b538a632d9 Merge branch 'canary' into feature/langflow-template 2024-12-14 01:28:38 -06:00
Mauricio Siu
765c6442cb Merge pull request #869 from DJKnaeckebrot/feature/unsend-dev-template
feat: add unsend template
2024-12-14 01:24:09 -06:00
Mauricio Siu
115ed7e7bf refactor: remove is loading false 2024-12-14 01:17:13 -06:00
190km
0644842305 style: selects width 2024-12-14 03:00:05 +01:00
190km
a9c62b47ef style: selects wididth 2024-12-14 02:58:21 +01:00
190km
138650d561 feat: improved deployment view scroll & style 2024-12-14 01:30:36 +01:00
190km
280be5c9df style: fixed select sizes 2024-12-13 21:13:10 +01:00
190km
7726fa6112 style: make selects responsive 2024-12-13 20:29:26 +01:00
190km
c71d12fd06 feat: added info possibilities & debug more debug possibilities 2024-12-13 20:21:00 +01:00
usopp
3df3d187e4 feat: added deployment loader & lines count 2024-12-13 19:41:02 +01:00
djknaeckebrot
8ce9db8dd6 feat: add penpot template 2024-12-13 19:40:49 +01:00
190km
6773458da3 fix: text came out of the parent div 2024-12-13 18:29:18 +01:00
djknaeckebrot
92c2a83d92 feat: add filter to delete volumes is wanted 2024-12-13 16:34:46 +01:00
djknaeckebrot
3decbd5207 feat: add new form validator 2024-12-13 16:34:29 +01:00
djknaeckebrot
8779c67b71 refactor: change import names 2024-12-13 16:34:12 +01:00
djknaeckebrot
4dc7d9e3c8 feat: add params to mutation 2024-12-13 16:33:54 +01:00
djknaeckebrot
a439286e5f feat: add UI selection 2024-12-13 16:14:52 +01:00
Nicholas Penree
e5d5a98bab feat(logs): preserve whitespace in log line 2024-12-13 09:15:56 -05:00
Nicholas Penree
4311ba93f3 chore: lint/typecheck 2024-12-13 09:00:17 -05:00
djknaeckebrot
e0b596ec76 chore: set static minio version 2024-12-13 14:14:22 +01:00
djknaeckebrot
379ba20930 feat: add huly.io template 2024-12-13 13:55:57 +01:00
djknaeckebrot
236e511adc feat: add langflow template 2024-12-13 12:02:01 +01:00
djknaeckebrot
0b37e171c5 chore: add fixed versions 2024-12-13 09:20:23 +01:00
Mauricio Siu
1df1e7b50b Merge pull request #870 from drudge/setup
fix(setup/validate): arm64 build fixes, improved validation
2024-12-13 01:07:13 -06:00
Mauricio Siu
f15a5bc22d Update apps/dokploy/templates/unsend/index.ts 2024-12-13 00:50:12 -06:00
Mauricio Siu
469871d383 Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:50:08 -06:00
Mauricio Siu
e22b6ab9be Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:50:04 -06:00
Mauricio Siu
b01b05077d Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:49:58 -06:00
Mauricio Siu
22122361ba Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:49:54 -06:00
Mauricio Siu
87c1ce68b9 Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:49:49 -06:00
Mauricio Siu
4c8619677b Update apps/dokploy/templates/unsend/docker-compose.yml 2024-12-13 00:49:45 -06:00
Mauricio Siu
7f705e31d3 Merge pull request #867 from DJKnaeckebrot/feat/add-vscode-settings-for-same-formatting
format: setup .vscode folder with biome.js for consistent format and spacing
2024-12-13 00:39:18 -06:00
Mauricio Siu
20432ebc3f Merge pull request #856 from DJKnaeckebrot/feat/project-search
feat: add global search command
2024-12-13 00:38:07 -06:00
Nicholas Penree
a51a7a82d2 feat(setup): remove debconf warnings during setup 2024-12-12 23:58:56 -05:00
Nicholas Penree
5ba19686c8 feat(setup): align pass/fail icons at the end 2024-12-12 23:57:54 -05:00
Nicholas Penree
22a2e64563 feat(logs): tooltip improvements (break out, no delay) 2024-12-12 23:12:13 -05:00
190km
37ee89e6ab fix: debug value in select 2024-12-13 00:53:58 +01:00
190km
cb487b8be0 feat: added debug log type & noTimestamp props for TerminalLine 2024-12-12 21:53:10 +01:00
DJKnaeckebrot
26f8719e5f fix: wrong port publishing 2024-12-12 21:41:57 +01:00
190km
3bc1bd5b15 feat: added more log success filter 2024-12-12 21:10:19 +01:00
190km
ee622b1ba0 feat: added new logs styling in deployments views 2024-12-12 21:00:17 +01:00
190km
fe088bad3b feat: add loading spinner when logs are being loaded 2024-12-12 19:54:44 +01:00
usopp
d374f5eedf fix: no time found block same width as the timestamp ones 2024-12-12 19:28:16 +01:00
Nicholas Penree
1c498ee2d2 fix(setup/validate): arm64 build fixes, improved validation 2024-12-12 12:11:30 -05:00
djknaeckebrot
d7e5eb6dfd feat: add unsend template 2024-12-12 16:46:58 +01:00
djknaeckebrot
f71e04eaaa feat: add page titles 2024-12-12 12:56:55 +01:00
djknaeckebrot
fc9808e295 feat: added .vscode folder
Added settings.json to use biome.js formatter by default
Added extentions.json to recommend to install biome.js

This all is to keep spacing the same across different contributors and to make it easier for people to get started contributing
2024-12-12 11:56:57 +01:00
djknaeckebrot
bc2a286e1d fix: close modal after selection of item 2024-12-12 08:48:23 +01:00
djknaeckebrot
6c582eb91d chore: close when project or app is selected
chore: better closing checks
fix: url for projects
2024-12-12 08:43:41 +01:00
djknaeckebrot
e3b2a401a7 fix: resolve issue with same names 2024-12-12 08:39:29 +01:00
djknaeckebrot
6c55143e96 chore: remove debug logging 2024-12-12 08:33:23 +01:00
djknaeckebrot
19a0550b32 style: change status indication 2024-12-12 08:32:18 +01:00
Mauricio Siu
bb31bef8bc Merge pull request #865 from drudge/config-code-editor
feat(docker): use code editor when displaying container config
2024-12-11 23:31:21 -06:00
Mauricio Siu
abc606d8d9 Merge pull request #864 from mezotv/dynamic-timestamp
feat(dynamic timestamp): add dynamic discord timestamps
2024-12-11 23:28:47 -06:00
Mauricio Siu
749dd03fe6 Merge pull request #859 from kawws/feature/github-app
feat: improve github app validation
2024-12-11 23:25:27 -06:00
Mauricio Siu
858d7e5c11 Merge pull request #863 from 190km/italian-lang
feat(i18n): add italian language support
2024-12-11 23:12:31 -06:00
Mauricio Siu
079b7b8e72 Merge branch 'canary' into italian-lang 2024-12-11 23:11:22 -06:00
Nicholas Penree
179f3818f0 feat(docker): use code editor when displaying container config 2024-12-11 22:53:10 -05:00
Nicholas Penree
8546031df0 feat(logs): lint 2024-12-11 19:32:34 -05:00
Nicholas Penree
16ca198eb4 feat(logs): better download file names 2024-12-11 19:31:37 -05:00
Nicholas Penree
9b5b452d90 Merge pull request #2 from drudge/log-test
feat(logs): improvements based on feedback
2024-12-11 19:23:45 -05:00
Nicholas Penree
2fa6f3bfa6 feat(logs): lint 2024-12-11 19:20:30 -05:00
Nicholas Penree
42f3105f69 feat(logs): improvements based on feedback 2024-12-11 19:13:53 -05:00
Dominik Koch
a08ba7e8b5 feat(dynamic timestamp): add dynamic discord timestamps 2024-12-11 21:18:01 +00:00
190km
a51ada4a1e feat(i18n): add italian language support 2024-12-11 20:39:59 +01:00
190km
50b1de9594 feat: added appname as filename when export 2024-12-11 20:26:19 +01:00
190km
cb90281583 feat: added appname as filename when export 2024-12-11 20:25:49 +01:00
usopp
20b253e708 removed useless state 2024-12-11 18:03:28 +01:00
190km
9a51e0a00d show a message about no matches found 2024-12-11 17:58:35 +01:00
190km
49b812e462 Merge pull request #1 from drudge/log-test
feat(logs): improvements to searching
2024-12-11 16:49:05 +01:00
Nicholas Penree
7233667d49 feat(logs): improvements to searching 2024-12-11 10:35:12 -05:00
Nicholas Penree
95cd410825 feat(logs): improvements to searching 2024-12-11 10:29:09 -05:00
Andreassenemyr
5b8ebdaaa4 feat: improve github app validation 2024-12-11 13:31:07 +01:00
djknaeckebrot
343d5ae6a2 feat: add service status 2024-12-11 08:27:18 +01:00
djknaeckebrot
e16ce0c817 refactor: only show Monitoring, Traefik, Docker and Requests when installation is not a cloud installation 2024-12-11 07:36:23 +01:00
Mauricio Siu
3b2440b1db Merge pull request #835 from Dokploy/560-self-hosted-gitlab
560 self hosted gitlab
2024-12-10 22:07:59 -06:00
Mauricio Siu
2f72ccbea7 Merge pull request #855 from hua1995116/fix/memory-bug
fix: error about memoryReservation not set
2024-12-10 21:55:41 -06:00
Mauricio Siu
be47f6d09a Merge pull request #848 from minagishl/feat/i18n-ja
feat(i18n): add japanese language support
2024-12-10 21:54:06 -06:00
Mauricio Siu
9a65bf8e21 chore: remove unused file 2024-12-10 21:53:32 -06:00
Mauricio Siu
15959fa91f fix: add missing migration 2024-12-10 21:52:09 -06:00
Mauricio Siu
f0c14d144c Merge branch 'canary' into 560-self-hosted-gitlab 2024-12-10 21:50:09 -06:00
Mauricio Siu
725b763aa8 Merge pull request #854 from DJKnaeckebrot/560-self-hosted-gitlab
560 self hosted gitlab additions
2024-12-10 21:48:39 -06:00
Mauricio Siu
c0bfd7dde7 Merge pull request #851 from drudge/n8n-template-update
chore: update n8n template to 1.70.3
2024-12-10 21:45:23 -06:00
Mauricio Siu
31ba5a784d Merge pull request #850 from drudge/logto-template
feat: add Logto template
2024-12-10 21:45:09 -06:00
190km
00f9e262a9 feat(logs): new logs style and system 2024-12-11 00:20:22 +01:00
djknaeckebrot
54b6a850b7 refactor: make command globally available 2024-12-10 14:15:39 +01:00
djknaeckebrot
029cbf4498 refactor: change location of search-command 2024-12-10 14:09:04 +01:00
hua1995116
8a1cba470c fix: error about memoryReservation not set 2024-12-10 20:40:26 +08:00
djknaeckebrot
84bb98c7e6 feat: add search command dialog with projects and services 2024-12-10 13:37:57 +01:00
djknaeckebrot
cbf0f37a49 feat: add search command dialog with projects and services 2024-12-10 13:37:46 +01:00
djknaeckebrot
2c22aa3689 chore: remove debug logs 2024-12-10 10:25:48 +01:00
Mauricio Siu
46289305e8 Merge pull request #853 from Dokploy/canary
v0.14.1
2024-12-10 02:51:45 -06:00
Mauricio Siu
0b3e15aabc Merge pull request #852 from Dokploy/fix/nixpacks-version
fix: pin nixpacks version
2024-12-10 02:50:26 -06:00
Mauricio Siu
69a3583717 chore: bump version 2024-12-10 02:39:31 -06:00
Mauricio Siu
bc55fde6d6 fix: pin nixpacks version 2024-12-10 02:38:50 -06:00
djknaeckebrot
1cb1da8097 fix: replace hardcoded gitlab.com with dynamic urls 2024-12-10 09:19:01 +01:00
djknaeckebrot
0698ac8318 chore: remove debug output 2024-12-10 08:54:22 +01:00
djknaeckebrot
7ced6840fa fix: change hardcoded gitlab.com to gitlabUrl 2024-12-10 08:53:53 +01:00
djknaeckebrot
22e6d07f60 fix: hardcoded gitlab.com to gitlabUrl 2024-12-10 08:37:55 +01:00
Nicholas Penree
6a9690fe3c chore: update n8n template to 1.70.3 2024-12-09 22:57:32 -05:00
Nicholas Penree
1c02478688 feat: add Logto template 2024-12-09 22:28:47 -05:00
minagishl
bbe72ad584 feat(i18n): add japanese language support 2024-12-09 15:15:16 +09:00
Mauricio Siu
83b3176f6f Merge pull request #837 from wish-oss/fix/gpu-setup
fix: update GPU setup command to use sudo and add error handling
2024-12-08 22:09:23 -06:00
Mauricio Siu
7ecd1627c8 Merge pull request #845 from Dokploy/canary
v0.14.0
2024-12-08 20:59:38 -06:00
vishalkadam47
49559ebee6 fix: update GPU setup command to use sudo and add error handling 2024-12-08 06:27:34 +05:30
Mauricio Siu
f94ee8c299 refactor: update 2024-12-07 16:50:25 -06:00
Mauricio Siu
f47335efe5 refactor: wip 2024-12-07 16:47:39 -06:00
Mauricio Siu
572579af91 Merge pull request #785 from Dokploy/canary
v0.13.1
2024-11-28 23:44:33 -06:00
Mauricio Siu
b296b6bbf0 Merge pull request #772 from Dokploy/canary
v0.13.0
2024-11-27 23:28:40 -06:00
Mauricio Siu
5c8721406a Merge pull request #720 from Dokploy/canary
v0.12.0
2024-11-17 22:07:33 -06:00
Mauricio Siu
be934065d9 Merge pull request #702 from Dokploy/canary
v0.11.2
2024-11-13 23:48:47 -06:00
Mauricio Siu
8162dcfb71 Merge pull request #697 from limichange/patch-1
Update plausible docker-compose.yml
2024-11-13 23:34:57 -06:00
limichange
46f7d43595 Update templates.ts 2024-11-14 09:37:20 +08:00
limichange
59bb59ee24 Update docker-compose.yml 2024-11-13 16:30:11 +08:00
Mauricio Siu
0e433a3d36 Merge pull request #689 from Dokploy/canary
v0.11.1
2024-11-12 01:04:36 -06:00
Mauricio Siu
819de5a32e Merge pull request #677 from Dokploy/canary
v0.11.0
2024-11-10 19:28:28 -06:00
Mauricio Siu
5cd624c7ea Merge pull request #647 from Dokploy/canary
v0.10.10
2024-11-04 10:32:20 -06:00
Mauricio Siu
89c7e96df0 Merge pull request #643 from Dokploy/canary
v0.10.9
2024-11-02 17:18:34 -06:00
Mauricio Siu
0e136ffb8f Merge pull request #632 from Dokploy/canary
v10.7.0
2024-10-30 23:10:48 -06:00
Mauricio Siu
6b4e52fb37 Merge pull request #631 from Dokploy/canary
v0.10.6
2024-10-30 23:00:45 -06:00
Mauricio Siu
db9136d981 Merge pull request #629 from Dokploy/canary
v0.10.5
2024-10-30 22:01:04 -06:00
Mauricio Siu
a93f18eb4a Merge pull request #599 from Dokploy/canary
v0.10.4
2024-10-25 21:35:15 -06:00
Mauricio Siu
467acc4d4d Merge pull request #586 from Dokploy/canary
v0.10.3
2024-10-24 01:21:17 -06:00
Mauricio Siu
01e5cf0852 Merge pull request #580 from Dokploy/canary
v0.10.2
2024-10-22 21:17:38 -06:00
Mauricio Siu
df9fad088f Merge pull request #567 from Dokploy/canary
v0.10.1
2024-10-18 23:12:12 -06:00
Mauricio Siu
2644b638d1 Merge pull request #553 from Dokploy/canary
v0.10.0
2024-10-13 16:30:00 -06:00
Mauricio Siu
acd722678e Merge pull request #521 from Dokploy/canary
v0.9.4
2024-10-03 02:12:03 -06:00
Mauricio Siu
727e50648e Merge pull request #501 from Dokploy/canary
v0.9.3
2024-09-29 16:30:43 -06:00
Mauricio Siu
349bc89851 Merge pull request #500 from Dokploy/canary
v0.9.2
2024-09-29 14:16:56 -06:00
Mauricio Siu
9f6f872536 Merge pull request #495 from Dokploy/canary
v0.9.1
2024-09-28 12:00:04 -06:00
Mauricio Siu
e378d89477 Merge pull request #475 from Dokploy/canary
v0.9.0
2024-09-22 19:38:12 -06:00
Mauricio Siu
63e7eacae9 chore(version): bump version 2024-09-19 16:37:00 -06:00
Mauricio Siu
f4ab588516 Merge pull request #466 from Dokploy/canary
v0.8.3
2024-09-19 16:01:27 -06:00
Mauricio Siu
4d8a0ba58f Merge pull request #457 from Dokploy/canary
v0.8.2
2024-09-16 15:57:20 -06:00
Mauricio Siu
e88cd11041 Merge pull request #427 from Dokploy/canary
v0.8.1
2024-09-07 13:25:36 -06:00
Mauricio Siu
5f174a883b Merge pull request #424 from Dokploy/canary
v0.8.0
2024-09-07 00:55:08 -06:00
Mauricio Siu
536a6ba2ff Merge pull request #397 from Dokploy/canary
v0.7.3
2024-08-30 00:27:59 -06:00
Mauricio Siu
213fa08210 Merge pull request #382 from Dokploy/canary
v0.7.2
2024-08-26 15:52:49 -06:00
Mauricio Siu
d5c6a601d8 Merge pull request #367 from Dokploy/canary
v0.7.1
2024-08-19 16:03:39 -06:00
Mauricio Siu
452793c8e5 Merge pull request #359 from Dokploy/canary
v0.7.0
2024-08-18 10:26:52 -06:00
Mauricio Siu
385fbf4af5 Merge pull request #355 from Dokploy/canary
v0.6.3
2024-08-16 22:26:35 -06:00
Mauricio Siu
3590f3bed2 Merge pull request #332 from Dokploy/canary
v0.6.2
2024-08-07 21:48:49 -06:00
Mauricio Siu
9b2fcaea31 Merge pull request #317 from Dokploy/canary
v0.6.1
2024-08-03 15:46:05 -06:00
Mauricio Siu
5abcc82215 Merge pull request #312 from Dokploy/canary
v0.6.0
2024-08-02 10:47:43 -06:00
Mauricio Siu
ee855452e3 Merge pull request #303 from Dokploy/canary
chore: add slash to version
2024-08-01 02:06:43 -06:00
Mauricio Siu
d000b526d3 Merge pull request #302 from Dokploy/canary
v0.5.1
2024-08-01 01:58:15 -06:00
Mauricio Siu
9bf88b90c3 Merge pull request #280 from Dokploy/canary
v0.5.0
2024-07-27 15:20:43 -06:00
Mauricio Siu
b1a48d4636 refactor: update job 2024-07-22 03:51:07 -06:00
Mauricio Siu
c34c4b244e Merge pull request #251 from Dokploy/canary
v0.4.0
2024-07-22 03:38:47 -06:00
Mauricio Siu
bb59a0cd3f Merge pull request #230 from Dokploy/canary
v0.3.3
2024-07-18 00:11:10 -06:00
Mauricio Siu
44e6a117dd Merge pull request #208 from Dokploy/canary
v0.3.2
2024-07-11 23:21:32 -06:00
Mauricio Siu
bfdc73f8d1 Merge pull request #197 from Dokploy/canary
v0.3.1
2024-07-06 12:01:07 -06:00
Mauricio Siu
64ada7020a Merge pull request #185 from Dokploy/canary
v0.3.0
2024-07-01 00:01:16 -06:00
Mauricio Siu
4706adc0c0 Merge pull request #174 from Dokploy/canary
v0.2.5
2024-06-29 13:29:39 -06:00
Mauricio Siu
e01d92d1d9 Merge pull request #161 from Dokploy/canary
v0.2.4
2024-06-23 19:40:45 -06:00
Mauricio Siu
fe22890311 Merge pull request #156 from Dokploy/canary
v0.2.3
2024-06-21 11:50:40 -06:00
Mauricio Siu
2b7c7632f4 Merge pull request #136 from Dokploy/canary
v0.2.2
2024-06-08 22:06:39 -06:00
Mauricio Siu
1b7244e841 Merge pull request #127 from Dokploy/canary
v0.2.1
2024-06-07 02:52:03 -06:00
583 changed files with 65669 additions and 18394 deletions

View File

@@ -1,119 +0,0 @@
version: 2.1
jobs:
build-amd64:
machine:
image: ubuntu-2004:current
steps:
- checkout
- run:
name: Prepare .env file
command: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
- run:
name: Build and push AMD64 image
command: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN
if [ "${CIRCLE_BRANCH}" == "main" ]; then
TAG="latest"
elif [ "${CIRCLE_BRANCH}" == "canary" ]; then
TAG="canary"
else
TAG="feature"
fi
docker build --platform linux/amd64 -t dokploy/dokploy:${TAG}-amd64 .
docker push dokploy/dokploy:${TAG}-amd64
build-arm64:
machine:
image: ubuntu-2004:current
resource_class: arm.large
steps:
- checkout
- run:
name: Prepare .env file
command: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
- run:
name: Build and push ARM64 image
command: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN
if [ "${CIRCLE_BRANCH}" == "main" ]; then
TAG="latest"
elif [ "${CIRCLE_BRANCH}" == "canary" ]; then
TAG="canary"
else
TAG="feature"
fi
docker build --platform linux/arm64 -t dokploy/dokploy:${TAG}-arm64 .
docker push dokploy/dokploy:${TAG}-arm64
combine-manifests:
docker:
- image: cimg/node:18.18.0
steps:
- checkout
- setup_remote_docker
- run:
name: Create and push multi-arch manifest
command: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN
if [ "${CIRCLE_BRANCH}" == "main" ]; then
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
echo $VERSION
TAG="latest"
docker manifest create dokploy/dokploy:${TAG} \
dokploy/dokploy:${TAG}-amd64 \
dokploy/dokploy:${TAG}-arm64
docker manifest push dokploy/dokploy:${TAG}
docker manifest create dokploy/dokploy:${VERSION} \
dokploy/dokploy:${TAG}-amd64 \
dokploy/dokploy:${TAG}-arm64
docker manifest push dokploy/dokploy:${VERSION}
elif [ "${CIRCLE_BRANCH}" == "canary" ]; then
TAG="canary"
docker manifest create dokploy/dokploy:${TAG} \
dokploy/dokploy:${TAG}-amd64 \
dokploy/dokploy:${TAG}-arm64
docker manifest push dokploy/dokploy:${TAG}
else
TAG="feature"
docker manifest create dokploy/dokploy:${TAG} \
dokploy/dokploy:${TAG}-amd64 \
dokploy/dokploy:${TAG}-arm64
docker manifest push dokploy/dokploy:${TAG}
fi
workflows:
build-all:
jobs:
- build-amd64:
filters:
branches:
only:
- main
- canary
- 379-preview-deployment
- build-arm64:
filters:
branches:
only:
- main
- canary
- 379-preview-deployment
- combine-manifests:
requires:
- build-amd64
- build-arm64
filters:
branches:
only:
- main
- canary
- 379-preview-deployment

BIN
.github/sponsors/its.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
.github/sponsors/light-node.webp vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

83
.github/workflows/create-pr.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
name: Auto PR to main when version changes
on:
push:
branches:
- canary
permissions:
contents: write
pull-requests: write
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from package.json
id: package_version
run: echo "VERSION=$(jq -r .version ./apps/dokploy/package.json)" >> $GITHUB_ENV
- name: Get latest GitHub tag
id: latest_tag
run: |
LATEST_TAG=$(git ls-remote --tags origin | awk -F'/' '{print $3}' | sort -V | tail -n1)
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo $LATEST_TAG
- name: Compare versions
id: compare_versions
run: |
if [ "${{ env.VERSION }}" != "${{ env.LATEST_TAG }}" ]; then
VERSION_CHANGED="true"
else
VERSION_CHANGED="false"
fi
echo "VERSION_CHANGED=$VERSION_CHANGED" >> $GITHUB_ENV
echo "Comparing versions:"
echo "Current version: ${{ env.VERSION }}"
echo "Latest tag: ${{ env.LATEST_TAG }}"
echo "Version changed: $VERSION_CHANGED"
- name: Check if a PR already exists
id: check_pr
run: |
PR_EXISTS=$(gh pr list --state open --base main --head canary --json number --jq '. | length')
echo "PR_EXISTS=$PR_EXISTS" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
- name: Create Pull Request
if: env.VERSION_CHANGED == 'true' && env.PR_EXISTS == '0'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin main
git checkout canary
git push origin canary
gh pr create \
--title "🚀 Release ${{ env.VERSION }}" \
--body '
This PR promotes changes from `canary` to `main` for version ${{ env.VERSION }}.
### 🔍 Changes Include:
- Version bump to ${{ env.VERSION }}
- All changes from canary branch
### ✅ Pre-merge Checklist:
- [ ] All tests passing
- [ ] Documentation updated
- [ ] Docker images built and tested
> 🤖 This PR was automatically generated by [GitHub Actions](https://github.com/actions)' \
--base main \
--head canary \
--label "release" --label "automated pr" || true \
--reviewer siumauricio \
--assignee siumauricio
env:
GH_TOKEN: ${{ github.token }}

161
.github/workflows/dokploy.yml vendored Normal file
View File

@@ -0,0 +1,161 @@
name: Dokploy Docker Build
on:
push:
branches: [main, canary, feat/github-runners]
env:
IMAGE_NAME: dokploy/dokploy
jobs:
docker-amd:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tag and version
id: meta
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
TAG="latest"
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
TAG="canary"
else
TAG="feature"
fi
echo "tags=${IMAGE_NAME}:${TAG}-amd64" >> $GITHUB_OUTPUT
- name: Prepare env file
run: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
docker-arm:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tag and version
id: meta
run: |
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
TAG="latest"
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
TAG="canary"
else
TAG="feature"
fi
echo "tags=${IMAGE_NAME}:${TAG}-arm64" >> $GITHUB_OUTPUT
- name: Prepare env file
run: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
combine-manifests:
needs: [docker-amd, docker-arm]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push manifests
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
TAG="latest"
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
${IMAGE_NAME}:${TAG}-amd64 \
${IMAGE_NAME}:${TAG}-arm64
docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION} \
${IMAGE_NAME}:${TAG}-amd64 \
${IMAGE_NAME}:${TAG}-arm64
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
TAG="canary"
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
${IMAGE_NAME}:${TAG}-amd64 \
${IMAGE_NAME}:${TAG}-arm64
else
TAG="feature"
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
${IMAGE_NAME}:${TAG}-amd64 \
${IMAGE_NAME}:${TAG}-arm64
fi
generate-release:
needs: [combine-manifests]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: get_version
run: |
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: ${{ steps.get_version.outputs.version }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -12,7 +12,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18.18.0
node-version: 20.9.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build
@@ -26,7 +26,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18.18.0
node-version: 20.9.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build
@@ -39,7 +39,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18.18.0
node-version: 20.9.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build

1
.gitignore vendored
View File

@@ -34,7 +34,6 @@ yarn-debug.log*
yarn-error.log*
# Editor
.vscode
.idea
# Misc

2
.nvmrc
View File

@@ -1 +1 @@
18.18.0
20.9.0

View File

@@ -14,12 +14,10 @@ We have a few guidelines to follow when contributing to this project:
## Commit Convention
Before you create a Pull Request, please make sure your commit message follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
### Commit Message Format
```
<type>[optional scope]: <description>
@@ -54,6 +52,8 @@ feat: add new feature
Before you start, please make the clone based on the `canary` branch, since the `main` branch is the source of truth and should always reflect the latest stable release, also the PRs will be merged to the `canary` branch.
We use Node v20.9.0
```bash
git clone https://github.com/dokploy/dokploy.git
cd dokploy
@@ -73,9 +73,10 @@ Run the command that will spin up all the required services and files.
pnpm run dokploy:setup
```
Run this script
Run this script
```bash
pnpm run server:script
pnpm run server:script
```
Now run the development server.
@@ -169,6 +170,7 @@ Let's take the example of `plausible` template.
```typescript
// EXAMPLE
import {
generateBase64,
generateHash,
generateRandomDomain,
type Template,
@@ -200,8 +202,8 @@ export function generate(schema: Schema): Template {
const mounts: Template["mounts"] = [
{
mountPath: "./clickhouse/clickhouse-config.xml",
content: `some content......`,
filePath: "./clickhouse/clickhouse-config.xml",
content: "some content......",
},
];
@@ -247,4 +249,3 @@ export function generate(schema: Schema): Template {
## Docs & Website
To contribute to the Dokploy docs or website, please go to this [repository](https://github.com/Dokploy/website).

View File

@@ -1,4 +1,4 @@
FROM node:18-slim AS base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
@@ -7,7 +7,7 @@ FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
@@ -29,7 +29,7 @@ WORKDIR /app
# Set production
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y curl unzip apache2-utils && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y curl unzip apache2-utils iproute2 && rm -rf /var/lib/apt/lists/*
# Copy only the necessary files
COPY --from=build /prod/dokploy/.next ./.next
@@ -48,6 +48,8 @@ RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm
# Install Nixpacks and tsx
# | VERBOSE=1 VERSION=1.21.0 bash
ARG NIXPACKS_VERSION=1.29.1
RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \
&& chmod +x install.sh \
&& ./install.sh \

View File

@@ -1,4 +1,4 @@
FROM node:18-slim AS base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
@@ -7,7 +7,7 @@ FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server --filter=./apps/dokploy install --frozen-lockfile

View File

@@ -1,4 +1,4 @@
FROM node:18-slim AS base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
@@ -7,7 +7,7 @@ FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server --filter=./apps/schedules install --frozen-lockfile

View File

@@ -1,4 +1,4 @@
FROM node:18-slim AS base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
@@ -7,7 +7,7 @@ FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server --filter=./apps/api install --frozen-lockfile

View File

@@ -71,6 +71,9 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
<a href="https://mandarin3d.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<img src=".github/sponsors/mandarin.png" alt="Mandarin" height="50"/>
</a>
<a href="https://lightnode.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<img src=".github/sponsors/light-node.webp" alt="Lightnode" height="70"/>
</a>
</div>
### Premium Supporters 🥇
@@ -89,6 +92,7 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
<a href="https://lightspeed.run/?ref=dokploy"><img src="https://github.com/lightspeedrun.png" width="60px" alt="Lightspeed.run"/></a>
<a href="https://cloudblast.io/?ref=dokploy "><img src="https://cloudblast.io/img/logo-icon.193cf13e.svg" width="250px" alt="Cloudblast.io"/></a>
<a href="https://startupfa.me/?ref=dokploy "><img src=".github/sponsors/startupfame.png" width="65px" alt="Startupfame"/></a>
<a href="https://itsdb-center.com?ref=dokploy "><img src=".github/sponsors/its.png" width="65px" alt="Itsdb-center"/></a>
</div>
### Community Backers 🤝

View File

@@ -5,7 +5,7 @@
"scripts": {
"dev": "PORT=4000 tsx watch src/index.ts",
"build": "tsc --project tsconfig.json",
"start": "node --experimental-specifier-resolution=node dist/index.js",
"start": "node dist/index.js",
"typecheck": "tsc --noEmit"
},
"dependencies": {

View File

@@ -4,9 +4,9 @@ import "dotenv/config";
import { zValidator } from "@hono/zod-validator";
import { Queue } from "@nerimity/mimiqueue";
import { createClient } from "redis";
import { logger } from "./logger";
import { type DeployJob, deployJobSchema } from "./schema";
import { deploy } from "./utils";
import { logger } from "./logger.js";
import { type DeployJob, deployJobSchema } from "./schema.js";
import { deploy } from "./utils.js";
const app = new Hono();
const redisClient = createClient({

View File

@@ -1 +1 @@
18.18.0
20.9.0

View File

@@ -0,0 +1,98 @@
import { extractCommitMessage } from "@/pages/api/deploy/[refreshToken]";
import { describe, expect, it } from "vitest";
describe("GitHub Webhook Skip CI", () => {
const mockGithubHeaders = {
"x-github-event": "push",
};
const createMockBody = (message: string) => ({
head_commit: {
message,
},
});
const skipKeywords = [
"[skip ci]",
"[ci skip]",
"[no ci]",
"[skip actions]",
"[actions skip]",
];
it("should detect skip keywords in commit message", () => {
for (const keyword of skipKeywords) {
const message = `feat: add new feature ${keyword}`;
const commitMessage = extractCommitMessage(
mockGithubHeaders,
createMockBody(message),
);
expect(commitMessage.includes(keyword)).toBe(true);
}
});
it("should not detect skip keywords in normal commit message", () => {
const message = "feat: add new feature";
const commitMessage = extractCommitMessage(
mockGithubHeaders,
createMockBody(message),
);
for (const keyword of skipKeywords) {
expect(commitMessage.includes(keyword)).toBe(false);
}
});
it("should handle different webhook sources", () => {
// GitHub
expect(
extractCommitMessage(
{ "x-github-event": "push" },
{ head_commit: { message: "[skip ci] test" } },
),
).toBe("[skip ci] test");
// GitLab
expect(
extractCommitMessage(
{ "x-gitlab-event": "push" },
{ commits: [{ message: "[skip ci] test" }] },
),
).toBe("[skip ci] test");
// Bitbucket
expect(
extractCommitMessage(
{ "x-event-key": "repo:push" },
{
push: {
changes: [{ new: { target: { message: "[skip ci] test" } } }],
},
},
),
).toBe("[skip ci] test");
// Gitea
expect(
extractCommitMessage(
{ "x-gitea-event": "push" },
{ commits: [{ message: "[skip ci] test" }] },
),
).toBe("[skip ci] test");
});
it("should handle missing commit message", () => {
expect(extractCommitMessage(mockGithubHeaders, {})).toBe("NEW COMMIT");
expect(extractCommitMessage({ "x-gitlab-event": "push" }, {})).toBe(
"NEW COMMIT",
);
expect(
extractCommitMessage(
{ "x-event-key": "repo:push" },
{ push: { changes: [] } },
),
).toBe("NEW COMMIT");
expect(extractCommitMessage({ "x-gitea-event": "push" }, {})).toBe(
"NEW COMMIT",
);
});
});

View File

@@ -14,6 +14,9 @@ import {
import { beforeEach, expect, test, vi } from "vitest";
const baseAdmin: Admin = {
cleanupCacheApplications: false,
cleanupCacheOnCompose: false,
cleanupCacheOnPreviews: false,
createdAt: "",
authId: "",
adminId: "string",

View File

@@ -13,6 +13,7 @@ export default defineConfig({
NODE: "test",
},
},
plugins: [tsconfigPaths()],
resolve: {
alias: {
"@dokploy/server": path.resolve(

View File

@@ -13,10 +13,12 @@ import { CardTitle } from "@/components/ui/card";
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { REGEXP_ONLY_DIGITS } from "input-otp";
import { AlertTriangle } from "lucide-react";
import { useRouter } from "next/router";
import { useEffect } from "react";
@@ -87,25 +89,31 @@ export const Login2FA = ({ authId }: Props) => {
</span>
</div>
)}
<CardTitle className="text-xl font-bold">2FA Setup</CardTitle>
<CardTitle className="text-xl font-bold">2FA Login</CardTitle>
<FormField
control={form.control}
name="pin"
render={({ field }) => (
<FormItem className="flex flex-col justify-center max-sm:items-center">
<FormItem className="flex flex-col max-sm:items-center">
<FormLabel>Pin</FormLabel>
<FormControl>
<InputOTP maxLength={6} {...field}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<div className="flex">
<InputOTP
maxLength={6}
{...field}
pattern={REGEXP_ONLY_DIGITS}
>
<InputOTPGroup>
<InputOTPSlot index={0} className="border-border" />
<InputOTPSlot index={1} className="border-border" />
<InputOTPSlot index={2} className="border-border" />
<InputOTPSlot index={3} className="border-border" />
<InputOTPSlot index={4} className="border-border" />
<InputOTPSlot index={5} className="border-border" />
</InputOTPGroup>
</InputOTP>
</div>
</FormControl>
<FormDescription>
Please enter the 6 digits code provided by your authenticator

View File

@@ -259,7 +259,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
refetch();
})
.catch(() => {
toast.error("Error to update the swarm settings");
toast.error("Error updating the swarm settings");
});
};
return (

View File

@@ -94,7 +94,7 @@ export const ShowClusterSettings = ({ applicationId }: Props) => {
});
})
.catch(() => {
toast.error("Error to update the command");
toast.error("Error updating the command");
});
};

View File

@@ -71,7 +71,7 @@ export const AddCommand = ({ applicationId }: Props) => {
});
})
.catch(() => {
toast.error("Error to update the command");
toast.error("Error updating the command");
});
};
@@ -81,7 +81,8 @@ export const AddCommand = ({ applicationId }: Props) => {
<div>
<CardTitle className="text-xl">Run Command</CardTitle>
<CardDescription>
Run a custom command in the container
Run a custom command in the container after the application
initialized
</CardDescription>
</div>
</CardHeader>

View File

@@ -1,63 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { TrashIcon } from "lucide-react";
import { toast } from "sonner";
interface Props {
portId: string;
}
export const DeletePort = ({ portId }: Props) => {
const utils = api.useUtils();
const { mutateAsync, isLoading } = api.port.delete.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground " />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the port
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
portId,
})
.then((data) => {
utils.application.one.invalidate({
applicationId: data?.applicationId,
});
toast.success("Port delete succesfully");
})
.catch(() => {
toast.error("Error to delete the port");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -27,7 +27,7 @@ import {
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon } from "lucide-react";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -45,18 +45,29 @@ type AddPort = z.infer<typeof AddPortSchema>;
interface Props {
applicationId: string;
portId?: string;
children?: React.ReactNode;
}
export const AddPort = ({
export const HandlePorts = ({
applicationId,
portId,
children = <PlusIcon className="h-4 w-4" />,
}: Props) => {
const [isOpen, setIsOpen] = useState(false);
const utils = api.useUtils();
const { mutateAsync, isLoading, error, isError } =
api.port.create.useMutation();
const { data } = api.port.one.useQuery(
{
portId: portId ?? "",
},
{
enabled: !!portId,
},
);
const { mutateAsync, isLoading, error, isError } = portId
? api.port.update.useMutation()
: api.port.create.useMutation();
const form = useForm<AddPort>({
defaultValues: {
@@ -68,32 +79,46 @@ export const AddPort = ({
useEffect(() => {
form.reset({
publishedPort: 0,
targetPort: 0,
publishedPort: data?.publishedPort ?? 0,
targetPort: data?.targetPort ?? 0,
protocol: data?.protocol ?? "tcp",
});
}, [form, form.reset, form.formState.isSubmitSuccessful]);
}, [form, form.reset, form.formState.isSubmitSuccessful, data]);
const onSubmit = async (data: AddPort) => {
await mutateAsync({
applicationId,
...data,
portId: portId || "",
})
.then(async () => {
toast.success("Port Created");
toast.success(portId ? "Port Updated" : "Port Created");
await utils.application.one.invalidate({
applicationId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to create the port");
toast.error(
portId ? "Error updating the port" : "Error creating the port",
);
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button>{children}</Button>
{portId ? (
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
) : (
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
@@ -204,7 +229,7 @@ export const AddPort = ({
form="hook-form-add-port"
type="submit"
>
Create
{portId ? "Update" : "Create"}
</Button>
</DialogFooter>
</Form>

View File

@@ -1,4 +1,6 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
@@ -7,23 +9,25 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Rss } from "lucide-react";
import { Rss, Trash2 } from "lucide-react";
import React from "react";
import { AddPort } from "./add-port";
import { DeletePort } from "./delete-port";
import { UpdatePort } from "./update-port";
import { toast } from "sonner";
import { HandlePorts } from "./handle-ports";
interface Props {
applicationId: string;
}
export const ShowPorts = ({ applicationId }: Props) => {
const { data } = api.application.one.useQuery(
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync: deletePort, isLoading: isRemoving } =
api.port.delete.useMutation();
return (
<Card className="bg-background">
<CardHeader className="flex flex-row justify-between flex-wrap gap-4">
@@ -35,7 +39,7 @@ export const ShowPorts = ({ applicationId }: Props) => {
</div>
{data && data?.ports.length > 0 && (
<AddPort applicationId={applicationId}>Add Port</AddPort>
<HandlePorts applicationId={applicationId}>Add Port</HandlePorts>
)}
</CardHeader>
<CardContent className="flex flex-col gap-4">
@@ -45,7 +49,7 @@ export const ShowPorts = ({ applicationId }: Props) => {
<span className="text-base text-muted-foreground">
No ports configured
</span>
<AddPort applicationId={applicationId}>Add Port</AddPort>
<HandlePorts applicationId={applicationId}>Add Port</HandlePorts>
</div>
) : (
<div className="flex flex-col pt-2 gap-4">
@@ -78,8 +82,36 @@ export const ShowPorts = ({ applicationId }: Props) => {
</div>
</div>
<div className="flex flex-row gap-4">
<UpdatePort portId={port.portId} />
<DeletePort portId={port.portId} />
<HandlePorts
applicationId={applicationId}
portId={port.portId}
/>
<DialogAction
title="Delete Port"
description="Are you sure you want to delete this port?"
type="destructive"
onClick={async () => {
await deletePort({
portId: port.portId,
})
.then(() => {
refetch();
toast.success("Port deleted successfully");
})
.catch(() => {
toast.error("Error deleting port");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10 "
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
</div>

View File

@@ -1,195 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input, NumberInput } from "@/components/ui/input";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, Pencil } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const UpdatePortSchema = z.object({
publishedPort: z.number().int().min(1).max(65535),
targetPort: z.number().int().min(1).max(65535),
protocol: z.enum(["tcp", "udp"], {
required_error: "Protocol is required",
invalid_type_error: "Protocol must be a valid protocol",
}),
});
type UpdatePort = z.infer<typeof UpdatePortSchema>;
interface Props {
portId: string;
}
export const UpdatePort = ({ portId }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const utils = api.useUtils();
const { data } = api.port.one.useQuery(
{
portId,
},
{
enabled: !!portId,
},
);
const { mutateAsync, isLoading, error, isError } =
api.port.update.useMutation();
const form = useForm<UpdatePort>({
defaultValues: {},
resolver: zodResolver(UpdatePortSchema),
});
useEffect(() => {
if (data) {
form.reset({
publishedPort: data.publishedPort,
targetPort: data.targetPort,
protocol: data.protocol,
});
}
}, [form, form.reset, data]);
const onSubmit = async (data: UpdatePort) => {
await mutateAsync({
portId,
publishedPort: data.publishedPort,
targetPort: data.targetPort,
protocol: data.protocol,
})
.then(async (response) => {
toast.success("Port Updated");
await utils.application.one.invalidate({
applicationId: response?.applicationId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the port");
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<PenBoxIcon className="size-4 text-muted-foreground" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Update</DialogTitle>
<DialogDescription>Update the port</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
<Form {...form}>
<form
id="hook-form-update-redirect"
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-4"
>
<div className="flex flex-col gap-4">
<FormField
control={form.control}
name="publishedPort"
render={({ field }) => (
<FormItem>
<FormLabel>Published Port</FormLabel>
<FormControl>
<NumberInput placeholder="1-65535" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="targetPort"
render={({ field }) => (
<FormItem>
<FormLabel>Target Port</FormLabel>
<FormControl>
<NumberInput placeholder="1-65535" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="protocol"
render={({ field }) => {
return (
<FormItem className="md:col-span-2">
<FormLabel>Protocol</FormLabel>
<Select
onValueChange={field.onChange}
value={field.value}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a protocol" />
</SelectTrigger>
</FormControl>
<SelectContent defaultValue={"none"}>
<SelectItem value={"none"} disabled>
None
</SelectItem>
<SelectItem value={"tcp"}>TCP</SelectItem>
<SelectItem value={"udp"}>UDP</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
);
}}
/>
</div>
</form>
<DialogFooter>
<Button
isLoading={isLoading}
form="hook-form-update-redirect"
type="submit"
>
Update
</Button>
</DialogFooter>
</Form>
</DialogContent>
</Dialog>
);
};

View File

@@ -1,66 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { TrashIcon } from "lucide-react";
import { toast } from "sonner";
interface Props {
redirectId: string;
}
export const DeleteRedirect = ({ redirectId }: Props) => {
const utils = api.useUtils();
const { mutateAsync, isLoading } = api.redirects.delete.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground " />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the
redirect
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
redirectId,
})
.then((data) => {
utils.application.one.invalidate({
applicationId: data?.applicationId,
});
utils.application.readTraefikConfig.invalidate({
applicationId: data?.applicationId,
});
toast.success("Redirect delete succesfully");
})
.catch(() => {
toast.error("Error to delete the redirect");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -31,7 +31,7 @@ import { Separator } from "@/components/ui/separator";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon } from "lucide-react";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -77,19 +77,32 @@ const redirectPresets = [
interface Props {
applicationId: string;
redirectId?: string;
children?: React.ReactNode;
}
export const AddRedirect = ({
export const HandleRedirect = ({
applicationId,
redirectId,
children = <PlusIcon className="w-4 h-4" />,
}: Props) => {
const [isOpen, setIsOpen] = useState(false);
const [presetSelected, setPresetSelected] = useState("");
const { data, refetch } = api.redirects.one.useQuery(
{
redirectId: redirectId || "",
},
{
enabled: !!redirectId,
},
);
const utils = api.useUtils();
const { mutateAsync, isLoading, error, isError } =
api.redirects.create.useMutation();
const { mutateAsync, isLoading, error, isError } = redirectId
? api.redirects.update.useMutation()
: api.redirects.create.useMutation();
const form = useForm<AddRedirect>({
defaultValues: {
@@ -102,29 +115,35 @@ export const AddRedirect = ({
useEffect(() => {
form.reset({
permanent: false,
regex: "",
replacement: "",
permanent: data?.permanent || false,
regex: data?.regex || "",
replacement: data?.replacement || "",
});
}, [form, form.reset, form.formState.isSubmitSuccessful]);
}, [form, form.reset, form.formState.isSubmitSuccessful, data]);
const onSubmit = async (data: AddRedirect) => {
await mutateAsync({
applicationId,
...data,
redirectId: redirectId || "",
})
.then(async () => {
toast.success("Redirect Created");
toast.success(redirectId ? "Redirect Updated" : "Redirect Created");
await utils.application.one.invalidate({
applicationId,
});
refetch();
await utils.application.readTraefikConfig.invalidate({
applicationId,
});
onDialogToggle(false);
})
.catch(() => {
toast.error("Error to create the redirect");
toast.error(
redirectId
? "Error updating the redirect"
: "Error creating the redirect",
);
});
};
@@ -148,7 +167,17 @@ export const AddRedirect = ({
return (
<Dialog open={isOpen} onOpenChange={onDialogToggle}>
<DialogTrigger asChild>
<Button>{children}</Button>
{redirectId ? (
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
) : (
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
@@ -243,7 +272,7 @@ export const AddRedirect = ({
form="hook-form-add-redirect"
type="submit"
>
Create
{redirectId ? "Update" : "Create"}
</Button>
</DialogFooter>
</Form>

View File

@@ -1,3 +1,5 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
@@ -6,23 +8,28 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Split } from "lucide-react";
import { Split, Trash2 } from "lucide-react";
import React from "react";
import { AddRedirect } from "./add-redirect";
import { DeleteRedirect } from "./delete-redirect";
import { UpdateRedirect } from "./update-redirect";
import { toast } from "sonner";
import { HandleRedirect } from "./handle-redirect";
interface Props {
applicationId: string;
}
export const ShowRedirects = ({ applicationId }: Props) => {
const { data } = api.application.one.useQuery(
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync: deleteRedirect, isLoading: isRemoving } =
api.redirects.delete.useMutation();
const utils = api.useUtils();
return (
<Card className="bg-background">
<CardHeader className="flex flex-row justify-between flex-wrap gap-4">
@@ -35,7 +42,9 @@ export const ShowRedirects = ({ applicationId }: Props) => {
</div>
{data && data?.redirects.length > 0 && (
<AddRedirect applicationId={applicationId}>Add Redirect</AddRedirect>
<HandleRedirect applicationId={applicationId}>
Add Redirect
</HandleRedirect>
)}
</CardHeader>
<CardContent className="flex flex-col gap-4">
@@ -45,9 +54,9 @@ export const ShowRedirects = ({ applicationId }: Props) => {
<span className="text-base text-muted-foreground">
No redirects configured
</span>
<AddRedirect applicationId={applicationId}>
<HandleRedirect applicationId={applicationId}>
Add Redirect
</AddRedirect>
</HandleRedirect>
</div>
) : (
<div className="flex flex-col pt-2">
@@ -76,8 +85,40 @@ export const ShowRedirects = ({ applicationId }: Props) => {
</div>
</div>
<div className="flex flex-row gap-4">
<UpdateRedirect redirectId={redirect.redirectId} />
<DeleteRedirect redirectId={redirect.redirectId} />
<HandleRedirect
redirectId={redirect.redirectId}
applicationId={applicationId}
/>
<DialogAction
title="Delete Redirect"
description="Are you sure you want to delete this redirect?"
type="destructive"
onClick={async () => {
await deleteRedirect({
redirectId: redirect.redirectId,
})
.then(() => {
refetch();
utils.application.readTraefikConfig.invalidate({
applicationId,
});
toast.success("Redirect deleted successfully");
})
.catch(() => {
toast.error("Error deleting redirect");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10"
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
</div>

View File

@@ -1,182 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, Pencil } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const UpdateRedirectSchema = z.object({
regex: z.string().min(1, "Regex required"),
permanent: z.boolean().default(false),
replacement: z.string().min(1, "Replacement required"),
});
type UpdateRedirect = z.infer<typeof UpdateRedirectSchema>;
interface Props {
redirectId: string;
}
export const UpdateRedirect = ({ redirectId }: Props) => {
const utils = api.useUtils();
const [isOpen, setIsOpen] = useState(false);
const { data } = api.redirects.one.useQuery(
{
redirectId,
},
{
enabled: !!redirectId,
},
);
const { mutateAsync, isLoading, error, isError } =
api.redirects.update.useMutation();
const form = useForm<UpdateRedirect>({
defaultValues: {
permanent: false,
regex: "",
replacement: "",
},
resolver: zodResolver(UpdateRedirectSchema),
});
useEffect(() => {
if (data) {
form.reset({
permanent: data.permanent || false,
regex: data.regex || "",
replacement: data.replacement || "",
});
}
}, [form, form.reset, data]);
const onSubmit = async (data: UpdateRedirect) => {
await mutateAsync({
redirectId,
permanent: data.permanent,
regex: data.regex,
replacement: data.replacement,
})
.then(async (response) => {
toast.success("Redirect Updated");
await utils.application.one.invalidate({
applicationId: response?.applicationId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the redirect");
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<PenBoxIcon className="size-4 text-muted-foreground" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Update</DialogTitle>
<DialogDescription>Update the redirect</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
<Form {...form}>
<form
id="hook-form-update-redirect"
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-4"
>
<div className="flex flex-col gap-4">
<FormField
control={form.control}
name="regex"
render={({ field }) => (
<FormItem>
<FormLabel>Regex</FormLabel>
<FormControl>
<Input placeholder="^http://localhost/(.*)" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="replacement"
render={({ field }) => (
<FormItem>
<FormLabel>Replacement</FormLabel>
<FormControl>
<Input placeholder="http://mydomain/$${1}" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="permanent"
render={({ field }) => (
<FormItem className="mt-4 flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm">
<div className="space-y-0.5">
<FormLabel>Permanent</FormLabel>
<FormDescription>
Set the permanent option to true to apply a permanent
redirection.
</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>
</div>
</form>
<DialogFooter>
<Button
isLoading={isLoading}
form="hook-form-update-redirect"
type="submit"
>
Update
</Button>
</DialogFooter>
</Form>
</DialogContent>
</Dialog>
);
};

View File

@@ -1,66 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { TrashIcon } from "lucide-react";
import { toast } from "sonner";
interface Props {
securityId: string;
}
export const DeleteSecurity = ({ securityId }: Props) => {
const utils = api.useUtils();
const { mutateAsync, isLoading } = api.security.delete.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground " />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the
security
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
securityId,
})
.then((data) => {
utils.application.one.invalidate({
applicationId: data?.applicationId,
});
utils.application.readTraefikConfig.invalidate({
applicationId: data?.applicationId,
});
toast.success("Security delete succesfully");
})
.catch(() => {
toast.error("Error to delete the security");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -20,7 +20,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon } from "lucide-react";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -35,17 +35,29 @@ type AddSecurity = z.infer<typeof AddSecuritychema>;
interface Props {
applicationId: string;
securityId?: string;
children?: React.ReactNode;
}
export const AddSecurity = ({
export const HandleSecurity = ({
applicationId,
securityId,
children = <PlusIcon className="h-4 w-4" />,
}: Props) => {
const utils = api.useUtils();
const [isOpen, setIsOpen] = useState(false);
const { mutateAsync, isLoading, error, isError } =
api.security.create.useMutation();
const { data } = api.security.one.useQuery(
{
securityId: securityId ?? "",
},
{
enabled: !!securityId,
},
);
const { mutateAsync, isLoading, error, isError } = securityId
? api.security.update.useMutation()
: api.security.create.useMutation();
const form = useForm<AddSecurity>({
defaultValues: {
@@ -56,16 +68,20 @@ export const AddSecurity = ({
});
useEffect(() => {
form.reset();
}, [form, form.reset, form.formState.isSubmitSuccessful]);
form.reset({
username: data?.username || "",
password: data?.password || "",
});
}, [form, form.reset, form.formState.isSubmitSuccessful, data]);
const onSubmit = async (data: AddSecurity) => {
await mutateAsync({
applicationId,
...data,
securityId: securityId || "",
})
.then(async () => {
toast.success("Security Created");
toast.success(securityId ? "Security Updated" : "Security Created");
await utils.application.one.invalidate({
applicationId,
});
@@ -75,20 +91,34 @@ export const AddSecurity = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to create the security");
toast.error(
securityId
? "Error updating the security"
: "Error creating security",
);
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button>{children}</Button>
{securityId ? (
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
) : (
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Security</DialogTitle>
<DialogDescription>
Add security to your application
{securityId ? "Update" : "Add"} security to your application
</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
@@ -137,7 +167,7 @@ export const AddSecurity = ({
form="hook-form-add-security"
type="submit"
>
Create
{securityId ? "Update" : "Create"}
</Button>
</DialogFooter>
</Form>

View File

@@ -1,3 +1,5 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
@@ -6,23 +8,27 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { LockKeyhole } from "lucide-react";
import { LockKeyhole, Trash2 } from "lucide-react";
import React from "react";
import { AddSecurity } from "./add-security";
import { DeleteSecurity } from "./delete-security";
import { UpdateSecurity } from "./update-security";
import { toast } from "sonner";
import { HandleSecurity } from "./handle-security";
interface Props {
applicationId: string;
}
export const ShowSecurity = ({ applicationId }: Props) => {
const { data } = api.application.one.useQuery(
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync: deleteSecurity, isLoading: isRemoving } =
api.security.delete.useMutation();
const utils = api.useUtils();
return (
<Card className="bg-background">
<CardHeader className="flex flex-row justify-between flex-wrap gap-4">
@@ -32,7 +38,9 @@ export const ShowSecurity = ({ applicationId }: Props) => {
</div>
{data && data?.security.length > 0 && (
<AddSecurity applicationId={applicationId}>Add Security</AddSecurity>
<HandleSecurity applicationId={applicationId}>
Add Security
</HandleSecurity>
)}
</CardHeader>
<CardContent className="flex flex-col gap-4">
@@ -42,9 +50,9 @@ export const ShowSecurity = ({ applicationId }: Props) => {
<span className="text-base text-muted-foreground">
No security configured
</span>
<AddSecurity applicationId={applicationId}>
<HandleSecurity applicationId={applicationId}>
Add Security
</AddSecurity>
</HandleSecurity>
</div>
) : (
<div className="flex flex-col pt-2">
@@ -67,8 +75,39 @@ export const ShowSecurity = ({ applicationId }: Props) => {
</div>
</div>
<div className="flex flex-row gap-2">
<UpdateSecurity securityId={security.securityId} />
<DeleteSecurity securityId={security.securityId} />
<HandleSecurity
securityId={security.securityId}
applicationId={applicationId}
/>
<DialogAction
title="Delete Security"
description="Are you sure you want to delete this security?"
type="destructive"
onClick={async () => {
await deleteSecurity({
securityId: security.securityId,
})
.then(() => {
refetch();
utils.application.readTraefikConfig.invalidate({
applicationId,
});
toast.success("Security deleted successfully");
})
.catch(() => {
toast.error("Error deleting security");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10"
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
</div>

View File

@@ -1,155 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, Pencil } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const UpdateSecuritySchema = z.object({
username: z.string().min(1, "Username is required"),
password: z.string().min(1, "Password is required"),
});
type UpdateSecurity = z.infer<typeof UpdateSecuritySchema>;
interface Props {
securityId: string;
}
export const UpdateSecurity = ({ securityId }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const utils = api.useUtils();
const { data } = api.security.one.useQuery(
{
securityId,
},
{
enabled: !!securityId,
},
);
const { mutateAsync, isLoading, error, isError } =
api.security.update.useMutation();
const form = useForm<UpdateSecurity>({
defaultValues: {
username: "",
password: "",
},
resolver: zodResolver(UpdateSecuritySchema),
});
useEffect(() => {
if (data) {
form.reset({
username: data.username || "",
password: data.password || "",
});
}
}, [form, form.reset, data]);
const onSubmit = async (data: UpdateSecurity) => {
await mutateAsync({
securityId,
username: data.username,
password: data.password,
})
.then(async (response) => {
toast.success("Security Updated");
await utils.application.one.invalidate({
applicationId: response?.applicationId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the security");
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<PenBoxIcon className="size-4 text-muted-foreground" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Update</DialogTitle>
<DialogDescription>Update the security</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
<Form {...form}>
<form
id="hook-form-update-security"
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-4 "
>
<div className="flex flex-col gap-4">
<FormField
control={form.control}
name="username"
render={({ field }) => (
<FormItem>
<FormLabel>Username</FormLabel>
<FormControl>
<Input placeholder="test1" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<Input placeholder="test" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
</form>
<DialogFooter>
<Button
isLoading={isLoading}
form="hook-form-update-security"
type="submit"
>
Update
</Button>
</DialogFooter>
</Form>
</DialogContent>
</Dialog>
);
};

View File

@@ -1,231 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import React, { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const addResourcesApplication = z.object({
memoryReservation: z.number().nullable().optional(),
cpuLimit: z.number().nullable().optional(),
memoryLimit: z.number().nullable().optional(),
cpuReservation: z.number().nullable().optional(),
});
interface Props {
applicationId: string;
}
type AddResourcesApplication = z.infer<typeof addResourcesApplication>;
export const ShowApplicationResources = ({ applicationId }: Props) => {
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync, isLoading } = api.application.update.useMutation();
const form = useForm<AddResourcesApplication>({
defaultValues: {},
resolver: zodResolver(addResourcesApplication),
});
useEffect(() => {
if (data) {
form.reset({
cpuLimit: data?.cpuLimit || undefined,
cpuReservation: data?.cpuReservation || undefined,
memoryLimit: data?.memoryLimit || undefined,
memoryReservation: data?.memoryReservation || undefined,
});
}
}, [data, form, form.reset]);
const onSubmit = async (formData: AddResourcesApplication) => {
await mutateAsync({
applicationId,
cpuLimit: formData.cpuLimit || null,
cpuReservation: formData.cpuReservation || null,
memoryLimit: formData.memoryLimit || null,
memoryReservation: formData.memoryReservation || null,
})
.then(async () => {
toast.success("Resources Updated");
await refetch();
})
.catch(() => {
toast.error("Error to Update the resources");
});
};
return (
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Resources</CardTitle>
<CardDescription>
If you want to decrease or increase the resources to a specific.
application or database
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<AlertBlock type="info">
Please remember to click Redeploy after modify the resources to apply
the changes.
</AlertBlock>
<Form {...form}>
<form
id="hook-form"
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-8 "
>
<div className="grid w-full md:grid-cols-2 gap-4">
<FormField
control={form.control}
name="memoryReservation"
render={({ field }) => (
<FormItem>
<FormLabel>Memory Reservation</FormLabel>
<FormControl>
<Input
placeholder="256 MB"
{...field}
value={field.value?.toString() || ""}
onChange={(e) => {
const value = e.target.value;
if (value === "") {
field.onChange(null);
} else {
const number = Number.parseInt(value, 10);
if (!Number.isNaN(number)) {
field.onChange(number);
}
}
}}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="memoryLimit"
render={({ field }) => {
return (
<FormItem>
<FormLabel>Memory Limit</FormLabel>
<FormControl>
<Input
placeholder={"1024 MB"}
{...field}
value={field.value?.toString() || ""}
onChange={(e) => {
const value = e.target.value;
if (value === "") {
field.onChange(null);
} else {
const number = Number.parseInt(value, 10);
if (!Number.isNaN(number)) {
field.onChange(number);
}
}
}}
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="cpuLimit"
render={({ field }) => {
return (
<FormItem>
<FormLabel>Cpu Limit</FormLabel>
<FormControl>
<Input
placeholder={"2"}
{...field}
type="number"
value={field.value?.toString() || ""}
onChange={(e) => {
const value = e.target.value;
if (
value === "" ||
/^[0-9]*\.?[0-9]*$/.test(value)
) {
const float = Number.parseFloat(value);
field.onChange(float);
}
}}
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="cpuReservation"
render={({ field }) => {
return (
<FormItem>
<FormLabel>Cpu Reservation</FormLabel>
<FormControl>
<Input
placeholder={"1"}
{...field}
type="number"
value={field.value?.toString() || ""}
onChange={(e) => {
const value = e.target.value;
if (
value === "" ||
/^[0-9]*\.?[0-9]*$/.test(value)
) {
const float = Number.parseFloat(value);
field.onChange(float);
}
}}
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
</div>
<div className="flex w-full justify-end">
<Button isLoading={isLoading} type="submit">
Save
</Button>
</div>
</form>
</Form>
</CardContent>
</Card>
);
};

View File

@@ -0,0 +1,288 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { InfoIcon } from "lucide-react";
import React, { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const addResourcesSchema = z.object({
memoryReservation: z.string().optional(),
cpuLimit: z.string().optional(),
memoryLimit: z.string().optional(),
cpuReservation: z.string().optional(),
});
export type ServiceType =
| "postgres"
| "mongo"
| "redis"
| "mysql"
| "mariadb"
| "application";
interface Props {
id: string;
type: ServiceType | "application";
}
type AddResources = z.infer<typeof addResourcesSchema>;
export const ShowResources = ({ id, type }: Props) => {
const queryMap = {
postgres: () =>
api.postgres.one.useQuery({ postgresId: id }, { enabled: !!id }),
redis: () => api.redis.one.useQuery({ redisId: id }, { enabled: !!id }),
mysql: () => api.mysql.one.useQuery({ mysqlId: id }, { enabled: !!id }),
mariadb: () =>
api.mariadb.one.useQuery({ mariadbId: id }, { enabled: !!id }),
application: () =>
api.application.one.useQuery({ applicationId: id }, { enabled: !!id }),
mongo: () => api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id }),
};
const { data, refetch } = queryMap[type]
? queryMap[type]()
: api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id });
const mutationMap = {
postgres: () => api.postgres.update.useMutation(),
redis: () => api.redis.update.useMutation(),
mysql: () => api.mysql.update.useMutation(),
mariadb: () => api.mariadb.update.useMutation(),
application: () => api.application.update.useMutation(),
mongo: () => api.mongo.update.useMutation(),
};
const { mutateAsync, isLoading } = mutationMap[type]
? mutationMap[type]()
: api.mongo.update.useMutation();
const form = useForm<AddResources>({
defaultValues: {
cpuLimit: "",
cpuReservation: "",
memoryLimit: "",
memoryReservation: "",
},
resolver: zodResolver(addResourcesSchema),
});
useEffect(() => {
if (data) {
form.reset({
cpuLimit: data?.cpuLimit || undefined,
cpuReservation: data?.cpuReservation || undefined,
memoryLimit: data?.memoryLimit || undefined,
memoryReservation: data?.memoryReservation || undefined,
});
}
}, [data, form, form.reset]);
const onSubmit = async (formData: AddResources) => {
await mutateAsync({
mongoId: id || "",
postgresId: id || "",
redisId: id || "",
mysqlId: id || "",
mariadbId: id || "",
applicationId: id || "",
cpuLimit: formData.cpuLimit || null,
cpuReservation: formData.cpuReservation || null,
memoryLimit: formData.memoryLimit || null,
memoryReservation: formData.memoryReservation || null,
})
.then(async () => {
toast.success("Resources Updated");
await refetch();
})
.catch(() => {
toast.error("Error updating the resources");
});
};
return (
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Resources</CardTitle>
<CardDescription>
If you want to decrease or increase the resources to a specific.
application or database
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<AlertBlock type="info">
Please remember to click Redeploy after modify the resources to apply
the changes.
</AlertBlock>
<Form {...form}>
<form
id="hook-form"
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-8 "
>
<div className="grid w-full md:grid-cols-2 gap-4">
<FormField
control={form.control}
name="memoryReservation"
render={({ field }) => (
<FormItem>
<div className="flex items-center gap-2">
<FormLabel>Memory Reservation</FormLabel>
<TooltipProvider>
<Tooltip delayDuration={0}>
<TooltipTrigger>
<InfoIcon className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent>
<p>
Memory soft limit in bytes. Example: 256MB =
268435456 bytes
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<FormControl>
<Input
placeholder="268435456 (256MB in bytes)"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="memoryLimit"
render={({ field }) => {
return (
<FormItem>
<div className="flex items-center gap-2">
<FormLabel>Memory Limit</FormLabel>
<TooltipProvider>
<Tooltip delayDuration={0}>
<TooltipTrigger>
<InfoIcon className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent>
<p>
Memory hard limit in bytes. Example: 1GB =
1073741824 bytes
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<FormControl>
<Input
placeholder="1073741824 (1GB in bytes)"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="cpuLimit"
render={({ field }) => {
return (
<FormItem>
<div className="flex items-center gap-2">
<FormLabel>CPU Limit</FormLabel>
<TooltipProvider>
<Tooltip delayDuration={0}>
<TooltipTrigger>
<InfoIcon className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent>
<p>
CPU quota in units of 10^-9 CPUs. Example: 2
CPUs = 2000000000
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<FormControl>
<Input
placeholder="2000000000 (2 CPUs)"
{...field}
value={field.value?.toString() || ""}
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="cpuReservation"
render={({ field }) => {
return (
<FormItem>
<div className="flex items-center gap-2">
<FormLabel>CPU Reservation</FormLabel>
<TooltipProvider>
<Tooltip delayDuration={0}>
<TooltipTrigger>
<InfoIcon className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent>
<p>
CPU shares (relative weight). Example: 1 CPU =
1000000000
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<FormControl>
<Input placeholder="1000000000 (1 CPU)" {...field} />
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
</div>
<div className="flex w-full justify-end">
<Button isLoading={isLoading} type="submit">
Save
</Button>
</div>
</form>
</Form>
</CardContent>
</Card>
);
};

View File

@@ -105,7 +105,7 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => {
form.reset();
})
.catch(() => {
toast.error("Error to update the traefik config");
toast.error("Error updating the Traefik config");
});
};

View File

@@ -107,7 +107,7 @@ export const AddVolumes = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to create the Bind mount");
toast.error("Error creating the Bind mount");
});
} else if (data.type === "volume") {
await mutateAsync({
@@ -122,7 +122,7 @@ export const AddVolumes = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to create the Volume mount");
toast.error("Error creating the Volume mount");
});
} else if (data.type === "file") {
await mutateAsync({
@@ -138,7 +138,7 @@ export const AddVolumes = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to create the File mount");
toast.error("Error creating the File mount");
});
}

View File

@@ -1,61 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { TrashIcon } from "lucide-react";
import React from "react";
import { toast } from "sonner";
interface Props {
mountId: string;
refetch: () => void;
}
export const DeleteVolume = ({ mountId, refetch }: Props) => {
const { mutateAsync, isLoading } = api.mounts.remove.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground " />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the mount
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
mountId,
})
.then(() => {
refetch();
toast.success("Mount deleted succesfully");
})
.catch(() => {
toast.error("Error to delete the mount");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,4 +1,6 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
@@ -7,40 +9,49 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Package } from "lucide-react";
import { Package, Trash2 } from "lucide-react";
import React from "react";
import { toast } from "sonner";
import type { ServiceType } from "../show-resources";
import { AddVolumes } from "./add-volumes";
import { DeleteVolume } from "./delete-volume";
import { UpdateVolume } from "./update-volume";
interface Props {
applicationId: string;
id: string;
type: ServiceType | "compose";
}
export const ShowVolumes = ({ applicationId }: Props) => {
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
export const ShowVolumes = ({ id, type }: Props) => {
const queryMap = {
postgres: () =>
api.postgres.one.useQuery({ postgresId: id }, { enabled: !!id }),
redis: () => api.redis.one.useQuery({ redisId: id }, { enabled: !!id }),
mysql: () => api.mysql.one.useQuery({ mysqlId: id }, { enabled: !!id }),
mariadb: () =>
api.mariadb.one.useQuery({ mariadbId: id }, { enabled: !!id }),
application: () =>
api.application.one.useQuery({ applicationId: id }, { enabled: !!id }),
mongo: () => api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id }),
compose: () =>
api.compose.one.useQuery({ composeId: id }, { enabled: !!id }),
};
const { data, refetch } = queryMap[type]
? queryMap[type]()
: api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id });
const { mutateAsync: deleteVolume, isLoading: isRemoving } =
api.mounts.remove.useMutation();
return (
<Card className="bg-background">
<CardHeader className="flex flex-row justify-between flex-wrap gap-4">
<div>
<CardTitle className="text-xl">Volumes</CardTitle>
<CardDescription>
If you want to persist data in this application use the following
config to setup the volumes
If you want to persist data in this postgres database use the
following config to setup the volumes
</CardDescription>
</div>
{data && data?.mounts.length > 0 && (
<AddVolumes
serviceId={applicationId}
refetch={refetch}
serviceType="application"
>
<AddVolumes serviceId={id} refetch={refetch} serviceType={type}>
Add Volume
</AddVolumes>
)}
@@ -52,17 +63,13 @@ export const ShowVolumes = ({ applicationId }: Props) => {
<span className="text-base text-muted-foreground">
No volumes/mounts configured
</span>
<AddVolumes
serviceId={applicationId}
refetch={refetch}
serviceType="application"
>
<AddVolumes serviceId={id} refetch={refetch} serviceType={type}>
Add Volume
</AddVolumes>
</div>
) : (
<div className="flex flex-col pt-2 gap-4">
<AlertBlock type="info">
<AlertBlock type="warning">
Please remember to click Redeploy after adding, editing, or
deleting a mount to apply the changes.
</AlertBlock>
@@ -73,7 +80,8 @@ export const ShowVolumes = ({ applicationId }: Props) => {
key={mount.mountId}
className="flex w-full flex-col sm:flex-row sm:items-center justify-between gap-4 sm:gap-10 border rounded-lg p-4"
>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 flex-col gap-4 sm:gap-8">
{/* <Package className="size-8 self-center text-muted-foreground" /> */}
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 flex-col gap-4 sm:gap-8">
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Type</span>
<span className="text-sm text-muted-foreground">
@@ -90,21 +98,12 @@ export const ShowVolumes = ({ applicationId }: Props) => {
)}
{mount.type === "file" && (
<>
<div className="flex flex-col gap-1">
<span className="font-medium">Content</span>
<span className="text-sm text-muted-foreground">
{mount.content}
</span>
</div>
<div className="flex flex-col gap-1">
<span className="font-medium">File Path</span>
<span className="text-sm text-muted-foreground">
{mount.filePath}
</span>
</div>
</>
<div className="flex flex-col gap-1">
<span className="font-medium">Content</span>
<span className="text-sm text-muted-foreground line-clamp-[10] whitespace-break-spaces">
{mount.content}
</span>
</div>
)}
{mount.type === "bind" && (
<div className="flex flex-col gap-1">
@@ -114,21 +113,55 @@ export const ShowVolumes = ({ applicationId }: Props) => {
</span>
</div>
)}
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Path</span>
<span className="text-sm text-muted-foreground">
{mount.mountPath}
</span>
</div>
{mount.type === "file" ? (
<div className="flex flex-col gap-1">
<span className="font-medium">File Path</span>
<span className="text-sm text-muted-foreground">
{mount.filePath}
</span>
</div>
) : (
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Path</span>
<span className="text-sm text-muted-foreground">
{mount.mountPath}
</span>
</div>
)}
</div>
<div className="flex flex-row gap-1">
<UpdateVolume
mountId={mount.mountId}
type={mount.type}
refetch={refetch}
serviceType="application"
serviceType={type}
/>
<DeleteVolume mountId={mount.mountId} refetch={refetch} />
<DialogAction
title="Delete Volume"
description="Are you sure you want to delete this volume?"
type="destructive"
onClick={async () => {
await deleteVolume({
mountId: mount.mountId,
})
.then(() => {
refetch();
toast.success("Volume deleted successfully");
})
.catch(() => {
toast.error("Error deleting volume");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10"
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
</div>

View File

@@ -21,7 +21,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Pencil } from "lucide-react";
import { PenBoxIcon, Pencil } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -139,7 +139,7 @@ export const UpdateVolume = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the Bind mount");
toast.error("Error updating the Bind mount");
});
} else if (data.type === "volume") {
await mutateAsync({
@@ -153,7 +153,7 @@ export const UpdateVolume = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the Volume mount");
toast.error("Error updating the Volume mount");
});
} else if (data.type === "file") {
await mutateAsync({
@@ -168,7 +168,7 @@ export const UpdateVolume = ({
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the File mount");
toast.error("Error updating the File mount");
});
}
refetch();
@@ -177,8 +177,13 @@ export const UpdateVolume = ({
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<Pencil className="size-4 text-muted-foreground" />
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
isLoading={isLoading}
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-3xl">

View File

@@ -126,7 +126,7 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the build type");
toast.error("Error saving the build type");
});
};

View File

@@ -1,143 +0,0 @@
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { TrashIcon } from "lucide-react";
import { useRouter } from "next/router";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const deleteApplicationSchema = z.object({
projectName: z.string().min(1, {
message: "Application name is required",
}),
});
type DeleteApplication = z.infer<typeof deleteApplicationSchema>;
interface Props {
applicationId: string;
}
export const DeleteApplication = ({ applicationId }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const { mutateAsync, isLoading } = api.application.delete.useMutation();
const { data } = api.application.one.useQuery(
{ applicationId },
{ enabled: !!applicationId },
);
const { push } = useRouter();
const form = useForm<DeleteApplication>({
defaultValues: {
projectName: "",
},
resolver: zodResolver(deleteApplicationSchema),
});
const onSubmit = async (formData: DeleteApplication) => {
const expectedName = `${data?.name}/${data?.appName}`;
if (formData.projectName === expectedName) {
await mutateAsync({
applicationId,
})
.then((data) => {
push(`/dashboard/project/${data?.projectId}`);
toast.success("Application deleted successfully");
setIsOpen(false);
})
.catch(() => {
toast.error("Error deleting the application");
});
} else {
form.setError("projectName", {
message: "Project name does not match",
});
}
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Are you absolutely sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete the
application. If you are sure please enter the application name to
delete this application.
</DialogDescription>
</DialogHeader>
<div className="grid gap-4">
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
id="hook-form-delete-application"
className="grid w-full gap-4"
>
<FormField
control={form.control}
name="projectName"
render={({ field }) => (
<FormItem>
<FormLabel>
To confirm, type "{data?.name}/{data?.appName}" in the box
below
</FormLabel>
<FormControl>
<Input
placeholder="Enter application name to confirm"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</form>
</Form>
</div>
<DialogFooter>
<Button
variant="secondary"
onClick={() => {
setIsOpen(false);
}}
>
Cancel
</Button>
<Button
isLoading={isLoading}
form="hook-form-delete-application"
type="submit"
variant="destructive"
>
Confirm
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
};

View File

@@ -20,6 +20,12 @@ interface Props {
export const CancelQueues = ({ applicationId }: Props) => {
const { mutateAsync, isLoading } = api.application.cleanQueues.useMutation();
const { data: isCloud } = api.settings.isCloud.useQuery();
if (isCloud) {
return null;
}
return (
<AlertDialog>
<AlertDialogTrigger asChild>

View File

@@ -47,7 +47,7 @@ export const RefreshToken = ({ applicationId }: Props) => {
toast.success("Refresh updated");
})
.catch(() => {
toast.error("Error to update the refresh token");
toast.error("Error updating the refresh token");
});
}}
>

View File

@@ -1,3 +1,5 @@
import { Badge } from "@/components/ui/badge";
import { Checkbox } from "@/components/ui/checkbox";
import {
Dialog,
DialogContent,
@@ -5,18 +7,45 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { TerminalLine } from "../../docker/logs/terminal-line";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
interface Props {
logPath: string | null;
open: boolean;
onClose: () => void;
serverId?: string;
errorMessage?: string;
}
export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
export const ShowDeployment = ({
logPath,
open,
onClose,
serverId,
errorMessage,
}: Props) => {
const [data, setData] = useState("");
const endOfLogsRef = useRef<HTMLDivElement>(null);
const [showExtraLogs, setShowExtraLogs] = useState(false);
const [filteredLogs, setFilteredLogs] = useState<LogLine[]>([]);
const wsRef = useRef<WebSocket | null>(null); // Ref to hold WebSocket instance
const [autoScroll, setAutoScroll] = useState(true);
const scrollRef = useRef<HTMLDivElement>(null);
const scrollToBottom = () => {
if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
};
const handleScroll = () => {
if (!scrollRef.current) return;
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) < 10;
setAutoScroll(isAtBottom);
};
useEffect(() => {
if (!open || !logPath) return;
@@ -48,13 +77,36 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
};
}, [logPath, open]);
const scrollToBottom = () => {
endOfLogsRef.current?.scrollIntoView({ behavior: "smooth" });
};
useEffect(() => {
const logs = parseLogs(data);
let filteredLogsResult = logs;
if (serverId) {
let hideSubsequentLogs = false;
filteredLogsResult = logs.filter((log) => {
if (
log.message.includes(
"===================================EXTRA LOGS============================================",
)
) {
hideSubsequentLogs = true;
return showExtraLogs;
}
return showExtraLogs ? true : !hideSubsequentLogs;
});
}
setFilteredLogs(filteredLogsResult);
}, [data, showExtraLogs]);
useEffect(() => {
scrollToBottom();
}, [data]);
if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
}, [filteredLogs, autoScroll]);
const optionalErrors = parseLogs(errorMessage || "");
return (
<Dialog
@@ -75,18 +127,57 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
<DialogContent className={"sm:max-w-5xl overflow-y-auto max-h-screen"}>
<DialogHeader>
<DialogTitle>Deployment</DialogTitle>
<DialogDescription>
See all the details of this deployment
<DialogDescription className="flex items-center gap-2">
<span>
See all the details of this deployment |{" "}
<Badge variant="blank" className="text-xs">
{filteredLogs.length} lines
</Badge>
</span>
{serverId && (
<div className="flex items-center space-x-2">
<Checkbox
id="show-extra-logs"
checked={showExtraLogs}
onCheckedChange={(checked) =>
setShowExtraLogs(checked as boolean)
}
/>
<label
htmlFor="show-extra-logs"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
Show Extra Logs
</label>
</div>
)}
</DialogDescription>
</DialogHeader>
<div className="text-wrap rounded-lg border p-4 text-sm sm:max-w-[59rem]">
<code>
<pre className="whitespace-pre-wrap break-words">
{data || "Loading..."}
</pre>
<div ref={endOfLogsRef} />
</code>
<div
ref={scrollRef}
onScroll={handleScroll}
className="h-[720px] overflow-y-auto space-y-0 border p-4 bg-[#fafafa] dark:bg-[#050506] rounded custom-logs-scrollbar"
>
{" "}
{filteredLogs.length > 0 ? (
filteredLogs.map((log: LogLine, index: number) => (
<TerminalLine key={index} log={log} noTimestamp />
))
) : (
<>
{optionalErrors.length > 0 ? (
optionalErrors.map((log: LogLine, index: number) => (
<TerminalLine key={`extra-${index}`} log={log} noTimestamp />
))
) : (
<div className="flex justify-center items-center h-full text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin" />
</div>
)}
</>
)}
</div>
</DialogContent>
</Dialog>

View File

@@ -8,7 +8,7 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { type RouterOutputs, api } from "@/utils/api";
import { RocketIcon } from "lucide-react";
import React, { useEffect, useState } from "react";
import { CancelQueues } from "./cancel-queues";
@@ -18,8 +18,11 @@ import { ShowDeployment } from "./show-deployment";
interface Props {
applicationId: string;
}
export const ShowDeployments = ({ applicationId }: Props) => {
const [activeLog, setActiveLog] = useState<string | null>(null);
const [activeLog, setActiveLog] = useState<
RouterOutputs["deployment"]["all"][number] | null
>(null);
const { data } = api.application.one.useQuery({ applicationId });
const { data: deployments } = api.deployment.all.useQuery(
{ applicationId },
@@ -100,7 +103,7 @@ export const ShowDeployments = ({ applicationId }: Props) => {
<Button
onClick={() => {
setActiveLog(deployment.logPath);
setActiveLog(deployment);
}}
>
View
@@ -112,9 +115,10 @@ export const ShowDeployments = ({ applicationId }: Props) => {
)}
<ShowDeployment
serverId={data?.serverId || ""}
open={activeLog !== null}
open={Boolean(activeLog && activeLog.logPath !== null)}
onClose={() => setActiveLog(null)}
logPath={activeLog}
logPath={activeLog?.logPath || ""}
errorMessage={activeLog?.errorMessage || ""}
/>
</CardContent>
</Card>

View File

@@ -104,9 +104,7 @@ export const AddDomain = ({
const dictionary = {
success: domainId ? "Domain Updated" : "Domain Created",
error: domainId
? "Error to update the domain"
: "Error to create the domain",
error: domainId ? "Error updating the domain" : "Error creating the domain",
submit: domainId ? "Update" : "Create",
dialogDescription: domainId
? "In this section you can edit a domain"
@@ -264,21 +262,21 @@ export const AddDomain = ({
name="certificateType"
render={({ field }) => (
<FormItem className="col-span-2">
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>

View File

@@ -1,73 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { TrashIcon } from "lucide-react";
import React from "react";
import { toast } from "sonner";
interface Props {
domainId: string;
}
export const DeleteDomain = ({ domainId }: Props) => {
const { mutateAsync, isLoading } = api.domain.delete.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground " />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the
domain
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
domainId,
})
.then((data) => {
if (data?.applicationId) {
utils.domain.byApplicationId.invalidate({
applicationId: data?.applicationId,
});
utils.application.readTraefikConfig.invalidate({
applicationId: data?.applicationId,
});
} else if (data?.composeId) {
utils.domain.byComposeId.invalidate({
composeId: data?.composeId,
});
}
toast.success("Domain delete succesfully");
})
.catch(() => {
toast.error("Error to delete Domain");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,3 +1,4 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -8,17 +9,17 @@ import {
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { ExternalLink, GlobeIcon, PenBoxIcon } from "lucide-react";
import { ExternalLink, GlobeIcon, PenBoxIcon, Trash2 } from "lucide-react";
import Link from "next/link";
import { toast } from "sonner";
import { AddDomain } from "./add-domain";
import { DeleteDomain } from "./delete-domain";
interface Props {
applicationId: string;
}
export const ShowDomains = ({ applicationId }: Props) => {
const { data } = api.domain.byApplicationId.useQuery(
const { data, refetch } = api.domain.byApplicationId.useQuery(
{
applicationId,
},
@@ -26,6 +27,10 @@ export const ShowDomains = ({ applicationId }: Props) => {
enabled: !!applicationId,
},
);
const { mutateAsync: deleteDomain, isLoading: isRemoving } =
api.domain.delete.useMutation();
return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
@@ -97,7 +102,32 @@ export const ShowDomains = ({ applicationId }: Props) => {
<PenBoxIcon className="size-4 text-muted-foreground" />
</Button>
</AddDomain>
<DeleteDomain domainId={item.domainId} />
<DialogAction
title="Delete Domain"
description="Are you sure you want to delete this domain?"
type="destructive"
onClick={async () => {
await deleteDomain({
domainId: item.domainId,
})
.then((data) => {
refetch();
toast.success("Domain deleted successfully");
})
.catch(() => {
toast.error("Error deleting domain");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10"
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
);

View File

@@ -18,10 +18,11 @@ import { Toggle } from "@/components/ui/toggle";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { EyeIcon, EyeOffIcon } from "lucide-react";
import React, { useEffect, useState } from "react";
import React, { type CSSProperties, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import type { ServiceType } from "../advanced/show-resources";
const addEnvironmentSchema = z.object({
environment: z.string(),
@@ -30,21 +31,39 @@ const addEnvironmentSchema = z.object({
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;
interface Props {
mariadbId: string;
id: string;
type: Exclude<ServiceType | "compose", "application">;
}
export const ShowMariadbEnvironment = ({ mariadbId }: Props) => {
export const ShowEnvironment = ({ id, type }: Props) => {
const queryMap = {
postgres: () =>
api.postgres.one.useQuery({ postgresId: id }, { enabled: !!id }),
redis: () => api.redis.one.useQuery({ redisId: id }, { enabled: !!id }),
mysql: () => api.mysql.one.useQuery({ mysqlId: id }, { enabled: !!id }),
mariadb: () =>
api.mariadb.one.useQuery({ mariadbId: id }, { enabled: !!id }),
mongo: () => api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id }),
compose: () =>
api.compose.one.useQuery({ composeId: id }, { enabled: !!id }),
};
const { data, refetch } = queryMap[type]
? queryMap[type]()
: api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id });
const [isEnvVisible, setIsEnvVisible] = useState(true);
const { mutateAsync, isLoading } = api.mariadb.saveEnvironment.useMutation();
const { data, refetch } = api.mariadb.one.useQuery(
{
mariadbId,
},
{
enabled: !!mariadbId,
},
);
const mutationMap = {
postgres: () => api.postgres.update.useMutation(),
redis: () => api.redis.update.useMutation(),
mysql: () => api.mysql.update.useMutation(),
mariadb: () => api.mariadb.update.useMutation(),
mongo: () => api.mongo.update.useMutation(),
compose: () => api.compose.update.useMutation(),
};
const { mutateAsync, isLoading } = mutationMap[type]
? mutationMap[type]()
: api.mongo.update.useMutation();
const form = useForm<EnvironmentSchema>({
defaultValues: {
environment: "",
@@ -62,22 +81,26 @@ export const ShowMariadbEnvironment = ({ mariadbId }: Props) => {
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
mongoId: id || "",
postgresId: id || "",
redisId: id || "",
mysqlId: id || "",
mariadbId: id || "",
composeId: id || "",
env: data.environment,
mariadbId,
})
.then(async () => {
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add environment");
toast.error("Error adding environment");
});
};
return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
{" "}
<CardHeader className="flex flex-row w-full items-center justify-between">
<div>
<CardTitle className="text-xl">Environment Settings</CardTitle>
@@ -112,6 +135,11 @@ export const ShowMariadbEnvironment = ({ mariadbId }: Props) => {
<FormItem className="w-full">
<FormControl>
<CodeEditor
style={
{
WebkitTextSecurity: isEnvVisible ? "disc" : null,
} as CSSProperties
}
language="properties"
disabled={isEnvVisible}
placeholder={`NODE_ENV=production

View File

@@ -51,17 +51,17 @@ export const ShowEnvironment = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to add environment");
toast.error("Error adding environment");
});
};
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="flex w-full flex-col gap-5 "
>
<Card className="bg-background p-6">
<Card className="bg-background px-6 pb-6">
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="flex w-full flex-col gap-4"
>
<Secrets
name="env"
title="Environment Settings"
@@ -89,15 +89,13 @@ export const ShowEnvironment = ({ applicationId }: Props) => {
placeholder="NPM_TOKEN=xyz"
/>
)}
<CardContent>
<div className="flex flex-row justify-end">
<Button isLoading={isLoading} className="w-fit" type="submit">
Save
</Button>
</div>
</CardContent>
</Card>
</form>
</Form>
<div className="flex flex-row justify-end">
<Button isLoading={isLoading} className="w-fit" type="submit">
Save
</Button>
</div>
</form>
</Form>
</Card>
);
};

View File

@@ -1,69 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { toast } from "sonner";
interface Props {
applicationId: string;
}
export const DeployApplication = ({ applicationId }: Props) => {
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync: deploy } = api.application.deploy.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button isLoading={data?.applicationStatus === "running"}>
Deploy
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This will deploy the application
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await deploy({
applicationId,
})
.then(async () => {
toast.success("Application deployed succesfully");
await refetch();
})
.catch(() => {
toast.error("Error to deploy Application");
});
await refetch();
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -137,7 +137,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the Bitbucket provider");
toast.error("Error saving the Bitbucket provider");
});
};

View File

@@ -68,7 +68,7 @@ export const SaveDockerProvider = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the Docker provider");
toast.error("Error saving the Docker provider");
});
};

View File

@@ -56,7 +56,7 @@ export const SaveDragNDrop = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the deployment");
toast.error("Error saving the deployment");
});
};

View File

@@ -84,7 +84,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the Git provider");
toast.error("Error saving the Git provider");
});
};

View File

@@ -131,7 +131,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the github provider");
toast.error("Error saving the github provider");
});
};

View File

@@ -144,7 +144,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the gitlab provider");
toast.error("Error saving the gitlab provider");
});
};

View File

@@ -1,70 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { RefreshCcw } from "lucide-react";
import { toast } from "sonner";
interface Props {
applicationId: string;
appName: string;
}
export const ResetApplication = ({ applicationId, appName }: Props) => {
const { refetch } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync: reload, isLoading } =
api.application.reload.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="secondary" isLoading={isLoading}>
Reload
<RefreshCcw className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This will reload the application
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await reload({
applicationId,
appName,
})
.then(() => {
toast.success("Service Reloaded");
})
.catch(() => {
toast.error("Error to reload the service");
});
await refetch();
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,23 +1,21 @@
import { ShowBuildChooseForm } from "@/components/dashboard/application/build/show";
import { ShowProviderForm } from "@/components/dashboard/application/general/generic/show";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Terminal } from "lucide-react";
import { Ban, CheckCircle2, Hammer, RefreshCcw, Terminal } from "lucide-react";
import { useRouter } from "next/router";
import React from "react";
import { toast } from "sonner";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
import { RedbuildApplication } from "../rebuild-application";
import { StartApplication } from "../start-application";
import { StopApplication } from "../stop-application";
import { DeployApplication } from "./deploy-application";
import { ResetApplication } from "./reset-application";
interface Props {
applicationId: string;
}
export const ShowGeneralApplication = ({ applicationId }: Props) => {
const router = useRouter();
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
@@ -25,6 +23,18 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => {
{ enabled: !!applicationId },
);
const { mutateAsync: update } = api.application.update.useMutation();
const { mutateAsync: start, isLoading: isStarting } =
api.application.start.useMutation();
const { mutateAsync: stop, isLoading: isStopping } =
api.application.stop.useMutation();
const { mutateAsync: deploy, isLoading: isDeploying } =
api.application.deploy.useMutation();
const { mutateAsync: reload, isLoading: isReloading } =
api.application.reload.useMutation();
const { mutateAsync: redeploy } = api.application.redeploy.useMutation();
return (
<>
@@ -33,17 +43,127 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => {
<CardTitle className="text-xl">Deploy Settings</CardTitle>
</CardHeader>
<CardContent className="flex flex-row gap-4 flex-wrap">
<DeployApplication applicationId={applicationId} />
<ResetApplication
applicationId={applicationId}
appName={data?.appName || ""}
/>
<DialogAction
title="Deploy Application"
description="Are you sure you want to deploy this application?"
type="default"
onClick={async () => {
await deploy({
applicationId: applicationId,
})
.then(() => {
toast.success("Application deployed successfully");
refetch();
router.push(
`/dashboard/project/${data?.projectId}/services/application/${applicationId}?tab=deployments`,
);
})
.catch(() => {
toast.error("Error deploying application");
});
}}
>
<Button
variant="default"
isLoading={data?.applicationStatus === "running"}
>
Deploy
</Button>
</DialogAction>
<DialogAction
title="Reload Application"
description="Are you sure you want to reload this application?"
type="default"
onClick={async () => {
await reload({
applicationId: applicationId,
appName: data?.appName || "",
})
.then(() => {
toast.success("Application reloaded successfully");
refetch();
})
.catch(() => {
toast.error("Error reloading application");
});
}}
>
<Button variant="secondary" isLoading={isReloading}>
Reload
<RefreshCcw className="size-4" />
</Button>
</DialogAction>
<DialogAction
title="Rebuild Application"
description="Are you sure you want to rebuild this application?"
type="default"
onClick={async () => {
await redeploy({
applicationId: applicationId,
})
.then(() => {
toast.success("Application rebuilt successfully");
refetch();
})
.catch(() => {
toast.error("Error rebuilding application");
});
}}
>
<Button
variant="secondary"
isLoading={data?.applicationStatus === "running"}
>
Rebuild
<Hammer className="size-4" />
</Button>
</DialogAction>
<RedbuildApplication applicationId={applicationId} />
{data?.applicationStatus === "idle" ? (
<StartApplication applicationId={applicationId} />
<DialogAction
title="Start Application"
description="Are you sure you want to start this application?"
type="default"
onClick={async () => {
await start({
applicationId: applicationId,
})
.then(() => {
toast.success("Application started successfully");
refetch();
})
.catch(() => {
toast.error("Error starting application");
});
}}
>
<Button variant="secondary" isLoading={isStarting}>
Start
<CheckCircle2 className="size-4" />
</Button>
</DialogAction>
) : (
<StopApplication applicationId={applicationId} />
<DialogAction
title="Stop Application"
description="Are you sure you want to stop this application?"
onClick={async () => {
await stop({
applicationId: applicationId,
})
.then(() => {
toast.success("Application stopped successfully");
refetch();
})
.catch(() => {
toast.error("Error stopping application");
});
}}
>
<Button variant="destructive" isLoading={isStopping}>
Stop
<Ban className="size-4" />
</Button>
</DialogAction>
)}
<DockerTerminalModal
appName={data?.appName || ""}
@@ -69,7 +189,7 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to update Auto Deploy");
toast.error("Error updating Auto Deploy");
});
}}
className="flex flex-row gap-2 items-center"

View File

@@ -1,3 +1,4 @@
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
@@ -15,6 +16,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
@@ -29,28 +31,67 @@ export const DockerLogs = dynamic(
},
);
export const badgeStateColor = (state: string) => {
switch (state) {
case "running":
return "green";
case "exited":
case "shutdown":
return "red";
case "accepted":
case "created":
return "blue";
default:
return "default";
}
};
interface Props {
appName: string;
serverId?: string;
}
export const ShowDockerLogs = ({ appName, serverId }: Props) => {
const { data, isLoading } = api.docker.getContainersByAppNameMatch.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName,
},
);
const [containerId, setContainerId] = useState<string | undefined>();
const [option, setOption] = useState<"swarm" | "native">("native");
const { data: services, isLoading: servicesLoading } =
api.docker.getServiceContainersByAppName.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName && option === "swarm",
},
);
const { data: containers, isLoading: containersLoading } =
api.docker.getContainersByAppNameMatch.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName && option === "native",
},
);
useEffect(() => {
if (data && data?.length > 0) {
setContainerId(data[0]?.containerId);
if (option === "native") {
if (containers && containers?.length > 0) {
setContainerId(containers[0]?.containerId);
}
} else {
if (services && services?.length > 0) {
setContainerId(services[0]?.containerId);
}
}
}, [data]);
}, [option, services, containers]);
const isLoading = option === "native" ? containersLoading : servicesLoading;
const containersLenght =
option === "native" ? containers?.length : services?.length;
return (
<Card className="bg-background">
@@ -62,7 +103,21 @@ export const ShowDockerLogs = ({ appName, serverId }: Props) => {
</CardHeader>
<CardContent className="flex flex-col gap-4">
<Label>Select a container to view logs</Label>
<div className="flex flex-row justify-between items-center gap-2">
<Label>Select a container to view logs</Label>
<div className="flex flex-row gap-2 items-center">
<span className="text-sm text-muted-foreground">
{option === "native" ? "Native" : "Swarm"}
</span>
<Switch
checked={option === "native"}
onCheckedChange={(checked) => {
setOption(checked ? "native" : "swarm");
}}
/>
</div>
</div>
<Select onValueChange={setContainerId} value={containerId}>
<SelectTrigger>
{isLoading ? (
@@ -76,22 +131,45 @@ export const ShowDockerLogs = ({ appName, serverId }: Props) => {
</SelectTrigger>
<SelectContent>
<SelectGroup>
{data?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}) {container.state}
</SelectItem>
))}
<SelectLabel>Containers ({data?.length})</SelectLabel>
{option === "native" ? (
<div>
{containers?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}){" "}
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</div>
) : (
<>
{services?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}@{container.node}
)
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</>
)}
<SelectLabel>Containers ({containersLenght})</SelectLabel>
</SelectGroup>
</SelectContent>
</Select>
<DockerLogs
serverId={serverId || ""}
id="terminal"
containerId={containerId || "select-a-container"}
runType={option}
/>
</CardContent>
</Card>

View File

@@ -104,9 +104,7 @@ export const AddPreviewDomain = ({
const dictionary = {
success: domainId ? "Domain Updated" : "Domain Created",
error: domainId
? "Error to update the domain"
: "Error to create the domain",
error: domainId ? "Error updating the domain" : "Error creating the domain",
submit: domainId ? "Update" : "Create",
dialogDescription: domainId
? "In this section you can edit a domain"
@@ -265,21 +263,21 @@ export const AddPreviewDomain = ({
name="certificateType"
render={({ field }) => (
<FormItem className="col-span-2">
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>

View File

@@ -18,15 +18,28 @@ import { ShowDeployment } from "../deployments/show-deployment";
interface Props {
deployments: RouterOutputs["deployment"]["all"];
serverId?: string;
trigger?: React.ReactNode;
}
export const ShowPreviewBuilds = ({ deployments, serverId }: Props) => {
const [activeLog, setActiveLog] = useState<string | null>(null);
export const ShowPreviewBuilds = ({
deployments,
serverId,
trigger,
}: Props) => {
const [activeLog, setActiveLog] = useState<
RouterOutputs["deployment"]["all"][number] | null
>(null);
const [isOpen, setIsOpen] = useState(false);
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="outline">View Builds</Button>
{trigger ? (
trigger
) : (
<Button className="sm:w-auto w-full" size="sm" variant="outline">
View Builds
</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-5xl">
<DialogHeader>
@@ -66,7 +79,7 @@ export const ShowPreviewBuilds = ({ deployments, serverId }: Props) => {
<Button
onClick={() => {
setActiveLog(deployment.logPath);
setActiveLog(deployment);
}}
>
View
@@ -78,9 +91,10 @@ export const ShowPreviewBuilds = ({ deployments, serverId }: Props) => {
</DialogContent>
<ShowDeployment
serverId={serverId || ""}
open={activeLog !== null}
open={Boolean(activeLog && activeLog.logPath !== null)}
onClose={() => setActiveLog(null)}
logPath={activeLog}
logPath={activeLog?.logPath || ""}
errorMessage={activeLog?.errorMessage || ""}
/>
</Dialog>
);

View File

@@ -1,5 +1,8 @@
import { GithubIcon } from "@/components/icons/data-tools-icons";
import { DateTooltip } from "@/components/shared/date-tooltip";
import { DialogAction } from "@/components/shared/dialog-action";
import { StatusTooltip } from "@/components/shared/status-tooltip";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -8,30 +11,34 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Switch } from "@/components/ui/switch";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { Pencil, RocketIcon } from "lucide-react";
import React, { useEffect, useState } from "react";
import {
ExternalLink,
FileText,
GitPullRequest,
Layers,
PenSquare,
RocketIcon,
Trash2,
} from "lucide-react";
import React from "react";
import { toast } from "sonner";
import { ShowDeployment } from "../deployments/show-deployment";
import Link from "next/link";
import { ShowModalLogs } from "../../settings/web-server/show-modal-logs";
import { DialogAction } from "@/components/shared/dialog-action";
import { AddPreviewDomain } from "./add-preview-domain";
import { GithubIcon } from "@/components/icons/data-tools-icons";
import { ShowPreviewSettings } from "./show-preview-settings";
import { ShowPreviewBuilds } from "./show-preview-builds";
import { ShowPreviewSettings } from "./show-preview-settings";
interface Props {
applicationId: string;
}
export const ShowPreviewDeployments = ({ applicationId }: Props) => {
const [activeLog, setActiveLog] = useState<string | null>(null);
const { data } = api.application.one.useQuery({ applicationId });
const { mutateAsync: deletePreviewDeployment, isLoading } =
api.previewDeployment.delete.useMutation();
const { data: previewDeployments, refetch: refetchPreviewDeployments } =
api.previewDeployment.all.useQuery(
{ applicationId },
@@ -39,10 +46,19 @@ export const ShowPreviewDeployments = ({ applicationId }: Props) => {
enabled: !!applicationId,
},
);
// const [url, setUrl] = React.useState("");
// useEffect(() => {
// setUrl(document.location.origin);
// }, []);
const handleDeletePreviewDeployment = async (previewDeploymentId: string) => {
deletePreviewDeployment({
previewDeploymentId: previewDeploymentId,
})
.then(() => {
refetchPreviewDeployments();
toast.success("Preview deployment deleted");
})
.catch((error) => {
toast.error(error.message);
});
};
return (
<Card className="bg-background">
@@ -65,7 +81,7 @@ export const ShowPreviewDeployments = ({ applicationId }: Props) => {
each pull request you create.
</span>
</div>
{data?.previewDeployments?.length === 0 ? (
{!previewDeployments?.length ? (
<div className="flex w-full flex-col items-center justify-center gap-3 pt-10">
<RocketIcon className="size-8 text-muted-foreground" />
<span className="text-base text-muted-foreground">
@@ -74,120 +90,131 @@ export const ShowPreviewDeployments = ({ applicationId }: Props) => {
</div>
) : (
<div className="flex flex-col gap-4">
{previewDeployments?.map((previewDeployment) => {
const { deployments, domain } = previewDeployment;
{previewDeployments?.map((deployment) => {
const deploymentUrl = `${deployment.domain?.https ? "https" : "http"}://${deployment.domain?.host}${deployment.domain?.path || "/"}`;
const status = deployment.previewStatus;
return (
<div
key={previewDeployment?.previewDeploymentId}
className="flex flex-col justify-between rounded-lg border p-4 gap-2"
key={deployment.previewDeploymentId}
className="group relative overflow-hidden border rounded-lg transition-colors"
>
<div className="flex justify-between gap-2 max-sm:flex-wrap">
<div className="flex flex-col gap-2">
{deployments?.length === 0 ? (
<div>
<span className="text-sm text-muted-foreground">
No deployments found
</span>
</div>
) : (
<div className="flex items-center gap-2">
<span className="flex items-center gap-4 font-medium capitalize text-foreground">
{previewDeployment?.pullRequestTitle}
</span>
<StatusTooltip
status={previewDeployment.previewStatus}
className="size-2.5"
/>
</div>
)}
<div className="flex flex-col gap-1">
{previewDeployment?.pullRequestTitle && (
<div className="flex items-center gap-2">
<span className="break-all text-sm text-muted-foreground w-fit">
Title: {previewDeployment?.pullRequestTitle}
</span>
</div>
)}
<div
className={`absolute left-0 top-0 w-1 h-full ${
status === "done"
? "bg-green-500"
: status === "running"
? "bg-yellow-500"
: "bg-red-500"
}`}
/>
{previewDeployment?.pullRequestURL && (
<div className="flex items-center gap-2">
<GithubIcon />
<Link
target="_blank"
href={previewDeployment?.pullRequestURL}
className="break-all text-sm text-muted-foreground w-fit hover:underline hover:text-foreground"
>
Pull Request URL
</Link>
<div className="p-4">
<div className="flex items-start justify-between mb-3">
<div className="flex items-start gap-3">
<GitPullRequest className="size-5 text-muted-foreground mt-1 flex-shrink-0" />
<div>
<div className="font-medium text-sm">
{deployment.pullRequestTitle}
</div>
<div className="text-sm text-muted-foreground mt-1">
{deployment.branch}
</div>
)}
</div>
<div className="flex flex-col ">
<span>Domain </span>
<div className="flex flex-row items-center gap-4">
<Link
target="_blank"
href={`http://${domain?.host}`}
className="text-sm text-muted-foreground w-fit hover:underline hover:text-foreground"
>
{domain?.host}
</Link>
<AddPreviewDomain
previewDeploymentId={
previewDeployment.previewDeploymentId
}
domainId={domain?.domainId}
>
<Button variant="outline" size="sm">
<Pencil className="size-4 text-muted-foreground" />
</Button>
</AddPreviewDomain>
</div>
</div>
<Badge variant="outline" className="gap-2">
<StatusTooltip
status={deployment.previewStatus}
className="size-2"
/>
<DateTooltip date={deployment.createdAt} />
</Badge>
</div>
<div className="flex flex-col sm:items-end gap-2 max-sm:w-full">
{previewDeployment?.createdAt && (
<div className="text-sm capitalize text-muted-foreground">
<DateTooltip
date={previewDeployment?.createdAt}
/>
</div>
)}
<ShowPreviewBuilds
deployments={previewDeployment?.deployments || []}
serverId={data?.serverId || ""}
/>
<div className="pl-8 space-y-3">
<div className="relative flex-grow">
<Input
value={deploymentUrl}
readOnly
className="pr-8 text-sm text-blue-500 hover:text-blue-600 cursor-pointer"
onClick={() =>
window.open(deploymentUrl, "_blank")
}
/>
<ExternalLink className="absolute right-3 top-1/2 -translate-y-1/2 size-4 text-gray-400" />
</div>
<ShowModalLogs
appName={previewDeployment.appName}
serverId={data?.serverId || ""}
>
<Button variant="outline">View Logs</Button>
</ShowModalLogs>
<DialogAction
title="Delete Preview"
description="Are you sure you want to delete this preview?"
onClick={() => {
deletePreviewDeployment({
previewDeploymentId:
previewDeployment.previewDeploymentId,
})
.then(() => {
refetchPreviewDeployments();
toast.success("Preview deployment deleted");
})
.catch((error) => {
toast.error(error.message);
});
}}
>
<Button variant="destructive" isLoading={isLoading}>
Delete Preview
<div className="flex gap-2 opacity-80 group-hover:opacity-100 transition-opacity">
<Button
variant="outline"
size="sm"
className="gap-2"
onClick={() =>
window.open(deployment.pullRequestURL, "_blank")
}
>
<GithubIcon className="size-4" />
Pull Request
</Button>
</DialogAction>
<ShowModalLogs
appName={deployment.appName}
serverId={data?.serverId || ""}
>
<Button
variant="outline"
size="sm"
className="gap-2"
>
<FileText className="size-4" />
Logs
</Button>
</ShowModalLogs>
<ShowPreviewBuilds
deployments={deployment.deployments || []}
serverId={data?.serverId || ""}
trigger={
<Button
variant="outline"
size="sm"
className="gap-2"
>
<Layers className="size-4" />
Builds
</Button>
}
/>
<AddPreviewDomain
previewDeploymentId={`${deployment.previewDeploymentId}`}
domainId={deployment.domain?.domainId}
>
<Button
variant="ghost"
size="sm"
className="gap-2"
>
<PenSquare className="size-4" />
</Button>
</AddPreviewDomain>
<DialogAction
title="Delete Preview"
description="Are you sure you want to delete this preview?"
onClick={() =>
handleDeletePreviewDeployment(
deployment.previewDeploymentId,
)
}
>
<Button
variant="ghost"
size="sm"
isLoading={isLoading}
className="text-red-600 hover:text-red-700 hover:bg-red-50"
>
<Trash2 className="size-4" />
</Button>
</DialogAction>
</div>
</div>
</div>
</div>

View File

@@ -1,5 +1,3 @@
import { api } from "@/utils/api";
import { useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -20,12 +18,7 @@ import {
FormMessage,
} from "@/components/ui/form";
import { Input, NumberInput } from "@/components/ui/input";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { Secrets } from "@/components/ui/secrets";
import { toast } from "sonner";
import { Switch } from "@/components/ui/switch";
import {
Select,
SelectContent,
@@ -33,6 +26,14 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Settings2 } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const schema = z.object({
env: z.string(),
@@ -116,7 +117,10 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
<div>
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="outline">View Settings</Button>
<Button variant="outline">
<Settings2 className="size-4" />
Configure
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-5xl w-full">
<DialogHeader>
@@ -218,21 +222,21 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
name="previewCertificateType"
render={({ field }) => (
<FormItem>
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>
@@ -287,16 +291,6 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
"PORT=3000",
].join("\n")}
/>
{/* <CodeEditor
lineWrapping
language="properties"
wrapperClassName="h-[25rem] font-mono"
placeholder={`NODE_ENV=production
PORT=3000
`}
{...field}
/> */}
</FormControl>
<FormMessage />
</FormItem>

View File

@@ -1,76 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Hammer } from "lucide-react";
import { toast } from "sonner";
interface Props {
applicationId: string;
}
export const RedbuildApplication = ({ applicationId }: Props) => {
const { data } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
const { mutateAsync } = api.application.redeploy.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button
variant="secondary"
isLoading={data?.applicationStatus === "running"}
>
Rebuild
<Hammer className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you sure to rebuild the application?
</AlertDialogTitle>
<AlertDialogDescription>
Is required to deploy at least 1 time in order to reuse the same
code
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
toast.success("Redeploying Application....");
await mutateAsync({
applicationId,
})
.then(async () => {
await utils.application.one.invalidate({
applicationId,
});
})
.catch(() => {
toast.error("Error to rebuild the application");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,65 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { CheckCircle2 } from "lucide-react";
import { toast } from "sonner";
interface Props {
applicationId: string;
}
export const StartApplication = ({ applicationId }: Props) => {
const { mutateAsync, isLoading } = api.application.start.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="secondary" isLoading={isLoading}>
Start
<CheckCircle2 className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you sure to start the application?
</AlertDialogTitle>
<AlertDialogDescription>
This will start the application
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
applicationId,
})
.then(async () => {
await utils.application.one.invalidate({
applicationId,
});
toast.success("Application started succesfully");
})
.catch(() => {
toast.error("Error to start the Application");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,65 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Ban } from "lucide-react";
import { toast } from "sonner";
interface Props {
applicationId: string;
}
export const StopApplication = ({ applicationId }: Props) => {
const { mutateAsync, isLoading } = api.application.stop.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive" isLoading={isLoading}>
Stop
<Ban className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you absolutely sure to stop the application?
</AlertDialogTitle>
<AlertDialogDescription>
This will stop the application
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
applicationId,
})
.then(async () => {
await utils.application.one.invalidate({
applicationId,
});
toast.success("Application stopped succesfully");
})
.catch(() => {
toast.error("Error to stop the Application");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -21,7 +21,7 @@ import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { AlertTriangle, SquarePen } from "lucide-react";
import { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -76,14 +76,14 @@ export const UpdateApplication = ({ applicationId }: Props) => {
description: formData.description || "",
})
.then(() => {
toast.success("Application updated succesfully");
toast.success("Application updated successfully");
utils.application.one.invalidate({
applicationId: applicationId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the application");
toast.error("Error updating the Application");
})
.finally(() => {});
};
@@ -91,8 +91,12 @@ export const UpdateApplication = ({ applicationId }: Props) => {
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost">
<SquarePen className="size-4 text-muted-foreground" />
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">

View File

@@ -1,3 +1,4 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -81,7 +82,7 @@ export const AddCommandCompose = ({ composeId }: Props) => {
});
})
.catch(() => {
toast.error("Error to update the command");
toast.error("Error updating the command");
});
};
@@ -91,7 +92,7 @@ export const AddCommandCompose = ({ composeId }: Props) => {
<div>
<CardTitle className="text-xl">Run Command</CardTitle>
<CardDescription>
Append a custom command to the compose file
Override a custom command to the compose file
</CardDescription>
</div>
</CardHeader>
@@ -101,6 +102,12 @@ export const AddCommandCompose = ({ composeId }: Props) => {
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-4"
>
<AlertBlock type="warning">
Modifying the default command may affect deployment stability,
impacting logs and monitoring. Proceed carefully and test
thoroughly. By default, the command starts with{" "}
<strong>docker</strong>.
</AlertBlock>
<div className="flex flex-col gap-4">
<FormField
control={form.control}

View File

@@ -1,142 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Package } from "lucide-react";
import React from "react";
import { AddVolumes } from "../../application/advanced/volumes/add-volumes";
import { DeleteVolume } from "../../application/advanced/volumes/delete-volume";
import { UpdateVolume } from "../../application/advanced/volumes/update-volume";
interface Props {
composeId: string;
}
export const ShowVolumesCompose = ({ composeId }: Props) => {
const { data, refetch } = api.compose.one.useQuery(
{
composeId,
},
{ enabled: !!composeId },
);
return (
<Card className="bg-background">
<CardHeader className="flex flex-row justify-between flex-wrap gap-4">
<div>
<CardTitle className="text-xl">Volumes</CardTitle>
<CardDescription>
If you want to persist data in this compose use the following config
to setup the volumes
</CardDescription>
</div>
{data && data?.mounts.length > 0 && (
<AddVolumes
serviceId={composeId}
refetch={refetch}
serviceType="compose"
>
Add Volume
</AddVolumes>
)}
</CardHeader>
<CardContent className="flex flex-col gap-4">
{data?.mounts.length === 0 ? (
<div className="flex w-full flex-col items-center justify-center gap-3 pt-10">
<Package className="size-8 text-muted-foreground" />
<span className="text-base text-muted-foreground">
No volumes/mounts configured
</span>
<AddVolumes
serviceId={composeId}
refetch={refetch}
serviceType="compose"
>
Add Volume
</AddVolumes>
</div>
) : (
<div className="flex flex-col pt-2 gap-4">
<AlertBlock type="info">
Please remember to click Redeploy after adding, editing, or
deleting a mount to apply the changes.
</AlertBlock>
<div className="flex flex-col gap-6">
{data?.mounts.map((mount) => (
<div key={mount.mountId}>
<div
key={mount.mountId}
className="flex w-full flex-col sm:flex-row sm:items-center justify-between gap-4 sm:gap-10 border rounded-lg p-4"
>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 flex-col gap-4 sm:gap-8">
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Type</span>
<span className="text-sm text-muted-foreground">
{mount.type.toUpperCase()}
</span>
</div>
{mount.type === "volume" && (
<div className="flex flex-col gap-1">
<span className="font-medium">Volume Name</span>
<span className="text-sm text-muted-foreground">
{mount.volumeName}
</span>
</div>
)}
{mount.type === "file" && (
<>
<div className="flex flex-col gap-1">
<span className="font-medium">Content</span>
<span className="text-sm text-muted-foreground w-40 truncate">
{mount.content}
</span>
</div>
<div className="flex flex-col gap-1">
<span className="font-medium">File Path</span>
<span className="text-sm text-muted-foreground">
{mount.filePath}
</span>
</div>
</>
)}
{mount.type === "bind" && (
<div className="flex flex-col gap-1">
<span className="font-medium">Host Path</span>
<span className="text-sm text-muted-foreground">
{mount.hostPath}
</span>
</div>
)}
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Path</span>
<span className="text-sm text-muted-foreground">
{mount.mountPath}
</span>
</div>
</div>
<div className="flex flex-row gap-1">
<UpdateVolume
mountId={mount.mountId}
type={mount.type}
refetch={refetch}
serviceType="compose"
/>
<DeleteVolume mountId={mount.mountId} refetch={refetch} />
</div>
</div>
</div>
))}
</div>
</div>
)}
</CardContent>
</Card>
);
};

View File

@@ -1,4 +1,6 @@
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import {
Dialog,
DialogContent,
@@ -19,6 +21,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Copy, Trash2 } from "lucide-react";
import { TrashIcon } from "lucide-react";
import { useRouter } from "next/router";
import { useState } from "react";
@@ -30,6 +33,7 @@ const deleteComposeSchema = z.object({
projectName: z.string().min(1, {
message: "Compose name is required",
}),
deleteVolumes: z.boolean(),
});
type DeleteCompose = z.infer<typeof deleteComposeSchema>;
@@ -49,6 +53,7 @@ export const DeleteCompose = ({ composeId }: Props) => {
const form = useForm<DeleteCompose>({
defaultValues: {
projectName: "",
deleteVolumes: false,
},
resolver: zodResolver(deleteComposeSchema),
});
@@ -56,7 +61,8 @@ export const DeleteCompose = ({ composeId }: Props) => {
const onSubmit = async (formData: DeleteCompose) => {
const expectedName = `${data?.name}/${data?.appName}`;
if (formData.projectName === expectedName) {
await mutateAsync({ composeId })
const { deleteVolumes } = formData;
await mutateAsync({ composeId, deleteVolumes })
.then((result) => {
push(`/dashboard/project/${result?.projectId}`);
toast.success("Compose deleted successfully");
@@ -75,8 +81,13 @@ export const DeleteCompose = ({ composeId }: Props) => {
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost" isLoading={isLoading}>
<TrashIcon className="size-4 text-muted-foreground" />
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10 "
isLoading={isLoading}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
@@ -100,10 +111,27 @@ export const DeleteCompose = ({ composeId }: Props) => {
name="projectName"
render={({ field }) => (
<FormItem>
<FormLabel>
To confirm, type "{data?.name}/{data?.appName}" in the box
below
</FormLabel>{" "}
<FormLabel className="flex items-center gap-2">
<span>
To confirm, type{" "}
<Badge
className="p-2 rounded-md ml-1 mr-1 hover:border-primary hover:text-primary-foreground hover:bg-primary hover:cursor-pointer"
variant="outline"
onClick={() => {
if (data?.name && data?.appName) {
navigator.clipboard.writeText(
`${data.name}/${data.appName}`,
);
toast.success("Copied to clipboard. Be careful!");
}
}}
>
{data?.name}/{data?.appName}&nbsp;
<Copy className="h-4 w-4 ml-1 text-muted-foreground" />
</Badge>{" "}
in the box below:
</span>
</FormLabel>
<FormControl>
<Input
placeholder="Enter compose name to confirm"
@@ -114,6 +142,27 @@ export const DeleteCompose = ({ composeId }: Props) => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="deleteVolumes"
render={({ field }) => (
<FormItem>
<div className="flex items-center">
<FormControl>
<Checkbox
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
<FormLabel className="ml-2">
Delete volumes associated with this compose
</FormLabel>
</div>
<FormMessage />
</FormItem>
)}
/>
</form>
</Form>
</div>

View File

@@ -20,6 +20,11 @@ interface Props {
export const CancelQueuesCompose = ({ composeId }: Props) => {
const { mutateAsync, isLoading } = api.compose.cleanQueues.useMutation();
const { data: isCloud } = api.settings.isCloud.useQuery();
if (isCloud) {
return null;
}
return (
<AlertDialog>
<AlertDialogTrigger asChild>

View File

@@ -47,7 +47,7 @@ export const RefreshTokenCompose = ({ composeId }: Props) => {
toast.success("Refresh Token updated");
})
.catch(() => {
toast.error("Error to update the refresh token");
toast.error("Error updating the refresh token");
});
}}
>

View File

@@ -1,3 +1,5 @@
import { Badge } from "@/components/ui/badge";
import { Checkbox } from "@/components/ui/checkbox";
import {
Dialog,
DialogContent,
@@ -5,23 +7,45 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { TerminalLine } from "../../docker/logs/terminal-line";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
interface Props {
logPath: string | null;
serverId?: string;
open: boolean;
onClose: () => void;
errorMessage?: string;
}
export const ShowDeploymentCompose = ({
logPath,
open,
onClose,
serverId,
errorMessage,
}: Props) => {
const [data, setData] = useState("");
const endOfLogsRef = useRef<HTMLDivElement>(null);
const [filteredLogs, setFilteredLogs] = useState<LogLine[]>([]);
const [showExtraLogs, setShowExtraLogs] = useState(false);
const wsRef = useRef<WebSocket | null>(null); // Ref to hold WebSocket instance
const [autoScroll, setAutoScroll] = useState(true);
const scrollRef = useRef<HTMLDivElement>(null);
const scrollToBottom = () => {
if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
};
const handleScroll = () => {
if (!scrollRef.current) return;
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) < 10;
setAutoScroll(isAtBottom);
};
useEffect(() => {
if (!open || !logPath) return;
@@ -54,13 +78,36 @@ export const ShowDeploymentCompose = ({
};
}, [logPath, open]);
const scrollToBottom = () => {
endOfLogsRef.current?.scrollIntoView({ behavior: "smooth" });
};
useEffect(() => {
const logs = parseLogs(data);
let filteredLogsResult = logs;
if (serverId) {
let hideSubsequentLogs = false;
filteredLogsResult = logs.filter((log) => {
if (
log.message.includes(
"===================================EXTRA LOGS============================================",
)
) {
hideSubsequentLogs = true;
return showExtraLogs;
}
return showExtraLogs ? true : !hideSubsequentLogs;
});
}
setFilteredLogs(filteredLogsResult);
}, [data, showExtraLogs]);
useEffect(() => {
scrollToBottom();
}, [data]);
if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
}, [filteredLogs, autoScroll]);
const optionalErrors = parseLogs(errorMessage || "");
return (
<Dialog
@@ -78,21 +125,58 @@ export const ShowDeploymentCompose = ({
}
}}
>
<DialogContent className={"sm:max-w-5xl overflow-y-auto max-h-screen"}>
<DialogContent className={"sm:max-w-5xl max-h-screen"}>
<DialogHeader>
<DialogTitle>Deployment</DialogTitle>
<DialogDescription>
See all the details of this deployment
<DialogDescription className="flex items-center gap-2">
<span>
See all the details of this deployment |{" "}
<Badge variant="blank" className="text-xs">
{filteredLogs.length} lines
</Badge>
</span>
{serverId && (
<div className="flex items-center space-x-2">
<Checkbox
id="show-extra-logs"
checked={showExtraLogs}
onCheckedChange={(checked) =>
setShowExtraLogs(checked as boolean)
}
/>
<label
htmlFor="show-extra-logs"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
Show Extra Logs
</label>
</div>
)}
</DialogDescription>
</DialogHeader>
<div className="text-wrap rounded-lg border p-4 text-sm sm:max-w-[59rem]">
<code>
<pre className="whitespace-pre-wrap break-words">
{data || "Loading..."}
</pre>
<div ref={endOfLogsRef} />
</code>
<div
ref={scrollRef}
onScroll={handleScroll}
className="h-[720px] overflow-y-auto space-y-0 border p-4 bg-[#fafafa] dark:bg-[#050506] rounded custom-logs-scrollbar"
>
{filteredLogs.length > 0 ? (
filteredLogs.map((log: LogLine, index: number) => (
<TerminalLine key={index} log={log} noTimestamp />
))
) : (
<>
{optionalErrors.length > 0 ? (
optionalErrors.map((log: LogLine, index: number) => (
<TerminalLine key={`extra-${index}`} log={log} noTimestamp />
))
) : (
<div className="flex justify-center items-center h-full text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin" />
</div>
)}
</>
)}
</div>
</DialogContent>
</Dialog>

View File

@@ -8,7 +8,7 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { type RouterOutputs, api } from "@/utils/api";
import { RocketIcon } from "lucide-react";
import React, { useEffect, useState } from "react";
import { CancelQueuesCompose } from "./cancel-queues-compose";
@@ -19,7 +19,9 @@ interface Props {
composeId: string;
}
export const ShowDeploymentsCompose = ({ composeId }: Props) => {
const [activeLog, setActiveLog] = useState<string | null>(null);
const [activeLog, setActiveLog] = useState<
RouterOutputs["deployment"]["all"][number] | null
>(null);
const { data } = api.compose.one.useQuery({ composeId });
const { data: deployments } = api.deployment.allByCompose.useQuery(
{ composeId },
@@ -100,7 +102,7 @@ export const ShowDeploymentsCompose = ({ composeId }: Props) => {
<Button
onClick={() => {
setActiveLog(deployment.logPath);
setActiveLog(deployment);
}}
>
View
@@ -112,9 +114,10 @@ export const ShowDeploymentsCompose = ({ composeId }: Props) => {
)}
<ShowDeploymentCompose
serverId={data?.serverId || ""}
open={activeLog !== null}
open={Boolean(activeLog && activeLog.logPath !== null)}
onClose={() => setActiveLog(null)}
logPath={activeLog}
logPath={activeLog?.logPath || ""}
errorMessage={activeLog?.errorMessage || ""}
/>
</CardContent>
</Card>

View File

@@ -126,9 +126,7 @@ export const AddDomainCompose = ({
const dictionary = {
success: domainId ? "Domain Updated" : "Domain Created",
error: domainId
? "Error to update the domain"
: "Error to create the domain",
error: domainId ? "Error updating the domain" : "Error creating the domain",
submit: domainId ? "Update" : "Create",
dialogDescription: domainId
? "In this section you can edit a domain"
@@ -400,21 +398,21 @@ export const AddDomainCompose = ({
name="certificateType"
render={({ field }) => (
<FormItem className="col-span-2">
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>

View File

@@ -1,3 +1,4 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -8,9 +9,9 @@ import {
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { ExternalLink, GlobeIcon, PenBoxIcon } from "lucide-react";
import { ExternalLink, GlobeIcon, PenBoxIcon, Trash2 } from "lucide-react";
import Link from "next/link";
import { DeleteDomain } from "../../application/domains/delete-domain";
import { toast } from "sonner";
import { AddDomainCompose } from "./add-domain";
interface Props {
@@ -18,7 +19,7 @@ interface Props {
}
export const ShowDomainsCompose = ({ composeId }: Props) => {
const { data } = api.domain.byComposeId.useQuery(
const { data, refetch } = api.domain.byComposeId.useQuery(
{
composeId,
},
@@ -27,6 +28,9 @@ export const ShowDomainsCompose = ({ composeId }: Props) => {
},
);
const { mutateAsync: deleteDomain, isLoading: isRemoving } =
api.domain.delete.useMutation();
return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
@@ -97,7 +101,32 @@ export const ShowDomainsCompose = ({ composeId }: Props) => {
<PenBoxIcon className="size-4 text-muted-foreground" />
</Button>
</AddDomainCompose>
<DeleteDomain domainId={item.domainId} />
<DialogAction
title="Delete Domain"
description="Are you sure you want to delete this domain?"
type="destructive"
onClick={async () => {
await deleteDomain({
domainId: item.domainId,
})
.then((data) => {
refetch();
toast.success("Domain deleted successfully");
})
.catch(() => {
toast.error("Error deleting domain");
});
}}
>
<Button
variant="ghost"
size="icon"
className="group hover:bg-red-500/10"
isLoading={isRemoving}
>
<Trash2 className="size-4 text-primary group-hover:text-red-500" />
</Button>
</DialogAction>
</div>
</div>
);

View File

@@ -1,167 +0,0 @@
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import {
Form,
FormControl,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Toggle } from "@/components/ui/toggle";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { EyeIcon, EyeOffIcon } from "lucide-react";
import React, { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const addEnvironmentSchema = z.object({
environment: z.string(),
});
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;
interface Props {
composeId: string;
}
export const ShowEnvironmentCompose = ({ composeId }: Props) => {
const [isEnvVisible, setIsEnvVisible] = useState(true);
const { mutateAsync, isLoading } = api.compose.update.useMutation();
const { data, refetch } = api.compose.one.useQuery(
{
composeId,
},
{
enabled: !!composeId,
},
);
const form = useForm<EnvironmentSchema>({
defaultValues: {
environment: "",
},
resolver: zodResolver(addEnvironmentSchema),
});
useEffect(() => {
if (data) {
form.reset({
environment: data.env || "",
});
}
}, [form.reset, data, form]);
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
env: data.environment,
composeId,
})
.then(async () => {
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add environment");
});
};
useEffect(() => {
if (isEnvVisible) {
if (data?.env) {
const maskedLines = data.env
.split("\n")
.map((line) => "*".repeat(line.length))
.join("\n");
form.reset({
environment: maskedLines,
});
} else {
form.reset({
environment: "",
});
}
} else {
form.reset({
environment: data?.env || "",
});
}
}, [form.reset, data, form, isEnvVisible]);
return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
<CardHeader className="flex flex-row w-full items-center justify-between">
<div>
<CardTitle className="text-xl">Environment Settings</CardTitle>
<CardDescription>
You can add environment variables to your resource.
</CardDescription>
</div>
<Toggle
aria-label="Toggle bold"
pressed={isEnvVisible}
onPressedChange={setIsEnvVisible}
>
{isEnvVisible ? (
<EyeOffIcon className="h-4 w-4 text-muted-foreground" />
) : (
<EyeIcon className="h-4 w-4 text-muted-foreground" />
)}
</Toggle>
</CardHeader>
<CardContent>
<Form {...form}>
<form
id="hook-form"
onSubmit={form.handleSubmit(onSubmit)}
className="w-full space-y-4"
>
<FormField
control={form.control}
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>
<CodeEditor
language="properties"
disabled={isEnvVisible}
placeholder={`NODE_ENV=production
PORT=3000
`}
className="h-96 font-mono"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex flex-row justify-end">
<Button
disabled={isEnvVisible}
isLoading={isLoading}
className="w-fit"
type="submit"
>
Save
</Button>
</div>
</form>
</Form>
</CardContent>
</Card>
</div>
);
};

View File

@@ -1,28 +1,17 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { CheckCircle2, ExternalLink, Globe, Terminal } from "lucide-react";
import Link from "next/link";
import { Ban, CheckCircle2, Hammer, Terminal } from "lucide-react";
import { useRouter } from "next/router";
import { toast } from "sonner";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
import { StartCompose } from "../start-compose";
import { DeployCompose } from "./deploy-compose";
import { RedbuildCompose } from "./rebuild-compose";
import { StopCompose } from "./stop-compose";
interface Props {
composeId: string;
}
export const ComposeActions = ({ composeId }: Props) => {
const router = useRouter();
const { data, refetch } = api.compose.one.useQuery(
{
composeId,
@@ -30,33 +19,109 @@ export const ComposeActions = ({ composeId }: Props) => {
{ enabled: !!composeId },
);
const { mutateAsync: update } = api.compose.update.useMutation();
const extractDomains = (env: string) => {
const lines = env.split("\n");
const hostLines = lines.filter((line) => {
const [key, value] = line.split("=");
return key?.trim().endsWith("_HOST");
});
const hosts = hostLines.map((line) => {
const [key, value] = line.split("=");
return value ? value.trim() : "";
});
return hosts;
};
const domains = extractDomains(data?.env || "");
const { mutateAsync: deploy } = api.compose.deploy.useMutation();
const { mutateAsync: redeploy } = api.compose.redeploy.useMutation();
const { mutateAsync: start, isLoading: isStarting } =
api.compose.start.useMutation();
const { mutateAsync: stop, isLoading: isStopping } =
api.compose.stop.useMutation();
return (
<div className="flex flex-row gap-4 w-full flex-wrap ">
<DeployCompose composeId={composeId} />
<RedbuildCompose composeId={composeId} />
<DialogAction
title="Deploy Compose"
description="Are you sure you want to deploy this compose?"
type="default"
onClick={async () => {
await deploy({
composeId: composeId,
})
.then(() => {
toast.success("Compose deployed successfully");
refetch();
router.push(
`/dashboard/project/${data?.project.projectId}/services/compose/${composeId}?tab=deployments`,
);
})
.catch(() => {
toast.error("Error deploying compose");
});
}}
>
<Button variant="default" isLoading={data?.composeStatus === "running"}>
Deploy
</Button>
</DialogAction>
<DialogAction
title="Rebuild Compose"
description="Are you sure you want to rebuild this compose?"
type="default"
onClick={async () => {
await redeploy({
composeId: composeId,
})
.then(() => {
toast.success("Compose rebuilt successfully");
refetch();
})
.catch(() => {
toast.error("Error rebuilding compose");
});
}}
>
<Button
variant="secondary"
isLoading={data?.composeStatus === "running"}
>
Rebuild
<Hammer className="size-4" />
</Button>
</DialogAction>
{data?.composeType === "docker-compose" &&
data?.composeStatus === "idle" ? (
<StartCompose composeId={composeId} />
<DialogAction
title="Start Compose"
description="Are you sure you want to start this compose?"
type="default"
onClick={async () => {
await start({
composeId: composeId,
})
.then(() => {
toast.success("Compose started successfully");
refetch();
})
.catch(() => {
toast.error("Error starting compose");
});
}}
>
<Button variant="secondary" isLoading={isStarting}>
Start
<CheckCircle2 className="size-4" />
</Button>
</DialogAction>
) : (
<StopCompose composeId={composeId} />
<DialogAction
title="Stop Compose"
description="Are you sure you want to stop this compose?"
onClick={async () => {
await stop({
composeId: composeId,
})
.then(() => {
toast.success("Compose stopped successfully");
refetch();
})
.catch(() => {
toast.error("Error stopping compose");
});
}}
>
<Button variant="destructive" isLoading={isStopping}>
Stop
<Ban className="size-4" />
</Button>
</DialogAction>
)}
<DockerTerminalModal
@@ -83,47 +148,12 @@ export const ComposeActions = ({ composeId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to update Auto Deploy");
toast.error("Error updating Auto Deploy");
});
}}
className="flex flex-row gap-2 items-center"
/>
</div>
{domains.length > 0 && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline">
Domains
<Globe className="text-xs size-4 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuLabel>Domains detected</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuGroup>
{domains.map((host, index) => {
const url =
host.startsWith("http://") || host.startsWith("https://")
? host
: `http://${host}`;
return (
<DropdownMenuItem
key={`domain-${index}`}
className="cursor-pointer"
asChild
>
<Link href={url} target="_blank">
{host}
<ExternalLink className="ml-2 text-xs text-muted-foreground" />
</Link>
</DropdownMenuItem>
);
})}
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
)}
</div>
);
};

View File

@@ -77,7 +77,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => {
});
})
.catch((e) => {
toast.error("Error to update the compose config");
toast.error("Error updating the Compose config");
});
};
return (

View File

@@ -1,64 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { toast } from "sonner";
interface Props {
composeId: string;
}
export const DeployCompose = ({ composeId }: Props) => {
const { data, refetch } = api.compose.one.useQuery(
{
composeId,
},
{ enabled: !!composeId },
);
const { mutateAsync: deploy } = api.compose.deploy.useMutation();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button isLoading={data?.composeStatus === "running"}>Deploy</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This will deploy the compose
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
toast.success("Deploying Compose....");
await refetch();
await deploy({
composeId,
}).catch(() => {
toast.error("Error to deploy Compose");
});
await refetch();
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -139,7 +139,7 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the Bitbucket provider");
toast.error("Error saving the Bitbucket provider");
});
};

View File

@@ -83,7 +83,7 @@ export const SaveGitProviderCompose = ({ composeId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the Git provider");
toast.error("Error saving the Git provider");
});
};

View File

@@ -133,7 +133,7 @@ export const SaveGithubProviderCompose = ({ composeId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the github provider");
toast.error("Error saving the Github provider");
});
};

View File

@@ -146,7 +146,7 @@ export const SaveGitlabProviderCompose = ({ composeId }: Props) => {
await refetch();
})
.catch(() => {
toast.error("Error to save the gitlab provider");
toast.error("Error saving the Gitlab provider");
});
};

View File

@@ -90,7 +90,7 @@ export const RandomizeCompose = ({ composeId }: Props) => {
toast.success("Compose updated");
})
.catch(() => {
toast.error("Error to randomize the compose");
toast.error("Error randomizing the compose");
});
};
@@ -105,7 +105,7 @@ export const RandomizeCompose = ({ composeId }: Props) => {
toast.success("Compose randomized");
})
.catch(() => {
toast.error("Error to randomize the compose");
toast.error("Error randomizing the compose");
});
};

View File

@@ -1,75 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Hammer } from "lucide-react";
import { toast } from "sonner";
interface Props {
composeId: string;
}
export const RedbuildCompose = ({ composeId }: Props) => {
const { data } = api.compose.one.useQuery(
{
composeId,
},
{ enabled: !!composeId },
);
const { mutateAsync } = api.compose.redeploy.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button
variant="secondary"
isLoading={data?.composeStatus === "running"}
>
Rebuild
<Hammer className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you sure to rebuild the compose?
</AlertDialogTitle>
<AlertDialogDescription>
Is required to deploy at least 1 time in order to reuse the same
code
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
toast.success("Redeploying Compose....");
await mutateAsync({
composeId,
})
.then(async () => {
await utils.compose.one.invalidate({
composeId,
});
})
.catch(() => {
toast.error("Error to rebuild the compose");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -73,7 +73,7 @@ export const ShowConvertedCompose = ({ composeId }: Props) => {
toast.success("Fetched source type");
})
.catch((err) => {
toast.error("Error to fetch source type", {
toast.error("Error fetching source type", {
description: err.message,
});
});

View File

@@ -1,69 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Ban } from "lucide-react";
import { toast } from "sonner";
interface Props {
composeId: string;
}
export const StopCompose = ({ composeId }: Props) => {
const { data } = api.compose.one.useQuery(
{
composeId,
},
{ enabled: !!composeId },
);
const { mutateAsync, isLoading } = api.compose.stop.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive" isLoading={isLoading}>
Stop
<Ban className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you sure to stop the compose?</AlertDialogTitle>
<AlertDialogDescription>
This will stop the compose services
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
composeId,
})
.then(async () => {
await utils.compose.one.invalidate({
composeId,
});
toast.success("Compose stopped succesfully");
})
.catch(() => {
toast.error("Error to stop the compose");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,161 +0,0 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { ImportIcon, SquarePen } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const updateComposeSchema = z.object({
name: z.string().min(1, {
message: "Name is required",
}),
description: z.string().optional(),
});
type UpdateCompose = z.infer<typeof updateComposeSchema>;
interface Props {
composeId: string;
}
export const ImportTemplate = ({ composeId }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const utils = api.useUtils();
const { mutateAsync, error, isError, isLoading } =
api.compose.update.useMutation();
const { data } = api.compose.one.useQuery(
{
composeId,
},
{
enabled: !!composeId,
},
);
const form = useForm<UpdateCompose>({
defaultValues: {
description: data?.description ?? "",
name: data?.name ?? "",
},
resolver: zodResolver(updateComposeSchema),
});
useEffect(() => {
if (data) {
form.reset({
description: data.description ?? "",
name: data.name,
});
}
}, [data, form, form.reset]);
const onSubmit = async (formData: UpdateCompose) => {
await mutateAsync({
name: formData.name,
composeId: composeId,
description: formData.description || "",
})
.then(() => {
toast.success("Compose updated succesfully");
utils.compose.one.invalidate({
composeId: composeId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the Compose");
})
.finally(() => {});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost">
<ImportIcon className="size-5 text-muted-foreground" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>Import Template</DialogTitle>
<DialogDescription>Import external template</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
<div className="grid gap-4">
<div className="grid items-center gap-4">
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
id="hook-form-update-compose"
className="grid w-full gap-4 "
>
<FormField
control={form.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>Name</FormLabel>
<FormControl>
<Input placeholder="Tesla" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="description"
render={({ field }) => (
<FormItem>
<FormLabel>Description</FormLabel>
<FormControl>
<Textarea
placeholder="Description about your project..."
className="resize-none"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<DialogFooter>
<Button
isLoading={isLoading}
form="hook-form-update-compose"
type="submit"
>
Update
</Button>
</DialogFooter>
</form>
</Form>
</div>
</div>
</DialogContent>
</Dialog>
);
};

View File

@@ -0,0 +1,165 @@
import { badgeStateColor } from "@/components/dashboard/application/logs/show";
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
import { useEffect, useState } from "react";
export const DockerLogs = dynamic(
() =>
import("@/components/dashboard/docker/logs/docker-logs-id").then(
(e) => e.DockerLogsId,
),
{
ssr: false,
},
);
interface Props {
appName: string;
serverId?: string;
}
badgeStateColor;
export const ShowDockerLogsStack = ({ appName, serverId }: Props) => {
const [option, setOption] = useState<"swarm" | "native">("native");
const [containerId, setContainerId] = useState<string | undefined>();
const { data: services, isLoading: servicesLoading } =
api.docker.getStackContainersByAppName.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName && option === "swarm",
},
);
const { data: containers, isLoading: containersLoading } =
api.docker.getContainersByAppNameMatch.useQuery(
{
appName,
appType: "stack",
serverId,
},
{
enabled: !!appName && option === "native",
},
);
useEffect(() => {
if (option === "native") {
if (containers && containers?.length > 0) {
setContainerId(containers[0]?.containerId);
}
} else {
if (services && services?.length > 0) {
setContainerId(services[0]?.containerId);
}
}
}, [option, services, containers]);
const isLoading = option === "native" ? containersLoading : servicesLoading;
const containersLenght =
option === "native" ? containers?.length : services?.length;
return (
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Logs</CardTitle>
<CardDescription>
Watch the logs of the application in real time
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<div className="flex flex-row justify-between items-center gap-2">
<Label>Select a container to view logs</Label>
<div className="flex flex-row gap-2 items-center">
<span className="text-sm text-muted-foreground">
{option === "native" ? "Native" : "Swarm"}
</span>
<Switch
checked={option === "native"}
onCheckedChange={(checked) => {
setOption(checked ? "native" : "swarm");
}}
/>
</div>
</div>
<Select onValueChange={setContainerId} value={containerId}>
<SelectTrigger>
{isLoading ? (
<div className="flex flex-row gap-2 items-center justify-center text-sm text-muted-foreground">
<span>Loading...</span>
<Loader2 className="animate-spin size-4" />
</div>
) : (
<SelectValue placeholder="Select a container" />
)}
</SelectTrigger>
<SelectContent>
<SelectGroup>
{option === "native" ? (
<div>
{containers?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}){" "}
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</div>
) : (
<>
{services?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}@{container.node}
)
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</>
)}
<SelectLabel>Containers ({containersLenght})</SelectLabel>
</SelectGroup>
</SelectContent>
</Select>
<DockerLogs
serverId={serverId || ""}
containerId={containerId || "select-a-container"}
runType={option}
/>
</CardContent>
</Card>
);
};

View File

@@ -1,3 +1,5 @@
import { badgeStateColor } from "@/components/dashboard/application/logs/show";
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
@@ -87,7 +89,10 @@ export const ShowDockerLogsCompose = ({
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}) {container.state}
{container.name} ({container.containerId}){" "}
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
<SelectLabel>Containers ({data?.length})</SelectLabel>
@@ -96,8 +101,8 @@ export const ShowDockerLogsCompose = ({
</Select>
<DockerLogs
serverId={serverId || ""}
id="terminal"
containerId={containerId || "select-a-container"}
runType="native"
/>
</CardContent>
</Card>

View File

@@ -1,65 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { CheckCircle2 } from "lucide-react";
import { toast } from "sonner";
interface Props {
composeId: string;
}
export const StartCompose = ({ composeId }: Props) => {
const { mutateAsync, isLoading } = api.compose.start.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="secondary" isLoading={isLoading}>
Start
<CheckCircle2 className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you sure to start the compose?
</AlertDialogTitle>
<AlertDialogDescription>
This will start the compose
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
composeId,
})
.then(async () => {
await utils.compose.one.invalidate({
composeId,
});
toast.success("Compose started succesfully");
})
.catch(() => {
toast.error("Error to start the Compose");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -1,65 +0,0 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Ban } from "lucide-react";
import { toast } from "sonner";
interface Props {
composeId: string;
}
export const StopCompose = ({ composeId }: Props) => {
const { mutateAsync, isLoading } = api.compose.stop.useMutation();
const utils = api.useUtils();
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive" isLoading={isLoading}>
Stop
<Ban className="size-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you absolutely sure to stop the compose?
</AlertDialogTitle>
<AlertDialogDescription>
This will stop the compose
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await mutateAsync({
composeId,
})
.then(async () => {
await utils.compose.one.invalidate({
composeId,
});
toast.success("Compose stopped succesfully");
})
.catch(() => {
toast.error("Error to stop the Compose");
});
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

View File

@@ -21,7 +21,7 @@ import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { SquarePen } from "lucide-react";
import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -76,14 +76,14 @@ export const UpdateCompose = ({ composeId }: Props) => {
description: formData.description || "",
})
.then(() => {
toast.success("Compose updated succesfully");
toast.success("Compose updated successfully");
utils.compose.one.invalidate({
composeId: composeId,
});
setIsOpen(false);
})
.catch(() => {
toast.error("Error to update the Compose");
toast.error("Error updating the Compose");
})
.finally(() => {});
};
@@ -91,8 +91,12 @@ export const UpdateCompose = ({ composeId }: Props) => {
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<Button variant="ghost">
<SquarePen className="size-4 text-muted-foreground" />
<Button
variant="ghost"
size="icon"
className="group hover:bg-blue-500/10 "
>
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">

View File

@@ -125,7 +125,7 @@ export const AddBackup = ({ databaseId, databaseType, refetch }: Props) => {
refetch();
})
.catch(() => {
toast.error("Error to create a backup");
toast.error("Error creating a backup");
});
};
return (

Some files were not shown because too many files have changed in this diff Show More