2022-03-08 17:28:36 +00:00
|
|
|
{{! template-lint-disable require-input-label }}
|
2020-06-01 19:03:56 +00:00
|
|
|
<PopoverMenu
|
2019-11-22 02:39:42 +00:00
|
|
|
data-test-drain-popover
|
2020-07-09 20:19:07 +00:00
|
|
|
@isDisabled={{this.isDisabled}}
|
|
|
|
@label={{if this.client.isDraining "Update Drain" "Drain"}}
|
|
|
|
@tooltip={{if this.isDisabled "Not allowed to drain clients"}}
|
2020-06-01 19:03:56 +00:00
|
|
|
@triggerClass={{concat
|
2020-01-30 22:34:43 +00:00
|
|
|
"is-small "
|
2020-07-09 20:19:07 +00:00
|
|
|
(if this.drain.isRunning "is-loading ")
|
2022-03-08 17:28:36 +00:00
|
|
|
(if this.isDisabled "tooltip is-right-aligned")
|
|
|
|
}}
|
|
|
|
as |m|
|
|
|
|
>
|
|
|
|
<form
|
|
|
|
data-test-drain-popover-form
|
|
|
|
onsubmit={{action
|
|
|
|
(queue (action this.preventDefault) (perform this.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">
|
2020-07-09 17:30:11 +00:00
|
|
|
<Toggle
|
2019-11-22 02:39:42 +00:00
|
|
|
data-test-drain-deadline-toggle
|
2020-07-09 20:19:07 +00:00
|
|
|
@isActive={{this.deadlineEnabled}}
|
2022-03-08 17:28:36 +00:00
|
|
|
@onToggle={{action (mut this.deadlineEnabled) value="target.checked"}}
|
|
|
|
>
|
2019-11-19 09:56:31 +00:00
|
|
|
Deadline
|
2022-03-08 17:28:36 +00:00
|
|
|
</Toggle>
|
|
|
|
<span
|
|
|
|
class="tooltip multiline"
|
|
|
|
aria-label="The amount of time a drain must complete within."
|
|
|
|
>
|
2019-11-12 01:05:47 +00:00
|
|
|
{{x-icon "info-circle-outline" class="is-faded"}}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.deadlineEnabled}}
|
2022-03-08 17:28:36 +00:00
|
|
|
<div
|
|
|
|
class="field is-sub-field"
|
|
|
|
data-test-drain-deadline-option-select-parent
|
|
|
|
>
|
2020-06-01 19:03:56 +00:00
|
|
|
<PowerSelect
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-drain-deadline-option-select
|
2020-06-01 19:03:56 +00:00
|
|
|
@tagName="div"
|
2020-07-09 20:19:07 +00:00
|
|
|
@options={{this.durationQuickOptions}}
|
|
|
|
@selected={{this.selectedDurationQuickOption}}
|
2022-03-08 17:28:36 +00:00
|
|
|
@onChange={{action (mut this.selectedDurationQuickOption)}}
|
|
|
|
as |opt|
|
|
|
|
>
|
2019-11-12 01:05:47 +00:00
|
|
|
{{opt.label}}
|
2020-06-01 19:03:56 +00:00
|
|
|
</PowerSelect>
|
2019-11-12 01:05:47 +00:00
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.durationIsCustom}}
|
2019-11-12 01:05:47 +00:00
|
|
|
<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"
|
2022-03-08 17:28:36 +00:00
|
|
|
class="input {{if this.parseError 'is-danger'}}"
|
2019-11-12 01:05:47 +00:00
|
|
|
placeholder="1h30m"
|
2021-10-22 14:51:31 +00:00
|
|
|
value={{if (eq this.customDuration 0) "" this.customDuration}}
|
2022-03-08 17:28:36 +00:00
|
|
|
oninput={{action
|
|
|
|
(queue
|
|
|
|
(action (mut this.parseError) "")
|
|
|
|
(action (mut this.customDuration) value="target.value")
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
/>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.parseError}}
|
|
|
|
<em class="help is-danger">{{this.parseError}}</em>
|
2019-11-12 01:05:47 +00:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
<div class="field">
|
|
|
|
<label class="label is-interactive">
|
2020-07-09 17:30:11 +00:00
|
|
|
<Toggle
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-force-drain-toggle
|
2020-07-09 20:19:07 +00:00
|
|
|
@isActive={{this.forceDrain}}
|
2022-03-08 17:28:36 +00:00
|
|
|
@onToggle={{action (mut this.forceDrain) value="target.checked"}}
|
|
|
|
>
|
2019-11-19 09:56:31 +00:00
|
|
|
Force Drain
|
2022-03-08 17:28:36 +00:00
|
|
|
</Toggle>
|
|
|
|
<span
|
|
|
|
class="tooltip multiline"
|
|
|
|
aria-label="Immediately remove allocations from the client."
|
|
|
|
>
|
2019-11-12 01:05:47 +00:00
|
|
|
{{x-icon "info-circle-outline" class="is-faded"}}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label is-interactive">
|
2020-07-09 17:30:11 +00:00
|
|
|
<Toggle
|
2019-12-07 07:45:00 +00:00
|
|
|
data-test-system-jobs-toggle
|
2020-07-09 20:19:07 +00:00
|
|
|
@isActive={{this.drainSystemJobs}}
|
2022-03-08 17:28:36 +00:00
|
|
|
@onToggle={{action (mut this.drainSystemJobs) value="target.checked"}}
|
|
|
|
>
|
2019-11-19 09:56:31 +00:00
|
|
|
Drain System Jobs
|
2022-03-08 17:28:36 +00:00
|
|
|
</Toggle>
|
|
|
|
<span
|
|
|
|
class="tooltip multiline"
|
|
|
|
aria-label="Stop allocations for system jobs."
|
|
|
|
>
|
2019-11-12 01:05:47 +00:00
|
|
|
{{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"
|
2022-03-08 17:28:36 +00:00
|
|
|
onclick={{perform this.drain m.actions.close}}
|
|
|
|
>
|
2019-11-12 01:05:47 +00:00
|
|
|
Drain
|
|
|
|
</button>
|
2022-03-08 17:28:36 +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>
|
2020-06-01 19:03:56 +00:00
|
|
|
</PopoverMenu>
|