github.com/hernad/nomad@v1.6.112/ui/app/components/task-sub-row.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  <tr class="task-sub-row {{if @active "is-active"}}"
     7  	{{keyboard-shortcut
     8  		enumerated=true
     9  		action=(action "gotoTask" this.task.allocation this.task)
    10  	}}
    11  >
    12  	<td colspan={{@namespan}}>
    13  		<div class="name-grid">
    14  			<LinkTo title={{this.task.name}} class="task-name" @route="allocations.allocation.task" @models={{array this.task.allocation this.task}}>{{this.task.name}}</LinkTo>
    15  			<button type="button" class="logs-sidebar-trigger button is-borderless is-inline is-compact" onclick={{action "handleTaskLogsClick" this.task}}>
    16  				<FlightIcon @name="logs" />View Logs
    17  			</button>
    18  		</div>
    19  	</td>
    20  	<td data-test-cpu class="is-1 has-text-centered">
    21  		{{#if this.task.isRunning}}
    22  			{{#if (and (not this.cpu) this.fetchStats.isRunning)}}
    23  				...
    24  			{{else if this.statsError}}
    25  				<span
    26  					class="tooltip text-center"
    27  					role="tooltip"
    28  					aria-label="Couldn't collect stats"
    29  				>
    30  					{{x-icon "alert-triangle" class="is-warning"}}
    31  				</span>
    32  			{{else}}
    33  				<div
    34  					class="inline-chart is-small tooltip"
    35  					role="tooltip"
    36  					aria-label="{{format-hertz this.cpu.used}}
    37  						/
    38  						{{format-hertz this.taskStats.reservedCPU}}"
    39  				>
    40  					<progress
    41  						class="progress is-info is-small"
    42  						value="{{this.cpu.percent}}"
    43  						max="1"
    44  					>
    45  						{{this.cpu.percent}}
    46  					</progress>
    47  				</div>
    48  			{{/if}}
    49  		{{/if}}
    50  	</td>
    51  	<td data-test-mem class="is-1 has-text-centered">
    52  		{{#if this.task.isRunning}}
    53  			{{#if (and (not this.memory) this.fetchStats.isRunning)}}
    54  				...
    55  			{{else if this.statsError}}
    56  				<span
    57  					class="tooltip is-small text-center"
    58  					role="tooltip"
    59  					aria-label="Couldn't collect stats"
    60  				>
    61  					{{x-icon "alert-triangle" class="is-warning"}}
    62  				</span>
    63  			{{else}}
    64  				<div
    65  					class="inline-chart tooltip"
    66  					role="tooltip"
    67  					aria-label="{{format-bytes this.memory.used}}
    68  						/
    69  						{{format-bytes this.taskStats.reservedMemory start="MiB"}}"
    70  				>
    71  					<progress
    72  						class="progress is-danger is-small"
    73  						value="{{this.memory.percent}}"
    74  						max="1"
    75  					>
    76  						{{this.memory.percent}}
    77  					</progress>
    78  				</div>
    79  			{{/if}}
    80  		{{/if}}
    81  	</td>
    82  </tr>
    83  
    84  {{yield}}
    85  
    86  {{#if this.shouldShowLogs}}
    87  	<TaskContextSidebar
    88  		@task={{this.task}}
    89  		@fns={{hash
    90  			closeSidebar=this.closeSidebar
    91  		}}
    92  	/>
    93  {{/if}}