mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
update AppConfigPanel with TabForm
This commit is contained in:
parent
a19f57c6d6
commit
71f1e67289
1 changed files with 25 additions and 32 deletions
|
@ -1,41 +1,32 @@
|
||||||
<template>
|
<template>
|
||||||
<view-base :queries="queries" @queries-response="onQueriesResponse" skeleton="card-form-skeleton">
|
<view-base :queries="queries" @queries-response="onQueriesResponse" skeleton="card-form-skeleton">
|
||||||
<template v-if="panels" #default>
|
<b-card v-if="panels" no-body>
|
||||||
<b-tabs pills card vertical>
|
<b-tabs fill pills card>
|
||||||
<b-tab v-for="{ name, id: id_, sections, help, serverError } in panels"
|
<tab-form
|
||||||
:key="id_"
|
v-for="{ name, id: id_, sections, help, serverError } in panels" :key="id_"
|
||||||
:title="name"
|
v-bind="{ name, id: id_ + '-form', validation: $v.forms[id_], serverError }"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template v-if="help" #disclaimer>
|
||||||
<icon iname="wrench" /> {{ name }}
|
<div class="alert alert-info" v-html="help" />
|
||||||
</template>
|
</template>
|
||||||
<card-form
|
|
||||||
:key="id_"
|
|
||||||
:title="name" icon="wrench" title-tag="h2"
|
|
||||||
:validation="$v.forms[id_]" :id="id_ + '-form'" :server-error="serverError"
|
|
||||||
@submit.prevent="applyConfig(id_)"
|
|
||||||
>
|
|
||||||
<template v-if="help" #disclaimer>
|
|
||||||
<div class="alert alert-info" v-html="help" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-for="section in sections">
|
<template v-for="section in sections">
|
||||||
<div :key="section.id" class="mb-5" v-if="isVisible(section.visible, section)">
|
<div v-if="isVisible(section.visible, section)" :key="section.id" class="mb-5">
|
||||||
<b-card-title v-if="section.name" title-tag="h3">
|
<b-card-title v-if="section.name" title-tag="h3">
|
||||||
{{ section.name }} <small v-if="section.help">{{ section.help }}</small>
|
{{ section.name }} <small v-if="section.help">{{ section.help }}</small>
|
||||||
</b-card-title>
|
</b-card-title>
|
||||||
<template v-for="(field, fname) in section.fields">
|
|
||||||
<form-field :key="fname" v-model="forms[id_][fname]"
|
<template v-for="(field, fname) in section.fields">
|
||||||
:validation="$v.forms[id_][fname]"
|
<form-field
|
||||||
v-if="isVisible(field.visible, field)" v-bind="field"
|
v-if="isVisible(field.visible, field)" :key="fname"
|
||||||
/>
|
v-model="forms[id_][fname]" v-bind="field" :validation="$v.forms[id_][fname]"
|
||||||
</template>
|
/>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
</div>
|
||||||
</card-form>
|
</template>
|
||||||
</b-tab>
|
</tab-form>
|
||||||
</b-tabs>
|
</b-tabs>
|
||||||
</template>
|
</b-card>
|
||||||
|
|
||||||
<!-- if no config panel -->
|
<!-- if no config panel -->
|
||||||
<b-alert v-else-if="panels === null" variant="warning">
|
<b-alert v-else-if="panels === null" variant="warning">
|
||||||
|
@ -117,6 +108,7 @@ export default {
|
||||||
// This value should be updated magically when vuejs will detect isVisible changed
|
// This value should be updated magically when vuejs will detect isVisible changed
|
||||||
return field.isVisible
|
return field.isVisible
|
||||||
},
|
},
|
||||||
|
|
||||||
onQueriesResponse (data) {
|
onQueriesResponse (data) {
|
||||||
if (!data.panels || data.panels.length === 0) {
|
if (!data.panels || data.panels.length === 0) {
|
||||||
this.panels = null
|
this.panels = null
|
||||||
|
@ -182,6 +174,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
h3 {
|
h3 {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|
Loading…
Reference in a new issue