diff --git a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue index 86be8e2f04..9a97a092ad 100644 --- a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue +++ b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue @@ -38,6 +38,7 @@ import type { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; + import { getEnvironment } from '@/api/modules/api-test/common'; import { useI18n } from '@/hooks/useI18n'; import { EnvConfig } from '@/models/projectManagement/environmental'; @@ -109,14 +110,24 @@ watch( () => currentEnvConfig?.value, (config) => { - if (config) { - propsRes.value.data = cloneDeep(config.dataSources) as any[]; + if (config && config.id) { + // eslint-disable-next-line no-use-before-define + initEnvironment(config.id); } }, { immediate: true, } ); + async function initEnvironment(envId: string) { + try { + const res = await getEnvironment(envId); + propsRes.value.data = cloneDeep(res.dataSources) as any[]; + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } + } function searchDataSource() { if (keyword.value.trim() !== '') { diff --git a/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue b/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue index c24694d1f8..6ff1c72a75 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue @@ -33,7 +33,13 @@ :placeholder="t('project.environmental.database.namePlaceholder')" /> - +