Skip to content

Commit

Permalink
feat(frontend): mongodb访问db支持分隔符 TencentBlueKing#8407
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 26011
  • Loading branch information
JustaCattt committed Dec 5, 2024
1 parent c627604 commit 9f8c9f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3706,9 +3706,9 @@
"不允许使用特殊账号名称n": "不允许使用特殊账号名称 {n}",
"非 admin": "非 admin",
"请输入访问DB名_以字母开头_支持字母_数字_下划线": "请输入访问DB名,以字母开头,支持字母,数字,下划线",
"您输入的访问 DB 名不符合要求_访问 DB 名应以字母开头_且仅包含字母_数字和下划线": "您输入的访问 DB 名不符合要求。访问 DB 名应以字母开头,且仅包含字母、数字和下划线",
"访问 DB 不能为空": "访问 DB 不能为空",
"访问 DB 名不允许为 admin": "访问 DB 名不允许为 admin",
"删除规则后将不能恢复,请谨慎操作": "删除规则后将不能恢复,请谨慎操作",
"请输入访问DB名_以字母开头_支持字母_数字_下划线_多个使用英文逗号_分号或换行分隔": "请输入访问DB名,以字母开头,支持字母,数字,下划线。多个使用英文逗号、分号或换行分隔",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
security_type: passwordParam.value,
password: getEncyptPassword(),
});
tippyInstance.show();
emits('verifyResult', isStrength);
return isStrength;
};
Expand Down Expand Up @@ -291,7 +290,7 @@
* 密码框获取焦点
*/
const handlePasswordFocus = () => {
debounceVerifyPassword();
tippyInstance.show();
};
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@

<script setup lang="ts">
import { Message } from 'bkui-vue';
import _ from 'lodash';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';

Expand Down Expand Up @@ -247,8 +248,11 @@
{
required: true,
trigger: 'blur',
message: t('您输入的访问 DB 名不符合要求_访问 DB 名应以字母开头_且仅包含字母_数字和下划线'),
validator: (value: string) => /^[A-Za-z][A-Za-z0-9_]*$/.test(value),
message: t('请输入访问DB名_以字母开头_支持字母_数字_下划线_多个使用英文逗号_分号或换行分隔'),
validator: (value: string) => {
const dbs = value.split(/[\n;,]/);
return _.every(dbs, (item) => (!item ? true : /^[_a-zA-Z0-9]/.test(item) && !/\*/.test(value)));
},
},
],
};
Expand Down

0 comments on commit 9f8c9f4

Please sign in to comment.