open-nomad/ui/app/templates/jobs/job/task-group.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

349 lines
11 KiB
Handlebars
Raw Normal View History

<Breadcrumb @crumb={{this.breadcrumb}} />
{{page-title "Task group " this.model.name " - Job " this.model.job.name}}
2018-07-25 22:19:43 +00:00
<div class="tabs is-subnav">
<ul>
2022-01-19 16:20:00 +00:00
<li>
<LinkTo
@route="jobs.job.task-group"
@models={{array this.model.job this.model}}
@activeClass="is-active"
>
Overview
</LinkTo>
</li>
2018-07-25 22:19:43 +00:00
</ul>
</div>
<section class="section">
<h1 class="title with-flex">
2022-01-19 16:20:00 +00:00
<span>
{{this.model.name}}
</span>
<div>
<Exec::OpenButton @job={{this.model.job}} @taskGroup={{this.model}} />
{{#if this.model.scaling}}
2022-01-19 16:20:00 +00:00
<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>
2018-07-25 22:19:43 +00:00
</h1>
<div class="boxed-section is-small">
<div class="boxed-section-body inline-definitions">
2022-01-19 16:20:00 +00:00
<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>
2022-01-19 16:20:00 +00:00
<span class="term">
Reserved Memory
</span>
{{format-scheduled-bytes this.model.reservedMemory start="MiB"}}
{{#if (gt this.model.reservedMemoryMax this.model.reservedMemory)}}
2022-01-19 16:20:00 +00:00
({{format-scheduled-bytes this.model.reservedMemoryMax start="MiB"}}Max)
{{/if}}
</span>
2022-01-19 16:20:00 +00:00
<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}}
2022-01-19 16:20:00 +00:00
<span class="pair" data-test-task-group-min>
<span class="term">
Count Range
</span>
{{this.model.scaling.min}}
to
{{this.model.scaling.max}}
</span>
2022-01-19 16:20:00 +00:00
<span class="pair" data-test-task-group-max>
<span class="term">
Scaling Policy?
</span>
{{if this.model.scaling.policy "Yes" "No"}}
</span>
{{/if}}
{{#if (and (can "list variables") this.model.pathLinkedVariable)}}
<span class="pair" data-test-task-group-stat="variables">
<LinkTo @route="variables.variable" @model={{this.model.pathLinkedVariable.id}}>Variables</LinkTo>
</span>
{{/if}}
2017-09-19 14:47:10 +00:00
</div>
2018-07-25 22:19:43 +00:00
</div>
<div class="boxed-section">
<div class="boxed-section-head">
2022-01-19 16:20:00 +00:00
<div>
Allocation Status
<span class="badge is-white">
{{this.allocations.length}}
</span>
</div>
2018-07-25 22:19:43 +00:00
</div>
<div class="boxed-section-body">
2022-01-19 16:20:00 +00:00
<AllocationStatusBar
@allocationContainer={{this.model.summary}}
@class="split-view" as |chart|
>
2018-07-25 22:19:43 +00:00
<ol class="legend">
{{#each chart.data as |datum index|}}
2022-01-19 16:20:00 +00:00
<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}} />
2018-07-25 22:19:43 +00:00
</li>
{{/each}}
</ol>
</AllocationStatusBar>
2017-09-19 14:47:10 +00:00
</div>
2018-07-25 22:19:43 +00:00
</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"
/>
<span class="is-padded is-one-line">
<Toggle
@isActive={{this.showSubTasks}}
@onToggle={{this.toggleShowSubTasks}}
title="Show tasks of allocations"
>
Show Tasks
</Toggle>
</span>
</div>
2018-07-25 22:19:43 +00:00
</div>
<div class="boxed-section-body is-full-bleed">
{{#if this.sortedAllocations}}
<ListPagination
@source={{this.sortedAllocations}}
@size={{this.pageSize}}
@page={{this.currentPage}}
2022-01-19 16:20:00 +00:00
@class="allocations" as |p|
>
<ListTable
@source={{p.list}}
@sortProperty={{this.sortProperty}}
@sortDescending={{this.sortDescending}}
@class="with-foot {{if this.showSubTasks "with-collapsed-borders"}}" as |t|
2022-01-19 16:20:00 +00:00
>
<t.head>
<th class="is-narrow"></th>
2022-01-19 16:20:00 +00:00
<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|>
2022-01-19 16:20:00 +00:00
<AllocationRow
[ui] general keyboard navigation: 1.3.4 release (#14138) * Initialized keyboard service Neat but funky: dynamic subnav traversal 👻 generalized traverseSubnav method Shift as special modifier key Nice little demo panel Keyboard shortcuts keycard Some animation styles on keyboard shortcuts Handle situations where a link is deeply nested from its parent menu item Keyboard service cleanup helper-based initializer and teardown for new contextual commands Keyboard shortcuts modal component added and demo-ghost removed Removed j and k from subnav traversal Register and unregister methods for subnav plus new subnavs for volumes and volume register main nav method Generalizing the register nav method 12762 table keynav (#12975) * Experimental feature: shortcut visual hints * Long way around to a custom modifier for keyboard shortcuts * dynamic table and list iterative shortcuts * Progress with regular old tether * Delogging * Table Keynav tether fix, server and client navs, and fix to shiftless on modified arrow keys Go to Optimize keyboard link and storage key changed to g r parameterized jobs keyboard nav Dynamic numeric keynav for multiple tables (#13482) * Multiple tables init * URL-bind enumerable keyboard commands and add to more taskRow and allocationRows * Type safety and lint fixes * Consolidated push to keyCommands * Default value when removing keyCommands * Remove the URL-based removal method and perform a recompute on any add Get tests passing in Keynav: remove math helpers and a few other defensive moves (#13761) * Remove ember math helpers * Test fixes for jobparts/body * Kill an unneeded integration helper test * delog * Trying if disabling percy lets this finish * Okay so its not percy; try parallelism in circle * Percyless yet again * Trying a different angle to not have percy * Upgrade percy to 1.6.1 [ui] Keyboard nav: "u" key to go up a level (#13754) * U to go up a level * Mislabelled my conditional * Custom lint ignore rule * Custom lint ignore rule, this time with commas * Since we're getting rid of ember math helpers elsewhere, do the math ourselves here Replace ArrowLeft etc. with an ascii arrow (#13776) * Replace ArrowLeft etc. with an ascii arrow * non-mutative helper cleanup Keyboard Nav: let users rebind their shortcuts (#13781) * click-outside and shortcuts enabled/disabled toggle * Trap focus when modal open * Enabled/disabled saved to localStorage * Autofocus edit button on variable index * Modal overflow styles * Functional rebind * Saving rebinds to localStorage for all majors * Started on defaultCommandBindings * Modal header style and cancel rebind on escape * keyboardable keybindings w buttons instead of spans * recording and defaultvalues * Enter short-circuits rebind * Only some commands are rebindable, and dont show dupes * No unused get import * More visually distinct header on modal * Disallowed keys for rebind, showing buffer as you type, and moving dedupe to modal logic willDestroy hook to prevent tests from doubling/tripling up addEventListener on kb events remove unused tests Keyboard Navigation acceptance tests (#13893) * Acceptance tests for keyboard modal * a11y audit fix and localStorage clear * Bind/rebind/localStorage tests * Keyboard tests for dynamic nav and tables * Rebinder and assert expectation * Second percy snapshot showing hints no longer relevant Weird issue where linktos with query props specifically from the task-groups page would fail to route / hit undefined.shouldSuperCede errors Adds the concept of exclusivity to a keycommand, removing peers that also share its label Lintfix Changelog and PR feedback Changelog and PR feedback Fix to rebinding in firefox by blurring the now-disabled button on rebind (#14053) * Secure Variables shortcuts removed * Variable index route autofocus removed * Updated changelog entry * Updated changelog entry * Keynav docs (#14148) * Section added to the API Docs UI page * Added a note about disabling * Prev and Next order * Remove dev log and unneeded comments
2022-08-17 16:59:33 +00:00
{{keyboard-shortcut
enumerated=true
action=(action "gotoAllocation" row.model)
}}
2022-01-19 16:20:00 +00:00
@data-test-allocation={{row.model.id}}
@allocation={{row.model}}
@context="taskGroup"
@onClick={{action "gotoAllocation" row.model}}
/>
{{#if this.showSubTasks}}
{{#each row.model.states as |task|}}
<TaskSubRow @namespan="8" @taskState={{task}} @active={{eq this.activeTask (concat task.allocation.id "-" task.name)}} @onSetActiveTask={{action 'setActiveTaskQueryParam'}} />
{{/each}}
{{/if}}
</t.body>
</ListTable>
<div class="table-foot">
<PageSizeSelect @onChange={{action this.resetPagination}} />
<nav class="pagination">
<div class="pagination-numbers">
2022-01-19 16:20:00 +00:00
{{p.startsAt}}
{{p.endsAt}}
of
{{this.sortedAllocations.length}}
</div>
2022-01-19 16:20:00 +00:00
<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>
2022-01-19 16:20:00 +00:00
{{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>
2018-07-25 22:19:43 +00:00
</div>
2022-01-19 16:20:00 +00:00
</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>
2022-01-06 21:01:55 +00:00
</div>
2022-01-19 16:20:00 +00:00
</div>
{{/if}}
2017-09-19 14:47:10 +00:00
</div>
2018-07-25 22:19:43 +00:00
</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>
2022-01-19 16:20:00 +00:00
<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>
2022-01-19 16:20:00 +00:00
<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}}
2022-01-19 16:20:00 +00:00
</section>