|
|
@ -27,9 +27,11 @@ import { |
|
|
|
watch, |
|
|
|
watch, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ connectionType?: ClientType }>() |
|
|
|
const props = defineProps<{ open: boolean; connectionType?: ClientType }>() |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['sourceCreated', 'close']) |
|
|
|
const emit = defineEmits(['update:open', 'sourceCreated']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const vOpen = useVModel(props, 'open', emit) |
|
|
|
|
|
|
|
|
|
|
|
const connectionType = computed(() => props.connectionType ?? ClientType.MYSQL) |
|
|
|
const connectionType = computed(() => props.connectionType ?? ClientType.MYSQL) |
|
|
|
|
|
|
|
|
|
|
@ -284,7 +286,7 @@ const createSource = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
emit('sourceCreated') |
|
|
|
emit('sourceCreated') |
|
|
|
emit('close') |
|
|
|
vOpen.value = false |
|
|
|
creatingSource.value = false |
|
|
|
creatingSource.value = false |
|
|
|
} else if (status === JobStatus.FAILED) { |
|
|
|
} else if (status === JobStatus.FAILED) { |
|
|
|
message.error('Failed to create base') |
|
|
|
message.error('Failed to create base') |
|
|
@ -405,9 +407,21 @@ watch( |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ immediate: true }, |
|
|
|
{ immediate: true }, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
const toggleModal = (val: boolean) => { |
|
|
|
|
|
|
|
vOpen.value = val |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
|
|
|
|
<GeneralModal |
|
|
|
|
|
|
|
:visible="vOpen" |
|
|
|
|
|
|
|
:closable="!creatingSource" |
|
|
|
|
|
|
|
:keyboard="!creatingSource" |
|
|
|
|
|
|
|
:mask-closable="false" |
|
|
|
|
|
|
|
size="medium" |
|
|
|
|
|
|
|
@update:visible="toggleModal" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div class="py-6 px-8"> |
|
|
|
<div class="create-source bg-white relative flex flex-col justify-center gap-2 w-full"> |
|
|
|
<div class="create-source bg-white relative flex flex-col justify-center gap-2 w-full"> |
|
|
|
<h1 class="prose-xl font-bold self-start mb-4 flex items-center gap-2"> |
|
|
|
<h1 class="prose-xl font-bold self-start mb-4 flex items-center gap-2"> |
|
|
|
{{ $t('title.newBase') }} |
|
|
|
{{ $t('title.newBase') }} |
|
|
@ -415,7 +429,14 @@ watch( |
|
|
|
<span class="flex-grow"></span> |
|
|
|
<span class="flex-grow"></span> |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
|
|
|
|
|
|
|
|
<a-form ref="form" :model="formState" name="external-base-create-form" layout="horizontal" no-style :label-col="{ span: 8 }"> |
|
|
|
<a-form |
|
|
|
|
|
|
|
ref="form" |
|
|
|
|
|
|
|
:model="formState" |
|
|
|
|
|
|
|
name="external-base-create-form" |
|
|
|
|
|
|
|
layout="horizontal" |
|
|
|
|
|
|
|
no-style |
|
|
|
|
|
|
|
:label-col="{ span: 8 }" |
|
|
|
|
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="nc-scrollbar-md" |
|
|
|
class="nc-scrollbar-md" |
|
|
|
:style="{ |
|
|
|
:style="{ |
|
|
@ -451,7 +472,10 @@ watch( |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<!-- Host Address --> |
|
|
|
<!-- Host Address --> |
|
|
|
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']"> |
|
|
|
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']"> |
|
|
|
<a-input v-model:value="(formState.dataSource.connection as DefaultConnection).host" class="nc-extdb-host-address" /> |
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model:value="(formState.dataSource.connection as DefaultConnection).host" |
|
|
|
|
|
|
|
class="nc-extdb-host-address" |
|
|
|
|
|
|
|
/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Port Number --> |
|
|
|
<!-- Port Number --> |
|
|
@ -506,7 +530,11 @@ watch( |
|
|
|
<span>{{ $t('title.advancedParameters') }}</span> |
|
|
|
<span>{{ $t('title.advancedParameters') }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<a-form-item label="SSL mode"> |
|
|
|
<a-form-item label="SSL mode"> |
|
|
|
<a-select v-model:value="formState.sslUse" dropdown-class-name="nc-dropdown-ssl-mode" @select="onSSLModeChange"> |
|
|
|
<a-select |
|
|
|
|
|
|
|
v-model:value="formState.sslUse" |
|
|
|
|
|
|
|
dropdown-class-name="nc-dropdown-ssl-mode" |
|
|
|
|
|
|
|
@select="onSSLModeChange" |
|
|
|
|
|
|
|
> |
|
|
|
<a-select-option v-for="opt in Object.values(SSLUsage)" :key="opt" :value="opt">{{ opt }} </a-select-option> |
|
|
|
<a-select-option v-for="opt in Object.values(SSLUsage)" :key="opt" :value="opt">{{ opt }} </a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
@ -556,7 +584,11 @@ watch( |
|
|
|
<a-divider /> |
|
|
|
<a-divider /> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Extra connection parameters --> |
|
|
|
<!-- Extra connection parameters --> |
|
|
|
<a-form-item class="mb-2" :label="$t('labels.extraConnectionParameters')" v-bind="validateInfos.extraParameters"> |
|
|
|
<a-form-item |
|
|
|
|
|
|
|
class="mb-2" |
|
|
|
|
|
|
|
:label="$t('labels.extraConnectionParameters')" |
|
|
|
|
|
|
|
v-bind="validateInfos.extraParameters" |
|
|
|
|
|
|
|
> |
|
|
|
<a-card> |
|
|
|
<a-card> |
|
|
|
<div v-for="(item, index) of formState.extraParameters" :key="index"> |
|
|
|
<div v-for="(item, index) of formState.extraParameters" :key="index"> |
|
|
|
<div class="flex py-1 items-center gap-1"> |
|
|
|
<div class="flex py-1 items-center gap-1"> |
|
|
@ -662,6 +694,8 @@ watch( |
|
|
|
<a-input v-model:value="importURL" /> |
|
|
|
<a-input v-model:value="importURL" /> |
|
|
|
</a-modal> |
|
|
|
</a-modal> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</GeneralModal> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|