2019-11-12 22:18:26 +00:00
|
|
|
{{#popover-menu
|
2019-11-22 02:39:42 +00:00
|
|
|
data-test-drain-popover
|
2020-01-30 21:40:17 +00:00
|
|
|
isDisabled=isDisabled
|
2019-12-07 07:45:00 +00:00
|
|
|
label=(if client.isDraining "Update Drain" "Drain")
|
2019-11-19 06:36:07 +00:00
|
|
|
triggerClass=(concat "is-small " (if drain.isRunning "is-loading")) as |m|}}
|
2019-12-07 07:45:00 +00:00
|
|
|
<form data-test-drain-popover-form onsubmit={{action (queue (action preventDefault) (perform drain m.actions.close))}} class="form is-small">
|
2019-11-12 01:05:47 +00:00
|
|
|
<h4 class="group-heading">Drain Options</h4>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label is-interactive">
|
2019-11-19 09:56:31 +00:00
|
|
|
{{#toggle
|
2019-11-22 02:39:42 +00:00
|
|
|
data-test-drain-deadline-toggle
|
2019-11-19 09:56:31 +00:00
|
|
|
isActive=deadlineEnabled
|
|
|
|
onToggle=(action (mut deadlineEnabled) value="target.checked")}}
|
|
|
|
Deadline
|
|
|
|
{{/toggle}}
|
2019-11-12 01:05:47 +00:00
|
|
|
<span class="tooltip multiline" aria-label="The amount of time a drain must complete within.">
|
|
|
|
{{x-icon "info-circle-outline" class="is-faded"}}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{{#if deadlineEnabled}}
|
|
|
|
<div class="field is-sub-field">
|
|
|
|
{{#power-select
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-drain-deadline-option-select
|
|
|
|
tagName="div"
|
2019-11-12 01:05:47 +00:00
|
|
|
options=durationQuickOptions
|
|
|
|
selected=selectedDurationQuickOption
|
|
|
|
onChange=(action (mut selectedDurationQuickOption)) as |opt|}}
|
|
|
|
{{opt.label}}
|
|
|
|
{{/power-select}}
|
|
|
|
</div>
|
|
|
|
{{#if durationIsCustom}}
|
|
|
|
<div class="field is-sub-field">
|
|
|
|
<label class="label">Deadline</label>
|
|
|
|
<input
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-drain-custom-deadline
|
2019-11-12 01:05:47 +00:00
|
|
|
type="text"
|
|
|
|
class="input {{if parseError "is-danger"}}"
|
|
|
|
placeholder="1h30m"
|
|
|
|
oninput={{action (queue
|
|
|
|
(action (mut parseError) '')
|
|
|
|
(action (mut customDuration) value="target.value"))}} />
|
|
|
|
{{#if parseError}}
|
|
|
|
<em class="help is-danger">{{parseError}}</em>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
<div class="field">
|
|
|
|
<label class="label is-interactive">
|
2019-11-19 09:56:31 +00:00
|
|
|
{{#toggle
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-force-drain-toggle
|
2019-11-19 09:56:31 +00:00
|
|
|
isActive=forceDrain
|
|
|
|
onToggle=(action (mut forceDrain) value="target.checked")}}
|
|
|
|
Force Drain
|
|
|
|
{{/toggle}}
|
2019-11-12 01:05:47 +00:00
|
|
|
<span class="tooltip multiline" aria-label="Immediately remove allocations from the client.">
|
|
|
|
{{x-icon "info-circle-outline" class="is-faded"}}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label is-interactive">
|
2019-11-19 09:56:31 +00:00
|
|
|
{{#toggle
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-system-jobs-toggle
|
2019-11-19 09:56:31 +00:00
|
|
|
isActive=drainSystemJobs
|
|
|
|
onToggle=(action (mut drainSystemJobs) value="target.checked")}}
|
|
|
|
Drain System Jobs
|
|
|
|
{{/toggle}}
|
2019-11-12 01:05:47 +00:00
|
|
|
<span class="tooltip multiline" aria-label="Stop allocations for system jobs.">
|
|
|
|
{{x-icon "info-circle-outline" class="is-faded"}}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="popover-actions">
|
|
|
|
<button
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-drain-submit
|
2019-11-12 01:05:47 +00:00
|
|
|
type="button"
|
|
|
|
class="popover-action is-primary"
|
|
|
|
onclick={{perform drain m.actions.close}}>
|
|
|
|
Drain
|
|
|
|
</button>
|
2019-12-07 07:45:00 +00:00
|
|
|
<button data-test-drain-cancel type="button" class="popover-action" onclick={{action m.actions.close}}>Cancel</button>
|
2019-11-12 01:05:47 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{/popover-menu}}
|