From 60dbd75ce2bb814b12fc5cd7098aef79db2476c3 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 30 May 2024 17:09:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9C=E7=A8=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=A2=9E=E5=8A=A0=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=20(#5222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/database/mysql/remote/operate/index.vue | 2 +- .../src/views/database/postgresql/remote/operate/index.vue | 2 +- frontend/src/views/database/redis/command/index.vue | 6 +++++- frontend/src/views/database/redis/remote/operate/index.vue | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/database/mysql/remote/operate/index.vue b/frontend/src/views/database/mysql/remote/operate/index.vue index 0e7942dd2..ec794666a 100644 --- a/frontend/src/views/database/mysql/remote/operate/index.vue +++ b/frontend/src/views/database/mysql/remote/operate/index.vue @@ -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], diff --git a/frontend/src/views/database/postgresql/remote/operate/index.vue b/frontend/src/views/database/postgresql/remote/operate/index.vue index 2ece91c6f..66916c16a 100644 --- a/frontend/src/views/database/postgresql/remote/operate/index.vue +++ b/frontend/src/views/database/postgresql/remote/operate/index.vue @@ -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], diff --git a/frontend/src/views/database/redis/command/index.vue b/frontend/src/views/database/redis/command/index.vue index 90fdf80bb..c77552ca4 100644 --- a/frontend/src/views/database/redis/command/index.vue +++ b/frontend/src/views/database/redis/command/index.vue @@ -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(() => { diff --git a/frontend/src/views/database/redis/remote/operate/index.vue b/frontend/src/views/database/redis/remote/operate/index.vue index 173172f73..c1fcec269 100644 --- a/frontend/src/views/database/redis/remote/operate/index.vue +++ b/frontend/src/views/database/redis/remote/operate/index.vue @@ -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],