Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(frontend): slow query improvements (#5536)
Liu Ji5678d24824e8
diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.goindex 2b7be2ebe5..e322a2ab39 100644--- a/backend/legacyapi/plan.go+++ b/backend/legacyapi/plan.go@@ -156,8 +156,6 @@ const (// FeatureCustomApproval enables custom risk level definition and custom// approval chain definition.FeatureCustomApproval FeatureType = "bb.feature.custom-approval"- // FeatureSlowQuery enables slow query logging and analyzing.- FeatureSlowQuery FeatureType = "bb.feature.slow-query"// FeaturePluginOpenAI enables AI features powered by OpenAI.FeaturePluginOpenAI FeatureType = "bb.feature.plugin.openai"@@ -224,8 +222,6 @@ func (e FeatureType) Name() string {return "Access Control"case FeatureCustomApproval:return "Custom Approval"- case FeatureSlowQuery:- return "Slow Query"// Pluginscase FeaturePluginOpenAI:return "OpenAI"@@ -285,7 +281,6 @@ var FeatureMatrix = map[FeatureType][3]bool{FeatureSensitiveData: {false, false, true},FeatureAccessControl: {false, false, true},FeatureCustomApproval: {false, false, true},- FeatureSlowQuery: {false, false, true},// PluginsFeaturePluginOpenAI: {false, false, true},}diff --git a/frontend/src/components/DatabaseSlowQueryPanel.vue b/frontend/src/components/DatabaseSlowQueryPanel.vueindex cf3cf4e2c2..9dca1430c5 100644--- a/frontend/src/components/DatabaseSlowQueryPanel.vue+++ b/frontend/src/components/DatabaseSlowQueryPanel.vue@@ -4,6 +4,8 @@v-if="database"v-model:filter="filter":filter-types="['time-range']"+ :show-environment-column="false"+ :show-instance-column="false"/></div></template>diff --git a/frontend/src/components/SlowQuery/Panel/DetailDialog.vue b/frontend/src/components/SlowQuery/Panel/DetailDialog.vuedeleted file mode 100644index 7db6d1a314..0000000000--- a/frontend/src/components/SlowQuery/Panel/DetailDialog.vue+++ /dev/null@@ -1,116 +0,0 @@-<template>- <BBModal :title="$t('common.detail')" @close="$emit('close')">- <div- class="max-h-[calc(100vh-12rem)] w-[calc(100vw-8rem)] lg:max-w-[56rem] flex flex-col gap-y-4 text-sm"- >- <div- class="grid grid-cols-[minmax(auto,7rem)_1fr] md:grid-cols-[minmax(auto,7rem)_1fr_minmax(auto,7rem)_1fr] gap-x-2 gap-y-4"- >- <div class="contents">- <label class="font-medium">{{ $t("common.instance") }}</label>-- <InstanceName :instance="database.instance" />- </div>-- <div class="contents">- <label class="font-medium">{{ $t("common.database") }}</label>-- <DatabaseName :database="database" />- </div>-- <div class="contents">- <label class="font-medium whitespace-nowrap">- {{ $t("common.sql-statement") }}- </label>-- <div- class="col-start-2 md:col-span-3 max-h-[8rem] overflow-auto border p-1 text-xs"- >- <HighlightCodeBlock- :code="log.statistics?.sqlFingerprint ?? ''"- class="whitespace-pre-wrap"- />- </div>- </div>- </div>- <div class="flex-1 overflow-auto border">- <BBGrid- :column-list="columns"- :data-source="log.statistics?.samples"- :row-clickable="false"- class="compact"- header-class="capitalize"- >- <template #item="{ item: detail }: SlowQueryDetailsRow">- <div class="bb-grid-cell">- {{ dayjs(detail.startTime).format("YYYY-MM-DD HH:mm:ss") }}- </div>- <div class="bb-grid-cell">- {{ detail.queryTime?.seconds.toFixed(6) }}- </div>- <div class="bb-grid-cell">- {{ detail.lockTime?.seconds.toFixed(6) }}- </div>- <div class="bb-grid-cell">- {{ detail.rowsExamined }}- </div>- <div class="bb-grid-cell">- {{ detail.rowsSent }}- </div>- </template>- </BBGrid>- </div>- </div>- </BBModal>-</template>--<script lang="ts" setup>-import { computed } from "vue";-import { useI18n } from "vue-i18n";--import { type BBGridColumn, type BBGridRow, BBModal, BBGrid } from "@/bbkit";-import type { ComposedSlowQueryLog } from "@/types";-import type { SlowQueryDetails } from "@/types/proto/v1/database_service";-import { DatabaseName, InstanceName } from "@/components/v2";-import HighlightCodeBlock from "@/components/HighlightCodeBlock";--export type SlowQueryDetailsRow = BBGridRow<SlowQueryDetails>;--const props = defineProps<{- slowQueryLog: ComposedSlowQueryLog;-}>();--defineEmits<{- (event: "close"): void;-}>();--const { t } = useI18n();--const columns = computed(() => {- const columns: BBGridColumn[] = [- {- title: t("slow-query.query-start-time"),- width: "minmax(auto, 2fr)",- },- {- title: t("slow-query.query-time"),- width: "minmax(auto, 1fr)",- },- {- title: t("slow-query.lock-time"),- width: "minmax(auto, 1fr)",- },- {- title: t("slow-query.rows-examined"),- width: "minmax(auto, 1fr)",- },- {- title: t("slow-query.rows-sent"),- width: "minmax(auto, 1fr)",- },- ];- return columns;-});-const log = computed(() => props.slowQueryLog.log);-const database = computed(() => props.slowQueryLog.database);-</script>diff --git a/frontend/src/components/SlowQuery/Panel/DetailPanel.vue b/frontend/src/components/SlowQuery/Panel/DetailPanel.vuenew file mode 100644index 0000000000..912927cd0e--- /dev/null+++ b/frontend/src/components/SlowQuery/Panel/DetailPanel.vue@@ -0,0 +1,138 @@+<template>+ <NDrawer+ :show="slowQueryLog !== undefined"+ :auto-focus="false"+ width="auto"+ @update:show="(show) => !show && $emit('close')"+ >+ <NDrawerContent+ :title="$t('common.detail')"+ :closable="true"+ class="w-[calc(100vw-8rem)] lg:max-w-[56rem]"+ >+ <div v-if="slowQueryLog" class="max-h-full flex flex-col gap-y-4 text-sm">+ <div+ class="grid grid-cols-[auto_1fr] md:grid-cols-[minmax(auto,7rem)_1fr_minmax(auto,7rem)_1fr_minmax(auto,7rem)_1fr] gap-x-2 gap-y-4"+ >+ <div class="contents">+ <label class="font-medium">{{ $t("common.environment") }}</label>++ <EnvironmentName :environment="database.instance.environment" />+ </div>++ <div class="contents">+ <label class="font-medium">{{ $t("common.instance") }}</label>++ <InstanceName :instance="database.instance" />+ </div>++ <div class="contents">+ <label class="font-medium">{{ $t("common.database") }}</label>++ <DatabaseName :database="database" />+ </div>++ <div class="contents">+ <label class="font-medium whitespace-nowrap">+ {{ $t("common.sql-statement") }}+ </label>++ <div+ class="col-start-2 md:col-span-5 max-h-[8rem] overflow-auto py-0.5 text-xs"+ >+ <HighlightCodeBlock+ :code="log.statistics?.sqlFingerprint ?? ''"+ class="whitespace-pre-wrap"+ />+ </div>+ </div>+ </div>+ <div class="flex-1 overflow-auto border">+ <BBGrid+ :column-list="columns"+ :data-source="log.statistics?.samples"+ :row-clickable="false"+ class="compact"+ header-class="capitalize"+ >+ <template #item="{ item: detail, row }: SlowQueryDetailsRow">+ <div class="bb-grid-cell whitespace-nowrap !pl-4 !pr-2">+ {{ row + 1 }}+ </div>+ <div class="bb-grid-cell whitespace-nowrap !pr-4">+ {{ dayjs(detail.startTime).format("YYYY-MM-DD HH:mm:ss") }}+ </div>+ <div class="bb-grid-cell">+ {{ detail.queryTime?.seconds.toFixed(6) }}+ </div>+ <div class="bb-grid-cell">+ {{ detail.lockTime?.seconds.toFixed(6) }}+ </div>+ <div class="bb-grid-cell">+ {{ detail.rowsExamined }}+ </div>+ <div class="bb-grid-cell">+ {{ detail.rowsSent }}+ </div>+ </template>+ </BBGrid>+ </div>+ </div>+ </NDrawerContent>+ </NDrawer>+</template>++<script lang="ts" setup>+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import { NDrawer, NDrawerContent } from "naive-ui";++import { type BBGridColumn, type BBGridRow, BBGrid } from "@/bbkit";+import type { ComposedSlowQueryLog } from "@/types";+import type { SlowQueryDetails } from "@/types/proto/v1/database_service";+import { DatabaseName, InstanceName, EnvironmentName } from "@/components/v2";+import HighlightCodeBlock from "@/components/HighlightCodeBlock";++export type SlowQueryDetailsRow = BBGridRow<SlowQueryDetails>;++const props = defineProps<{+ slowQueryLog: ComposedSlowQueryLog | undefined;+}>();++defineEmits<{+ (event: "close"): void;+}>();++const { t } = useI18n();++const columns = computed(() => {+ const columns: BBGridColumn[] = [+ {+ width: "auto",+ },+ {+ title: t("slow-query.query-start-time"),+ width: "auto",+ },+ {+ title: t("slow-query.query-time"),+ width: "minmax(auto, 1fr)",+ },+ {+ title: t("slow-query.lock-time"),+ width: "minmax(auto, 1fr)",+ },+ {+ title: t("slow-query.rows-examined"),+ width: "minmax(auto, 1fr)",+ },+ {+ title: t("slow-query.rows-sent"),+ width: "minmax(auto, 1fr)",+ },+ ];+ return columns;+});+const log = computed(() => props.slowQueryLog!.log);+const database = computed(() => props.slowQueryLog!.database);+</script>diff --git a/frontend/src/components/SlowQuery/Panel/LogFilter.vue b/frontend/src/components/SlowQuery/Panel/LogFilter.vueindex 4d6eb76309..9a8c5fa19d 100644--- a/frontend/src/components/SlowQuery/Panel/LogFilter.vue+++ b/frontend/src/components/SlowQuery/Panel/LogFilter.vue@@ -2,7 +2,7 @@<div class="mb-2 space-y-2"><div class="flex items-center gap-x-4 h-[34px]"><NRadioGroup- v-if="allowFilterByEnvironment"+ v-if="filterTypes.includes('mode')"v-model:value="mode":disabled="loading"class="ml-1"@@ -12,14 +12,6 @@</NRadioGroup><NInputGroup style="width: auto">- <ProjectSelect- v-if="mode === 'project' && filterTypes.includes('project')"- :project="params.project?.id ?? UNKNOWN_ID"- :include-default-project="false"- :include-all="true"- :disabled="loading"- @update:project="changeProjectId"- /><InstanceSelectv-if="mode === 'environment' && filterTypes.includes('instance')":instance="params.instance?.id ?? UNKNOWN_ID"@@ -51,15 +43,34 @@@update:value="changeTimeRange"/></NInputGroup>++ <div class="flex-1 flex items-center justify-end">+ <slot name="suffix" />+ </div></div>- <div v-if="filterTypes.includes('environment')">+ <div+ v-if="+ (mode === 'environment' && filterTypes.includes('environment')) ||+ (mode === 'project' && filterTypes.includes('project'))+ "+ ><EnvironmentTabFilter+ v-if="mode === 'environment' && filterTypes.includes('environment')":environment="params.environment?.id ?? UNKNOWN_ID":include-all="true":disabled="loading"@update:environment="changeEnvironmentId"/>++ <ProjectSelect+ v-if="mode === 'project' && filterTypes.includes('project')"+ :project="params.project?.id ?? UNKNOWN_ID"+ :include-default-project="false"+ :include-all="true"+ :disabled="loading"+ @update:project="changeProjectId"+ /></div></div></template>@@ -107,9 +118,6 @@ const currentUser = useCurrentUser();const mode = shallowRef<FilterMode>("environment");const allowFilterByEnvironment = computed(() => {- if (!props.filterTypes.includes("mode")) {- return false;- }return hasWorkspacePermission("bb.permission.workspace.manage-database",currentUser.value.rolediff --git a/frontend/src/components/SlowQuery/Panel/LogTable.vue b/frontend/src/components/SlowQuery/Panel/LogTable.vueindex 663a8df6bd..d96679fe37 100644--- a/frontend/src/components/SlowQuery/Panel/LogTable.vue+++ b/frontend/src/components/SlowQuery/Panel/LogTable.vue@@ -9,15 +9,6 @@><template #item="{ item: { log, database } }: SlowQueryLogRow"><template v-if="log.statistics">- <div class="bb-grid-cell">- <HumanizeTs :ts="dateToTS(log.statistics.latestLogTime)" />- </div>- <div class="bb-grid-cell">- <InstanceName :instance="database.instance" />- </div>- <div class="bb-grid-cell">- <DatabaseName :database="database" />- </div><div class="bb-grid-cell text-xs font-mono"><div class="truncate">{{ log.statistics.sqlFingerprint }}@@ -46,6 +37,23 @@<div class="bb-grid-cell">{{ log.statistics.averageRowsSent }}</div>+ <div v-if="showEnvironmentColumn" class="bb-grid-cell">+ <EnvironmentName+ :environment="database.instance.environment"+ :link="false"+ />+ </div>+ <div v-if="showInstanceColumn" class="bb-grid-cell">+ <InstanceName :instance="database.instance" :link="false" />+ </div>+ <div class="bb-grid-cell">+ <DatabaseName :database="database" :link="false" />+ </div>+ <div class="bb-grid-cell whitespace-nowrap !pr-4">+ {{+ dayjs(log.statistics.latestLogTime).format("YYYY-MM-DD HH:mm:ss")+ }}+ </div></template></template></BBGrid>@@ -57,19 +65,22 @@ import { useI18n } from "vue-i18n";import { type BBGridColumn, type BBGridRow, BBGrid } from "@/bbkit";import type { ComposedSlowQueryLog } from "@/types";-import HumanizeTs from "@/components/misc/HumanizeTs.vue";-import { DatabaseName, InstanceName } from "@/components/v2";+import { DatabaseName, InstanceName, EnvironmentName } from "@/components/v2";export type SlowQueryLogRow = BBGridRow<ComposedSlowQueryLog>;-withDefaults(+const props = withDefaults(defineProps<{slowQueryLogList?: ComposedSlowQueryLog[];showPlaceholder?: boolean;+ showEnvironmentColumn?: boolean;+ showInstanceColumn?: boolean;}>(),{slowQueryLogList: () => [],showPlaceholder: true,+ showEnvironmentColumn: true,+ showInstanceColumn: true,});@@ -80,19 +91,7 @@ defineEmits<{const { t } = useI18n();const columns = computed(() => {- const columns: BBGridColumn[] = [- {- title: t("slow-query.last-query-time"),- width: "minmax(8rem, auto)",- },- {- title: t("common.instance"),- width: "minmax(12rem, 18rem)",- },- {- title: t("common.database"),- width: "minmax(12rem, 18rem)",- },+ const columns = [{title: t("slow-query.sql-statement"),width: "minmax(20rem, 1fr)",@@ -114,23 +113,34 @@ const columns = computed(() => {width: "minmax(6rem, auto)",},{- title: t("slow-query.rows-sent-95-percent"),+ title: t("slow-query.rows-examined-avg"),width: "minmax(6rem, auto)",},{- title: t("slow-query.rows-examined-avg"),+ title: t("slow-query.rows-sent-95-percent"),width: "minmax(6rem, auto)",},{title: t("slow-query.rows-sent-avg"),width: "minmax(6rem, auto)",},- ];+ props.showEnvironmentColumn && {+ title: t("common.environment"),+ width: "minmax(6rem, auto)",+ },+ props.showInstanceColumn && {+ title: t("common.instance"),+ width: "minmax(12rem, 18rem)",+ },+ {+ title: t("common.database"),+ width: "minmax(12rem, 18rem)",+ },+ {+ title: t("slow-query.last-query-time"),+ width: "auto",+ },+ ].filter((col) => !!col) as BBGridColumn[];return columns;});--const dateToTS = (date: Date | undefined) => {- if (!date) return 0;- return Math.floor(date.getTime() / 1000);-};</script>diff --git a/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue b/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vueindex ecace98bba..a6daadccb1 100644--- a/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue+++ b/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue@@ -6,12 +6,25 @@:filter-types="filterTypes":loading="loading"@update:params="$emit('update:filter', $event)"- />+ >+ <template #suffix>+ <NButton+ type="primary"+ :quaternary="true"+ :loading="syncing"+ @click="syncNow"+ >+ {{ $t("common.sync-now") }}+ </NButton>+ </template>+ </LogFilter></div><div class="relative min-h-[8rem]"><LogTable:slow-query-log-list="slowQueryLogList":show-placeholder="!loading"+ :show-environment-column="showEnvironmentColumn"+ :show-instance-column="showInstanceColumn"@select="selectedSlowQueryLog = $event"/><div@@ -22,8 +35,7 @@</div></div>- <DetailDialog- v-if="selectedSlowQueryLog"+ <DetailPanel:slow-query-log="selectedSlowQueryLog"@close="selectedSlowQueryLog = undefined"/>@@ -32,9 +44,16 @@<script lang="ts" setup>import { computed, shallowRef, watch } from "vue";+import { NButton } from "naive-ui";+import { useI18n } from "vue-i18n";-import type { ComposedSlowQueryLog } from "@/types";-import { useSlowQueryStore } from "@/store";+import type { ComposedSlowQueryLog, SlowQueryPolicyPayload } from "@/types";+import {+ pushNotification,+ useInstanceStore,+ useSlowQueryPolicyStore,+ useSlowQueryStore,+} from "@/store";import {type FilterType,type SlowQueryFilterParams,@@ -43,15 +62,19 @@ import {} from "./types";import LogFilter from "./LogFilter.vue";import LogTable from "./LogTable.vue";-import DetailDialog from "./DetailDialog.vue";+import DetailPanel from "./DetailPanel.vue";const props = withDefaults(defineProps<{filter: SlowQueryFilterParams;filterTypes?: readonly FilterType[];+ showEnvironmentColumn?: boolean;+ showInstanceColumn?: boolean;}>(),{filterTypes: () => FilterTypeList,+ showEnvironmentColumn: true,+ showInstanceColumn: true,});@@ -59,10 +82,12 @@ defineEmits<{(event: "update:filter", filter: SlowQueryFilterParams): void;}>();+const { t } = useI18n();const slowQueryStore = useSlowQueryStore();const loading = shallowRef(false);const slowQueryLogList = shallowRef<ComposedSlowQueryLog[]>([]);const selectedSlowQueryLog = shallowRef<ComposedSlowQueryLog>();+const syncing = shallowRef(false);const params = computed(() => {return buildListSlowQueriesRequest(props.filter);@@ -78,6 +103,37 @@ const fetchSlowQueryLogList = async () => {}};+const syncNow = async () => {+ syncing.value = true;+ try {+ const instanceStore = useInstanceStore();+ await instanceStore.fetchInstanceList(["NORMAL"]);+ const policyList =+ await useSlowQueryPolicyStore().fetchPolicyListByResourceTypeAndPolicyType(+ "instance",+ "bb.policy.slow-query"+ );+ const requestList = policyList+ .filter((policy) => {+ const payload = policy.payload as SlowQueryPolicyPayload;+ return payload.active;+ })+ .map((policy) => {+ const instanceId = policy.resourceId;+ const instance = instanceStore.getInstanceById(instanceId);+ return slowQueryStore.syncSlowQueriesByInstance(instance);+ });+ await Promise.all(requestList);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("slow-query.sync-job-started"),+ });+ } finally {+ syncing.value = false;+ }+};+// Fetch the list while params changed.watch(() => JSON.stringify(params.value), fetchSlowQueryLogList, {immediate: true,diff --git a/frontend/src/components/SlowQuery/Panel/types.ts b/frontend/src/components/SlowQuery/Panel/types.tsindex dcd86b331f..b6cebbd4b3 100644--- a/frontend/src/components/SlowQuery/Panel/types.ts+++ b/frontend/src/components/SlowQuery/Panel/types.ts@@ -63,6 +63,6 @@ export const buildListSlowQueriesRequest = (filter: SlowQueryFilterParams) => {request.filter = query.join(" && ");}- request.orderBy = "count desc";+ request.orderBy = "nighty_fifth_percentile_query_time desc";return ListSlowQueriesRequest.fromJSON(request);};diff --git a/frontend/src/components/SlowQuery/Settings/SlowQuerySettings.vue b/frontend/src/components/SlowQuery/Settings/SlowQuerySettings.vueindex 30836e842f..bb2060e6f4 100644--- a/frontend/src/components/SlowQuery/Settings/SlowQuerySettings.vue+++ b/frontend/src/components/SlowQuery/Settings/SlowQuerySettings.vue@@ -32,7 +32,6 @@ import { computed, onMounted, reactive } from "vue";import { BBAttention } from "@/bbkit";import {- featureToRef,pushNotification,useEnvironmentList,useInstanceStore,@@ -51,10 +50,6 @@ import { SlowQueryPolicyTable } from "./components";import { instanceSupportSlowQuery } from "@/utils";import { useI18n } from "vue-i18n";-const emit = defineEmits<{- (event: "show-feature-modal"): void;-}>();-type LocalState = {ready: boolean;instanceList: Instance[];@@ -76,7 +71,6 @@ const policyStore = useSlowQueryPolicyStore();const slowQueryStore = useSlowQueryStore();const instanceStore = useInstanceStore();const environmentList = useEnvironmentList(["NORMAL"]);-const hasSlowQueryFeature = featureToRef("bb.feature.slow-query");const policyList = computed(() => {return policyStore.getPolicyListByResourceTypeAndPolicyType(@@ -119,11 +113,6 @@ const changeEnvironment = (id: EnvironmentId | undefined) => {};const toggleActive = async (instance: Instance, active: boolean) => {- if (!hasSlowQueryFeature.value) {- emit("show-feature-modal");- return;- }-try {const payload: SlowQueryPolicyPayload = {active,diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 99d0489a60..36fd8c1940 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1769,10 +1769,6 @@"title": "Custom approval","desc": "Configure security risk level and approval flow for different tasks."},- "bb-feature-slow-query": {- "title": "Slow query",- "desc": "Logging and analyzing slow SQL queries."- },"bb-feature-vcs-schema-write-back": {"title": "Schema write-back","desc": "After a successful schema change, schema write-back enables Bytebase to write back the latest full schema snapshot to your VCS repository."@@ -2271,6 +2267,7 @@"rows-sent": "Rows sent","lock-time": "Lock time","query-time": "Query time",- "attention-description": "Logging and analyzing slow queires for {versions}.\nBytebase will periodically sync slow query logs from instances."+ "attention-description": "Logging and analyzing slow queries for {versions}.\nBytebase will periodically sync slow query logs from instances.",+ "sync-job-started": "Sync jobs started. Please wait for the jobs to complete."}}diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 9bdbc506cc..47592662b7 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1768,10 +1768,6 @@"title": "自定义审批","desc": "为不同的任务配置安全风险等级和自定义审批流。"},- "bb-feature-slow-query": {- "title": "慢查询",- "desc": "记录与分析慢速的 SQL 查询。"- },"bb-feature-vcs-schema-write-back": {"title": "Schema 回写","desc": "当一个 Schema 变更完成后,可以将最新的 Schema 快照回写到 VCS。"@@ -2268,6 +2264,7 @@"rows-sent": "返回行数","lock-time": "持有锁时长","query-time": "执行时长",- "attention-description": "为 {versions} 记录和分析慢查询。\nBytebase 会定期从实例上同步慢查询日志。"+ "attention-description": "为 {versions} 记录和分析慢查询。\nBytebase 会定期从实例上同步慢查询日志。",+ "sync-job-started": "同步作业已启动。请等待同步完成。"}}diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex b6ef668690..451586f79b 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -40,7 +40,6 @@ export type FeatureType =| "bb.feature.sensitive-data"| "bb.feature.access-control"| "bb.feature.custom-approval"- | "bb.feature.slow-query"// Plugins| "bb.feature.plugin.openai";diff --git a/frontend/src/views/SettingWorkspaceSlowQuery.vue b/frontend/src/views/SettingWorkspaceSlowQuery.vueindex 796fb6618d..7d3d163cfa 100644--- a/frontend/src/views/SettingWorkspaceSlowQuery.vue+++ b/frontend/src/views/SettingWorkspaceSlowQuery.vue@@ -1,28 +1,9 @@<template><div class="w-full mt-4 space-y-4 text-sm">- <FeatureAttention- v-if="!hasSlowQueryFeature"- feature="bb.feature.slow-query"- :description="$t('subscription.features.bb-feature-slow-query.desc')"- />-- <SlowQuerySettings @show-feature-modal="showFeatureModal = true" />+ <SlowQuerySettings /></div>-- <FeatureModal- v-if="showFeatureModal"- feature="bb.feature.slow-query"- @cancel="showFeatureModal = false"- /></template><script lang="ts" setup>-import { ref } from "vue";--import { featureToRef } from "@/store";import { SlowQuerySettings } from "@/components/SlowQuery";--const showFeatureModal = ref(false);--const hasSlowQueryFeature = featureToRef("bb.feature.slow-query");</script>