fix: 远程数据库增加名称校验 (#5222)

This commit is contained in:
ssongliu 2024-05-30 17:09:15 +08:00 committed by GitHub
parent d5abd7ec3f
commit 60dbd75ce2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 4 deletions

View File

@ -178,7 +178,7 @@ const handleClose = () => {
};
const rules = reactive({
name: [Rules.requiredInput],
name: [Rules.simpleName, Rules.noSpace],
type: [Rules.requiredSelect],
version: [Rules.requiredSelect],
address: [Rules.ipV4V6OrDomain],

View File

@ -108,7 +108,7 @@ const handleClose = () => {
};
const rules = reactive({
name: [Rules.requiredInput],
name: [Rules.simpleName, Rules.noSpace],
type: [Rules.requiredSelect],
version: [Rules.requiredSelect],
address: [Rules.ipV4V6OrDomain],

View File

@ -83,7 +83,7 @@ import { saveRedisCommand, deleteRedisCommand, getRedisCommandPage } from '@/api
import { reactive, ref } from 'vue';
import i18n from '@/lang';
import DrawerHeader from '@/components/drawer-header/index.vue';
import { MsgSuccess } from '@/utils/message';
import { MsgError, MsgSuccess } from '@/utils/message';
const drawerVisible = ref();
const loading = ref();
@ -120,6 +120,10 @@ const handleCmdDelete = (index: number) => {
};
const handleCmdSave = async (row: any) => {
if (row.name === '' || row.command === '') {
MsgError(i18n.global.t('toolbox.device.hostHelper'));
return;
}
loading.value = true;
await saveRedisCommand(row)
.then(() => {

View File

@ -107,7 +107,7 @@ const handleClose = () => {
};
const rules = reactive({
name: [Rules.requiredInput],
name: [Rules.simpleName, Rules.noSpace],
type: [Rules.requiredSelect],
version: [Rules.requiredSelect],
address: [Rules.ipV4V6OrDomain],