Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: unify the frontend style (#18451)
ecmadaod511fb4a25ee
diff --git a/frontend/src/components/IdentityProvider/IdentityProviderCreateWizard.vue b/frontend/src/components/IdentityProvider/IdentityProviderCreateWizard.vueindex ec364282b5..2f3a3ef7e2 100644--- a/frontend/src/components/IdentityProvider/IdentityProviderCreateWizard.vue+++ b/frontend/src/components/IdentityProvider/IdentityProviderCreateWizard.vue@@ -74,25 +74,13 @@</NRadioGroup><!-- External URL Warning -->- <BBAttention+ <MissingExternalURLAttentionv-if="- !externalUrl &&- (selectedType === IdentityProviderType.OAUTH2 ||- selectedType === IdentityProviderType.OIDC)- "+ selectedType === IdentityProviderType.OAUTH2 ||+ selectedType === IdentityProviderType.OIDC+ "class="mt-6"- type="error"- :title="$t('banner.external-url')"- :description="- $t('settings.general.workspace.external-url.description')- "- >- <template #action>- <NButton type="primary" @click="configureSetting">- {{ $t("common.configure-now") }}- </NButton>- </template>- </BBAttention>+ /></div></div>@@ -447,20 +435,14 @@ import {} from "naive-ui";import { computed, reactive, ref, watch } from "vue";import { useI18n } from "vue-i18n";-import { useRouter } from "vue-router";-import { BBAttention, BBTextField } from "@/bbkit";+import { BBTextField } from "@/bbkit";import { FeatureBadge } from "@/components/FeatureGuard";import LearnMoreLink from "@/components/LearnMoreLink.vue";import RequiredStar from "@/components/RequiredStar.vue";import { Drawer, DrawerContent } from "@/components/v2";+import { MissingExternalURLAttention } from "@/components/v2/Form";import ResourceIdField from "@/components/v2/Form/ResourceIdField.vue";-import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";-import {- hasFeature,- pushNotification,- useActuatorV1Store,- useSubscriptionV1Store,-} from "@/store";+import { hasFeature, pushNotification, useSubscriptionV1Store } from "@/store";import { useIdentityProviderStore } from "@/store/modules/idp";import { idpNamePrefix } from "@/store/modules/v1/common";import type {@@ -502,7 +484,6 @@ const emit = defineEmits<{}>();const { t } = useI18n();-const router = useRouter();const identityProviderStore = useIdentityProviderStore();const subscriptionStore = useSubscriptionV1Store();@@ -584,10 +565,6 @@ const idpToCreate = computed((): IdentityProvider => {return base;});-const externalUrl = computed(- () => useActuatorV1Store().serverInfo?.externalUrl ?? ""-);-const resourceId = computed(() => {return resourceIdField.value?.resourceId || resourceIdValue.value || "";});@@ -909,12 +886,6 @@ const handleTemplateSelect = (template: IdentityProviderTemplate) => {}};-const configureSetting = () => {- router.push({- name: SETTING_ROUTE_WORKSPACE_GENERAL,- });-};-const handlePrevStep = () => {if (currentStep.value > 1) {currentStep.value--;diff --git a/frontend/src/components/User/Settings/AADSyncDrawer.vue b/frontend/src/components/User/Settings/AADSyncDrawer.vueindex 860a4cb61b..b194c8ad49 100644--- a/frontend/src/components/User/Settings/AADSyncDrawer.vue+++ b/frontend/src/components/User/Settings/AADSyncDrawer.vue@@ -14,21 +14,7 @@/></div>- <BBAttention- v-if="!externalUrl"- class="w-full border-none"- type="error"- :title="$t('banner.external-url')"- :description="- $t('settings.general.workspace.external-url.description')- "- >- <template #action>- <NButton type="primary" @click="configureSetting">- {{ $t("common.configure-now") }}- </NButton>- </template>- </BBAttention>+ <MissingExternalURLAttention /><div class="flex flex-col gap-y-2"><div class="gap-x-2">@@ -128,11 +114,9 @@ import { ReplyIcon } from "lucide-vue-next";import { NButton, NInput, useDialog } from "naive-ui";import { computed, ref } from "vue";import { useI18n } from "vue-i18n";-import { useRouter } from "vue-router";-import { BBAttention } from "@/bbkit";import LearnMoreLink from "@/components/LearnMoreLink.vue";import { CopyButton, Drawer, DrawerContent } from "@/components/v2";-import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";+import { MissingExternalURLAttention } from "@/components/v2/Form";import {pushNotification,useActuatorV1Store,@@ -151,7 +135,6 @@ defineEmits<{const settingV1Store = useSettingV1Store();const actuatorStore = useActuatorV1Store();const { t } = useI18n();-const router = useRouter();const scimUrlFieldRef = ref<HTMLInputElement | null>(null);const scimTokenFieldRef = ref<HTMLInputElement | null>(null);const $dialog = useDialog();@@ -183,12 +166,6 @@ const handleSelect = (component: HTMLInputElement | null) => {component?.select();};-const configureSetting = () => {- router.push({- name: SETTING_ROUTE_WORKSPACE_GENERAL,- });-};-const resetToken = () => {$dialog.warning({title: t("common.warning"),diff --git a/frontend/src/components/User/Settings/CreateUserDrawer.vue b/frontend/src/components/User/Settings/CreateUserDrawer.vueindex f295586cb1..5e46168ba6 100644--- a/frontend/src/components/User/Settings/CreateUserDrawer.vue+++ b/frontend/src/components/User/Settings/CreateUserDrawer.vue@@ -6,7 +6,7 @@><template #default><div class="flex flex-col gap-y-6">- <div class="w-full mb-4 flex flex-col gap-y-2">+ <div class="w-full flex flex-col gap-y-2"><div class="flex items-center gap-x-1"><div class="text-sm font-medium">{{ $t("common.type") }}</div><a@@ -123,7 +123,7 @@<!-- Advanced Settings --><NCollapseTransition :show="state.wif.showAdvanced">- <div class="flex flex-col gap-y-4 mt-4 pt-4 border-t">+ <div class="flex flex-col gap-y-6 pt-6 border-t"><!-- Issuer URL --><div class="flex flex-col gap-y-2"><labeldiff --git a/frontend/src/components/v2/Form/MissingExternalURLAttention.vue b/frontend/src/components/v2/Form/MissingExternalURLAttention.vuenew file mode 100644index 0000000000..23b46ca240--- /dev/null+++ b/frontend/src/components/v2/Form/MissingExternalURLAttention.vue@@ -0,0 +1,39 @@++<template>+ <BBAttention+ v-if="+ !externalUrl+ "+ type="error"+ :title="$t('banner.external-url')"+ :description="+ $t('settings.general.workspace.external-url.description')+ "+ >+ <template #action>+ <NButton type="primary" @click="configureSetting">+ {{ $t("common.configure-now") }}+ </NButton>+ </template>+ </BBAttention>+</template>++<script lang="tsx" setup>+import { NButton } from "naive-ui";+import { computed } from "vue";+import { useRouter } from "vue-router";+import { BBAttention } from "@/bbkit";+import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";+import { useActuatorV1Store } from "@/store";++const router = useRouter();+const externalUrl = computed(+ () => useActuatorV1Store().serverInfo?.externalUrl ?? ""+);++const configureSetting = () => {+ router.push({+ name: SETTING_ROUTE_WORKSPACE_GENERAL,+ });+};+</script>\ No newline at end of filediff --git a/frontend/src/components/v2/Form/index.ts b/frontend/src/components/v2/Form/index.tsindex ebabb8d9ed..23504f90b8 100644--- a/frontend/src/components/v2/Form/index.ts+++ b/frontend/src/components/v2/Form/index.ts@@ -8,6 +8,7 @@ import SpinnerSelect from "./SpinnerSelect.vue";import SpinnerSwitch from "./SpinnerSwitch.vue";import StepTab from "./StepTab.vue";import Switch from "./Switch.vue";+import MissingExternalURLAttention from "./MissingExternalURLAttention.vue";export * from "./types";export {@@ -21,4 +22,5 @@ export {ResourceIdField,Switch,StepTab,+ MissingExternalURLAttention,};diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex f1df2c0124..4f007ac9db 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -531,15 +531,13 @@"title": "MCP Integration","description": "Connect AI assistants to Bytebase using the Model Context Protocol.","setup": {- "external-url-warning": "External URL is not configured.",- "configure-external-url": "Configure External URL in General Settings",- "add-to-config": "Add to your MCP configuration:",- "run-command": "Run this command:",+ "add-to-config": "Add to your MCP configuration",+ "run-command": "Run this command","oauth-note": "On first use, you'll be prompted to authorize access."},"first-prompt": {"title": "Your First Prompt",- "description": "Once connected, try asking your AI assistant:",+ "description": "Once connected, try asking your AI assistant","example": "List all projects in my Bytebase instance"}},diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 1635ae2fc4..aa48d8befb 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -531,15 +531,13 @@"title": "Integración MCP","description": "Conecte asistentes de IA a Bytebase usando el Model Context Protocol.","setup": {- "external-url-warning": "La URL externa no está configurada.",- "configure-external-url": "Configurar URL externa en Configuración general",- "add-to-config": "Agregar a su configuración MCP:",- "run-command": "Ejecute este comando:",+ "add-to-config": "Agregar a su configuración MCP",+ "run-command": "Ejecute este comando","oauth-note": "En el primer uso, se le pedirá que autorice el acceso."},"first-prompt": {"title": "Tu primer prompt",- "description": "Una vez conectado, intente preguntar a su asistente de IA:",+ "description": "Una vez conectado, intente preguntar a su asistente de IA","example": "Listar todos los proyectos en mi instancia de Bytebase"}},diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 2f5bdf7974..bda4017902 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -531,15 +531,13 @@"title": "MCP 統合","description": "Model Context Protocol を使用して、AI アシスタントを Bytebase に接続します。","setup": {- "external-url-warning": "外部 URL が設定されていません。",- "configure-external-url": "一般設定で外部 URL を設定する",- "add-to-config": "MCP 設定に追加:",- "run-command": "このコマンドを実行:",+ "add-to-config": "MCP 設定に追加",+ "run-command": "このコマンドを実行","oauth-note": "初回使用時に、アクセスの承認を求められます。"},"first-prompt": {"title": "最初のプロンプト",- "description": "接続後、AI アシスタントに聞いてみてください:",+ "description": "接続後、AI アシスタントに聞いてみてください","example": "Bytebase インスタンス内のすべてのプロジェクトをリストする"}},diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 417781c6f9..23b8992cb0 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -531,15 +531,13 @@"title": "Tích hợp MCP","description": "Kết nối trợ lý AI với Bytebase bằng Model Context Protocol.","setup": {- "external-url-warning": "URL bên ngoài chưa được cấu hình.",- "configure-external-url": "Cấu hình URL bên ngoài trong Cài đặt chung",- "add-to-config": "Thêm vào cấu hình MCP:",- "run-command": "Chạy lệnh này:",+ "add-to-config": "Thêm vào cấu hình MCP",+ "run-command": "Chạy lệnh này","oauth-note": "Khi sử dụng lần đầu, bạn sẽ được yêu cầu cấp quyền truy cập."},"first-prompt": {"title": "Prompt đầu tiên của bạn",- "description": "Sau khi kết nối, hãy thử hỏi trợ lý AI của bạn:",+ "description": "Sau khi kết nối, hãy thử hỏi trợ lý AI của bạn","example": "Liệt kê tất cả các dự án trong phiên bản Bytebase của tôi"}},diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex bcb18e4140..fefd02bd32 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -531,15 +531,13 @@"title": "MCP 集成","description": "使用模型上下文协议将 AI 助手连接到 Bytebase。","setup": {- "external-url-warning": "外部 URL 未配置。",- "configure-external-url": "在通用设置中配置外部 URL",- "add-to-config": "添加到您的 MCP 配置:",- "run-command": "运行此命令:",+ "add-to-config": "添加到您的 MCP 配置",+ "run-command": "运行此命令","oauth-note": "首次使用时,系统会提示您授权访问。"},"first-prompt": {"title": "您的第一个提示",- "description": "连接后,尝试向 AI 助手提问:",+ "description": "连接后,尝试向 AI 助手提问","example": "列出我的 Bytebase 实例中的所有项目"}},diff --git a/frontend/src/views/SettingWorkspaceMCP.vue b/frontend/src/views/SettingWorkspaceMCP.vueindex 956e29434d..c11338a705 100644--- a/frontend/src/views/SettingWorkspaceMCP.vue+++ b/frontend/src/views/SettingWorkspaceMCP.vue@@ -9,17 +9,7 @@</div><!-- Warning if external URL not configured -->- <NAlert v-if="!hasExternalUrl" type="warning" :bordered="false">- <template #header>- {{ $t("settings.mcp.setup.external-url-warning") }}- </template>- <router-link- :to="{ name: SETTING_ROUTE_WORKSPACE_GENERAL }"- class="normal-link"- >- {{ $t("settings.mcp.setup.configure-external-url") }}- </router-link>- </NAlert>+ <MissingExternalURLAttention /><!-- General JSON Config (always visible) --><div class="flex flex-col gap-y-3">@@ -27,21 +17,7 @@<span class="text-sm text-control-light">{{ $t("settings.mcp.setup.add-to-config") }}</span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyGeneralConfig"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>+ <CopyButton :content="generalConfig" /></div><NInputtype="textarea"@@ -53,161 +29,27 @@</div><!-- CLI Quick Commands Tabs -->- <div class="flex flex-col gap-y-3">+ <div class="flex flex-col gap-y-2"><NTabs type="line" animated><!-- Claude Code -->- <NTabPane name="claude-code" tab="Claude Code">- <div class="flex flex-col gap-y-3 pt-3">- <div class="flex items-center gap-x-2">- <span class="text-sm text-control-light">- {{ $t("settings.mcp.setup.run-command") }}- </span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyCliCommand('claudeCode')"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>- </div>- <NInput- :value="cliCommands.claudeCode"- readonly- class="font-mono text-sm"- />- </div>- </NTabPane>-- <!-- Codex -->- <NTabPane name="codex" tab="Codex">- <div class="flex flex-col gap-y-3 pt-3">+ <NTabPane+ v-for="tab in tabs"+ :key="tab.id"+ :name="tab.id"+ :tab="tab.title"+ >+ <div class="flex flex-col gap-y-2 pt-3"><div class="flex items-center gap-x-2"><span class="text-sm text-control-light">{{ $t("settings.mcp.setup.run-command") }}</span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyCliCommand('codex')"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>+ <CopyButton :content="tab.content" /></div><NInput- :value="cliCommands.codex"+ :value="tab.content"readonlyclass="font-mono text-sm"- />- </div>- </NTabPane>-- <!-- Copilot CLI -->- <NTabPane name="copilot-cli" tab="Copilot CLI">- <div class="flex flex-col gap-y-3 pt-3">- <div class="flex items-center gap-x-2">- <span class="text-sm text-control-light">- {{ $t("settings.mcp.setup.run-command") }}- </span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyCliCommand('copilotCli')"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>- </div>- <NInput- :value="cliCommands.copilotCli"- readonly- class="font-mono text-sm"- />- </div>- </NTabPane>-- <!-- Gemini CLI -->- <NTabPane name="gemini-cli" tab="Gemini CLI">- <div class="flex flex-col gap-y-3 pt-3">- <div class="flex items-center gap-x-2">- <span class="text-sm text-control-light">- {{ $t("settings.mcp.setup.run-command") }}- </span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyCliCommand('geminiCli')"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>- </div>- <NInput- :value="cliCommands.geminiCli"- readonly- class="font-mono text-sm"- />- </div>- </NTabPane>-- <!-- VS Code -->- <NTabPane name="vscode" tab="VS Code">- <div class="flex flex-col gap-y-3 pt-3">- <div class="flex items-center gap-x-2">- <span class="text-sm text-control-light">- {{ $t("settings.mcp.setup.add-to-config") }}- </span>- <NTooltip>- <template #trigger>- <NButton- quaternary- size="small"- :disabled="!hasExternalUrl"- @click="copyVSCodeConfig"- >- <template #icon>- <CopyIcon class="w-4 h-4" />- </template>- </NButton>- </template>- {{ $t("common.copy") }}- </NTooltip>- </div>- <NInput- type="textarea"- :value="vscodeConfig"- readonly- :autosize="{ minRows: 5, maxRows: 8 }"- class="font-mono text-sm"+ v-bind="tab.inputProps"/></div></NTabPane>@@ -218,14 +60,15 @@</div><!-- Your First Prompt -->- <div class="flex flex-col gap-y-2">- <h3 class="text-base font-medium">+ <div class="flex flex-col gap-y-1">+ <span class="text-sm text-control-light">{{ $t("settings.mcp.first-prompt.title") }}- </h3>- <p class="text-sm text-control-light">+ </span>+ <div class="flex items-center gap-x-2 text-sm text-control-light">{{ $t("settings.mcp.first-prompt.description") }}- </p>- <code class="text-sm bg-gray-100 px-3 py-2 rounded">+ <CopyButton :content="$t('settings.mcp.first-prompt.example')" />+ </div>+ <code class="mt-1 text-sm bg-gray-100 px-3 py-2 rounded">{{ $t("settings.mcp.first-prompt.example") }}</code></div>@@ -233,17 +76,12 @@</template><script lang="ts" setup>-import { useClipboard } from "@vueuse/core";-import { CopyIcon } from "lucide-vue-next";-import { NAlert, NButton, NInput, NTabPane, NTabs, NTooltip } from "naive-ui";+import { type InputProps, NInput, NTabPane, NTabs } from "naive-ui";import { computed } from "vue";-import { useI18n } from "vue-i18n";-import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";-import { pushNotification, useActuatorV1Store } from "@/store";+import { CopyButton, MissingExternalURLAttention } from "@/components/v2";+import { useActuatorV1Store } from "@/store";-const { t } = useI18n();const actuatorStore = useActuatorV1Store();-const { copy } = useClipboard();const hasExternalUrl = computed(() => {return !actuatorStore.needConfigureExternalUrl;@@ -289,30 +127,44 @@ const vscodeConfig = computed(() => {return JSON.stringify(config, null, 2);});-const copyGeneralConfig = async () => {- await copy(generalConfig.value);- pushNotification({- module: "bytebase",- style: "SUCCESS",- title: t("common.copied"),- });-};--const copyCliCommand = async (key: keyof typeof cliCommands.value) => {- await copy(cliCommands.value[key]);- pushNotification({- module: "bytebase",- style: "SUCCESS",- title: t("common.copied"),- });-};--const copyVSCodeConfig = async () => {- await copy(vscodeConfig.value);- pushNotification({- module: "bytebase",- style: "SUCCESS",- title: t("common.copied"),- });-};+const tabs = computed(+ (): {+ id: string;+ title: string;+ content: string;+ inputProps?: InputProps;+ }[] => {+ return [+ {+ id: "claude-code",+ title: "Claude Code",+ content: cliCommands.value.claudeCode,+ },+ {+ id: "codex",+ title: "Codex",+ content: cliCommands.value.codex,+ },+ {+ id: "copilot-cli",+ title: "Copilot CLI",+ content: cliCommands.value.copilotCli,+ },+ {+ id: "gemini-cli",+ title: "Gemini CLI",+ content: cliCommands.value.geminiCli,+ },+ {+ id: "vscode",+ title: "VS Code",+ content: vscodeConfig.value,+ inputProps: {+ type: "textarea",+ autosize: { minRows: 5, maxRows: 8 },+ },+ },+ ];+ }+);</script>