<div *ngIf="object" class="fl-content" layoutDirection="column">
  <ng-container *ngIf="monitorList && monitorList.objects.length > 0; else noMonitors">
    <table mat-table [dataSource]="monitorList.objects" class="full-width fl-margin-bottom">
      <ng-container matColumnDef="name">
        <th mat-header-cell *matHeaderCellDef i18n>Name</th>
        <td mat-cell *matCellDef="let monitor">
          <a class="active-link"
             [routerLink]="[config.getPanelUrl('openstack/load-balancers'), loadBalancerId, 'pools', object.id, 'health-monitor', monitor.id]"
             [queryParamsHandling]="'merge'">
            {{monitor.name}}
          </a>
        </td>
      </ng-container>
      <ng-container matColumnDef="type">
        <th mat-header-cell *matHeaderCellDef class="hide-xs" i18n>Type</th>
        <td mat-cell *matCellDef="let monitor" class="hide-xs">
          {{monitor.type}}
        </td>
      </ng-container>
      <ng-container matColumnDef="operating_status">
        <th mat-header-cell *matHeaderCellDef i18n>Operating status</th>
        <td mat-cell *matCellDef="let monitor">
          {{monitor.operating_status}}
        </td>
      </ng-container>
      <ng-container matColumnDef="provisioning_status">
        <th mat-header-cell *matHeaderCellDef class="hide-xs" i18n>Provisioning status</th>
        <td mat-cell *matCellDef="let monitor" class="hide-xs">
          {{monitor.provisioning_status}}
        </td>
      </ng-container>
      <ng-container matColumnDef="admin_state_up">
        <th mat-header-cell *matHeaderCellDef class="hide-xs" i18n>Admin state up</th>
        <td mat-cell *matCellDef="let monitor" class="hide-xs">
          {{monitor.admin_state_up ? 'Yes' : 'No'}}
        </td>
      </ng-container>
      <ng-container matColumnDef="(actions)">
        <th mat-header-cell *matHeaderCellDef i18n></th>
        <td mat-cell *matCellDef="let monitor">
          <div class="fl-margin-right-medium">
            <app-object-actions [objectActions]="monitorActions[monitor.id]" [maxVisibleActions]="2">
            </app-object-actions>
          </div>
        </td>
      </ng-container>
      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
      <tr mat-row *matRowDef="let monitor; columns: displayedColumns;"></tr>
    </table>
  </ng-container>
  <ng-template #noMonitors>
    <p *ngIf="monitorList" class="fl-detail fl-margin-bottom" layoutAlign="center center" i18n>No health monitors.</p>
    <p *ngIf="!monitorList" class="fl-detail fl-margin-bottom" layoutAlign="center center" i18n>Loading health monitors ...</p>
  </ng-template>
  <div layoutDirection="row" layoutAlign="center center">
    <a mat-fab fl-tooltip="Create health monitor" i18n-fl-tooltip
       [routerLink]="[config.getPanelUrl('openstack/load-balancers', loadBalancerId), 'pools', object.id, 'health-monitor-create']"
       [queryParamsHandling]="'merge'">
      <mat-icon>add</mat-icon>
    </a>
  </div>
</div>
