diff --git a/app/src/components/ConfigPanel.vue b/app/src/components/ConfigPanel.vue index be92c993..78d6d1a5 100644 --- a/app/src/components/ConfigPanel.vue +++ b/app/src/components/ConfigPanel.vue @@ -1,7 +1,7 @@ - - diff --git a/app/src/components/globals/FormField.vue b/app/src/components/globals/FormField.vue index d7be17e1..3dd85173 100644 --- a/app/src/components/globals/FormField.vue +++ b/app/src/components/globals/FormField.vue @@ -28,15 +28,18 @@ @@ -76,8 +79,8 @@ export default { if ('label' in attrs) { const defaultAttrs = { 'label-cols-md': 4, - 'label-cols-lg': 2, - 'label-class': 'font-weight-bold' + 'label-cols-lg': 3, + 'label-class': ['font-weight-bold', 'py-0'] } if (!('label-cols' in attrs)) { for (const attr in defaultAttrs) { diff --git a/app/src/components/globals/ReadOnlyField.vue b/app/src/components/globals/ReadOnlyField.vue new file mode 100644 index 00000000..107165b5 --- /dev/null +++ b/app/src/components/globals/ReadOnlyField.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/app/src/components/globals/formItems/ButtonItem.vue b/app/src/components/globals/formItems/ButtonItem.vue new file mode 100644 index 00000000..c09f3fb4 --- /dev/null +++ b/app/src/components/globals/formItems/ButtonItem.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/src/components/globals/formItems/DisplayTextItem.vue b/app/src/components/globals/formItems/DisplayTextItem.vue new file mode 100644 index 00000000..186ef1a7 --- /dev/null +++ b/app/src/components/globals/formItems/DisplayTextItem.vue @@ -0,0 +1,16 @@ + + + diff --git a/app/src/components/globals/formItems/FileItem.vue b/app/src/components/globals/formItems/FileItem.vue index 8dca3b7b..160c2fae 100644 --- a/app/src/components/globals/formItems/FileItem.vue +++ b/app/src/components/globals/formItems/FileItem.vue @@ -1,19 +1,24 @@ diff --git a/app/src/components/globals/formItems/MarkdownItem.vue b/app/src/components/globals/formItems/MarkdownItem.vue index 7fd4bacb..359c4e67 100644 --- a/app/src/components/globals/formItems/MarkdownItem.vue +++ b/app/src/components/globals/formItems/MarkdownItem.vue @@ -12,4 +12,3 @@ export default { } } - diff --git a/app/src/components/globals/formItems/ReadOnlyAlertItem.vue b/app/src/components/globals/formItems/ReadOnlyAlertItem.vue index bc63ff6d..ac1dac55 100644 --- a/app/src/components/globals/formItems/ReadOnlyAlertItem.vue +++ b/app/src/components/globals/formItems/ReadOnlyAlertItem.vue @@ -1,8 +1,10 @@ @@ -11,29 +13,23 @@ export default { name: 'ReadOnlyAlertItem', - data () { - const icons = { - success: 'thumbs-up', - info: 'info-circle', - warning: 'warning', - danger: 'times' - } - return { - icon_: (this.icon) ? this.icon : icons[this.type] - } - }, - props: { id: { type: String, default: null }, label: { type: String, default: null }, type: { type: String, default: null }, icon: { type: String, default: null } + }, + + computed: { + icon_ () { + const icons = { + success: 'thumbs-up', + info: 'info', + warning: 'exclamation', + danger: 'times' + } + return this.icon || icons[this.type] + } } } - - diff --git a/app/src/components/globals/formItems/TextAreaItem.vue b/app/src/components/globals/formItems/TextAreaItem.vue index b9224f10..95af03e8 100644 --- a/app/src/components/globals/formItems/TextAreaItem.vue +++ b/app/src/components/globals/formItems/TextAreaItem.vue @@ -1,6 +1,6 @@ @@ -41,23 +44,27 @@ export default { this.config = formatYunoHostConfigPanels(config) }, - async applyConfig (id_) { - const formatedData = await formatFormData( - this.config.forms[id_], - { removeEmpty: false, removeNull: true, multipart: false } - ) + 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 } + ) - api.put( - `domains/${this.name}/config`, - { key: id_, args: objectToParams(formatedData) }, - { key: 'domains.update_config', name: this.name } - ).then(() => { + call.then(() => { this.$refs.view.fetchQueries({ triggerLoading: true }) }).catch(err => { if (err.name !== 'APIBadRequestError') throw err - const panel = this.config.panels.find(({ id }) => id_ === id) + const panel = this.config.panels.find(panel => panel.id === id) if (err.data.name) { - this.config.errors[id_][err.data.name].message = err.message + this.config.errors[id][err.data.name].message = err.message } else this.$set(panel, 'serverError', err.message) }) } diff --git a/app/src/views/domain/DomainInfo.vue b/app/src/views/domain/DomainInfo.vue index ed7cb2ac..3f52e27a 100644 --- a/app/src/views/domain/DomainInfo.vue +++ b/app/src/views/domain/DomainInfo.vue @@ -32,13 +32,6 @@
- -

{{ $t('certificate_manage') }}

- - {{ $t('ssl_certificate') }} - -
-

{{ $t('domain_delete_longdesc') }}