diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 2bca7711d..5dea872cb 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3630,6 +3630,8 @@ "ShardSvr 名称": "ShardSvr 名称", "回档至指定时间": "回档至指定时间", "待替换的主机 ": "待替换的主机", + "DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔": "DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔", + "不允许 *": "不允许 *", "确定启用集群": "确定启用集群", "确定禁用集群": "确定禁用集群", "确定删除集群": "确定删除集群", diff --git a/dbm-ui/frontend/src/views/db-manage/common/permission/components/mysql/create-rule/components/RuleSettings.vue b/dbm-ui/frontend/src/views/db-manage/common/permission/components/mysql/create-rule/components/RuleSettings.vue index 5362c5e42..41e4aa727 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/permission/components/mysql/create-rule/components/RuleSettings.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/permission/components/mysql/create-rule/components/RuleSettings.vue @@ -213,10 +213,10 @@ }, { trigger: 'blur', - message: t('DB名称支持通配符_如Data_区分大小写_多个使用英文逗号_分号或换行分隔'), + message: t('DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔'), validator: (value: string) => { const dbs = value.split(/[\n;,]/); - return _.every(dbs, (item) => (!item ? true : /^[_a-zA-Z0-9]/.test(item))); + return _.every(dbs, (item) => (!item ? true : /^[_a-zA-Z0-9]/.test(item) && !/\*/.test(value))); }, }, { diff --git a/dbm-ui/frontend/src/views/db-manage/common/permission/components/sqlserver/CreateRule.vue b/dbm-ui/frontend/src/views/db-manage/common/permission/components/sqlserver/CreateRule.vue index d9b4d1bbf..c1c32f67c 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/permission/components/sqlserver/CreateRule.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/permission/components/sqlserver/CreateRule.vue @@ -175,10 +175,10 @@ }, { trigger: 'blur', - message: t('DB名称支持通配符_如Data_区分大小写_多个使用英文逗号_分号或换行分隔'), + message: t('DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔'), validator: (value: string) => { const dbs = value.split(/[\n;,]/); - return _.every(dbs, (item) => (!item ? true : /^[_a-zA-Z0-9]/.test(item))); + return _.every(dbs, (item) => (!item ? true : /^[_a-zA-Z0-9]/.test(item) && !/\*/.test(value))); }, }, {