All files / src/app/components/device-card device-card.component.html

95.52% Statements 64/67
100% Branches 2/2
100% Functions 0/0
100% Lines 38/38

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 5586x   175x 175x         3x 175x   3x 172x   3x 175x   3x 172x   3x 172x 175x   3x   3x   172x 3x 3x 3x 3x 3x 172x 3x 3x 3x 3x 3x 172x 3x 3x 3x 3x 3x     172x 175x 3x     3x  
<div class="columns" *ngIf="device">
    <div class="column is-two-thirds">
        <h1 class="title">{{device.name}}</h1>
        <h2 class="subtitle is-5">device #{{device.device_id.slice(8)}}</h2>
 
        <div class="field is-grouped is-grouped-multiline">
            <div class="control">
              <div class="tags has-addons">
                <span class="tag is-dark">Status</span>
                <span class="tag " [ngClass]="{'is-success': device.status === 'up', 'is-danger': device.status === 'down'}">{{device.status}}</span>
              </div>
            </div>
            <div class="control" *ngIf="device.status === 'up' && currentMode">
              <div class="tags has-addons">
                <span class="tag is-dark">Current mode</span>
                <span class="tag is-info" >{{currentMode.name}}</span>
              </div>
            </div>
            <div class="control" *ngIf="device.status === 'up'">
              <div class="tags has-addons">
                <span class="tag is-dark">Load</span>
                <span *ngIf="device.load === undefined" class="tag is-danger">No load info</span>
                <span *ngIf="device.load !== undefined" class="tag " [ngClass]="{'is-success': device.load < 0.2, 'is-danger': device.load >= 0.2}">{{device.load*100 | number: '1.0-0'}} %</span>
              </div>
            </div>
        </div>
    </div>
    <div class="column">
        <button class="button" [routerLink]="['/devices', deviceId, 'petri-network']" id="petri-network">
          <span class="icon">
            <i class="iconoir-network-reverse"></i>
          </span>
          <span>Logic</span>
        </button>
        <button class="button" [routerLink]="['/devices', deviceId, 'pid']" id="pid">
            <span class="icon is-small">
                <i class="iconoir-temperature-high"></i>
              </span>
              <span>PID</span>
        </button>
        <button class="button" [routerLink]="['/devices', deviceId, 'states']" id="device-states">
            <span class="icon is-small">
                <i class="pi pi-history"></i>
              </span>
              <span>History</span>
        </button>
 
 
        <div class="tags places" *ngIf="device.status === 'up'">
          <span class="tag" *ngFor="let place of places">{{place}}</span>
        </div>
 
    </div>
  </div>