ondemand.adoc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [#exec-on-click]
  2. [#onclick]
  3. = Execute on click
  4. OliveTin has several options to control what happens when an action button is clicked and the execution starts. This can be controlled on a per-action basis using the `onclick` configuration option.
  5. You can also set the default for OliveTin using the `defaultOnClick` configuration option.
  6. NOTE: The older names `popupOnStart` and `defaultPopupOnStart` do exactly the same thing. OliveTin copies legacy values into `onclick` / `defaultOnClick` during config load. New configurations should use `onclick` and `defaultOnClick`.
  7. == Big Flashy Buttons (default)
  8. [source,yaml]
  9. .`config.yaml`
  10. ----
  11. actions:
  12. - title: Ping the Internet
  13. onclick: default
  14. ----
  15. This will also be the option that is used if no other values match.
  16. image::../flashyButton.png[]
  17. == Execution Dialog
  18. When an action uses `execution-dialog`, OliveTin opens the execution results view with the command output, plus the start time, end time, exit code, and duration.
  19. [NOTE]
  20. The legacy option `execution-dialog-stdout-only` is deprecated in OliveTin 3k. It is still accepted in config files for compatibility, but is treated the same as `execution-dialog`.
  21. [source,yaml]
  22. .`config.yaml`
  23. ----
  24. actions:
  25. - title: Check dmesg logs
  26. onclick: execution-dialog
  27. ----
  28. .Example of `onclick: execution-dialog`
  29. image::action_customization/execution-dialog/executionDialog.png[]
  30. == Execution Buttons
  31. This mode will create a new button for each individual execution. This can be useful for actions that are executed again and again.
  32. The text of the button (eg, "0s" in the screenshot below), is the time it took to execute the action in seconds.
  33. [source,yaml]
  34. .`config.yaml`
  35. ----
  36. actions:
  37. - title: date
  38. onclick: execution-button
  39. ----
  40. image::../executionButtons.png[]
  41. == Action execution history
  42. The `history` option opens the action details page for that binding when the execution starts, so you can see past runs and status for the same action.
  43. [source,yaml]
  44. .`config.yaml`
  45. ----
  46. actions:
  47. - title: Long-running job
  48. onclick: history
  49. ----