mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] New route for config panel
This commit is contained in:
parent
c9fb63603e
commit
ae66dc9111
1 changed files with 8 additions and 6 deletions
|
@ -64,7 +64,7 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
queries: [
|
queries: [
|
||||||
['GET', `apps/${this.id}/config-panel?full`],
|
['GET', `apps/${this.id}/config-panel?mode=full`],
|
||||||
['GET', { uri: 'domains' }],
|
['GET', { uri: 'domains' }],
|
||||||
['GET', { uri: 'domains/main', storeKey: 'main_domain' }],
|
['GET', { uri: 'domains/main', storeKey: 'main_domain' }],
|
||||||
['GET', { uri: 'users' }]
|
['GET', { uri: 'users' }]
|
||||||
|
@ -92,7 +92,7 @@ export default {
|
||||||
return evaluate(context, expression)
|
return evaluate(context, expression)
|
||||||
},
|
},
|
||||||
onQueriesResponse (data) {
|
onQueriesResponse (data) {
|
||||||
if (!data.panel || data.panel.length === 0) {
|
if (!data.panels || data.panels.length === 0) {
|
||||||
this.panels = null
|
this.panels = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -101,15 +101,17 @@ export default {
|
||||||
const validations_ = {}
|
const validations_ = {}
|
||||||
const errors_ = {}
|
const errors_ = {}
|
||||||
const panels_ = []
|
const panels_ = []
|
||||||
for (const { id, name, help, sections } of data.panel) {
|
for (const { id, name, help, sections } of data.panels) {
|
||||||
const panel_ = { id, name, sections: [] }
|
const panel_ = { id, sections: [] }
|
||||||
|
if (name) panel_.name = formatI18nField(name)
|
||||||
if (help) panel_.help = formatI18nField(help)
|
if (help) panel_.help = formatI18nField(help)
|
||||||
forms[id] = {}
|
forms[id] = {}
|
||||||
validations_[id] = {}
|
validations_[id] = {}
|
||||||
errors_[id] = {}
|
errors_[id] = {}
|
||||||
for (const { name, help, visibleIf, options } of sections) {
|
for (const { id_, name, help, visibleIf, options } of sections) {
|
||||||
const section_ = { name, visibleIf }
|
const section_ = { id: id_, visibleIf }
|
||||||
if (help) section_.help = formatI18nField(help)
|
if (help) section_.help = formatI18nField(help)
|
||||||
|
if (name) section_.name = formatI18nField(name)
|
||||||
const { form, fields, validations, errors } = formatYunoHostArguments(options)
|
const { form, fields, validations, errors } = formatYunoHostArguments(options)
|
||||||
Object.assign(forms[id], form)
|
Object.assign(forms[id], form)
|
||||||
Object.assign(validations_[id], validations)
|
Object.assign(validations_[id], validations)
|
||||||
|
|
Loading…
Add table
Reference in a new issue