mirror of https://github.com/1Panel-dev/1Panel
fix: 远程数据库增加名称校验 (#5222)
parent
d5abd7ec3f
commit
60dbd75ce2
|
@ -178,7 +178,7 @@ const handleClose = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
name: [Rules.requiredInput],
|
name: [Rules.simpleName, Rules.noSpace],
|
||||||
type: [Rules.requiredSelect],
|
type: [Rules.requiredSelect],
|
||||||
version: [Rules.requiredSelect],
|
version: [Rules.requiredSelect],
|
||||||
address: [Rules.ipV4V6OrDomain],
|
address: [Rules.ipV4V6OrDomain],
|
||||||
|
|
|
@ -108,7 +108,7 @@ const handleClose = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
name: [Rules.requiredInput],
|
name: [Rules.simpleName, Rules.noSpace],
|
||||||
type: [Rules.requiredSelect],
|
type: [Rules.requiredSelect],
|
||||||
version: [Rules.requiredSelect],
|
version: [Rules.requiredSelect],
|
||||||
address: [Rules.ipV4V6OrDomain],
|
address: [Rules.ipV4V6OrDomain],
|
||||||
|
|
|
@ -83,7 +83,7 @@ import { saveRedisCommand, deleteRedisCommand, getRedisCommandPage } from '@/api
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||||
|
|
||||||
const drawerVisible = ref();
|
const drawerVisible = ref();
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
|
@ -120,6 +120,10 @@ const handleCmdDelete = (index: number) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCmdSave = async (row: any) => {
|
const handleCmdSave = async (row: any) => {
|
||||||
|
if (row.name === '' || row.command === '') {
|
||||||
|
MsgError(i18n.global.t('toolbox.device.hostHelper'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await saveRedisCommand(row)
|
await saveRedisCommand(row)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
@ -107,7 +107,7 @@ const handleClose = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
name: [Rules.requiredInput],
|
name: [Rules.simpleName, Rules.noSpace],
|
||||||
type: [Rules.requiredSelect],
|
type: [Rules.requiredSelect],
|
||||||
version: [Rules.requiredSelect],
|
version: [Rules.requiredSelect],
|
||||||
address: [Rules.ipV4V6OrDomain],
|
address: [Rules.ipV4V6OrDomain],
|
||||||
|
|
Loading…
Reference in New Issue