Skip to content

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

Remove v-database-sync-status, which seems to cause stale rendering in database table even underlying status changed

天舟3a15ec0f3ad6
diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vue
index acdd2d4c87..f103fc4b9a 100644
--- a/frontend/src/components/DatabaseTable.vue
+++ b/frontend/src/components/DatabaseTable.vue
@@ -29,7 +29,7 @@
<BBTableCell class="w-8">
{{ database.collation }}
</BBTableCell>
- <BBTableCell class="w-8" v-database-sync-status>
+ <BBTableCell class="w-8">
{{ database.syncStatus }}
</BBTableCell>
<BBTableCell class="w-16">
diff --git a/frontend/src/directives/database-sync-status.ts b/frontend/src/directives/database-sync-status.ts
deleted file mode 100644
index e11169dabd..0000000000
--- a/frontend/src/directives/database-sync-status.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { DatabaseSyncStatus } from "../types";
-
-const directive = {
- beforeMount(el: HTMLElement) {
- const syncStatus = el.innerText as DatabaseSyncStatus;
- switch (syncStatus) {
- case "OK":
- el.innerText = "OK";
- return;
- case "DRIFTED":
- el.innerText = "Drifted";
- return;
- case "NOT_FOUND":
- el.innerText = "Not found";
- return;
- }
- },
-};
-
-export default directive;
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 770bed3547..65beaf5c9e 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -32,7 +32,6 @@ import {
BBTableTabFilter,
BBTextField,
} from "./bbkit";
-import databaseSyncStatus from "./directives/database-sync-status";
import dataSourceType from "./directives/data-source-type";
// @ts-ignore
import highlight from "./directives/highlight";
@@ -161,7 +160,6 @@ app
// The normal hljs.initHighlightingOnLoad() won't work because router change would cause vue
// to re-render the page and remove the event listener required for
.directive("highlight", highlight)
- .directive("database-sync-status", databaseSyncStatus)
.directive("data-source-type", dataSourceType)
.use(store)
.use(router)
diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vue
index 3ed36682dd..d4f07ddfc7 100644
--- a/frontend/src/views/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail.vue
@@ -113,7 +113,7 @@
Sync status
</dt>
<dd class="mt-1 text-sm text-main">
- <span v-database-sync-status>{{ database.syncStatus }}</span>
+ <span>{{ database.syncStatus }}</span>
</dd>
</div>