Files
nomad/ui/app/templates/components/task-row.hbs
Phil Renaud 1976202cd6 Feature: Dynamic Host Volumes in the UI (#25224)
* DHV UI init

* /csi routes to /storage routes and a routeRedirector util (#25163)

* /csi routes to /storage routes and a routeRedirector util

* Tests and routes move csi/ to storage/

* Changelog added

* [ui] Storage UI overhaul + Dynamic Host Volumes UI (#25226)

* Storage index page and DHV model properties

* Naive version of a storage overview page

* Experimental fetch of alloc data dirs

* Fetch ephemeral disks and static host volumes as an ember concurrency task and nice table stylings

* Playing nice with section header labels to make eslint happy even though wcag was already cool with it

* inlined the storage type explainers and reordered things, plus tooltips and keynav

* Bones of a dynamic host volume individual page

* Woooo dynamic host volume model, adapter, and serializer with embedded alloc relationships

* Couple test fixes

* async:false relationship for dhv.hasMany('alloc') to prevent a ton of xhr requests

* DHV request type at index routemodel and better serialization

* Pagination and searching and query params oh my

* Test retrofits for csi volumes

* Really fantastic flake gets fixed

* DHV detail page acceptance test and a bunch of mirage hooks

* Seed so that the actions test has a guaranteed task

* removed ephemeral disk and static host volume manual scanning

* CapacityBytes and capabilities table added to DHV detail page

* Debugging actions flyout test

* was becoming clear that faker.seed editing was causing havoc elsewhere so might as well not boil the ocean and just tell this test to do what I want it to

* Post-create job gets taskCount instead of count

* CSI volumes now get /csi route prefix at detail level

* lazyclick method for unused keynav removed

* keyboard nav and table-watcher for DHV added

* Addressed PR comments, changed up capabilities table and id references, etc.

* Capabilities table for DHV and ID in details header

* Testfixes for pluginID and capabilities table on DHV page
2025-03-10 14:46:02 -04:00

134 lines
3.5 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<td class="is-narrow">
{{#unless this.task.driverStatus.healthy}}
<Hds::TooltipButton data-test-icon="unhealthy-driver" @text="{{this.task.driver}} is unhealthy" aria-label="More information">
<Hds::Icon @name="alert-triangle" @isInline={{true}} />
</Hds::TooltipButton>
{{/unless}}
</td>
<td data-test-name class="nowrap">
<LinkTo
@route="allocations.allocation.task"
@models={{array this.task.allocation this.task}}
class="is-primary"
>
{{this.task.name}}
{{#if this.task.isConnectProxy}}
<ProxyTag @class="bumper-left" />
{{/if}}
</LinkTo>
</td>
<td data-test-state>
{{this.task.state}}
</td>
<td data-test-message>
{{#if this.task.events.lastObject.message}}
{{this.task.events.lastObject.message}}
{{else}}
<em>
No message
</em>
{{/if}}
</td>
<td data-test-time>
{{format-ts this.task.events.lastObject.time}}
</td>
<td data-test-volumes>
<ul>
{{#each this.task.task.volumeMounts as |volume|}}
<li data-test-volume>
<strong>
{{volume.volume}}
:
</strong>
{{#if volume.isCSI}}
<LinkTo
@route="storage.volumes.volume"
@model={{concat
(format-volume-name
source=volume.source
isPerAlloc=volume.volumeDeclaration.perAlloc
volumeExtension=this.task.allocation.volumeExtension)
"@"
volume.namespace.id
}}
>
{{format-volume-name
source=volume.source
isPerAlloc=volume.volumeDeclaration.perAlloc
volumeExtension=this.task.allocation.volumeExtension}}
</LinkTo>
{{else}}
{{volume.source}}
{{/if}}
</li>
{{/each}}
</ul>
</td>
<td data-test-cpu class="is-1 has-text-centered">
{{#if this.task.isRunning}}
{{#if (and (not this.cpu) this.fetchStats.isRunning)}}
...
{{else if this.statsError}}
<span
class="tooltip text-center"
role="tooltip"
aria-label="Couldn't collect stats"
>
{{x-icon "alert-triangle" class="is-warning"}}
</span>
{{else}}
<div
class="inline-chart is-small tooltip"
role="tooltip"
aria-label="{{format-hertz this.cpu.used}}
/
{{format-hertz this.taskStats.reservedCPU}}"
>
<progress
class="progress is-info is-small"
value="{{this.cpu.percent}}"
max="1"
>
{{this.cpu.percent}}
</progress>
</div>
{{/if}}
{{/if}}
</td>
<td data-test-mem class="is-1 has-text-centered">
{{#if this.task.isRunning}}
{{#if (and (not this.memory) this.fetchStats.isRunning)}}
...
{{else if this.statsError}}
<span
class="tooltip is-small text-center"
role="tooltip"
aria-label="Couldn't collect stats"
>
{{x-icon "alert-triangle" class="is-warning"}}
</span>
{{else}}
<div
class="inline-chart tooltip"
role="tooltip"
aria-label="{{format-bytes this.memory.used}}
/
{{format-bytes this.taskStats.reservedMemory start="MiB"}}"
>
<progress
class="progress is-danger is-small"
value="{{this.memory.percent}}"
max="1"
>
{{this.memory.percent}}
</progress>
</div>
{{/if}}
{{/if}}
</td>