Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update table view (#7452)
ecmadao680d30f83d3b
diff --git a/frontend/src/components/ColumnTable.vue b/frontend/src/components/ColumnTable.vueindex 8e144ae38c..446e5e3774 100644--- a/frontend/src/components/ColumnTable.vue+++ b/frontend/src/components/ColumnTable.vue@@ -7,7 +7,7 @@:right-bordered="true"v-bind="$attrs">- <template #body="{ rowData: column }">+ <template #body="{ rowData: column }: { rowData: ColumnMetadata }"><BBTableCellv-if="showSensitiveColumn":left-padding="4"@@ -35,9 +35,12 @@/></div></BBTableCell>- <BBTableCell class="w-16" :left-padding="showSensitiveColumn ? 2 : 4">+ <BBTableCell class="w-14" :left-padding="showSensitiveColumn ? 2 : 4">{{ column.name }}</BBTableCell>+ <BBTableCell v-if="showClassificationColumn" class="w-10">+ {{ column.classification }}+ </BBTableCell><BBTableCell class="w-8">{{ column.type }}</BBTableCell>@@ -84,7 +87,7 @@ import { useI18n } from "vue-i18n";import { Column, ComposedDatabase } from "@/types";import { ColumnMetadata, TableMetadata } from "@/types/proto/store/database";import { useCurrentUserV1, useSubscriptionV1Store } from "@/store";-import { hasWorkspacePermissionV1 } from "@/utils";+import { hasWorkspacePermissionV1, isDev } from "@/utils";import { BBTableColumn } from "@/bbkit/types";import { usePolicyV1Store } from "@/store/modules/v1/policy";import {@@ -152,6 +155,13 @@ const showSensitiveColumn = computed(() => {);});+const showClassificationColumn = computed(() => {+ return (+ (engine.value === Engine.MYSQL || engine.value === Engine.POSTGRES) &&+ isDev()+ );+});+const currentUserV1 = useCurrentUserV1();const allowAdmin = computed(() => {if (@@ -200,6 +210,11 @@ const NORMAL_COLUMN_LIST = computed(() => {nowrap: true,});}+ if (showClassificationColumn.value) {+ columnList.splice(1, 0, {+ title: t("database.classification.self"),+ });+ }return columnList;});const POSTGRES_COLUMN_LIST = computed(() => {@@ -230,6 +245,11 @@ const POSTGRES_COLUMN_LIST = computed(() => {nowrap: true,});}+ if (showClassificationColumn.value) {+ columnList.splice(1, 0, {+ title: t("database.classification.self"),+ });+ }return columnList;});const CLICKHOUSE_SNOWFLAKE_COLUMN_LIST = computed((): BBTableColumn[] => [diff --git a/frontend/src/components/TableDetailDrawer.vue b/frontend/src/components/TableDetailDrawer.vueindex 16e63f0362..803ad3bea2 100644--- a/frontend/src/components/TableDetailDrawer.vue+++ b/frontend/src/components/TableDetailDrawer.vue@@ -88,16 +88,14 @@</div><div class="mt-6">- <div- class="max-w-6xl mx-auto px-6 space-y-6 divide-y divide-block-border"- >+ <div class="max-w-6xl px-6 space-y-6 divide-y divide-block-border"><!-- Description list -->- <dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">- <div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">+ <dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-3">+ <div class="col-span-1">+ <dt class="text-sm text-control-light">{{ $t("database.engine") }}</dt>- <dd class="mt-1 text-sm text-main">+ <dd class="mt-1 text-lg sm:text-xl font-semibold">{{instanceEngine === Engine.POSTGRES ||instanceEngine === Engine.SNOWFLAKE@@ -107,27 +105,39 @@</dd></div>+ <!-- TODO: show table classification -->+ <div v-if="table.classification" class="col-span-1">+ <dt class="text-sm text-control-light">+ {{ $t("database.classification.self") }}+ </dt>+ <dd class="mt-1 text-lg sm:text-xl font-semibold">+ {{ table.classification }}+ </dd>+ </div>+<div class="col-span-1">- <dt class="text-sm font-medium text-control-light">+ <dt class="text-sm text-control-light">{{ $t("database.row-count-estimate") }}</dt>- <dd class="mt-1 text-sm text-main">{{ table.rowCount }}</dd>+ <dd class="mt-1 text-lg sm:text-xl font-semibold">+ {{ table.rowCount }}+ </dd></div>- <div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">+ <div class="col-span-1">+ <dt class="text-sm text-control-light">{{ $t("database.data-size") }}</dt>- <dd class="mt-1 text-sm text-main">+ <dd class="mt-1 text-lg sm:text-xl font-semibold">{{ bytesToString(table.dataSize) }}</dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">+ <dt class="text-sm text-control-light">{{ $t("database.index-size") }}</dt>- <dd class="mt-1 text-sm text-main">+ <dd class="mt-1 text-lg sm:text-xl font-semibold">{{instanceEngine === Engine.CLICKHOUSE ||instanceEngine === Engine.SNOWFLAKE@@ -144,10 +154,10 @@"><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">+ <dt class="text-sm text-control-light">{{ $t("db.collation") }}</dt>- <dd class="mt-1 text-sm text-main">+ <dd class="mt-1 text-lg sm:text-xl font-semibold">{{instanceEngine === Engine.POSTGRES? "n/a"diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex b2c319d07c..93938cb336 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1329,7 +1329,10 @@},"select-target-project": "Select target project"},- "transfer-database-from-to": "Transfer database from source project to target project"+ "transfer-database-from-to": "Transfer database from source project to target project",+ "classification": {+ "self": "Classification"+ }},"repository": {"branch-observe-file-change": "The branch where Bytebase observes the file change.",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex efc9533428..ccc32a52f5 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1327,7 +1327,10 @@},"select-target-project": "Seleccionar proyecto de destino"},- "transfer-database-from-to": "Transferir la base de datos del proyecto de origen al proyecto de destino"+ "transfer-database-from-to": "Transferir la base de datos del proyecto de origen al proyecto de destino",+ "classification": {+ "self": "Clasificación"+ }},"repository": {"branch-observe-file-change": "La rama donde Bytebase observa el cambio de archivo.",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 51b87d27f2..35df51e412 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1322,7 +1322,10 @@},"select-target-project": "选择目标项目"},- "transfer-database-from-to": "将数据库从源项目转移到目标项目"+ "transfer-database-from-to": "将数据库从源项目转移到目标项目",+ "classification": {+ "self": "分类分级"+ }},"repository": {"branch-observe-file-change": "Bytebase 跟踪文件变更的分支。",