Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Generate a default manual backup name as <<project-name>>-<<environment-name>>-<<time>>

天舟684f20eda1a6
diff --git a/frontend/src/components/DatabaseBackupCreateForm.vue b/frontend/src/components/DatabaseBackupCreateForm.vue
index 1c23c68101..bd7a4307e5 100644
--- a/frontend/src/components/DatabaseBackupCreateForm.vue
+++ b/frontend/src/components/DatabaseBackupCreateForm.vue
@@ -76,6 +76,8 @@
import { computed, PropType, reactive, ref } from "vue";
import { Database } from "../types";
import { isEmpty } from "lodash";
+import moment from "moment";
+import slug from "slug";
interface LocalState {
backupName: string;
@@ -96,9 +98,10 @@ export default {
const commentTextArea = ref("");
const state = reactive<LocalState>({
- backupName: `${
- props.database.name
- }-${new Date().toLocaleTimeString()}-manual`,
+ // The default format is consistent with the default automatic backup name format used in the server.
+ backupName: `${slug(props.database.project.name)}-${slug(
+ props.database.instance.environment.name
+ )}-${moment.utc().local().format("YYYYMMDDTHHmmss")}`,
comment: "",
});