1<loader loading="loading"></loader>
2<div id="sensors" class="sensors">
3  <h1>Sensors</h1>
4  <div class="page-header">
5    <h2 class="inline">All sensors present in the system</h2>
6      <a ng-href="data:text/json;charset=utf-8,{{export_data}}" class="btn btn-tertiary float-right" download="{{export_name}}"><icon file="icon-export.svg"></icon>Export</a>
7  </div>
8
9  <div>
10    <p class="content-label" aria-label="sensors filter">Filter sensors</p>
11    <div class="content__search">
12      <label for="content__search-input">Sensors Search</label>
13      <input id="content__search-input" type="text" ng-model="customSearch" ng-keydown="doSearchOnEnter($event)"/>
14      <div class="search-submit__wrapper">
15        <button class="btn" type="button" aria-label="clear filter" ng-click="clear()">
16            <icon file="icon-close.svg" aria-hidden="true"></icon>
17        </button>
18        <input id="content__search-submit" type="submit" class="btn btn-primary content__search-submit" value="Filter" ng-click="doSearchOnClick()"/>
19      </div>
20    </div>
21
22    <div class="toggle-filter">
23      <p class="content-label">FILTER BY SEVERITY</p>
24      <button class="btn" ng-click="toggleSeverityAll()"
25          ng-class="selectedSeverity.all ? 'btn-primary' : 'btn-secondary'">All
26      </button>
27      <button class="btn" ng-click="toggleSeverity('critical')"
28          ng-class="selectedSeverity.critical ? 'btn-primary' : 'btn-secondary'">Critical
29      </button>
30      <button class="btn" ng-click="toggleSeverity('warning')"
31          ng-class="selectedSeverity.warning ? 'btn-primary' : 'btn-secondary'">Warning
32      </button>
33      <button class="btn" ng-click="toggleSeverity('normal')"
34          ng-class="selectedSeverity.normal ? 'btn-primary' : 'btn-secondary'">Normal
35      </button>
36    </div>
37  </div>
38
39  <div ng-show="filteredSensorData.length == 0">
40    <span ng-if="selectedSeverity.all">{{messages.NO_SENSOR_DATA}}</span>
41    <span ng-if="selectedSeverity.critical">{{messages.CRITICAL_NO_SENSOR_DATA}}</span>
42    <span ng-if="selectedSeverity.warning">{{messages.WARNING_NO_SENSOR_DATA}}</span>
43    <span ng-if="selectedSeverity.normal">{{messages.NORMAL_NO_SENSOR_DATA}}</span>
44  </div>
45
46  <table id="sensor-categories" class="sensors__table" cellpadding="0" cellspacing="0" ng-show="filteredSensorData.length">
47    <thead class="sensors__thead fixed-table-header">
48      <tr class="sensors__thead-row">
49        <th class="sensors__thead-cell">Sensors ({{filteredSensorData.length}})<th>
50        <th class="sensors__thead-cell">Low critical<th>
51        <th class="sensors__thead-cell">Low warning<th>
52        <th class="sensors__thead-cell sensor__heading-current">Current<th>
53        <th class="sensors__thead-cell">High warning<th>
54        <th class="sensors__thead-cell">High critical<th>
55      </tr>
56    </thead>
57    <tbody class="sensors__tbody">
58      <tr class="sensors__tbody-row" ng-repeat="sensor in data|filter:filterBySeverity|filter:filterBySearchTerms|orderBy:'+custom_order' as filteredSensorData">
59        <th class="sensors__tbody-header">
60          <span class="icon" ng-class="{'icon__critical': sensor.status == 'critical', 'icon__warning': sensor.status == 'warning', 'icon__normal': sensor.status == 'normal'}" aria-label="Sensor status: {{sensor.status}}" ></span>
61          <span>{{sensor.title}}</span>
62        </th>
63        <td class="sensors__tbody-cell">
64          <span class="sensors__tbody-cell__title">Low critical</span>
65          <span class="sensors__tbody-cell__content">
66              <span class="sensors__tbody-info">{{sensor.CriticalLow}}</span>
67              <span class="sensors__tbody-degree" ng-if="sensor.unit == 'C'">&deg;</span>
68            <span class="sensors__tbody-unit">{{sensor.unit}}</span>
69          </span>
70        </td>
71        <td class="sensors__tbody-cell">
72          <span class="sensors__tbody-cell__title">Low warning</span>
73          <span class="sensors__tbody-cell__content">
74              <span class="sensors__tbody-info">{{sensor.WarningLow}}</span>
75              <span class="sensors__tbody-degree" ng-if="sensor.unit == 'C'">&deg;</span>
76            <span class="sensors__tbody-unit">{{sensor.unit}}</span>
77          </span>
78        </td>
79        <td class="sensors__tbody-cell sensors__tbody-current" ng-class="{'sensors__tbody-current--critical': sensor.status == 'critical', 'sensors__tbody-current--warn': sensor.status == 'warning', 'sensors__tbody-current--normal': sensor.status == 'normal'}">
80          <span class="sensors__tbody-cell__title">Current</span>
81          <span class="sensors__tbody-cell__content">
82              <span class="sensors__tbody-info">{{sensor.Value}}</span>
83              <span class="sensors__tbody-degree" ng-if="sensor.unit == 'C'">&deg;</span>
84            <span class="sensors__tbody-unit">{{sensor.unit}}</span>
85          </span>
86        </td>
87        <td class="sensors__tbody-cell">
88          <span class="sensors__tbody-cell__title">High warning</span>
89          <span class="sensors__tbody-cell__content">
90            <span class="sensors__tbody-info">{{sensor.WarningHigh}}</span>
91            <span class="sensors__tbody-degree" ng-if="sensor.unit == 'C'">&deg;</span>
92            <span class="sensors__tbody-unit">{{sensor.unit}}</span>
93          </span>
94        </td>
95        <td class="sensors__tbody-cell">
96          <span class="sensors__tbody-cell__title">High critical</span>
97          <span class="sensors__tbody-cell__content">
98            <span class="sensors__tbody-info">{{sensor.CriticalHigh}}</span>
99            <span class="sensors__tbody-degree" ng-if="sensor.unit == 'C'">&deg;</span>
100            <span class="sensors__tbody-unit">{{sensor.unit}}</span>
101          </span>
102        </td>
103      </tr>
104    </tbody>
105  </table>
106</div>
107