<tr class="main-row">
  <td valign="middle" class="row-check" style="padding-top: 2px;">
    {{check-box nodeId=model.id}}
  </td>

  <td data-title="{{dt.state}}" class="state">
    {{badge-state model=model}}
  </td>

  <td data-title="{{dt.name}}" class="clip">
    {{#if (eq view "global")}}
      {{#if model.clusterId}}
        <a href="{{href-to 'authenticated.cluster.monitoring.node-detail' model.clusterId model.id}}">{{model.displayName}}</a>
      {{else}}
        {{model.displayName}}
      {{/if}}
    {{else}}
      <a href="{{href-to 'authenticated.cluster.monitoring.node-detail' model.clusterId model.id}}">{{model.displayName}}</a>
    {{/if}}
    {{#if (or model.externalIpAddress model.ipAddress)}}
      {{node-ip model=model}}
    {{/if}}
  </td>

  {{#if showCluster}}
    <td data-title="{{dt.cluster}}">
      {{#if model.cluster}}
        {{model.cluster.displayName}}
      {{else}}
        <b>{{t 'generic.none'}}</b>
      {{/if}}

      <div class="text-small">
        {{#each model.displayRoles as |role|}}
          <span class="badge badge-xs bg-info">{{role}}</span>
        {{else}}
          <span class="text-muted">{{t 'generic.none'}}</span>
        {{/each}}
      </div>
    </td>
  {{/if}}


  {{#if showRoles}}
    <td data-title="{{dt.roles}}">
      {{#each model.displayRoles as |role|}}
        <span class="badge badge-xs bg-info">{{role}}</span>
      {{else}}
        <span class="text-muted">{{t 'generic.none'}}</span>
      {{/each}}
    </td>
  {{/if}}

  <td data-title="{{dt.version}}">
    {{#if model.info.kubernetes.kubeletVersion}}
      {{model.info.kubernetes.kubeletVersion}}
      {{#if model.engineBlurb}}
        <div class="text-small text-muted">
          <span>
            <i class="icon {{model.engineIcon}}"></i>
            {{model.engineBlurb}}
          </span>
        </div>
      {{/if}}
      {{#if (and model.osInfo scope.currentCluster.isWindows)}}
        <div class="text-small text-muted">
          <span>
            <i class="icon icon-fw icon-{{model.osInfo}}"></i>
            <span class="text-capitalize">
              {{model.osInfo}}
            </span>
          </span>
        </div>
      {{/if}}
    {{else}}
      <span class="text-muted">
        {{t 'generic.na'}}
      </span>
    {{/if}}
  </td>

  <td class="text-right" data-title="{{dt.cpu}}">
    {{#if model.cpuUsage}}
      {{model.cpuUsage}}
    {{else}}
      <span class="text-muted">
        {{t 'generic.na'}}
      </span>
    {{/if}}
  </td>

  <td class="text-right" data-title="{{dt.memory}}">
    {{#if model.memoryUsage}}
      {{model.memoryUsage}}
    {{else}}
      <span class="text-muted">
        {{t 'generic.na'}}
      </span>
    {{/if}}
  </td>

  <td class="text-right" data-title="{{dt.pod}}">
    {{#if model.podUsage}}
      {{model.podUsage}}
    {{else}}
      <span class="text-muted">
        {{t 'generic.na'}}
      </span>
    {{/if}}
  </td>

  <td data-title="{{dt.actions}}" class="actions">
    {{action-menu model=model showPrimary=false}}
  </td>
</tr>

{{#if (or model.displayUserLabelStrings.length model.displayTaintsStrings.length model.requireAnyLabelStrings.length model.isUnschedulable)}}
  <tr class="sub-row">
    <td colspan="2">{{! checkbox and expand}}</td>
    <td colspan="{{sub labelColspan 3}}">
      {{#if model.isUnschedulable}}
        <span class="tag-xs bg-warning">{{t 'nodesPage.table.unschedulable'}}</span>
      {{/if}}
      {{#each model.displayTaintsStrings as |taint|}}
        <span class="tag-xs bg-warning">{{taint}}</span>
      {{/each}}
      {{#each model.requireAnyLabelStrings as |label|}}
        <span class="tag-xs bg-warning">{{label}}</span>
      {{/each}}
      {{#each model.displayUserLabelStrings as |label|}}
        <span class="tag-xs bg-info">{{label}}</span>
      {{/each}}
    </td>
  </tr>
{{/if}}

{{#if model.showTransitioningMessage}}
  {{error-sub-row fullColspan=fullColspan model=model}}
{{/if}}

<tr class="sub-row {{unless expanded 'hide'}}">
  <td colspan="2">{{! checkbox and expand}}</td>
  <td colspan="{{sub fullColspan 3}}">
    {{#liquid-if expanded}}
      {{container-table
        body=model.instances
        stickyHeader=false
        bulkActions=false
        search=false
        searchText=searchText
        subRow=true
        showNode=false
      }}
    {{/liquid-if}}
  </td>
  <td>{{! actions}}</td>
</tr>

{{#if expanded}}
  <tr class="separator-row">
    <td colspan="{{fullColspan}}"></td>
  </tr>
{{/if}}
