Skip to content

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

List all database anomalies in anomaly center

天舟db302c3c2834
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index ad126a88be..b2ff18a8b7 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -192,11 +192,11 @@ const routes: Array<RouteRecordRaw> = [
},
},
{
- path: "control-center",
- name: "workspace.control-center",
- meta: { title: () => "Control Center" },
+ path: "anomaly-center",
+ name: "workspace.anomaly-center",
+ meta: { title: () => "Anomaly Center" },
components: {
- content: () => import("../views/ControlCenterDashboard.vue"),
+ content: () => import("../views/AnomalyCenterDashboard.vue"),
leftSidebar: DashboardSidebar,
},
props: {
@@ -872,7 +872,7 @@ router.beforeEach((to, from, next) => {
to.name === "oauth-callback" ||
to.name === "workspace.home" ||
to.name === "workspace.inbox" ||
- to.name === "workspace.control-center" ||
+ to.name === "workspace.anomaly-center" ||
to.name === "workspace.project" ||
to.name === "workspace.database" ||
to.name === "workspace.archive" ||
diff --git a/frontend/src/views/AnomalyCenterDashboard.vue b/frontend/src/views/AnomalyCenterDashboard.vue
new file mode 100644
index 0000000000..3179114045
--- /dev/null
+++ b/frontend/src/views/AnomalyCenterDashboard.vue
@@ -0,0 +1,46 @@
+<template>
+ <div class="px-6 mt-4">
+ <AnomalyTable :mode="'NORMAL'" :anomalyList="anomalyList" />
+ </div>
+</template>
+
+<script lang="ts">
+import { computed, watchEffect } from "vue-demi";
+import { useStore } from "vuex";
+import AnomalyTable from "../components/AnomalyTable.vue";
+import { Anomaly, Database } from "../types";
+export default {
+ name: "AnomalyCenterDashboard",
+ components: { AnomalyTable },
+ setup(props, ctx) {
+ const store = useStore();
+
+ const currentUser = computed(() => store.getters["auth/currentUser"]());
+
+ const prepareDatabaseList = () => {
+ // It will also be called when user logout
+ store.dispatch("database/fetchDatabaseList");
+ };
+
+ watchEffect(prepareDatabaseList);
+
+ const databaseList = computed((): Database[] => {
+ return store.getters["database/databaseListByPrincipalId"](
+ currentUser.value.id
+ );
+ });
+
+ const anomalyList = computed((): Anomaly[] => {
+ const list: Anomaly[] = [];
+ databaseList.value.forEach((database: Database) => {
+ list.push(...database.anomalyList);
+ });
+ return list;
+ });
+
+ return {
+ anomalyList,
+ };
+ },
+};
+</script>
diff --git a/frontend/src/views/ControlCenterDashboard.vue b/frontend/src/views/ControlCenterDashboard.vue
deleted file mode 100644
index dca19bb869..0000000000
--- a/frontend/src/views/ControlCenterDashboard.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-<template>
- <div>Control Center</div>
-</template>
-
-<script lang="ts">
-export default {
- name: "ControlCenterDashboard",
- components: {},
- setup(props, ctx) {
- return {};
- },
-};
-</script>
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 938f32fdc3..81e8ec4370 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -65,7 +65,7 @@
</svg>
</router-link>
<router-link
- to="/control-center"
+ to="/anomaly-center"
class="outline-item group flex items-center px-2 py-2"
>
<svg
@@ -78,7 +78,7 @@
d="M5 4a1 1 0 00-2 0v7.268a2 2 0 000 3.464V16a1 1 0 102 0v-1.268a2 2 0 000-3.464V4zM11 4a1 1 0 10-2 0v1.268a2 2 0 000 3.464V16a1 1 0 102 0V8.732a2 2 0 000-3.464V4zM16 3a1 1 0 011 1v7.268a2 2 0 010 3.464V16a1 1 0 11-2 0v-1.268a2 2 0 010-3.464V4a1 1 0 011-1z"
></path>
</svg>
- Control Center
+ Anomaly Center
</router-link>
<div>
<BookmarkListSidePanel />