|
|
@ -1,5 +1,5 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { Action } from '../../../composables/useAccountSetupStore' |
|
|
|
import {Action} from '../../../composables/useAccountSetupStore' |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ |
|
|
|
const props = defineProps<{ |
|
|
|
id: string |
|
|
|
id: string |
|
|
@ -29,7 +29,7 @@ const pluginTypeMap = { |
|
|
|
Password: FormBuilderInputType.Password, |
|
|
|
Password: FormBuilderInputType.Password, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { formState, validate } = useProvideFormBuilderHelper({ |
|
|
|
const {formState, validate} = useProvideFormBuilderHelper({ |
|
|
|
formSchema: [ |
|
|
|
formSchema: [ |
|
|
|
...plugin.value.formDetails.items.map((item) => ({ |
|
|
|
...plugin.value.formDetails.items.map((item) => ({ |
|
|
|
type: pluginTypeMap[item.type] || FormBuilderInputType.Input, |
|
|
|
type: pluginTypeMap[item.type] || FormBuilderInputType.Input, |
|
|
@ -50,6 +50,7 @@ const doAction = async (action: Action) => { |
|
|
|
await validate() |
|
|
|
await validate() |
|
|
|
pluginFormData.value = formState.value |
|
|
|
pluginFormData.value = formState.value |
|
|
|
await saveSettings() |
|
|
|
await saveSettings() |
|
|
|
|
|
|
|
vOpen.value = false |
|
|
|
break |
|
|
|
break |
|
|
|
case Action.Test: |
|
|
|
case Action.Test: |
|
|
|
await validate() |
|
|
|
await validate() |
|
|
@ -66,20 +67,21 @@ const doAction = async (action: Action) => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<NcModal :visible="vOpen" centered width="70rem" wrap-class-name="nc-modal-create-source" @keydown.esc="vOpen = false"> |
|
|
|
<NcModal :visible="vOpen" centered width="70rem" wrap-class-name="nc-modal-create-source" |
|
|
|
|
|
|
|
@keydown.esc="vOpen = false"> |
|
|
|
<div class="flex-1 flex flex-col max-h-full min-h-400px"> |
|
|
|
<div class="flex-1 flex flex-col max-h-full min-h-400px"> |
|
|
|
<div class="px-4 pb-4 w-full flex items-center gap-3 border-b-1 border-gray-200"> |
|
|
|
<div class="px-4 pb-4 w-full flex items-center gap-3 border-b-1 border-gray-200"> |
|
|
|
<GeneralIcon icon="arrowLeft" class="cursor-pointer flex-none text-[20px]" @click="vOpen = false" /> |
|
|
|
<GeneralIcon icon="arrowLeft" class="cursor-pointer flex-none text-[20px]" @click="vOpen = false"/> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-if="plugin.logo" |
|
|
|
v-if="plugin.logo" |
|
|
|
class="mr-1 flex items-center justify-center" |
|
|
|
class="mr-1 flex items-center justify-center" |
|
|
|
:class="[plugin.title === 'SES' ? 'p-2 bg-[#242f3e]' : '']" |
|
|
|
:class="[plugin.title === 'SES' ? 'p-2 bg-[#242f3e]' : '']" |
|
|
|
> |
|
|
|
> |
|
|
|
<img :alt="plugin.title || 'plugin'" :src="plugin.logo" class="h-3" /> |
|
|
|
<img :alt="plugin.title || 'plugin'" :src="plugin.logo" class="h-3"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<span class="font-semibold text-lg">{{ plugin.formDetails.title }}</span> |
|
|
|
<span class="font-semibold text-lg">{{ plugin.formDetails.title }}</span> |
|
|
|
<div class="flex-grow" /> |
|
|
|
<div class="flex-grow"/> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex gap-2"> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
@ -92,17 +94,17 @@ const doAction = async (action: Action) => { |
|
|
|
:disabled="!!loadingAction" |
|
|
|
:disabled="!!loadingAction" |
|
|
|
@click="doAction(action.key)" |
|
|
|
@click="doAction(action.key)" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ action.label }} |
|
|
|
{{ action.label === 'Save' ? 'Save configuration' : action.label }} |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="h-[calc(100%_-_58px)] flex py-4 flex-col"> |
|
|
|
<div class="h-[calc(100%_-_58px)] flex py-4 flex-col"> |
|
|
|
<div v-if="isLoading || !plugin" class="flex flex-row w-full justify-center items-center h-52"> |
|
|
|
<div v-if="isLoading || !plugin" class="flex flex-row w-full justify-center items-center h-52"> |
|
|
|
<a-spin size="large" /> |
|
|
|
<a-spin size="large"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-else class="flex"> |
|
|
|
<div v-else class="flex"> |
|
|
|
<NcFormBuilder class="w-500px mx-auto" /> |
|
|
|
<NcFormBuilder class="w-500px mx-auto"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|