From 70377493ccb64c19c03b7182b626be3c054e4e62 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 30 Sep 2023 17:01:46 +0000 Subject: [PATCH] fix: base edit/create modals --- .../dashboard/settings/DataSources.vue | 4 +- .../settings/data-sources/CreateBase.vue | 4 +- .../settings/data-sources/EditBase.vue | 42 ++++++++++--------- packages/nc-gui/components/general/Modal.vue | 9 +++- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue index 40597835b9..1628edb602 100644 --- a/packages/nc-gui/components/dashboard/settings/DataSources.vue +++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue @@ -478,7 +478,7 @@ const isEditBaseModalOpen = computed({ - +
- +
- + {{ $t('activity.testDbConn') }} diff --git a/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue b/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue index 5b1f9df97b..691d0bb428 100644 --- a/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue +++ b/packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue @@ -43,6 +43,8 @@ const useForm = Form.useForm const testSuccess = ref(false) +const testingConnection = ref(false) + const form = ref() const { api } = useApi() @@ -51,6 +53,8 @@ const { $e } = useNuxtApp() const { t } = useI18n() +const editingBase = ref(false) + const formState = ref({ title: '', dataSource: { ...getDefaultConnectionConfig(ClientType.MYSQL) }, @@ -234,8 +238,6 @@ const editBase = async () => { } } -const isConnSuccess = ref(false) - const testConnection = async () => { try { await validate() @@ -247,6 +249,8 @@ const testConnection = async () => { $e('a:base:edit:extdb:test-connection', []) try { + testingConnection.value = true + if (formState.value.dataSource.client === ClientType.SQLITE) { testSuccess.value = true } else { @@ -263,7 +267,6 @@ const testConnection = async () => { if (result.code === 0) { testSuccess.value = true - isConnSuccess.value = true } else { testSuccess.value = false @@ -275,6 +278,8 @@ const testConnection = async () => { message.error(await extractSdkResponseErrorMsg(e)) } + + testingConnection.value = false } const handleImportURL = async () => { @@ -427,7 +432,7 @@ onMounted(async () => {
- + {{ $t('activity.useConnectionUrl') }}
@@ -519,7 +524,7 @@ onMounted(async () => { v-model:value="formState.inflection.inflectionTable" dropdown-class-name="nc-dropdown-inflection-table-name" > - {{ type }} + {{ tp }} @@ -528,7 +533,7 @@ onMounted(async () => { v-model:value="formState.inflection.inflectionColumn" dropdown-class-name="nc-dropdown-inflection-column-name" > - {{ type }} + {{ tp }} @@ -545,15 +550,23 @@ onMounted(async () => {
- + + {{ $t('activity.testDbConn') }} {{ $t('general.submit') }} @@ -569,7 +582,7 @@ onMounted(async () => { @@ -589,17 +602,6 @@ onMounted(async () => {
- - - -
-
{{ t('msg.info.dbConnected') }}
-
- {{ $t('general.cancel') }} - {{ $t('activity.okEditBase') }} -
-
-