github.com/hernad/nomad@v1.6.112/ui/app/templates/components/drain-popover.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 {{! template-lint-disable require-input-label }} 7 <PopoverMenu 8 data-test-drain-popover 9 @isDisabled={{this.isDisabled}} 10 @label={{if this.client.isDraining "Update Drain" "Drain"}} 11 @tooltip={{if this.isDisabled "Not allowed to drain clients"}} 12 @triggerClass={{concat 13 "is-small " 14 (if this.drain.isRunning "is-loading ") 15 (if this.isDisabled "tooltip is-right-aligned") 16 }} 17 as |m| 18 > 19 <form 20 data-test-drain-popover-form 21 onsubmit={{action 22 (queue (action this.preventDefault) (perform this.drain m.actions.close)) 23 }} 24 class="form is-small" 25 > 26 <h4 class="group-heading">Drain Options</h4> 27 <div class="field"> 28 <label class="label is-interactive"> 29 <Toggle 30 data-test-drain-deadline-toggle 31 @isActive={{this.deadlineEnabled}} 32 @onToggle={{action (mut this.deadlineEnabled) value="target.checked"}} 33 > 34 Deadline 35 </Toggle> 36 <span 37 class="tooltip multiline" 38 aria-label="The amount of time a drain must complete within." 39 > 40 {{x-icon "info-circle-outline" class="is-faded"}} 41 </span> 42 </label> 43 </div> 44 {{#if this.deadlineEnabled}} 45 <div 46 class="field is-sub-field" 47 data-test-drain-deadline-option-select-parent 48 > 49 <PowerSelect 50 data-test-drain-deadline-option-select 51 @tagName="div" 52 @options={{this.durationQuickOptions}} 53 @selected={{this.selectedDurationQuickOption}} 54 @onChange={{action (mut this.selectedDurationQuickOption)}} 55 as |opt| 56 > 57 {{opt.label}} 58 </PowerSelect> 59 </div> 60 {{#if this.durationIsCustom}} 61 <div class="field is-sub-field"> 62 <label class="label">Deadline</label> 63 <input 64 data-test-drain-custom-deadline 65 type="text" 66 class="input {{if this.parseError 'is-danger'}}" 67 placeholder="1h30m" 68 value={{if (eq this.customDuration 0) "" this.customDuration}} 69 oninput={{action 70 (queue 71 (action (mut this.parseError) "") 72 (action (mut this.customDuration) value="target.value") 73 ) 74 }} 75 /> 76 {{#if this.parseError}} 77 <em class="help is-danger">{{this.parseError}}</em> 78 {{/if}} 79 </div> 80 {{/if}} 81 {{/if}} 82 <div class="field"> 83 <label class="label is-interactive"> 84 <Toggle 85 data-test-force-drain-toggle 86 @isActive={{this.forceDrain}} 87 @onToggle={{action (mut this.forceDrain) value="target.checked"}} 88 > 89 Force Drain 90 </Toggle> 91 <span 92 class="tooltip multiline" 93 aria-label="Immediately remove allocations from the client." 94 > 95 {{x-icon "info-circle-outline" class="is-faded"}} 96 </span> 97 </label> 98 </div> 99 <div class="field"> 100 <label class="label is-interactive"> 101 <Toggle 102 data-test-system-jobs-toggle 103 @isActive={{this.drainSystemJobs}} 104 @onToggle={{action (mut this.drainSystemJobs) value="target.checked"}} 105 > 106 Drain System Jobs 107 </Toggle> 108 <span 109 class="tooltip multiline" 110 aria-label="Stop allocations for system jobs." 111 > 112 {{x-icon "info-circle-outline" class="is-faded"}} 113 </span> 114 </label> 115 </div> 116 <div class="popover-actions"> 117 <button 118 data-test-drain-submit 119 type="button" 120 class="popover-action is-primary" 121 onclick={{perform this.drain m.actions.close}} 122 > 123 Drain 124 </button> 125 <button 126 data-test-drain-cancel 127 type="button" 128 class="popover-action" 129 onclick={{action m.actions.close}} 130 >Cancel</button> 131 </div> 132 </form> 133 </PopoverMenu>