Show rest errors in setup and use SingleSelect
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
<script setup>
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { TextInput, FormGroup, Checkbox, SingleSelect } from 'pankow';
|
||||
import { ENDPOINTS_OVH } from '../constants.js';
|
||||
|
||||
@@ -51,6 +55,16 @@ const tlsProviders = [
|
||||
{ name: 'Self-Signed', value: 'fallback' }, // this is not 'Custom' because we don't allow user to upload certs during setup phase
|
||||
];
|
||||
|
||||
const gandiTokenTypes = [
|
||||
{ name: t('domains.domainDialog.gandiTokenTypeApiKey'), value: 'ApiKey' },
|
||||
{ name: t('domains.domainDialog.gandiTokenTypePAT'), value: 'PAT' },
|
||||
];
|
||||
|
||||
const cloudflareTokenTypes = [
|
||||
{ name: t('domains.domainDialog.cloudflareTokenTypeGlobalApiKey'), value: 'GlobalApiKey' },
|
||||
{ name: t('domains.domainDialog.cloudflareTokenTypeApiToken'), value: 'ApiToken' },
|
||||
];
|
||||
|
||||
function needsPort80(dnsProvider, tlsProvider) {
|
||||
return ((dnsProvider === 'manual' || dnsProvider === 'noop' || dnsProvider === 'wildcard') &&
|
||||
(tlsProvider === 'letsencrypt-prod' || tlsProvider === 'letsencrypt-staging'));
|
||||
@@ -179,10 +193,7 @@ function onGcdnsFileInputChange(event) {
|
||||
<!-- Gandi -->
|
||||
<FormGroup v-if="provider === 'gandi'">
|
||||
<label for="gandiTokenTypeInput">{{ $t('domains.domainDialog.gandiTokenType') }}</label>
|
||||
<select id="gandiTokenTypeInput" v-model="dnsConfig.tokenType">
|
||||
<option value="ApiKey">{{ $t('domains.domainDialog.gandiTokenTypeApiKey') }}</option>
|
||||
<option value="PAT">{{ $t('domains.domainDialog.gandiTokenTypePAT') }}</option>
|
||||
</select>
|
||||
<SingleSelect v-model="dnsConfig.tokenType" :options="gandiTokenTypes" option-key="value" option-label="name" />
|
||||
</FormGroup>
|
||||
<FormGroup v-if="provider === 'gandi'">
|
||||
<label for="gandiApiKeyInput">{{ $t('domains.domainDialog.gandiApiKey') }}</label>
|
||||
@@ -216,9 +227,7 @@ function onGcdnsFileInputChange(event) {
|
||||
<!-- OVH -->
|
||||
<FormGroup v-if="provider === 'ovh'">
|
||||
<label for="ovhEndpointInput">{{ $t('domains.domainDialog.ovhEndpoint') }}</label>
|
||||
<select id="ovhEndpointInput" v-model="dnsConfig.endpoint">
|
||||
<option v-for="endpoint in ENDPOINTS_OVH" :value="endpoint.value" :key="endpoint.value">{{ endpoint.name }}</option>
|
||||
</select>
|
||||
<SingleSelect id="ovhEndpointInput" v-model="dnsConfig.endpoint" :options="ENDPOINTS_OVH" option-key="value" option-label="name" />
|
||||
</FormGroup>
|
||||
<FormGroup v-if="provider === 'ovh'">
|
||||
<label for="ovhConsumerKeyInput">{{ $t('domains.domainDialog.ovhConsumerKey') }}</label>
|
||||
@@ -246,10 +255,7 @@ function onGcdnsFileInputChange(event) {
|
||||
<!-- Cloudflare -->
|
||||
<FormGroup v-if="provider === 'cloudflare'">
|
||||
<label for="cloudflareTokenTypeInput">{{ $t('domains.domainDialog.cloudflareTokenType') }}</label>
|
||||
<select id="cloudflareTokenTypeInput" v-model="dnsConfig.tokenType">
|
||||
<option value="GlobalApiKey">{{ $t('domains.domainDialog.cloudflareTokenTypeGlobalApiKey') }}</option>
|
||||
<option value="ApiToken">{{ $t('domains.domainDialog.cloudflareTokenTypeApiToken') }}</option>
|
||||
</select>
|
||||
<SingleSelect v-model="dnsConfig.tokenType" :options="cloudflareTokenTypes" option-key="value" option-label="name" />
|
||||
</FormGroup>
|
||||
<FormGroup v-if="provider === 'cloudflare'">
|
||||
<label for="cloudflareTokenInput" v-show="dnsConfig.tokenType === 'GlobalApiKey'">{{ $t('domains.domainDialog.cloudflareTokenTypeGlobalApiKey') }}</label>
|
||||
|
||||
Reference in New Issue
Block a user