-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathtask-group.hbs
326 lines (324 loc) · 10.2 KB
/
task-group.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<Breadcrumb @crumb={{this.breadcrumb}} />
{{page-title "Task group " this.model.name " - Job " this.model.job.name}}
<div class="tabs is-subnav">
<ul>
<li>
<LinkTo
@route="jobs.job.task-group"
@models={{array this.model.job this.model}}
@activeClass="is-active"
>
Overview
</LinkTo>
</li>
</ul>
</div>
<section class="section">
<h1 class="title with-flex">
<span>
{{this.model.name}}
</span>
<div>
<Exec::OpenButton @job={{this.model.job}} @taskGroup={{this.model}} />
{{#if this.model.scaling}}
<StepperInput
data-test-task-group-count-stepper
aria-label={{this.tooltipText}}
@min={{this.model.scaling.min}}
@max={{this.model.scaling.max}}
@value={{this.model.count}}
@class="is-primary is-small"
@disabled={{or
this.model.job.runningDeployment
(cannot "scale job" namespace=this.model.job.namespace.name)
}}
@onChange={{action "scaleTaskGroup"}}
>
Count
</StepperInput>
{{/if}}
</div>
</h1>
<div class="boxed-section is-small">
<div class="boxed-section-body inline-definitions">
<span class="label">
Task Group Details
</span>
<span class="pair" data-test-task-group-tasks>
<span class="term">
# Tasks
</span>
{{this.model.tasks.length}}
</span>
<span class="pair" data-test-task-group-cpu>
<span class="term">
Reserved CPU
</span>
{{format-scheduled-hertz this.model.reservedCPU}}
</span>
<span class="pair" data-test-task-group-mem>
<span class="term">
Reserved Memory
</span>
{{format-scheduled-bytes this.model.reservedMemory start="MiB"}}
{{#if (gt this.model.reservedMemoryMax this.model.reservedMemory)}}
({{format-scheduled-bytes this.model.reservedMemoryMax start="MiB"}}Max)
{{/if}}
</span>
<span class="pair" data-test-task-group-disk>
<span class="term">
Reserved Disk
</span>
{{format-scheduled-bytes this.model.reservedEphemeralDisk start="MiB"}}
</span>
{{#if this.model.scaling}}
<span class="pair" data-test-task-group-min>
<span class="term">
Count Range
</span>
{{this.model.scaling.min}}
to
{{this.model.scaling.max}}
</span>
<span class="pair" data-test-task-group-max>
<span class="term">
Scaling Policy?
</span>
{{if this.model.scaling.policy "Yes" "No"}}
</span>
{{/if}}
</div>
</div>
<div class="boxed-section">
<div class="boxed-section-head">
<div>
Allocation Status
<span class="badge is-white">
{{this.allocations.length}}
</span>
</div>
</div>
<div class="boxed-section-body">
<AllocationStatusBar
@allocationContainer={{this.model.summary}}
@class="split-view" as |chart|
>
<ol class="legend">
{{#each chart.data as |datum index|}}
<li
class="{{datum.className}}
{{if (eq datum.label chart.activeDatum.label) "is-active"}}
{{if (eq datum.value 0) "is-empty"}}"
>
<JobPage::Parts::SummaryLegendItem @datum={{datum}} @index={{index}} />
</li>
{{/each}}
</ol>
</AllocationStatusBar>
</div>
</div>
<div class="boxed-section">
<div class="boxed-section-head">
Allocations
<div class="pull-right is-subsection">
<MultiSelectDropdown
data-test-allocation-status-facet
@label="Status"
@options={{this.optionsAllocationStatus}}
@selection={{this.selectionStatus}}
@onSelect={{action this.setFacetQueryParam "qpStatus"}}
/>
<MultiSelectDropdown
data-test-allocation-client-facet
@label="Client"
@options={{this.optionsClients}}
@selection={{this.selectionClient}}
@onSelect={{action this.setFacetQueryParam "qpClient"}}
/>
<SearchBox
@searchTerm={{mut this.searchTerm}}
@placeholder="Search allocations..."
@onChange={{action this.resetPagination}}
@class="is-padded"
@inputClass="is-compact"
/>
</div>
</div>
<div class="boxed-section-body is-full-bleed">
{{#if this.sortedAllocations}}
<ListPagination
@source={{this.sortedAllocations}}
@size={{this.pageSize}}
@page={{this.currentPage}}
@class="allocations" as |p|
>
<ListTable
@source={{p.list}}
@sortProperty={{this.sortProperty}}
@sortDescending={{this.sortDescending}}
@class="with-foot" as |t|
>
<t.head>
<th class="is-narrow"></th>
<t.sort-by @prop="shortId">
ID
</t.sort-by>
<t.sort-by @prop="createIndex" @title="Create Index">
Created
</t.sort-by>
<t.sort-by @prop="modifyIndex" @title="Modify Index">
Modified
</t.sort-by>
<t.sort-by @prop="statusIndex">
Status
</t.sort-by>
<t.sort-by @prop="jobVersion">
Version
</t.sort-by>
<t.sort-by @prop="node.shortId">
Client
</t.sort-by>
<th>
Volume
</th>
<th>
CPU
</th>
<th>
Memory
</th>
</t.head>
<t.body @key="model.id" as |row|>
<AllocationRow
@data-test-allocation={{row.model.id}}
@allocation={{row.model}}
@context="taskGroup"
@onClick={{action "gotoAllocation" row.model}}
/>
</t.body>
</ListTable>
<div class="table-foot">
<PageSizeSelect @onChange={{action this.resetPagination}} />
<nav class="pagination">
<div class="pagination-numbers">
{{p.startsAt}}
–
{{p.endsAt}}
of
{{this.sortedAllocations.length}}
</div>
<p.prev @class="pagination-previous">
{{x-icon "chevron-left"}}
</p.prev>
<p.next @class="pagination-next">
{{x-icon "chevron-right"}}
</p.next>
<ul class="pagination-list"></ul>
</nav>
</div>
</ListPagination>
{{else if this.allocations.length}}
<div class="boxed-section-body">
<div class="empty-message" data-test-empty-allocations-list>
<h3 class="empty-message-headline" data-test-empty-allocations-list-headline>
No Matches
</h3>
<p class="empty-message-body">
No allocations match the term
<strong>
{{this.searchTerm}}
</strong>
</p>
</div>
</div>
{{else}}
<div class="boxed-section-body">
<div class="empty-message" data-test-empty-allocations-list>
<h3 class="empty-message-headline" data-test-empty-allocations-list-headline>
No Allocations
</h3>
<p class="empty-message-body">
No allocations have been placed.
</p>
</div>
</div>
{{/if}}
</div>
</div>
<LifecycleChart @tasks={{this.model.tasks}} />
{{#if this.model.scaleState.isVisible}}
{{#if this.shouldShowScaleEventTimeline}}
<div data-test-scaling-timeline class="boxed-section">
<div class="boxed-section-head is-hollow">
Scaling Timeline
</div>
<div class="boxed-section-body">
<ScaleEventsChart @events={{this.sortedScaleEvents}} />
</div>
</div>
{{/if}}
<div data-test-scaling-events class="boxed-section">
<div class="boxed-section-head">
Recent Scaling Events
</div>
<div class="boxed-section-body">
<ScaleEventsAccordion @events={{this.sortedScaleEvents}} />
</div>
</div>
{{/if}}
{{#if this.model.volumes.length}}
<div data-test-volumes class="boxed-section">
<div class="boxed-section-head">
Volume Requirements
</div>
<div class="boxed-section-body is-full-bleed">
<ListTable @source={{this.model.volumes}} as |t|>
<t.head>
<th>
Name
</th>
<th>
Type
</th>
<th>
Source
</th>
<th>
Permissions
</th>
</t.head>
<t.body as |row|>
<tr data-test-volume>
<td data-test-volume-name>
{{#if row.model.isCSI}}
{{!-- if volume is per_alloc=true, there's no one specific volume. So, link to the volumes index with an active query --}}
{{#if row.model.perAlloc}}
<LinkTo @route="csi.volumes.index" @query={{hash search=row.model.source}}>{{row.model.name}}</LinkTo>
{{else}}
<LinkTo
@route="csi.volumes.volume"
@model={{concat row.model.source "@" row.model.namespace.id}}
>
{{row.model.name}}
</LinkTo>
{{/if}}
{{else}}
{{row.model.name}}
{{/if}}
</td>
<td data-test-volume-type>
{{row.model.type}}
</td>
<td data-test-volume-source>
{{row.model.source}}
</td>
<td data-test-volume-permissions>
{{if row.model.readOnly "Read" "Read/Write"}}
</td>
</tr>
</t.body>
</ListTable>
</div>
</div>
{{/if}}
</section>