Make AccessControl a component
This commit is contained in:
@@ -19,10 +19,19 @@
|
||||
<div class="description" v-html="description"></div>
|
||||
</div>
|
||||
<div v-else-if="step === STEP.INSTALL">
|
||||
<div>Now install {{ manifest.title }}</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<Button @click="step = STEP.DETAILS" icon="fa-solid fa-circle-down">TODO Submit</Button>
|
||||
<form @submit="submit()" autocomplete="off">
|
||||
<fieldset :disabled="busy">
|
||||
<input style="display: none;" type="submit" :disabled="!formValid" />
|
||||
|
||||
<FormGroup>
|
||||
<label for="location">{{ $t('appstore.installDialog.location') }}</label>
|
||||
<TextInput id="location" v-model="location" />
|
||||
</FormGroup>
|
||||
|
||||
<AccessControl v-model="accessRestriction"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
<Button @click="submit" icon="fa-solid fa-circle-down">Install {{ manifest.title }}</Button>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
@@ -32,9 +41,10 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, computed, useTemplateRef } from 'vue';
|
||||
import { Button, Dialog } from 'pankow';
|
||||
import { prettyDate, prettyFileSize } from 'pankow/utils';
|
||||
import { marked } from 'marked';
|
||||
import { Button, Dialog, FormGroup, TextInput } from 'pankow';
|
||||
import { prettyDate, prettyFileSize } from 'pankow/utils';
|
||||
import AccessControl from './AccessControl.vue';
|
||||
|
||||
const STEP = Object.freeze({
|
||||
DETAILS: Symbol('details'),
|
||||
@@ -47,10 +57,21 @@ const manifest = ref({});
|
||||
const step = ref(STEP.DETAILS);
|
||||
const dialog = useTemplateRef('dialogHandle');
|
||||
const description = computed(() => marked.parse(manifest.value.description || ''));
|
||||
const formValid = computed(() => {
|
||||
return true;
|
||||
});
|
||||
|
||||
// form data
|
||||
const location = ref('');
|
||||
const accessRestriction = ref(null);
|
||||
|
||||
function submit() {
|
||||
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(a) {
|
||||
step.value = STEP.DETAILS;
|
||||
step.value = STEP.INSTALL;
|
||||
app.value = a;
|
||||
manifest.value = a.manifest;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user