Skip to content

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

chore: label setting improvement (#630)

Liu Ji42ffb5206982
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index 3beda65401..68be155035 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -169,6 +169,7 @@ common:
loading: Loading
copy: Copy
copied: Copied
+ manage: Manage
error-page:
go-back-home: Go back home
anomaly-center: Anomaly Center
@@ -1141,6 +1142,8 @@ label:
select-key: Select key...
select-value: Select value...
select-values: Select values...
+ setting:
+ description: A label is a key-value pair that helps you identify the tenant for a database. {link}.
oauth:
unknown-event: Unexpeted event type, OAuth failed.
subscription:
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index f109dc6a45..aa9e042b45 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -169,6 +169,7 @@ common:
loading: 加载中
copied: 已拷贝
copy: 拷贝
+ manage: 管理
error-page:
go-back-home: 回到主页
anomaly-center: 异常中心
@@ -1010,6 +1011,8 @@ label:
select-key: 选择 Key…
select-value: 选择值…
select-values: 选择值…
+ setting:
+ description: 标签是一组可用于标识数据库租户的键值对。{link}。
oauth:
unknown-event: 未知的事件类型,认证失败
subscription:
diff --git a/frontend/src/views/SettingWorkspaceLabel.vue b/frontend/src/views/SettingWorkspaceLabel.vue
index 346b7a23da..abee947bf2 100644
--- a/frontend/src/views/SettingWorkspaceLabel.vue
+++ b/frontend/src/views/SettingWorkspaceLabel.vue
@@ -1,6 +1,19 @@
<template>
- <div class="mt-2 space-y-6 divide-y divide-block-border">
- <div class="mt-4">
+ <div class="space-y-4">
+ <div class="textinfolabel mt-2">
+ <i18n-t keypath="label.setting.description">
+ <template #link>
+ <a
+ class="normal-link inline-flex items-center"
+ href="https://docs.bytebase.com/features/tenant-database-management#labels"
+ >
+ {{ $t("common.learn-more") }}
+ <heroicons-outline:external-link class="w-4 h-4 ml-1" />
+ </a>
+ </template>
+ </i18n-t>
+ </div>
+ <div>
<BBTable
class="mt-2"
:column-list="COLUMN_LIST"
@@ -9,7 +22,7 @@
:row-clickable="false"
>
<template #body="{ rowData: label }">
- <BBTableCell :left-padding="4" class="w-36 table-cell">
+ <BBTableCell :left-padding="4" class="w-36 table-cell capitalize">
<!-- will not capitalize label.key here due to it may be editable in the future -->
<!-- capitalizing editable things may be confusing -->
<!-- capitalizing only bb.prefixed things makes it inconsistent with others -->
@@ -28,11 +41,20 @@
<heroicons-solid:x class="w-3 h-3" />
</span>
</div>
- <AddLabelValue
- v-if="allowEdit"
- :label="label"
- @add="(v) => addValue(label, v)"
- />
+ <template v-if="allowEdit">
+ <router-link
+ v-if="label.key === 'bb.environment'"
+ :to="{ name: 'workspace.environment' }"
+ class="h-6 px-1 py-1 inline-flex items-center rounded bg-white border border-control-border hover:bg-control-bg-hover cursor-pointer"
+ >
+ {{ $t("common.manage") }}
+ </router-link>
+ <AddLabelValue
+ v-else
+ :label="label"
+ @add="(v) => addValue(label, v)"
+ />
+ </template>
</div>
</BBTableCell>
</template>