Update pankow which now has Dropdown replaced with SingleSelect
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { ref, computed, useTemplateRef, onMounted } from 'vue';
|
||||
import { marked } from 'marked';
|
||||
import { Button, Dialog, Dropdown, FormGroup, TextInput, InputGroup } from 'pankow';
|
||||
import { Button, Dialog, SingleSelect, FormGroup, TextInput, InputGroup } from 'pankow';
|
||||
import { prettyDate, prettyFileSize } from 'pankow/utils';
|
||||
import AccessControl from './AccessControl.vue';
|
||||
import PortBindings from './PortBindings.vue';
|
||||
@@ -53,19 +53,25 @@ function setStep(newStep) {
|
||||
const location = ref('');
|
||||
const accessRestrictionOption = ref(ACL_OPTIONS.ANY);
|
||||
const accessRestrictionAcl = ref({ users: [], groups: [] });
|
||||
const domain = ref({});
|
||||
const domain = ref('');
|
||||
const domainProvider = ref('');
|
||||
const tcpPorts = ref({});
|
||||
const udpPorts = ref({});
|
||||
const secondaryDomains = ref({});
|
||||
const upstreamUri = ref('');
|
||||
|
||||
function onDomainChange() {
|
||||
const tmp = domains.value.find(d => d.domain === domain.value);
|
||||
domainProvider.value = tmp ? tmp.provider : '';
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
formError.value = {};
|
||||
busy.value = true;
|
||||
|
||||
const config = {
|
||||
subdomain: location.value,
|
||||
domain: domain.value.domain,
|
||||
domain: domain.value,
|
||||
accessRestriction: accessRestrictionOption.value === ACL_OPTIONS.ANY ? null : (accessRestrictionOption.value === ACL_OPTIONS.NOSSO ? null : accessRestrictionAcl.value)
|
||||
};
|
||||
|
||||
@@ -127,7 +133,7 @@ onMounted(async () => {
|
||||
if (error) return console.error(error);
|
||||
|
||||
// preselect with dashboard domain
|
||||
domain.value = domains.value.find(d => d.domain === result.adminDomain) || domains.value[0];
|
||||
domain.value = (domains.value.find(d => d.domain === result.adminDomain) || domains.value[0]).domain;
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
@@ -193,19 +199,19 @@ defineExpose({
|
||||
<label for="location">{{ $t('appstore.installDialog.location') }}</label>
|
||||
<InputGroup>
|
||||
<TextInput id="location" ref="locationInput" v-model="location" style="flex-grow: 1"/>
|
||||
<Dropdown v-model="domain" :options="domains" option-label="domain" />
|
||||
<SingleSelect v-model="domain" :options="domains" option-label="domain" option-key="domain" @select="onDomainChange()"/>
|
||||
</InputGroup>
|
||||
<div class="text-danger" v-if="formError.location">{{ formError.location }}</div>
|
||||
</FormGroup>
|
||||
|
||||
<p class="text-small text-warning" v-show="domain.provider === 'noop' || domain.provider === 'manual'" v-html="$t('appstore.installDialog.manualWarning', { location: ((location ? location + '.' : '') + domain.domain) })"></p>
|
||||
<p class="text-small text-warning" v-show="domainProvider === 'noop' || domainProvider === 'manual'" v-html="$t('appstore.installDialog.manualWarning', { location: ((location ? location + '.' : '') + domain) })"></p>
|
||||
|
||||
<FormGroup v-for="(port, key) in secondaryDomains" :key="key">
|
||||
<label :for="'secondaryDomainInput' + key">{{ port.title }}</label>
|
||||
<small>{{ port.description }}</small>
|
||||
<InputGroup>
|
||||
<TextInput :id="'secondaryDomainInput' + key" v-model="port.value" :placeholder="$t('appstore.installDialog.locationPlaceholder')" style="flex-grow: 1"/>
|
||||
<Dropdown v-model="port.domain" :options="domains" option-label="domain" option-key="domain" />
|
||||
<SingleSelect v-model="port.domain" :options="domains" option-label="domain" option-key="domain" />
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user