feature: #69 - Add action confirmation (#208)

* feature: #69 - Add action confirmation

* fmt: style
This commit is contained in:
James Read 2023-12-28 23:50:39 +00:00 committed by GitHub
parent 6b3e9e4676
commit f559a2f9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -85,3 +85,10 @@ actions:
shell: sleep 5
timeout: 5
icon: "&#x1F62A"
- title: Delete old backups
icon: ashtonished
shell: rm -rf /opt/oldBackups/
arguments:
- type: confirmation
title: Are you sure?!

View File

@ -93,6 +93,15 @@ class ArgumentForm extends window.HTMLElement {
for (const choice of arg.choices) {
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 {
domEl = document.createElement('input')
domEl.onchange = () => {