open-nomad/ui/app/templates/components/two-step-button.hbs
Michael Lange 182e020835 Fix the flickering issue with start/stop job
When the server doesn't respond immediately, there is a visible window
of time between the action being submitted and the blocking query coming
back with the new job status.
2018-08-28 11:27:00 -07:00

26 lines
814 B
Handlebars

{{#if isIdle}}
<button data-test-idle-button type="button" class="button is-danger is-outlined is-important is-small" onclick={{action "promptForConfirmation"}}>
{{idleText}}
</button>
{{else if isPendingConfirmation}}
<span data-test-confirmation-message class="confirmation-text">{{confirmationMessage}}</span>
<button
data-test-cancel-button
type="button"
class="button is-dark is-outlined is-small"
disabled={{awaitingConfirmation}}
onclick={{action (queue
(action "setToIdle")
(action onCancel)
)}}>
{{cancelText}}
</button>
<button
data-test-confirm-button
class="button is-danger is-small {{if awaitingConfirmation "is-loading"}}"
disabled={{awaitingConfirmation}}
onclick={{action "confirm"}}>
{{confirmText}}
</button>
{{/if}}