diff --git a/client/components/prompt/Confirm.vue b/client/components/prompt/Confirm.vue index 032190cf..4e11ce45 100644 --- a/client/components/prompt/Confirm.vue +++ b/client/components/prompt/Confirm.vue @@ -7,6 +7,14 @@ +
+ +
+
{{ $strings.ButtonCancel }}
@@ -25,7 +33,8 @@ export default { return { el: null, content: null, - checkboxValue: false + checkboxValue: false, + formData: {} } }, watch: { @@ -61,6 +70,9 @@ export default { persistent() { return !!this.confirmPromptOptions.persistent }, + formFields() { + return this.confirmPromptOptions.formFields || [] + }, checkboxLabel() { return this.confirmPromptOptions.checkboxLabel }, @@ -100,11 +112,31 @@ export default { this.show = false }, confirm() { - if (this.callback) this.callback(true, this.checkboxValue) + if (this.callback) { + if (this.formFields.length) { + const formFieldData = { + ...this.formData + } + + this.callback(true, formFieldData) + } else { + this.callback(true, this.checkboxValue) + } + } this.show = false }, setShow() { this.checkboxValue = this.checkboxDefaultValue + + if (this.formFields.length) { + this.formFields.forEach((field) => { + let defaultValue = '' + if (field.type === 'boolean') defaultValue = false + if (field.type === 'select') defaultValue = field.options[0].value + this.$set(this.formData, field.name, defaultValue) + }) + } + this.$eventBus.$emit('showing-prompt', true) document.body.appendChild(this.el) setTimeout(() => { diff --git a/client/pages/config/plugins/_id.vue b/client/pages/config/plugins/_id.vue index dda1094f..e376abb0 100644 --- a/client/pages/config/plugins/_id.vue +++ b/client/pages/config/plugins/_id.vue @@ -12,10 +12,14 @@ help_outline + +
+ + Sourceopen_in_new
-

{{ configDescription }}

+

{{ configDescription }}