Visually tidied up the devices pages

This commit is contained in:
laf
2014-03-02 20:10:15 +00:00
parent ce4eb65f7b
commit 9c6d73dae3
3 changed files with 32 additions and 31 deletions

View File

@@ -4,21 +4,21 @@ if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b
if ($device['status'] == '0')
{
$class = "list-device-down";
$class = "bg-danger";
} else {
$class = "list-device";
$class = "bg-primary";
}
if ($device['ignore'] == '1')
{
$class = "list-device-ignored";
$class = "bg-warning";
if ($device['status'] == '1')
{
$class = "list-device-ignored-up";
$class = "bg-success";
}
}
if ($device['disabled'] == '1')
{
$class = "list-device-disabled";
$class = "bg-info";
}
$type = strtolower($device['os']);
@@ -26,14 +26,13 @@ $type = strtolower($device['os']);
if ($device['os'] == "ios") { formatCiscoHardware($device, true); }
$device['os_text'] = $config['os'][$device['os']]['text'];
echo(' <tr class="'.$class.'" bgcolor="' . $bg . '" onmouseover="this.style.backgroundColor=\'#fdd\';" onmouseout="this.style.backgroundColor=\'' . $bg . '\';"
onclick="location.href=\'device/'.$device['device_id'].'/\'" style="cursor: pointer;">
<td width="1" style="background-color: '.$table_tab_colour.';"></td>
<td width="40" class="paddedcell" align="center" valign="middle">' . $image . '</td>
<td width="300"><span style="font-size: 15px;">' . generate_device_link($device) . '</span></td>'
echo(' <tr onclick="location.href=\'device/'.$device['device_id'].'/\'" style="cursor: pointer;">
<td class="'. $class .' "></td>
<td>' . $image . '</td>
<td><span style="font-size: 15px;">' . generate_device_link($device) . '</span></td>'
);
echo('<td width="55">');
echo('<td>');
if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); }
echo('<br />');
if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); }

View File

@@ -5,25 +5,25 @@ if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b
if ($device['status'] == '0')
{
$class = "list-device-down";
$table_tab_colour = "#cc0000";
$table_tab_colour = "bg-danger";
} else {
$class = "list-device";
$table_tab_colour = "#0000cc";
$table_tab_colour = "bg-primary";
}
if ($device['ignore'] == '1')
{
$class = "list-device-ignored";
$table_tab_colour = "#aaaaaa";
$table_tab_colour = "bg-warning";
if ($device['status'] == '1')
{
$class = "list-device-ignored-up";
$table_tab_colour = "#009900";
$table_tab_colour = "bg-success";
}
}
if ($device['disabled'] == '1')
{
$class = "list-device-disabled";
$table_tab_colour = "#aaaaaa";
$table_tab_colour = "bg-info";
}
$type = strtolower($device['os']);
@@ -35,22 +35,21 @@ $device['os_text'] = $config['os'][$device['os']]['text'];
$port_count = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `device_id` = ?", array($device['device_id']));
$sensor_count = dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ?", array($device['device_id']));
echo(' <tr class="'.$class.'" onmouseover="this.style.backgroundColor=\'#fdd\';" onmouseout="this.style.backgroundColor=\'' . $bg . '\';"
onclick="location.href=\'device/device='.$device['device_id'].'/\'" style="cursor: pointer;">
<td width="1" style="background-color: '.$table_tab_colour.';"></td>
<td width="40" class="paddedcell" align="center" valign="middle">' . $image . '</td>
<td width="300" class="paddedcell"><span style="font-size: 15px;">' . generate_device_link($device) . '</span>
echo(' <tr onclick="location.href=\'device/device='.$device['device_id'].'/\'" style="cursor: pointer;">
<td class="'. $table_tab_colour .'"></td>
<td>' . $image . '</td>
<td><span style="font-size: 15px;">' . generate_device_link($device) . '</span>
<br />' . $device['sysName'] . '</td>'
);
echo('<td width="55">');
echo('<td>');
if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); }
echo('<br />');
if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); }
echo('</td>');
echo(' <td class="paddedcell">' . $device['hardware'] . '<br />' . $device['features'] . '</td>');
echo(' <td class="paddedcell">' . $device['os_text'] . '<br />' . $device['version'] . '</td>');
echo(' <td class="paddedcell">' . formatUptime($device['uptime'], 'short') . ' <br />');
echo(' <td>' . $device['hardware'] . '<br />' . $device['features'] . '</td>');
echo(' <td>' . $device['os_text'] . '<br />' . $device['version'] . '</td>');
echo(' <td>' . formatUptime($device['uptime'], 'short') . ' <br />');
if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); }
echo(' ' . truncate($device['location'],32, '') . '</td>');

View File

@@ -273,17 +273,19 @@ if($format == "graph")
} else {
echo('<table class="table table-condensed">');
echo('<div class="panel panel-default panel-condensed">
<table class="table table-condensed">');
if ($subformat == "detail" || $subformat == "basic")
{
echo('<tr class="tablehead">
echo('<tr>
<th></th>
<th></th>
<th class="paddedcell">Device</th>
<th>Device</th>
<th></th>
<th class="paddedcell">Platform</th>
<th class="paddedcell">Operating System</th>
<th class="paddedcell">Uptime/Location</th>
<th>Platform</th>
<th>Operating System</th>
<th>Uptime/Location</th>
</tr>');
}
@@ -304,6 +306,7 @@ if($format == "graph")
}
}
echo("</table>");
echo('</div>');
}
?>