Skip to content

Commit

Permalink
feat(frontend): mysql、spider库表校验规则调整 #6595
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 17574
  • Loading branch information
jinquantianxia committed Sep 6, 2024
1 parent 5f50cec commit 8b3fc02
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
:single="single"
@change="handleValueChange">
<template #tip>
<p>{{ t('%:匹配任意长度字符串,如 a%, 不允许独立使用') }}</p>
<p>{{ t('?: 匹配任意单一字符,如 a%?%d') }}</p>
<p>{{ t('* :专门指代 ALL 语义, 只能独立使用') }}</p>
<p>{{ t('注:含通配符的单元格仅支持输入单个对象') }}</p>
<p>{{ t('按Enter或失焦可完成内容输入') }}</p>
<p>{{ t('粘贴多个对象可用换行,空格或;,|分隔') }}</p>
<p>{{ t('不允许输入系统库和特殊库,如mysql、sys 等') }}</p>
<p>{{ t('DB名、表名不允许为空,忽略DB名、忽略表名不允许为 *') }}</p>
<p>{{ t('支持 %(指代任意长度字符串), ?(指代单个字符串), *(指代全部)三个通配符') }}</p>
<p>{{ t('单元格可同时输入多个对象,使用换行,空格或;,|分隔,按 Enter 或失焦完成内容输入') }}</p>
<p>{{ t('包含通配符时, 每一单元格只允许输入单个对象。% ? 不能独立使用, * 只能单独使用') }}</p>
</template>
</TagInput>
</template>
Expand Down
4 changes: 2 additions & 2 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3487,8 +3487,8 @@
"数量(台)": "数量(台)",
"统计视图": "统计视图",
"主机列表": "主机列表",
"库表只能由[0-9],[a-z],[A-Z],-,_ 组成,支持* % ?通配符,最大35字符": "库表只能由[0-9],[a-z],[A-Z],-,_ 组成,支持* % ?通配符,最大35字符",
"不允许填写系统库": "不允许填写系统库",
"库表名支持数字、字母、中划线、下划线,最大35字符": "库表名支持数字、字母、中划线、下划线,最大35字符",
"不允许输入系统库和特殊库": "不允许输入系统库和特殊库",
"不能以stage_truncate开头或dba_rollback结尾": "不能以 stage_truncate 开头或 dba_rollback 结尾",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
},
{
validator: (value: string[]) => _.every(value, (item) => /^[-_a-zA-Z0-9*?%]{0,35}$/.test(item)),
message: t('库表只能由[0-9],[a-z],[A-Z],-,_ 组成,支持* % ?通配符,最大35字符'),
message: t('库表名支持数字、字母、中划线、下划线,最大35字符'),
},
{
validator: (value: string[]) => _.every(value, (item) => !systemDbNames.includes(item)),
message: t('不允许填写系统库'),
message: t('不允许输入系统库和特殊库'),
},
{
validator: (value: string[]) =>
Expand Down
4 changes: 2 additions & 2 deletions dbm-ui/frontend/src/views/mysql/common/edit-field/DbName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@
},
{
validator: (value: string[]) => _.every(value, (item) => /^[-_a-zA-Z0-9*?%]{0,35}$/.test(item)),
message: t('库表只能由[0-9],[a-z],[A-Z],-,_ 组成,支持* % ?通配符,最大35字符'),
message: t('库表名支持数字、字母、中划线、下划线,最大35字符'),
},
{
validator: (value: string[]) => _.every(value, (item) => !systemDbNames.includes(item)),
message: t('不允许填写系统库'),
message: t('不允许输入系统库和特殊库'),
},
{
validator: (value: string[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
{
validator: (value: string[]) => _.every(value, (item) => /^[-_a-zA-Z0-9*?%]{0,35}$/.test(item)),
message: t('库表只能由[0-9],[a-z],[A-Z],-,_ 组成,支持* % ?通配符,最大35字符'),
message: t('库表名支持数字、字母、中划线、下划线,最大35字符'),
},
{
validator: (value: string[]) => {
Expand Down

0 comments on commit 8b3fc02

Please sign in to comment.