github.com/hernad/nomad@v1.6.112/ui/app/components/job-status/panel/steady.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 <div class="job-status-panel boxed-section steady-state {{if (eq @statusMode "historical") "historical-state" "current-state"}}" data-test-job-status-panel data-test-status-mode={{@statusMode}}> 7 <div class="boxed-section-head"> 8 <h2>Status: <Hds::Badge @text={{this.currentStatus.label}} @color={{this.currentStatus.state}} @type="filled" /></h2> 9 10 <div class="select-mode"> 11 <button type="button" 12 data-test-status-mode-current 13 class="button is-small is-borderless {{if (eq @statusMode "current") "is-active"}}" 14 {{on "click" (action (optional @setStatusMode) "current")}} 15 > 16 Current 17 </button> 18 <button type="button" 19 data-test-status-mode-historical 20 class="button is-small is-borderless {{if (eq @statusMode "historical") "is-active"}}" 21 {{on "click" (action (optional @setStatusMode) "historical")}}> 22 Historical 23 </button> 24 </div> 25 </div> 26 <div class="boxed-section-body"> 27 {{#if (eq @statusMode "historical")}} 28 <JobPage::Parts::SummaryChart @job={{@job}} /> 29 {{else}} 30 <h3 class="title is-4 running-allocs-title"> 31 {{#if this.allAllocsComplete}} 32 All allocations have completed successfully 33 {{else}} 34 <strong> 35 {{@job.runningAllocs ~}} 36 {{#unless this.atMostOneAllocPerNode ~}} 37 {{#if (eq @job.type "batch") ~}} 38 /{{this.totalNonCompletedAllocs}} 39 {{else ~}} 40 /{{this.totalAllocs}} 41 {{/if}} 42 {{/unless}} 43 </strong> 44 {{#if (eq @job.type "batch") ~}}Remaining{{/if}} 45 {{pluralize "Allocation" @job.runningAllocs}} Running 46 {{/if}} 47 </h3> 48 <JobStatus::AllocationStatusRow @allocBlocks={{this.allocBlocks}} @steady={{true}} /> 49 50 <div class="legend-and-summary {{if @job.latestDeployment "has-latest-deployment"}}"> 51 <legend> 52 {{#each this.allocTypes as |type|}} 53 <ConditionalLinkTo 54 @condition={{and (not (eq type.label "unplaced")) (get (get (get (get this.allocBlocks type.label) 'healthy') 'nonCanary') "length")}} 55 @route="jobs.job.allocations" 56 @model={{@job}} 57 @query={{hash status=(concat '["' type.label '"]') version=(concat '[' (map-by "version" this.versions) ']')}} 58 @class="legend-item {{if (eq (get (get (get (get this.allocBlocks type.label) 'healthy') 'nonCanary') "length") 0) "faded"}}" 59 @label="View {{type.label}} allocations" 60 > 61 <span class="represented-allocation {{type.label}}"></span> 62 <span class="count">{{get (get (get (get this.allocBlocks type.label) 'healthy') 'nonCanary') "length"}} {{capitalize type.label}}</span> 63 </ConditionalLinkTo> 64 {{/each}} 65 </legend> 66 67 68 <JobStatus::FailedOrLost 69 @rescheduledAllocs={{this.rescheduledAllocs}} 70 @restartedAllocs={{this.restartedAllocs}} 71 @job={{@job}} 72 @supportsRescheduling={{this.supportsRescheduling}} 73 /> 74 75 <section class="versions"> 76 <h4>Versions</h4> 77 <ul> 78 {{#each this.versions as |versionObj|}} 79 <li> 80 <LinkTo data-version={{versionObj.version}} @route="jobs.job.allocations" @model={{@job}} @query={{hash version=(concat '[' versionObj.version ']') status=(concat '["running", "pending", "failed"]') }}> 81 {{#if (eq versionObj.version "unknown")}} 82 <Hds::Badge @text="unknown" @type="inverted" class="version-label" /> 83 {{else}} 84 <Hds::Badge @text={{concat "v" versionObj.version}} @type="inverted" class="version-label" /> 85 {{/if}} 86 <Hds::Badge @text={{versionObj.allocations.length}} @type="filled" class="version-count" /> 87 </LinkTo> 88 </li> 89 {{/each}} 90 </ul> 91 </section> 92 93 {{#if @job.latestDeployment}} 94 <JobStatus::LatestDeployment @job={{@job}} /> 95 {{/if}} 96 97 </div> 98 99 <div class="history-and-params"> 100 {{#if this.latestVersionAllocations.length}} 101 <JobStatus::DeploymentHistory 102 @title="Allocation History" 103 @allocations={{this.latestVersionAllocations}} 104 @isHidden={{true}} 105 /> 106 {{/if}} 107 </div> 108 109 {{/if}} 110 </div> 111 </div>