style: add backup recommendation before rebuilding database#4892
Open
damiogunsiji wants to merge 2 commits into
Open
style: add backup recommendation before rebuilding database#4892damiogunsiji wants to merge 2 commits into
damiogunsiji wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add backup recommendation with one-click navigation before rebuilding database
Problem
When users click "Rebuild Database" in the Danger Zone, the dialog warns about data loss but never suggests creating a backup first — nor provides a way to navigate there directly. This puts user data at unnecessary risk, especially since Dokploy already has a backup system in place.
Solution
Added backup reminder text in two places, both with clickable links that navigate directly to the Backups tab:
Card body — below the destructive warning description:
Confirmation dialog — after "This action cannot be undone":
Changes
apps/dokploy/components/dashboard/shared/rebuild-database.tsxAlertTriangleicon andonClickhandlers that navigate to?tab=backupsviarouter.pushwithshallow: trueapps/dokploy/pages/.../services/postgres/[postgresId].tsxuseEffectto sync tab state fromrouter.query.tabapps/dokploy/pages/.../services/mongo/[mongoId].tsxapps/dokploy/pages/.../services/mysql/[mysqlId].tsxapps/dokploy/pages/.../services/mariadb/[mariadbId].tsxapps/dokploy/pages/.../services/libsql/[libsqlId].tsxapps/dokploy/pages/.../services/redis/[redisId].tsxHow it works
The clickable text uses
router.push(url, undefined, { shallow: true })— matching the project's existing tab-switching convention. AuseEffectin each database page syncs the localtabstate with the URL's?tab=parameter, so clicking the link properly switches to the Backups tab without a full page reload.Screenshots
Testing
pnpm typecheck— passes clean forapps/dokploy