From 9aaf32e2bf6c1d096d0be1ff37d8fe88c241c7a8 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:39:04 +0800 Subject: [PATCH] fix: test connection status may display incorrectly #79 --- frontend/src/components/dialogs/ConnectionDialog.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/dialogs/ConnectionDialog.vue b/frontend/src/components/dialogs/ConnectionDialog.vue index e428ddd..d6718ff 100644 --- a/frontend/src/components/dialogs/ConnectionDialog.vue +++ b/frontend/src/components/dialogs/ConnectionDialog.vue @@ -120,8 +120,10 @@ const onLoadSentinelMasters = async () => { const tab = ref('general') const testing = ref(false) -const showTestResult = ref(false) -const testResult = ref('') +const testResult = ref(null) +const showTestResult = computed(() => { + return !testing.value && testResult.value != null +}) const predefineColors = ref(['', '#F75B52', '#F7A234', '#F7CE33', '#4ECF60', '#348CF7', '#B270D3']) const generalFormRef = ref(null) const advanceFormRef = ref(null) @@ -194,8 +196,7 @@ const resetForm = () => { generalForm.value = connectionStore.newDefaultConnection() generalFormRef.value?.restoreValidation() testing.value = false - showTestResult.value = false - testResult.value = '' + testResult.value = null tab.value = 'general' loadingSentinelMaster.value = false } @@ -226,7 +227,6 @@ const onTestConnection = async () => { result = e.message } finally { testing.value = false - showTestResult.value = true } if (!isEmpty(result)) { @@ -566,7 +566,7 @@ const onClose = () => {