From 0ff7c418bd26ec58db026b1112deef527cdca749 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Tue, 7 Mar 2023 18:21:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/mysql/setting/slow-log/index.vue | 13 ++++++-- .../mysql/setting/variables/index.vue | 32 +++++++++---------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/frontend/src/views/database/mysql/setting/slow-log/index.vue b/frontend/src/views/database/mysql/setting/slow-log/index.vue index ab452cb55..a0618d721 100644 --- a/frontend/src/views/database/mysql/setting/slow-log/index.vue +++ b/frontend/src/views/database/mysql/setting/slow-log/index.vue @@ -2,9 +2,10 @@
{{ $t('database.longQueryTime') }}
- + + {{ $t('commons.rule.numberRange', [1, 600]) }}
{{ $t('database.isOn') }} { const confirmDialogRef = ref(); +const errTime = ref(); const isWatch = ref(); let timer: NodeJS.Timer | null = null; @@ -109,7 +111,14 @@ const onCancle = async () => { variables.slow_query_log = variables.slow_query_log === 'ON' ? 'OFF' : 'ON'; }; +const checkValid = () => { + errTime.value = !(variables.long_query_time > 0 && variables.long_query_time < 600); +}; + const onSave = async () => { + if (!(variables.long_query_time > 0 && variables.long_query_time < 600)) { + return; + } let param = [] as Array; if (variables.slow_query_log !== oldVariables.value.slow_query_log) { param.push({ param: 'slow_query_log', value: variables.slow_query_log }); diff --git a/frontend/src/views/database/mysql/setting/variables/index.vue b/frontend/src/views/database/mysql/setting/variables/index.vue index 59f1d235e..033c1af33 100644 --- a/frontend/src/views/database/mysql/setting/variables/index.vue +++ b/frontend/src/views/database/mysql/setting/variables/index.vue @@ -115,7 +115,7 @@