mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-31 16:23:50 +02:00
Tidy up + new tiles
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$sql = "SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime` FROM `devices` AS `D`";
|
||||
$sql = 'SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime` FROM `devices` AS `D`';
|
||||
|
||||
if (is_admin() === false && is_read() === false) {
|
||||
$sql .= " , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND";
|
||||
$sql .= ' , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND';
|
||||
$param = array($_SESSION['user_id']);
|
||||
}
|
||||
else {
|
||||
$sql .= " WHERE";
|
||||
$sql .= ' WHERE';
|
||||
}
|
||||
|
||||
$sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `hostname`";
|
||||
@@ -34,12 +34,11 @@ foreach(dbFetchRows($sql,$param) as $device) {
|
||||
else {
|
||||
$btn_type = 'btn-danger';
|
||||
}
|
||||
$temp_output[] = "<a href='" .generate_url(array('page' => 'device', 'device' => $device['device_id'])). "' role='button' class='btn " . $btn_type . " btn-xs' title='" . $device['hostname'] . "' style='min-height:25px; min-width:25px; border-radius:0px; border:0px; margin:0; padding:0;'></a>";
|
||||
$temp_output[] = '<a href="' .generate_url(array('page' => 'device', 'device' => $device['device_id'])). '" role="button" class="btn ' . $btn_type . ' btn-xs" title="' . $device['hostname'] . '" style="min-height:25px; min-width:25px; border-radius:0px; border:0px; margin:0; padding:0;"></a>';
|
||||
}
|
||||
|
||||
$temp_rows = count($temp_output);
|
||||
|
||||
$temp_output[] = "</div>";
|
||||
$temp_header = array("<div style='margin-left:auto; margin-right:auto;'><center><h3>All Devices(" . $temp_rows . ")</h3></center>");
|
||||
$temp_output[] = '</div>';
|
||||
$temp_header = array('<div style="margin-left:auto; margin-right:auto;"><center><h3>All Devices(' . $temp_rows . ')</h3></center>');
|
||||
$common_output = array_merge($temp_header,$temp_output);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user