webui: split apart max and min sensor limits, allows sorting (#6592)

This commit is contained in:
Tony Murray
2017-05-05 12:18:05 -05:00
committed by Neil Lathwood
parent ef3a163db8
commit 9d0b35187e
3 changed files with 13 additions and 10 deletions

View File

@@ -95,12 +95,13 @@ foreach (dbFetchRows($sql, $param) as $sensor) {
$sensor['sensor_descr'] = substr($sensor['sensor_descr'], 0, 48);
$response[] = array(
'hostname' => generate_device_link($sensor),
'sensor_descr' => overlib_link($link, $sensor['sensor_descr'], $overlib_content, null),
'graph' => overlib_link($link_graph, $sensor_minigraph, $overlib_content, null),
'alert' => $alert,
'sensor_current' => $sensor['sensor_current'].$unit,
'sensor_range' => round($sensor['sensor_limit_low'], 2).$unit.' - '.round($sensor['sensor_limit'], 2).$unit,
'hostname' => generate_device_link($sensor),
'sensor_descr' => overlib_link($link, $sensor['sensor_descr'], $overlib_content, null),
'graph' => overlib_link($link_graph, $sensor_minigraph, $overlib_content, null),
'alert' => $alert,
'sensor_current' => $sensor['sensor_current'].$unit,
'sensor_limit_low' => is_null($sensor['sensor_limit_low']) ? '-' : round($sensor['sensor_limit_low'], 2).$unit,
'sensor_limit' => is_null($sensor['sensor_limit']) ? '-' : round($sensor['sensor_limit'], 2).$unit,
);
if ($_POST['view'] == 'graphs') {

View File

@@ -7,7 +7,8 @@
<th data-column-id="graph" data-sortable="false" data-searchable="false"></th>
<th data-column-id="alert" data-sortable="false" data-searchable="false"></th>
<th data-column-id="sensor_current">Current</th>
<th data-column-id="sensor_range" data-sortable="false" data-searchable="false">Range limit</th>
<th data-column-id="sensor_limit_low" data-searchable="false">Low Limit</th>
<th data-column-id="sensor_limit" data-searchable="false">High Limit</th>
</tr>
</thead>
</table>
@@ -24,7 +25,7 @@
view: '<?php echo $vars['view']; ?>',
graph_type: '<?php echo $graph_type; ?>',
unit: '<?php echo $unit; ?>',
class: '<?php echo $class; ?>',
class: '<?php echo $class; ?>'
};
},
url: "ajax_table.php"

View File

@@ -7,7 +7,8 @@
<th data-column-id="graph" data-sortable="false" data-searchable="false"></th>
<th data-column-id="alert" data-sortable="false" data-searchable="false"></th>
<th data-column-id="sensor_current">Current</th>
<th data-column-id="sensor_range" data-sortable="false" data-searchable="false">Range limit</th>
<th data-column-id="sensor_limit_low" data-searchable="false">Low Limit</th>
<th data-column-id="sensor_limit" data-searchable="false">High Limit</th>
</tr>
</thead>
</table>
@@ -24,7 +25,7 @@
view: '<?php echo $vars['view']; ?>',
graph_type: '<?php echo $graph_type; ?>',
unit: '<?php echo $unit; ?>',
class: '<?php echo $class; ?>',
class: '<?php echo $class; ?>'
};
},
url: "ajax_table.php"