mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
fix: 远程数据库增加名称校验 (#5222)
This commit is contained in:
parent
d5abd7ec3f
commit
60dbd75ce2
@ -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],
|
||||
|
@ -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],
|
||||
|
@ -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(() => {
|
||||
|
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user