|
|
@ -139,16 +139,10 @@ const validators = computed(() => { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const { validate, validateInfos } = useForm(formState.value, validators) |
|
|
|
const { validate, validateInfos, clearValidate } = useForm(formState.value, validators) |
|
|
|
|
|
|
|
|
|
|
|
const populateName = (v: string) => { |
|
|
|
|
|
|
|
if (selectedIntegration.value) return |
|
|
|
|
|
|
|
formState.value.dataSource.connection.database = `${v.trim()}_noco` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onClientChange = () => { |
|
|
|
const onClientChange = () => { |
|
|
|
formState.value.dataSource = { ...getDefaultConnectionConfig(formState.value.dataSource.client) } |
|
|
|
formState.value.dataSource = { ...getDefaultConnectionConfig(formState.value.dataSource.client) } |
|
|
|
populateName(formState.value.title) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const inflectionTypes = ['camelize', 'none'] |
|
|
|
const inflectionTypes = ['camelize', 'none'] |
|
|
@ -322,7 +316,6 @@ watch( |
|
|
|
onMounted(async () => { |
|
|
|
onMounted(async () => { |
|
|
|
await loadIntegrations(true, base.value?.id) |
|
|
|
await loadIntegrations(true, base.value?.id) |
|
|
|
formState.value.title = await generateUniqueName() |
|
|
|
formState.value.title = await generateUniqueName() |
|
|
|
populateName(formState.value.title) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
nextTick(() => { |
|
|
|
// todo: replace setTimeout and follow better approach |
|
|
|
// todo: replace setTimeout and follow better approach |
|
|
@ -435,10 +428,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
<div class="h-6 self-start flex items-center"> |
|
|
|
<div class="h-6 self-start flex items-center"> |
|
|
|
<GeneralIcon icon="server1" class="!text-green-700 !h-4 !w-4" /> |
|
|
|
<GeneralIcon icon="server1" class="!text-green-700 !h-4 !w-4" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex-1"> |
|
|
|
<div class="flex-1 text-base font-weight-700">Add Data Source</div> |
|
|
|
<div class="flex-1 text-base font-weight-700">New Source</div> |
|
|
|
|
|
|
|
<div class="text-xs text-gray-600">Connect with a new external data source, directly in real time.</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center gap-3"> |
|
|
|
<div class="flex items-center gap-3"> |
|
|
|
<div class="w-[15px] h-[15px] cursor-pointer" @dblclick="onEasterEgg"></div> |
|
|
|
<div class="w-[15px] h-[15px] cursor-pointer" @dblclick="onEasterEgg"></div> |
|
|
@ -471,7 +461,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
:disabled="!testSuccess" |
|
|
|
:disabled="!testSuccess || !selectedIntegration" |
|
|
|
:loading="creatingSource" |
|
|
|
:loading="creatingSource" |
|
|
|
class="nc-extdb-btn-submit" |
|
|
|
class="nc-extdb-btn-submit" |
|
|
|
@click="createSource" |
|
|
|
@click="createSource" |
|
|
@ -483,7 +473,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="h-[calc(100%_-_66px)] flex"> |
|
|
|
<div class="h-[calc(100%_-_58px)] flex"> |
|
|
|
<div class="nc-add-source-left-panel nc-scrollbar-thin"> |
|
|
|
<div class="nc-add-source-left-panel nc-scrollbar-thin"> |
|
|
|
<div class="create-source bg-white relative flex flex-col gap-2 w-full max-w-[768px]"> |
|
|
|
<div class="create-source bg-white relative flex flex-col gap-2 w-full max-w-[768px]"> |
|
|
|
<a-form |
|
|
|
<a-form |
|
|
@ -496,12 +486,11 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
class="flex flex-col gap-5.5" |
|
|
|
class="flex flex-col gap-5.5" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="nc-form-section"> |
|
|
|
<div class="nc-form-section"> |
|
|
|
<div class="nc-form-section-title">Source details</div> |
|
|
|
|
|
|
|
<div class="nc-form-section-body"> |
|
|
|
<div class="nc-form-section-body"> |
|
|
|
<a-row :gutter="24"> |
|
|
|
<a-row :gutter="24"> |
|
|
|
<a-col :span="12"> |
|
|
|
<a-col :span="12"> |
|
|
|
<a-form-item label="Source name" v-bind="validateInfos.title"> |
|
|
|
<a-form-item label="Data Source Name" v-bind="validateInfos.title"> |
|
|
|
<a-input v-model:value="formState.title" @input="populateName(formState.title)" /> |
|
|
|
<a-input v-model:value="formState.title" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
@ -560,10 +549,8 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-if="selectedIntegration"> |
|
|
|
<div class="nc-form-section"> |
|
|
|
<div class="nc-form-section"> |
|
|
|
<div class="flex items-center justify-between"> |
|
|
|
|
|
|
|
<div class="nc-form-section-title">Connection details</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="nc-form-section-body"> |
|
|
|
<div class="nc-form-section-body"> |
|
|
|
<!-- SQLite File --> |
|
|
|
<!-- SQLite File --> |
|
|
|
<template v-if="formState.dataSource.client === ClientType.SQLITE"> </template> |
|
|
|
<template v-if="formState.dataSource.client === ClientType.SQLITE"> </template> |
|
|
@ -658,11 +645,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
<template |
|
|
|
<template |
|
|
|
v-if="![ClientType.SQLITE, ClientType.SNOWFLAKE, ClientType.DATABRICKS].includes(formState.dataSource.client)" |
|
|
|
v-if="![ClientType.SQLITE, ClientType.SNOWFLAKE, ClientType.DATABRICKS].includes(formState.dataSource.client)" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-collapse |
|
|
|
<a-collapse v-model:active-key="advancedOptionsExpansionPanel" ghost class="nc-source-advanced-options !mt-4"> |
|
|
|
v-model:active-key="advancedOptionsExpansionPanel" |
|
|
|
|
|
|
|
ghost |
|
|
|
|
|
|
|
class="nc-source-advanced-options !mt-4" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<template #expandIcon="{ isActive }"> |
|
|
|
<template #expandIcon="{ isActive }"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
@ -715,7 +698,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
</a-collapse-panel> |
|
|
|
</a-collapse-panel> |
|
|
|
</a-collapse> |
|
|
|
</a-collapse> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
</template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<!-- For spacing --> |
|
|
|
<!-- For spacing --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -726,7 +709,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="nc-add-source-right-panel"> |
|
|
|
<div class="nc-add-source-right-panel"> |
|
|
|
<DashboardSettingsDataSourcesSupportedDocs/> |
|
|
|
<DashboardSettingsDataSourcesSupportedDocs /> |
|
|
|
<NcDivider /> |
|
|
|
<NcDivider /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -739,7 +722,7 @@ const filterIntegrationCategory = (c: IntegrationCategoryItemType) => [Integrati |
|
|
|
@apply p-6 flex-1 flex justify-center; |
|
|
|
@apply p-6 flex-1 flex justify-center; |
|
|
|
} |
|
|
|
} |
|
|
|
.nc-add-source-right-panel { |
|
|
|
.nc-add-source-right-panel { |
|
|
|
@apply p-5 w-[320px] border-l-1 border-gray-200 flex flex-col gap-4 bg-gray-50 rounded-br-2xl; |
|
|
|
@apply p-4 w-[320px] border-l-1 border-gray-200 flex flex-col gap-4 bg-gray-50 rounded-br-2xl; |
|
|
|
} |
|
|
|
} |
|
|
|
:deep(.ant-collapse-header) { |
|
|
|
:deep(.ant-collapse-header) { |
|
|
|
@apply !-mt-4 !p-0 flex items-center !cursor-default children:first:flex; |
|
|
|
@apply !-mt-4 !p-0 flex items-center !cursor-default children:first:flex; |
|
|
|