Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): mysql、spider库表校验规则调整 #6595 #6720

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading