Skip to content

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

chore: always expose database name template (#2873)

tianzhouca61041fc8fa
diff --git a/frontend/src/components/ProjectDeploymentConfigPanel.vue b/frontend/src/components/ProjectDeploymentConfigPanel.vue
index d41f0230b9..5353337ba1 100644
--- a/frontend/src/components/ProjectDeploymentConfigPanel.vue
+++ b/frontend/src/components/ProjectDeploymentConfigPanel.vue
@@ -1,40 +1,38 @@
<template>
<div class="max-w-[60rem] mx-auto">
- <template v-if="project.dbNameTemplate">
- <div class="text-lg font-medium leading-7 text-main">
- {{ $t("project.db-name-template") }}
- </div>
- <div class="textinfolabel">
- <i18n-t keypath="label.db-name-template-tips">
- <template #placeholder>
- <!-- prettier-ignore -->
- <code v-pre class="text-xs font-mono bg-control-bg">{{DB_NAME}}</code>
- </template>
- <template #link>
- <a
- class="normal-link inline-flex items-center"
- href="https://bytebase.com/docs/tenant-database-management#database-name-template?source=console"
- target="__BLANK"
- >
- {{ $t("common.learn-more") }}
- <heroicons-outline:external-link class="w-4 h-4 ml-1" />
- </a>
- </template>
- </i18n-t>
- </div>
- <div class="mt-3">
- <input
- disabled
- type="text"
- class="textfield w-full"
- :value="project.dbNameTemplate"
- />
- </div>
+ <div class="text-lg font-medium leading-7 text-main">
+ {{ $t("project.db-name-template") }}
+ </div>
+ <div class="textinfolabel">
+ <i18n-t keypath="label.db-name-template-tips">
+ <template #placeholder>
+ <!-- prettier-ignore -->
+ <code v-pre class="text-xs font-mono bg-control-bg">{{DB_NAME}}</code>
+ </template>
+ <template #link>
+ <a
+ class="normal-link inline-flex items-center"
+ href="https://bytebase.com/docs/tenant-database-management#database-name-template?source=console"
+ target="__BLANK"
+ >
+ {{ $t("common.learn-more") }}
+ <heroicons-outline:external-link class="w-4 h-4 ml-1" />
+ </a>
+ </template>
+ </i18n-t>
+ </div>
+ <div class="mt-3">
+ <input
+ disabled
+ type="text"
+ class="textfield w-full"
+ :value="project.dbNameTemplate"
+ />
+ </div>
- <div class="text-lg font-medium leading-7 text-main mt-6 border-t pt-4">
- {{ $t("common.deployment-config") }}
- </div>
- </template>
+ <div class="text-lg font-medium leading-7 text-main mt-6 border-t pt-4">
+ {{ $t("common.deployment-config") }}
+ </div>
<BBAttention
v-if="state.deployment?.id === EMPTY_ID"
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 0d083ac306..6bca32cbab 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1326,7 +1326,7 @@
"setting": {
"description": "A label is a key-value pair that helps you identify the tenant for a database. {link}."
},
- "db-name-template-tips": "The name of all tenant databases should follow a naming template. The databases with the same {placeholder} will be the same group. {link}.",
+ "db-name-template-tips": "All tenant databases should follow this naming template. The databases with the same {placeholder} will be in the same group. Empty value means each database forms its own group. {link}.",
"confirm-change": "Are you sure to change '{label}' ?",
"parsed-from-template": "Parsed from {name} by template {template}.",
"cannot-transfer-template-not-match": "Database '{name}' cannot be transferred to this project. Since its name doesn't match the template {template}."
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index d485efc9df..1f1da319cd 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1326,7 +1326,7 @@
"setting": {
"description": "标签是一组可用于标识数据库租户的键值对。{link}。"
},
- "db-name-template-tips": "所有租户数据库名字遵循命名模版。有着相同 {placeholder} 的数据库会被分成一组。{link}。",
+ "db-name-template-tips": "所有租户数据库名字遵循命名模版。有着相同 {placeholder} 的数据库会被分成一组。空值代表每一个数据库自成一组。{link}。",
"confirm-change": "您确定要修改 '{label}' 吗?",
"parsed-from-template": "从 {name} 中依据模板 {template} 解析得出",
"cannot-transfer-template-not-match": "数据库 '{name}' 无法转移到这个项目,因为它的名称不符合模板 {template}。"