mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
domain: remove no longer used DomainConfig view
This commit is contained in:
parent
c2a62c6796
commit
47fa27b085
2 changed files with 0 additions and 102 deletions
|
@ -158,35 +158,6 @@ const routes = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
// no need for name here, only children are visited
|
|
||||||
path: '/domains/:name/config',
|
|
||||||
component: () => import(/* webpackChunkName: "views/domain/config" */ '@/views/domain/DomainConfig'),
|
|
||||||
props: true,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'domain-config',
|
|
||||||
path: ':tabId?',
|
|
||||||
component: () => import(/* webpackChunkName: "components/configPanel" */ '@/components/ConfigPanel'),
|
|
||||||
props: true,
|
|
||||||
meta: {
|
|
||||||
routerParams: ['name'], // Override router key params to avoid view recreation at tab change.
|
|
||||||
args: { trad: 'config' },
|
|
||||||
breadcrumb: ['domain-list', 'domain-info', 'domain-config']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'domain-dns',
|
|
||||||
path: '/domains/:name/dns',
|
|
||||||
component: () => import(/* webpackChunkName: "views/domain/dns" */ '@/views/domain/DomainDns'),
|
|
||||||
props: true,
|
|
||||||
meta: {
|
|
||||||
args: { trad: 'dns' },
|
|
||||||
breadcrumb: ['domain-list', 'domain-info', 'domain-dns']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/* ───────╮
|
/* ───────╮
|
||||||
│ APPS │
|
│ APPS │
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
<template>
|
|
||||||
<view-base
|
|
||||||
:queries="queries" @queries-response="onQueriesResponse"
|
|
||||||
ref="view" skeleton="card-form-skeleton"
|
|
||||||
>
|
|
||||||
<config-panels
|
|
||||||
v-if="config.panels" v-bind="config"
|
|
||||||
@submit="onConfigSubmit"
|
|
||||||
/>
|
|
||||||
</view-base>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import api, { objectToParams } from '@/api'
|
|
||||||
import {
|
|
||||||
formatFormData,
|
|
||||||
formatYunoHostConfigPanels
|
|
||||||
} from '@/helpers/yunohostArguments'
|
|
||||||
import ConfigPanels from '@/components/ConfigPanels'
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DomainConfig',
|
|
||||||
|
|
||||||
components: {
|
|
||||||
ConfigPanels
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
name: { type: String, required: true }
|
|
||||||
},
|
|
||||||
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
queries: [
|
|
||||||
['GET', `domains/${this.name}/config?full`]
|
|
||||||
],
|
|
||||||
config: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
onQueriesResponse (config) {
|
|
||||||
this.config = formatYunoHostConfigPanels(config)
|
|
||||||
},
|
|
||||||
|
|
||||||
async onConfigSubmit ({ id, form, action, name }) {
|
|
||||||
const args = await formatFormData(form, { removeEmpty: false, removeNull: true })
|
|
||||||
const call = action
|
|
||||||
? api.put(
|
|
||||||
`domain/${this.name}/actions/${action}`,
|
|
||||||
{ args: objectToParams(args) },
|
|
||||||
{ key: 'domains.' + name, name: this.name }
|
|
||||||
)
|
|
||||||
: api.put(
|
|
||||||
`domains/${this.name}/config/${id}`,
|
|
||||||
{ args: objectToParams(args) },
|
|
||||||
{ key: 'domains.update_config', id, name: this.name }
|
|
||||||
)
|
|
||||||
|
|
||||||
call.then(() => {
|
|
||||||
this.$refs.view.fetchQueries({ triggerLoading: true })
|
|
||||||
}).catch(err => {
|
|
||||||
if (err.name !== 'APIBadRequestError') throw err
|
|
||||||
const panel = this.config.panels.find(panel => panel.id === id)
|
|
||||||
if (err.data.name) {
|
|
||||||
this.config.errors[id][err.data.name].message = err.message
|
|
||||||
} else this.$set(panel, 'serverError', err.message)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
Loading…
Add table
Reference in a new issue