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: rename "Protected" environment to "Production"/"生产环境" (#4651)
Liu Jid58999621e36
diff --git a/frontend/src/components/AccessControl/AddRuleForm.vue b/frontend/src/components/AccessControl/AddRuleForm.vueindex 863c6b5fe6..ca771b897a 100644--- a/frontend/src/components/AccessControl/AddRuleForm.vue+++ b/frontend/src/components/AccessControl/AddRuleForm.vue@@ -49,17 +49,17 @@class="w-full flex flex-col py-6 justify-start items-center"><i18n-t- keypath="settings.access-control.no-database-in-protected-environment"+ keypath="settings.access-control.no-database-in-production-environment"tag="div"class="text-sm leading-6 text-gray-500 max-w-[15rem] whitespace-pre-wrap text-center">- <template #protected_environment>+ <template #production_environment><ahref="https://www.bytebase.com/docs/administration/database-access-control"class="normal-link lowercase"- target="__BLANK"+ target="_BLANK">- {{ $t("environment.protected-environment") }}+ {{ $t("environment.production-environment") }}<heroicons-outline:external-linkclass="inline-block w-4 h-4 -mt-0.5 mr-0.5"/>diff --git a/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue b/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vueindex 866b4c5efe..a940b6eef1 100644--- a/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue+++ b/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue@@ -45,7 +45,7 @@"/><div>{{ environment.name }}</div>- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="w-4 h-4 -ml-1":environment="environment"/>diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vueindex bf59f3ccdf..afefd8952a 100644--- a/frontend/src/components/DatabaseTable.vue+++ b/frontend/src/components/DatabaseTable.vue@@ -106,7 +106,7 @@<div v-if="showEnvironmentColumn" class="bb-grid-cell"><div class="flex items-center">{{ environmentName(database.instance.environment) }}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="ml-1":environment="database.instance.environment"/>diff --git a/frontend/src/components/Environment/ProtectedEnvironmentIcon.vue b/frontend/src/components/Environment/ProductionEnvironmentIcon.vuesimilarity index 92%rename from frontend/src/components/Environment/ProtectedEnvironmentIcon.vuerename to frontend/src/components/Environment/ProductionEnvironmentIcon.vueindex b8f7291aa9..6f97934344 100644--- a/frontend/src/components/Environment/ProtectedEnvironmentIcon.vue+++ b/frontend/src/components/Environment/ProductionEnvironmentIcon.vue@@ -15,7 +15,7 @@/></template>- <span>{{ $t("environment.protected") }}</span>+ <span>{{ $t("environment.production-environment") }}</span></NTooltip></template>@@ -25,7 +25,7 @@ import { Environment } from "@/types";import { featureToRef } from "@/store";export default defineComponent({- name: "ProtectedEnvironmentIcon",+ name: "ProductionEnvironmentIcon",inheritAttrs: false,props: {environment: {diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vueindex 396fea967b..8ad338b44a 100644--- a/frontend/src/components/EnvironmentForm.vue+++ b/frontend/src/components/EnvironmentForm.vue@@ -48,7 +48,7 @@/><div><div class="textlabel">- {{ $t("policy.environment-tier.mark-env-as-protected") }}+ {{ $t("policy.environment-tier.mark-env-as-production") }}</div></div></div>diff --git a/frontend/src/components/EnvironmentSelect.vue b/frontend/src/components/EnvironmentSelect.vueindex 008e6b7459..31d849715e 100644--- a/frontend/src/components/EnvironmentSelect.vue+++ b/frontend/src/components/EnvironmentSelect.vue@@ -10,7 +10,7 @@<template #menuItem="{ item: environment }"><div class="flex items-center">{{ environmentName(environment) }}- <ProtectedEnvironmentIcon class="ml-1" :environment="environment" />+ <ProductionEnvironmentIcon class="ml-1" :environment="environment" /></div></template></BBSelect>diff --git a/frontend/src/components/InstanceTable.vue b/frontend/src/components/InstanceTable.vueindex 34c499e95a..770791fde9 100644--- a/frontend/src/components/InstanceTable.vue+++ b/frontend/src/components/InstanceTable.vue@@ -15,7 +15,7 @@<div class="bb-grid-cell"><div class="flex items-center gap-x-1">{{ environmentNameFromId(instance.environment.id) }}- <ProtectedEnvironmentIcon :environment="instance.environment" />+ <ProductionEnvironmentIcon :environment="instance.environment" /></div></div><div class="bb-grid-cell">@@ -44,12 +44,12 @@ import { urlfy, instanceSlug, environmentName } from "@/utils";import { EnvironmentId, Instance } from "@/types";import { useEnvironmentStore } from "@/store";import InstanceEngineIcon from "./InstanceEngineIcon.vue";-import ProtectedEnvironmentIcon from "./Environment/ProtectedEnvironmentIcon.vue";+import ProductionEnvironmentIcon from "./Environment/ProductionEnvironmentIcon.vue";import { BBGridColumn } from "@/bbkit";export default defineComponent({name: "InstanceTable",- components: { InstanceEngineIcon, ProtectedEnvironmentIcon },+ components: { InstanceEngineIcon, ProductionEnvironmentIcon },props: {instanceList: {required: true,diff --git a/frontend/src/components/Issue/IssueSidebar.vue b/frontend/src/components/Issue/IssueSidebar.vueindex d63ea29820..6d4f7e9572 100644--- a/frontend/src/components/Issue/IssueSidebar.vue+++ b/frontend/src/components/Issue/IssueSidebar.vue@@ -195,7 +195,7 @@class="col-span-2 text-sm font-medium text-main hover:underline flex items-center">{{ environmentName(environment) }}- <ProtectedEnvironmentIcon class="ml-1" :environment="environment" />+ <ProductionEnvironmentIcon class="ml-1" :environment="environment" /></router-link><template v-for="label in visibleLabelList" :key="label.key">@@ -325,7 +325,7 @@ import {useIssueLogic,useAllowProjectOwnerToApprove,} from "./logic";-import ProtectedEnvironmentIcon from "@/components/Environment/ProtectedEnvironmentIcon.vue";+import ProductionEnvironmentIcon from "@/components/Environment/ProductionEnvironmentIcon.vue";dayjs.extend(isSameOrAfter);diff --git a/frontend/src/components/Issue/IssueTable.vue b/frontend/src/components/Issue/IssueTable.vueindex 243951dd26..9a66c1690e 100644--- a/frontend/src/components/Issue/IssueTable.vue+++ b/frontend/src/components/Issue/IssueTable.vue@@ -84,7 +84,7 @@<BBTableCell class="table-cell w-36"><div class="flex items-center">{{ activeEnvironmentName(issue) }}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="ml-1":environment="activeEnvironment(issue.pipeline)"/>@@ -147,7 +147,7 @@ import {stageSlug,activeTaskInStage,} from "@/utils";-import ProtectedEnvironmentIcon from "../Environment/ProtectedEnvironmentIcon.vue";+import ProductionEnvironmentIcon from "../Environment/ProductionEnvironmentIcon.vue";import { useElementVisibilityInScrollParent } from "@/composables/useElementVisibilityInScrollParent";import { useCurrentUser } from "@/store";diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 3a73a73fd9..d13b21ff74 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -457,12 +457,12 @@"remove-sensitive-column-tips": "Expose this column?"},"access-control": {- "description": "Allow developers to execute queries for the following databases in the protected environments from SQL Editor. {link}",+ "description": "Allow developers to execute queries for the following databases in the production environments from SQL Editor. {link}","add-rule": "Add rule","remove-policy-tips": "Remove this rule?","inactive-rules": "Inactive rules",- "inactive-rules-description": "These rules are inactive because environment is not protected.",- "no-database-in-protected-environment": "Make sure there are databases in the {protected_environment}."+ "inactive-rules-description": "These rules are inactive because environment is not production.",+ "no-database-in-production-environment": "Make sure there are databases in the {production_environment}."},"release": {"new-version-available": "New version is available",@@ -793,12 +793,11 @@"create": "Create Environment","restore": "Restore this environment","successfully-updated-environment": "Successfully updated environment '{name}'.",- "protected": "Protected","disable-auto-backup": {"self": "Disable database automatic backup","content": "Disabling automatic backup policy is not applied retroactively.\nAre you sure about applying to all databases in this environment?"},- "protected-environment": "Protected environment"+ "production-environment": "Production environment"},"quick-start": {"view-an-issue": "View an issue",@@ -880,7 +879,7 @@"environment-tier": {"name": "Environment tier","description": "The environment will appear differently from other environments.{newline}Developers cannot execute any query on this environment's databases \nusing SQL Editor by default. ",- "mark-env-as-protected": "Mark as protected environment"+ "mark-env-as-production": "Mark as production environment"}},"change-history": {@@ -1455,7 +1454,7 @@"sql-review-result": "SQL review result","alter-table": "Alter table","visualize-explain": "Visualize Explain",- "sql-execute-in-protected-environment": "The SQL statement below will be executed in a protected environment.",+ "sql-execute-in-production-environment": "The SQL statement below will be executed in a production environment.","rows-upper-limit": "reached the limit of query results","tab-mode": {"readonly": "Read-only",@@ -1624,7 +1623,7 @@},"bb-feature-environment-tier-policy": {"title": "Environment tier",- "desc": "Mark environment as protected."+ "desc": "Mark environment as production."},"bb-feature-sensitive-data": {"title": "Sensitive data",@@ -1632,7 +1631,7 @@},"bb-feature-access-control": {"title": "Access control",- "desc": "Change query permission for databases in the protected environments."+ "desc": "Change query permission for databases in the production environments."},"bb-feature-lgtm": {"title": "LGTM check",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 68c4deac94..3019787837 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -457,12 +457,12 @@"remove-sensitive-column-tips": "不再对此列数据脱敏?"},"access-control": {- "description": "允许开发者通过 SQL 编辑器对下列受保护环境中的数据库执行查询。{link}",+ "description": "允许开发者通过 SQL 编辑器对下列生产环境中的数据库执行查询。{link}","add-rule": "添加规则","remove-policy-tips": "删除这条规则?","inactive-rules": "无效的规则",- "inactive-rules-description": "这些规则不再生效,因为所属环境不是受保护的。",- "no-database-in-protected-environment": "请确保{protected_environment}中有数据库。"+ "inactive-rules-description": "这些规则不再生效,因为不属于生产环境。",+ "no-database-in-production-environment": "请确保{production_environment}中有数据库。"},"release": {"new-version-available": "有新版本可更新",@@ -793,12 +793,11 @@"create": "创建环境","restore": "恢复此环境","successfully-updated-environment": "环境'{name}'更新成功",- "protected": "受保护的","disable-auto-backup": {"self": "禁用数据库自动备份","content": "禁用自动备份策略仅对新添加的数据库生效。\n是否要将该设置应用到当前环境下的所有数据库?"},- "protected-environment": "受保护的环境"+ "production-environment": "生产环境"},"quick-start": {"view-an-issue": "查看工单",@@ -880,7 +879,7 @@"environment-tier": {"name": "环境级别","description": "使该环境在显示上不同于其他环境。{newline}默认情况下,开发者无法通过 SQL 编辑器在这个环境的数据库上执行任何查询。",- "mark-env-as-protected": "标记为受保护的环境"+ "mark-env-as-production": "标记为生产环境"}},"change-history": {@@ -1455,7 +1454,7 @@"sql-review-result": "SQL 检查结果","alter-table": "修改表结构","visualize-explain": "可视化 Explain",- "sql-execute-in-protected-environment": "下面的 SQL 语句将会在受保护的环境中执行。",+ "sql-execute-in-production-environment": "下面的 SQL 语句将会在生产环境中执行。","rows-upper-limit": "到达查询结果条数上限","tab-mode": {"readonly": "只读",@@ -1625,7 +1624,7 @@},"bb-feature-environment-tier-policy": {"title": "环境级别",- "desc": "「环境级别」可以将环境标记为受保护的"+ "desc": "「环境级别」可以将环境标记为生产环境"},"bb-feature-sensitive-data": {"title": "敏感数据",@@ -1633,7 +1632,7 @@},"bb-feature-access-control": {"title": "访问控制",- "desc": "可以修改受保护的环境中的数据库的查询权限。"+ "desc": "可以修改生产环境中的数据库的查询权限。"},"bb-feature-lgtm": {"title": "LGTM 检查",diff --git a/frontend/src/utils/policy.ts b/frontend/src/utils/policy.tsindex 9c0d5a5c22..ba34057731 100644--- a/frontend/src/utils/policy.ts+++ b/frontend/src/utils/policy.ts@@ -20,7 +20,7 @@ export const isInstanceAccessible = (instance: Instance, user: Principal) => {return true;}- // See if the instance is in a protected environment+ // See if the instance is in a production environmentconst { environment } = instance;if (environment.tier === "UNPROTECTED") {return true;diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vueindex 26e368c350..46ad4bbba0 100644--- a/frontend/src/views/DatabaseDetail.vue+++ b/frontend/src/views/DatabaseDetail.vue@@ -19,7 +19,7 @@>{{ database.name }}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIcon:environment="database.instance.environment"tooltipclass="w-5 h-5"diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vueindex 3ce0f1995a..0f0be583f3 100644--- a/frontend/src/views/EnvironmentDashboard.vue+++ b/frontend/src/views/EnvironmentDashboard.vue@@ -12,7 +12,7 @@><div class="flex items-center">{{ item.title }}- <ProtectedEnvironmentIcon :environment="item.data!" class="ml-1" />+ <ProductionEnvironmentIcon :environment="item.data!" class="ml-1" /></div></template>@@ -98,7 +98,7 @@ import {useEnvironmentStore,useEnvironmentList,} from "@/store";-import ProtectedEnvironmentIcon from "../components/Environment/ProtectedEnvironmentIcon.vue";+import ProductionEnvironmentIcon from "../components/Environment/ProductionEnvironmentIcon.vue";const DEFAULT_NEW_ENVIRONMENT: EnvironmentCreate = {name: "New Env",diff --git a/frontend/src/views/SettingWorkspaceAccessControl.vue b/frontend/src/views/SettingWorkspaceAccessControl.vueindex da6df630a3..3e70151e21 100644--- a/frontend/src/views/SettingWorkspaceAccessControl.vue+++ b/frontend/src/views/SettingWorkspaceAccessControl.vue@@ -52,7 +52,7 @@{{environmentName(databaseOfPolicy(policy).instance.environment)}}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="ml-1":environment="databaseOfPolicy(policy).instance.environment"/>@@ -128,7 +128,7 @@{{environmentName(databaseOfPolicy(policy).instance.environment)}}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="ml-1":environment="databaseOfPolicy(policy).instance.environment"/>diff --git a/frontend/src/views/SettingWorkspaceSensitiveData.vue b/frontend/src/views/SettingWorkspaceSensitiveData.vueindex 2885b3ec4d..354c6caf8e 100644--- a/frontend/src/views/SettingWorkspaceSensitiveData.vue+++ b/frontend/src/views/SettingWorkspaceSensitiveData.vue@@ -28,7 +28,7 @@</div><div class="bb-grid-cell">{{ environmentName(item.database.instance.environment) }}- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIconclass="ml-1 w-4 h-4":environment="item.database.instance.environment"/>diff --git a/frontend/src/views/sql-editor/AsidePanel/TreeNode/InstancePrefix.vue b/frontend/src/views/sql-editor/AsidePanel/TreeNode/InstancePrefix.vueindex b37757e62b..fe7bae33f4 100644--- a/frontend/src/views/sql-editor/AsidePanel/TreeNode/InstancePrefix.vue+++ b/frontend/src/views/sql-editor/AsidePanel/TreeNode/InstancePrefix.vue@@ -3,7 +3,7 @@<span class="text-sm -mr-0.5" :class="[!disabled && 'text-gray-500']">(</span>- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIcon:environment="instance.environment"class="w-4 h-4 text-inherit"/>diff --git a/frontend/src/views/sql-editor/EditorCommon/ConnectionPathBar.vue b/frontend/src/views/sql-editor/EditorCommon/ConnectionPathBar.vueindex 2357a5c405..0ef4128d0a 100644--- a/frontend/src/views/sql-editor/EditorCommon/ConnectionPathBar.vue+++ b/frontend/src/views/sql-editor/EditorCommon/ConnectionPathBar.vue@@ -2,7 +2,7 @@<divv-if="!tabStore.isDisconnected"class="w-full py-1 px-4 flex justify-between items-center border-b"- :class="[isProtectedEnvironment && 'bg-yellow-50']"+ :class="[isProductionEnvironment && 'bg-yellow-50']"><div class="flex justify-start items-center"><NPopover v-if="showReadonlyDatasourceWarning" trigger="hover">@@ -10,7 +10,7 @@<heroicons-outline:exclamationclass="h-6 w-6 flex-shrink-0 mr-2":class="[- isProtectedEnvironment ? 'text-yellow-500' : 'text-yellow-500',+ isProductionEnvironment ? 'text-yellow-500' : 'text-yellow-500',]"/></template>@@ -31,10 +31,10 @@class="flex items-center"><span class="">{{ selectedInstance.environment.name }}</span>- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIcon:environment="selectedInstance.environment"class="ml-1"- :class="[isProtectedEnvironment && '~!text-yellow-700']"+ :class="[isProductionEnvironment && '~!text-yellow-700']"/></div><div@@ -64,9 +64,9 @@</label></div>- <div :class="[isProtectedEnvironment ? 'text-yellow-700' : 'text-main']">- <template v-if="isProtectedEnvironment">- {{ $t("sql-editor.sql-execute-in-protected-environment") }}+ <div :class="[isProductionEnvironment ? 'text-yellow-700' : 'text-main']">+ <template v-if="isProductionEnvironment">+ {{ $t("sql-editor.sql-execute-in-production-environment") }}</template></div></div>@@ -92,7 +92,7 @@ const selectedInstance = useInstanceById(const selectedDatabase = useDatabaseById(computed(() => connection.value.databaseId));-const isProtectedEnvironment = computed(() => {+const isProductionEnvironment = computed(() => {const instance = selectedInstance.value;return instance.environment.tier === "PROTECTED";});diff --git a/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue b/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vueindex c7a3b5c1a1..6dbb6540d5 100644--- a/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue+++ b/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue@@ -2,7 +2,7 @@<label class="flex items-center text-sm h-6 ml-0.5 whitespace-nowrap"><template v-if="instance.id !== UNKNOWN_ID"><span>{{ instance.environment.name }}</span>- <ProtectedEnvironmentIcon+ <ProductionEnvironmentIcon:environment="instance.environment"class="w-4 h-4 ml-0.5 !text-current"/>@@ -24,7 +24,7 @@ import { computed, PropType } from "vue";import type { TabInfo } from "@/types";import { UNKNOWN_ID } from "@/types";import { useDatabaseById, useInstanceById } from "@/store";-import ProtectedEnvironmentIcon from "@/components/Environment/ProtectedEnvironmentIcon.vue";+import ProductionEnvironmentIcon from "@/components/Environment/ProductionEnvironmentIcon.vue";const props = defineProps({tab: {