Skip to content

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

chore: last update branch (#13257)

Liu Ji92e0e0679318
diff --git a/frontend/src/components/SchemaEditorLite/Aside/LastUpdate.vue b/frontend/src/components/SchemaEditorLite/Aside/LastUpdate.vue
index 428218c2dc..c1f1703f61 100644
--- a/frontend/src/components/SchemaEditorLite/Aside/LastUpdate.vue
+++ b/frontend/src/components/SchemaEditorLite/Aside/LastUpdate.vue
@@ -1,11 +1,16 @@
<template>
<NPopover
- v-if="updater"
+ v-if="updater || sourceBranch"
:disabled="!updateTime"
placement="right"
>
<template #trigger>
- <UserAvatar :user="updater" size="MINI" />
+ <div class="flex items-center justify-end gap-1">
+ <NTag v-if="sourceBranch" size="small" round>{{
+ sourceBranch.branchId
+ }}</NTag>
+ <UserAvatar v-if="updater" :user="updater" size="MINI" />
+ </div>
</template>
<template #default>
<div class="flex flex-col items-stretch gap-2 text-sm">
@@ -14,11 +19,20 @@
{{ $t("branch.last-update.self") }}
</div>
- <div class="flex justify-end gap-1">
+ <div v-if="updater" class="flex justify-end gap-1">
<UserAvatar :user="updater" size="TINY" />
{{ updater?.title }}
</div>
</div>
+ <div v-if="sourceBranch" class="flex justify-between gap-4">
+ <div>
+ {{ $t("branch.source-branch.self") }}
+ </div>
+
+ <div v-if="sourceBranch" class="flex justify-end gap-1">
+ {{ sourceBranch.branchId }}
+ </div>
+ </div>
<div v-if="updateTime" class="flex justify-end gap-1 text-xs">
{{ dayjs(updateTime).format("YYYY-MM-DD HH:mm:ss UTCZZ") }}
</div>
@@ -28,10 +42,11 @@
</template>
<script setup lang="ts">
-import { NPopover } from "naive-ui";
+import { NPopover, NTag } from "naive-ui";
import { computed } from "vue";
+import { watchEffect } from "vue";
import UserAvatar from "@/components/User/UserAvatar.vue";
-import { extractUserEmail, useUserStore } from "@/store";
+import { extractUserEmail, useBranchStore, useUserStore } from "@/store";
import type {
TreeNodeForFunction,
TreeNodeForProcedure,
@@ -47,6 +62,8 @@ const props = defineProps<{
| TreeNodeForFunction;
}>();
+const branchStore = useBranchStore();
+
const config = computed(() => {
const { type, metadata } = props.node;
const schemaConfig = metadata.database.schemaConfigs.find(
@@ -85,7 +102,26 @@ const updater = computed(() => {
return useUserStore().getUserByEmail(email);
});
+const sourceBranch = computed(() => {
+ if (!config.value?.sourceBranch) return undefined;
+ return branchStore.getBranchByName(
+ config.value.sourceBranch,
+ /* view: any */ undefined
+ );
+});
+
const updateTime = computed(() => {
return config.value?.updateTime;
});
+
+watchEffect(() => {
+ const source = config.value?.sourceBranch;
+ if (source) {
+ branchStore.fetchBranchByName(
+ source,
+ /* useCache */ true,
+ /* silent */ true
+ );
+ }
+});
</script>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 9941b1de3d..0bb6f6f268 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -3648,6 +3648,9 @@
},
"last-update": {
"self": "Last update"
+ },
+ "source-branch": {
+ "self": "Source branch"
}
}
}
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 620a7a7096..b26912ae80 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -3648,6 +3648,9 @@
},
"last-update": {
"self": "Última actualización"
+ },
+ "source-branch": {
+ "self": "Rama fuente"
}
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 7c63737496..ab387378b0 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -3648,6 +3648,9 @@
},
"last-update": {
"self": "最後の更新"
+ },
+ "source-branch": {
+ "self": "ソースブランチ"
}
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 93481b9224..c6c535bf94 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -3648,6 +3648,9 @@
},
"last-update": {
"self": "最后更新"
+ },
+ "source-branch": {
+ "self": "源分支"
}
}
}