ui/app/components/workload-row/template.hbs

98 lines
3.4 KiB
Handlebars

<tr class="main-row">
<td class="row-check" valign="middle" style="padding-top: 2px;">
{{check-box nodeId=model.id}}
</td>
<td>
{{#if canExpand}}<i role="button" {{action "toggle"}} class="icon icon-play eased text-small text-muted {{if expanded "icon-rotate-90"}}"><span class="visually-hidden">Open accordion</span></i>{{/if}}
</td>
<td data-title="{{dt.state}}" class="state">
{{badge-state model=model}}
</td>
<td data-title="{{dt.name}}" class="clip">
<a href="{{href-to "workload" model.id}}">{{model.displayName}} <i class="{{model.activeIcon}}"></i></a>
{{#if model.showTransitioningMessage}}
<div class="clip text-small {{model.stateColor}}">{{uc-first model.transitioningMessage}}</div>
{{else if model.displayEndpoints}}
<div class="clip text-small force-wrap">
{{model.displayEndpoints}}
</div>
{{/if}}
</td>
{{#if showImage}}
<td data-title="{{dt.image}}" class="clip top-half">
{{#tooltip-element
type="tooltip-basic"
tooltipTemplate="tooltip-multi-lines"
model=model.displayImages
}}
<div class="text-small clip">{{model.displayImage}}</div>
{{/tooltip-element}}
<p data-title="{{t "generic.details"}}" class="text-small text-muted m-0 clip">
{{#if subMatches}}
{{#if (eq (get subMatches model.id) 0)}}
{{t "pagination.podNoSubset" count=podCount htmlSafe=true}}
{{else if (lt (get subMatches model.id) podCount)}}
{{t "pagination.podHighlightSubset" subset=(get subMatches model.id) count=podCount htmlSafe=true}}
{{else}}
<b>{{t "pagination.pod" pages=1 count=podCount}}</b>
{{/if}}
{{else}}
{{t "pagination.pod" pages=1 count=(concat podCount "")}}
{{/if}} /
{{t "generic.createdDate"
date=(date-from-now model.created)
htmlSafe=true
}} /
{{t "generic.podRestarts"}}: {{model.restarts}}
</p>
</td>
{{/if}}
<td data-title="{{dt.scale}}" class="text-center">
{{progress-bar-multi
classNames="mt-5"
labelKey="state"
valueKey="count"
values=model.podStates.byColor
tooltipValues=model.podStates.byName
}}
<small class="text-muted">
{{model.displayScale}}
</small>
</td>
<td data-title="{{dt.actions}}" class="actions">
{{action-menu model=model}}
</td>
</tr>
{{#if canExpand}}
<tr class="sub-row {{unless expanded "hide"}}">
<td colspan="2">{{! checkbox and expand}}</td>
<td colspan="{{sub fullColspan 4}}">
{{#if expanded}}
{{pod-dots
pods=model.pods
searchText=searchText
groupByPod=model.hasSidekicks
}}
{{/if}}
</td>
<td class="text-center">
{{#if (and expanded model.canScale)}}
<div class="btn-group-xs bg-default scale-arrow">
<button class="btn btn-xs bg-primary" disabled={{not model.canScaleDown}} type="button" {{action "scaleDown" target=model}}><i class="icon icon-minus icon-fw"/></button>
<button class="btn btn-xs bg-primary" disabled={{not model.canScaleUp}} type="button" {{action "scaleUp" target=model}}><i class="icon icon-plus icon-fw"/></button>
</div>
{{/if}}
</td>
<td>{{! actions}}</td>
</tr>
{{#if expanded}}
<tr class="separator-row">
<td colspan="{{fullColspan}}"></td>
</tr>
{{/if}}
{{/if}}