diff --git a/html/css/styles.css b/html/css/styles.css index 0b5b5faeb2..765e831312 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1605,3 +1605,7 @@ tr.search:nth-child(odd) { width: 90%; height: 600px; } + +.full-width { + display:block; +} diff --git a/html/includes/hostbox-basic.inc.php b/html/includes/hostbox-basic.inc.php deleted file mode 100644 index c46713d7c6..0000000000 --- a/html/includes/hostbox-basic.inc.php +++ /dev/null @@ -1,51 +0,0 @@ - - - ' . $image . ' - ' . generate_device_link($device) . '' - ); - -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') . '
'); - -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.inc.php b/html/includes/hostbox.inc.php deleted file mode 100644 index 8d3115bb69..0000000000 --- a/html/includes/hostbox.inc.php +++ /dev/null @@ -1,60 +0,0 @@ - - - ' . $image . ' - ' . generate_device_link($device) . ' -
' . $device['sysName'] . '' - ); - -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') . '
'); - -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/table/devices.inc.php b/html/includes/table/devices.inc.php new file mode 100644 index 0000000000..7d45e3708d --- /dev/null +++ b/html/includes/table/devices.inc.php @@ -0,0 +1,157 @@ + +
'); + $actions .= ' View device '; + $actions .= ('
+
'); + $actions .= ' View alerts '; + $actions .= '
'; + if ($_SESSION['userlevel'] >= "7") { + $actions .= ('
+ Edit device +
'); + } + $actions .= (' +
+
+ telnet +
+
+ ssh +
+
+ https +
+
'); + + $hostname = generate_device_link($device); + $platform = $device['hardware'] . '
' . $device['features']; + $os = $device['os_text'] . '
' . $device['version']; + $uptime = formatUptime($device['uptime'], 'short') . '
' . truncate($device['location'],32, ''); + if ($subformat == "detail") { + $hostname .= '
' . $device['sysName']; + if ($port_count) { + $col_port = ' '.$port_count . '
'; + } + if ($sensor_count) { + $col_port .= ' '.$sensor_count; + } + } else { + + } + $response[] = array('extra'=>$extra,'msg'=>$msg,'icon'=>$image,'hostname'=>$hostname,'ports'=>$col_port,'hardware'=>$platform,'os'=>$os,'uptime'=>$uptime,'actions'=>$actions); + } + } +} + +$output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$total); +echo _json_encode($output); diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index 38528cc2f1..3eeb8d8c59 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -4,50 +4,6 @@ if(!isset($vars['format'])) { $vars['format'] = "list_detail"; } -$sql_param = array(); -if(isset($vars['state'])) -{ - if($vars['state'] == 'up') - { - $state = '1'; - } - elseif($vars['state'] == 'down') - { - $state = '0'; - } -} - -if (!empty($vars['hostname'])) { $where .= " AND hostname LIKE ?"; $sql_param[] = "%".$vars['hostname']."%"; } -if (!empty($vars['os'])) { $where .= " AND os = ?"; $sql_param[] = $vars['os']; } -if (!empty($vars['version'])) { $where .= " AND version = ?"; $sql_param[] = $vars['version']; } -if (!empty($vars['hardware'])) { $where .= " AND hardware = ?"; $sql_param[] = $vars['hardware']; } -if (!empty($vars['features'])) { $where .= " AND features = ?"; $sql_param[] = $vars['features']; } -if (!empty($vars['type'])) { - if ($vars['type'] == 'generic') { - $where .= " AND ( type = ? OR type = '')"; $sql_param[] = $vars['type']; - } else { - $where .= " AND type = ?"; $sql_param[] = $vars['type']; - } -} -if (!empty($vars['state'])) { - $where .= " AND status= ?"; $sql_param[] = $state; - $where .= " AND disabled='0' AND `ignore`='0'"; $sql_param[] = ''; -} -if (!empty($vars['disabled'])) { $where .= " AND disabled= ?"; $sql_param[] = $vars['disabled']; } -if (!empty($vars['ignore'])) { $where .= " AND `ignore`= ?"; $sql_param[] = $vars['ignore']; } -if (!empty($vars['location']) && $vars['location'] == "Unset") { $location_filter = ''; } -if (!empty($vars['location'])) { $location_filter = $vars['location']; } -if( !empty($vars['group']) ) { - require_once('../includes/device-groups.inc.php'); - $where .= " AND ( "; - foreach( GetDevicesFromGroup($vars['group']) as $dev ) { - $where .= "device_id = ? OR "; - $sql_param[] = $dev['device_id']; - } - $where = substr($where, 0, strlen($where)-3); - $where .= " )"; -} - $pagetitle[] = "Devices"; print_optionbar_start(); @@ -125,140 +81,14 @@ foreach ($menu_options as $option => $text) } else { echo('Remove Header'); } + +print_optionbar_end(); ?> -
-
- -
-
- - -
-
- - -
-
- - - -
-
- Update URL | - Reset -
-
- - -
- '); - - if ($subformat == "detail" || $subformat == "basic") - { - echo(' - - - - - - - - - '); - } +?> - foreach (dbFetchRows($query, $sql_param) as $device) - { - if (device_permitted($device['device_id'])) - { - if (!isset($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"); - } else { - include("includes/hostbox-basic.inc.php"); +
+
+
DevicePlatformOperating SystemUptime/LocationActions
+ + + + + + + + + + + + +
DevicePlatformOperating SystemUptime/LocationActions
+
+ + + +