github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/components/task-sub-row.hbs (about)

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