From 6e7c095bdec411872aca1f23630a24a6be0eb703 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 3 Feb 2015 21:35:34 +0000 Subject: [PATCH] Added a sub-menu on the device list page to enable quick access to features --- html/includes/hostbox-basic.inc.php | 17 ++++++++-------- html/includes/hostbox-menu.inc.php | 31 +++++++++++++++++++++++++++++ html/includes/hostbox.inc.php | 17 ++++++++-------- html/pages/devices.inc.php | 2 ++ 4 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 html/includes/hostbox-menu.inc.php diff --git a/html/includes/hostbox-basic.inc.php b/html/includes/hostbox-basic.inc.php index 094e7a7278..c46713d7c6 100644 --- a/html/includes/hostbox-basic.inc.php +++ b/html/includes/hostbox-basic.inc.php @@ -27,23 +27,24 @@ if ($device['os'] == "ios") { formatCiscoHardware($device, true); } $device['os_text'] = $config['os'][$device['os']]['text']; $image = getImage($device); -echo(' - - ' . $image . ' - ' . generate_device_link($device) . '' +echo(' + + ' . $image . ' + ' . generate_device_link($device) . '' ); -echo(''); +echo(''); if ($port_count) { echo(' '.$port_count); } echo('
'); if ($sensor_count) { echo(' '.$sensor_count); } echo(''); -echo(' ' . $device['hardware'] . ' ' . $device['features'] . ''); -echo(' ' . $device['os_text'] . ' ' . $device['version'] . ''); -echo(' ' . formatUptime($device['uptime'], 'short') . '
'); +echo(' ' . $device['hardware'] . ' ' . $device['features'] . ''); +echo(' ' . $device['os_text'] . ' ' . $device['version'] . ''); +echo(' ' . formatUptime($device['uptime'], 'short') . '
'); if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); } echo(' ' . truncate($device['location'],32, '') . ''); +require 'hostbox-menu.inc.php'; echo(' '); diff --git a/html/includes/hostbox-menu.inc.php b/html/includes/hostbox-menu.inc.php new file mode 100644 index 0000000000..c34d8e94d1 --- /dev/null +++ b/html/includes/hostbox-menu.inc.php @@ -0,0 +1,31 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +echo(''); + +?> diff --git a/html/includes/hostbox.inc.php b/html/includes/hostbox.inc.php index 021412225e..454039adfd 100644 --- a/html/includes/hostbox.inc.php +++ b/html/includes/hostbox.inc.php @@ -35,24 +35,25 @@ $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(' - - ' . $image . ' - ' . generate_device_link($device) . ' +echo(' + + ' . $image . ' + ' . generate_device_link($device) . '
' . $device['sysName'] . '' ); -echo(''); +echo(''); if ($port_count) { echo(' '.$port_count); } echo('
'); if ($sensor_count) { echo(' '.$sensor_count); } echo(''); -echo(' ' . $device['hardware'] . '
' . $device['features'] . ''); -echo(' ' . $device['os_text'] . '
' . $device['version'] . ''); -echo(' ' . formatUptime($device['uptime'], 'short') . '
'); +echo(' ' . $device['hardware'] . '
' . $device['features'] . ''); +echo(' ' . $device['os_text'] . '
' . $device['version'] . ''); +echo(' ' . formatUptime($device['uptime'], 'short') . '
'); if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); } echo(' ' . truncate($device['location'],32, '') . ''); +require 'hostbox-menu.inc.php'; echo(' '); diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index 78ea28f665..1e7af240d5 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -283,6 +283,7 @@ if($format == "graph") Platform Operating System Uptime/Location + Actions '); } @@ -293,6 +294,7 @@ if($format == "graph") if (!$location_filter || ((get_dev_attrib($device,'override_sysLocation_bool') && get_dev_attrib($device,'override_sysLocation_string') == $location_filter) || $device['location'] == $location_filter)) { + $cell_click = 'onclick="location.href=\'device/device='.$device['device_id'].'/\'" style="cursor: pointer;"'; if ($subformat == "detail") { include("includes/hostbox.inc.php");