* feature: #69 - Add action confirmation * fmt: style
This commit is contained in:
parent
6b3e9e4676
commit
f559a2f9c9
|
|
@ -85,3 +85,10 @@ actions:
|
||||||
shell: sleep 5
|
shell: sleep 5
|
||||||
timeout: 5
|
timeout: 5
|
||||||
icon: "😪"
|
icon: "😪"
|
||||||
|
|
||||||
|
- title: Delete old backups
|
||||||
|
icon: ashtonished
|
||||||
|
shell: rm -rf /opt/oldBackups/
|
||||||
|
arguments:
|
||||||
|
- type: confirmation
|
||||||
|
title: Are you sure?!
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,15 @@ class ArgumentForm extends window.HTMLElement {
|
||||||
for (const choice of arg.choices) {
|
for (const choice of arg.choices) {
|
||||||
domEl.appendChild(this.createSelectOption(choice))
|
domEl.appendChild(this.createSelectOption(choice))
|
||||||
}
|
}
|
||||||
|
} else if (arg.type === 'confirmation') {
|
||||||
|
this.domBtnStart.disabled = true
|
||||||
|
|
||||||
|
domEl = document.createElement('input')
|
||||||
|
domEl.setAttribute('type', 'checkbox')
|
||||||
|
domEl.onchange = () => {
|
||||||
|
this.domBtnStart.disabled = false
|
||||||
|
domEl.disabled = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
domEl = document.createElement('input')
|
domEl = document.createElement('input')
|
||||||
domEl.onchange = () => {
|
domEl.onchange = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue