Skip to content

Commit

Permalink
fix(frontend): 授权规格访问DB规则调整 #8166
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 24761
  • Loading branch information
jinquantianxia committed Nov 25, 2024
1 parent 3227e5e commit 58aba46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3630,6 +3630,8 @@
"ShardSvr 名称": "ShardSvr 名称",
"回档至指定时间": "回档至指定时间",
"待替换的主机 ": "待替换的主机",
"DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔": "DB名称不允许 * ,支持通配符 %,如 Data%,区分大小写,多个对象请使用英文逗号、分号或换行分隔",
"不允许 *": "不允许 *",
"确定启用集群": "确定启用集群",
"确定禁用集群": "确定禁用集群",
"确定删除集群": "确定删除集群",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
},
},
{
Expand Down

0 comments on commit 58aba46

Please sign in to comment.