4
0

input_confirmation.adoc 1.3 KB

1234567891011121314151617181920212223242526
  1. [#confirmation]
  2. = Input: Confirmation
  3. The `confirmation` type argument is a special argument type, which simply disables the "Start" button until a checkbox is ticked. This can be useful if you have an action with no other arguments, but you want to prevent accidental button-clicks starting the action.
  4. Confirmation arguments are usually left unnamed, so nothing is substituted into the command. If you do give the argument a `name`, the only allowed values are `0` (unchecked) and `1` (checked), so confirmation is safe to use with `shell:` actions.
  5. [NOTE]
  6. ====
  7. The checkbox guards against accidental clicks in the web UI; it is not an access control. An unnamed confirmation is not checked by the API, so calling xref:api/method_StartAction.adoc[StartAction] (or a custom web UI, or a script) starts the action without it. A named confirmation must be sent by API callers, but both `0` and `1` are accepted. To limit who can start an action, use xref:security/acl.adoc[access control lists].
  8. ====
  9. [source,yaml]
  10. ----
  11. actions:
  12. - title: Delete old backups
  13. icon: ashtonished
  14. shell: rm -rf /opt/oldBackups/
  15. arguments:
  16. - type: confirmation
  17. title: Are you sure?!
  18. ----
  19. image::args/confirmation/confirmation.png[]
  20. Notice in the webui the "start" button is disabled.