From aad9b675c32521cde91b6492fd894c4c06b7662e Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 6 Sep 2016 02:01:15 +0300 Subject: [PATCH 001/126] more options to amap --- html/css/styles.css | 1 - html/includes/common/availability-map.inc.php | 458 ++++++++---------- html/includes/functions.inc.php | 12 +- html/pages/settings/webui.inc.php | 14 +- sql-schema/133.sql | 3 + 5 files changed, 229 insertions(+), 259 deletions(-) create mode 100644 sql-schema/133.sql diff --git a/html/css/styles.css b/html/css/styles.css index e0b0caef57..7649a3e30a 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1872,7 +1872,6 @@ label { .device-availability, .service-availability { color:#000000; float:left; - width:163px; height:64px; margin:10px; padding:8px; diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php index 80cd4b38da..fefb525830 100644 --- a/html/includes/common/availability-map.inc.php +++ b/html/includes/common/availability-map.inc.php @@ -18,34 +18,164 @@ $select_modes = array( '2' => 'devices and services', ); -if (defined('SHOW_SETTINGS')) { - if (isset($widget_settings['mode'])) { - $mode = $widget_settings['mode']; - } else { - $mode = 0; +require_once 'includes/object-cache.inc.php'; + +$sql = dbFetchRow('SELECT `settings` FROM `users_widgets` WHERE `user_id` = ? AND `widget_id` = ?', array($_SESSION["user_id"], '1')); +$widget_mode = json_decode($sql['settings']); + +if (isset($_SESSION["map_view"])) { + $mode = $_SESSION["map_view"]; +} else { + $mode = $widget_mode->{'mode'}; +} + +$host_up_count = 0; +$host_warn_count = 0; +$host_down_count = 0; +$service_up_count = 0; +$service_warn_count = 0; +$service_down_count = 0; + +if ($config['webui']['availability_map_sort_status'] == 1) { + $deviceOrderBy = 'status'; + $serviceOrderBy = '`S`.`service_status` DESC'; +} else { + $deviceOrderBy = 'hostname'; + $serviceOrderBy = '`D`.`hostname`'; +} + +if ($mode == 0 || $mode == 2) { + // Only show devices if mode is 0 or 2 (Only Devices or both) + if ($config['webui']['availability_map_use_device_groups'] != 0) { + $device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?'; + $param = array($_SESSION['group_view']); + $devices = dbFetchRows($device_group, $param); + foreach ($devices as $in_dev) { + $in_devices[] = $in_dev['device_id']; + } + $in_devices = implode(',', $in_devices); } - if (isset($widget_settings['tile_width'])) { - $current_width = $widget_settings['tile_width']; + $sql = 'SELECT `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`status`, `D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`'; + + if (is_normal_user() === true) { + $sql .= ' , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND'; + $param = array( + $_SESSION['user_id'] + ); } else { - $current_width = 10; + $sql .= ' WHERE'; } - $common_output[] = ' -
-
- -
- -
-
-
- -
- '; if ($config['show_services'] == 0) { - $common_output[] = ''; + $temp_header[] = ''; } else { foreach ($select_modes as $mode_select => $option) { if ($mode_select == $mode) { @@ -53,249 +183,71 @@ if (defined('SHOW_SETTINGS')) { } else { $selected = ''; } - $common_output[] = ''; - } - } - $common_output[] =' - -
-
-
-
-
-
'; -} else { - require_once 'includes/object-cache.inc.php'; - - $sql = dbFetchRow('SELECT `settings` FROM `users_widgets` WHERE `user_id` = ? AND `widget_id` = ?', array($_SESSION["user_id"], '1')); - $widget_mode = json_decode($sql['settings']); - - if (isset($_SESSION["map_view"])) { - $mode = $_SESSION["map_view"]; - } else { - $mode = $widget_mode->{'mode'}; - } - - $host_up_count = 0; - $host_warn_count = 0; - $host_down_count = 0; - $service_up_count = 0; - $service_warn_count = 0; - $service_down_count = 0; - - if ($config['webui']['availability_map_sort_status'] == 1) { - $deviceOrderBy = 'status'; - $serviceOrderBy = '`S`.`service_status` DESC'; - } else { - $deviceOrderBy = 'hostname'; - $serviceOrderBy = '`D`.`hostname`'; - } - - if ($mode == 0 || $mode == 2) { - // Only show devices if mode is 0 or 2 (Only Devices or both) - if ($config['webui']['availability_map_use_device_groups'] != 0) { - $device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?'; - $param = array($_SESSION['group_view']); - $devices = dbFetchRows($device_group, $param); - foreach ($devices as $in_dev) { - $in_devices[] = $in_dev['device_id']; - } - $in_devices = implode(',', $in_devices); - } - - $sql = 'SELECT `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`status`, `D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`'; - - if (is_normal_user() === true) { - $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'; - } - - - if ($config['webui']['availability_map_use_device_groups'] != 0 && isset($in_devices)) { - $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' AND `D`.`device_id` IN (".$in_devices.") ORDER BY `".$deviceOrderBy."`"; - } else { - $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `".$deviceOrderBy."`"; - } - - $temp_output = array(); - - foreach (dbFetchRows($sql, $param) as $device) { - if ($device['status'] == '1') { - if (($device['uptime'] < $config['uptime_warning']) && ($device['uptime'] != '0')) { - $deviceState = 'warn'; - $deviceLabel = 'label-warning'; - $deviceLabelOld = 'availability-map-oldview-box-warn'; - $host_warn_count++; - } else { - $deviceState = 'up'; - $deviceLabel = 'label-success'; - $deviceLabelOld = 'availability-map-oldview-box-up'; - $host_up_count++; - } - } else { - $deviceState = 'down'; - $deviceLabel = 'label-danger'; - $deviceLabelOld = 'availability-map-oldview-box-down'; - $host_down_count++; - } - - if ($config['webui']['old_availability_map'] == 0) { - if ($directpage == "yes") { - $deviceIcon = getImage($device); - $temp_output[] = ' - -
- '.$deviceState.' - '.$deviceIcon.'
- '.shorthost(ip_to_sysname($device, $device['hostname'])).' -
-
'; - } else { - $temp_output[] = ' - - '.$deviceState.' - '; - } - } else { - $temp_output[] = '
'; - } + $temp_header[] = ''; } } - if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { - $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id` ORDER BY '.$serviceOrderBy.';'; - $services = dbFetchRows($service_query); - if (count($services) > 0) { - foreach ($services as $service) { - if ($service['service_status'] == '0') { - $serviceLabel = "label-success"; - $serviceLabelOld = 'availability-map-oldview-box-up'; - $serviceState = "up"; - $service_up_count++; - } elseif ($service['service_status'] == '1') { - $serviceLabel = "label-warning"; - $serviceLabelOld = 'availability-map-oldview-box-warn'; - $serviceState = "warn"; - $service_warn_count++; - } else { - $serviceLabel = "label-danger"; - $serviceLabelOld = 'availability-map-oldview-box-down'; - $serviceState = "down"; - $service_down_count++; - } - - if ($config['webui']['old_availability_map'] == 0) { - if ($directpage == "yes") { - $deviceIcon = getImage($service); - $temp_output[] = ' - -
- '.$service["service_type"].' - '.$serviceState.' - '.$deviceIcon.'
- '.shorthost(ip_to_sysname($service, $service['hostname'])).' -
-
'; - } else { - $temp_output[] = ' - - '.$service['service_type'].' - '.$serviceState.' - '; - } - } else { - $temp_output[] = '
'; - } - } - } else { - $temp_output [] = ''; - } - } - - if ($directpage == "yes") { - $temp_header[] = ' -
- Availability map for - + $temp_header[] = + '
'; - if (($config['webui']['availability_map_use_device_groups'] != 0) && ($mode == 0 || $mode == 2)) { - $sql = 'SELECT `G`.`id`, `G`.`name` FROM `device_groups` AS `G`'; - $dev_groups = dbFetchRows($sql); + if (($config['webui']['availability_map_use_device_groups'] != 0) && ($mode == 0 || $mode == 2)) { + $sql = 'SELECT `G`.`id`, `G`.`name` FROM `device_groups` AS `G`'; + $dev_groups = dbFetchRows($sql); - if ($_SESSION['group_view'] == 0) { + if ($_SESSION['group_view'] == 0) { + $selected = 'selected'; + } else { + $selected = ''; + } + + $temp_header[] = ' + Device group + - '; - - foreach ($dev_groups as $dev_group) { - if ($_SESSION['group_view'] == $dev_group['id']) { - $selected = 'selected'; - } else { - $selected = ''; - } - $temp_header[] = ''; - } - $temp_header[] = ''; + $temp_header[] = ''; } + $temp_header[] = ''; } - - if ($directpage == "yes") { - $deviceClass = 'page-availability-report-host'; - $serviceClass = 'page-availability-report-host'; - } else { - $deviceClass = 'widget-availability-host'; - $serviceClass = 'widget-availability-service'; - } - - if ($mode == 0 || $mode == 2) { - $temp_header[] = ' -
- Total hosts - up: '.$host_up_count.' - warn: '.$host_warn_count.' - down: '.$host_down_count.' -
'; - } - - if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { - $temp_header[] = ' -
- Total services - up: '.$service_up_count.' - warn: '.$service_warn_count.' - down: '.$service_down_count.' -
'; - } - - $temp_header[] = '
'; - $temp_header[] = '
'; - - $common_output = array_merge($temp_header, $temp_output); } + +if ($directpage == "yes") { + $deviceClass = 'page-availability-report-host'; + $serviceClass = 'page-availability-report-host'; +} else { + $deviceClass = 'widget-availability-host'; + $serviceClass = 'widget-availability-service'; +} + +if ($mode == 0 || $mode == 2) { + $temp_header[] = ' +
+ Total hosts + up: ' . $host_up_count . ' + warn: ' . $host_warn_count . ' + down: ' . $host_down_count . ' +
'; +} + +if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { + $temp_header[] = ' +
+ Total services + up: ' . $service_up_count . ' + warn: ' . $service_warn_count . ' + down: ' . $service_down_count . ' +
'; +} + +$temp_header[] = ''; +$temp_header[] = '
'; + +$common_output = array_merge($temp_header, $temp_output); diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index dfa560ab59..6a8f07b5fb 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -73,8 +73,11 @@ function nicecase($item) case 'nfs-v3-stats': return 'NFS v3 Stats'; - case 'ntpd': - return 'NTPD (Server)'; + case 'ntp-client': + return 'NTP Client'; + + case 'ntp-server': + return 'NTP Server'; case 'os-updates': return 'OS Updates'; @@ -1213,6 +1216,11 @@ function generate_dynamic_config_panel($title, $config_groups, $items = array(), '; + } elseif ($item['type'] == 'numeric') { + $output .= ' + + + '; } elseif ($item['type'] == 'select') { $output .= ' + + +
+
+ +
+
+ '; } else { - $mode = $widget_mode->{'mode'}; -} + require_once 'includes/object-cache.inc.php'; -$host_up_count = 0; -$host_warn_count = 0; -$host_down_count = 0; -$service_up_count = 0; -$service_warn_count = 0; -$service_down_count = 0; + $sql = dbFetchRow('SELECT `settings` FROM `users_widgets` WHERE `user_id` = ? AND `widget_id` = ?', array($_SESSION["user_id"], '1')); + $widget_mode = json_decode($sql['settings']); -if ($config['webui']['availability_map_sort_status'] == 1) { - $deviceOrderBy = 'status'; - $serviceOrderBy = '`S`.`service_status` DESC'; -} else { - $deviceOrderBy = 'hostname'; - $serviceOrderBy = '`D`.`hostname`'; -} - -if ($mode == 0 || $mode == 2) { - // Only show devices if mode is 0 or 2 (Only Devices or both) - if ($config['webui']['availability_map_use_device_groups'] != 0) { - $device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?'; - $param = array($_SESSION['group_view']); - $devices = dbFetchRows($device_group, $param); - foreach ($devices as $in_dev) { - $in_devices[] = $in_dev['device_id']; - } - $in_devices = implode(',', $in_devices); - } - - $sql = 'SELECT `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`status`, `D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`'; - - if (is_normal_user() === true) { - $sql .= ' , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND'; - $param = array( - $_SESSION['user_id'] - ); + if (isset($_SESSION["map_view"])) { + $mode = $_SESSION["map_view"]; } else { - $sql .= ' WHERE'; + $mode = $widget_mode->{'mode'}; } + $host_up_count = 0; + $host_warn_count = 0; + $host_down_count = 0; + $service_up_count = 0; + $service_warn_count = 0; + $service_down_count = 0; - if ($config['webui']['availability_map_use_device_groups'] != 0 && isset($in_devices)) { - $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' AND `D`.`device_id` IN (" . $in_devices . ") ORDER BY `" . $deviceOrderBy . "`"; + if ($config['webui']['availability_map_sort_status'] == 1) { + $deviceOrderBy = 'status'; + $serviceOrderBy = '`S`.`service_status` DESC'; } else { - $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `" . $deviceOrderBy . "`"; + $deviceOrderBy = 'hostname'; + $serviceOrderBy = '`D`.`hostname`'; } - $temp_output = array(); - - foreach (dbFetchRows($sql, $param) as $device) { - if ($device['status'] == '1') { - if (($device['uptime'] < $config['uptime_warning']) && ($device['uptime'] != '0')) { - $deviceState = 'warn'; - $deviceLabel = 'label-warning'; - $deviceLabelOld = 'availability-map-oldview-box-warn'; - $host_warn_count++; - } else { - $deviceState = 'up'; - $deviceLabel = 'label-success'; - $deviceLabelOld = 'availability-map-oldview-box-up'; - $host_up_count++; + if ($mode == 0 || $mode == 2) { + // Only show devices if mode is 0 or 2 (Only Devices or both) + if ($config['webui']['availability_map_use_device_groups'] != 0) { + $device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?'; + $param = array($_SESSION['group_view']); + $devices = dbFetchRows($device_group, $param); + foreach ($devices as $in_dev) { + $in_devices[] = $in_dev['device_id']; } - } else { - $deviceState = 'down'; - $deviceLabel = 'label-danger'; - $deviceLabelOld = 'availability-map-oldview-box-down'; - $host_down_count++; + $in_devices = implode(',', $in_devices); } - if ($config['webui']['availability_map_old'] == 0) { - if ($directpage == "yes") { - $deviceIcon = getImage($device); - $temp_output[] = ' + $sql = 'SELECT `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`status`, `D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`'; + + if (is_normal_user() === true) { + $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'; + } + + + if ($config['webui']['availability_map_use_device_groups'] != 0 && isset($in_devices)) { + $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' AND `D`.`device_id` IN (" . $in_devices . ") ORDER BY `" . $deviceOrderBy . "`"; + } else { + $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `" . $deviceOrderBy . "`"; + } + + $temp_output = array(); + + foreach (dbFetchRows($sql, $param) as $device) { + if ($device['status'] == '1') { + if (($device['uptime'] < $config['uptime_warning']) && ($device['uptime'] != '0')) { + $deviceState = 'warn'; + $deviceLabel = 'label-warning'; + $deviceLabelOld = 'availability-map-oldview-box-warn'; + $host_warn_count++; + } else { + $deviceState = 'up'; + $deviceLabel = 'label-success'; + $deviceLabelOld = 'availability-map-oldview-box-up'; + $host_up_count++; + } + } else { + $deviceState = 'down'; + $deviceLabel = 'label-danger'; + $deviceLabelOld = 'availability-map-oldview-box-down'; + $host_down_count++; + } + + if ($config['webui']['availability_map_old'] == 0) { + if ($directpage == "yes") { + $deviceIcon = getImage($device); + $temp_output[] = '
' . $deviceState . ' @@ -107,44 +125,44 @@ if ($mode == 0 || $mode == 2) { ' . shorthost(ip_to_sysname($device, $device['hostname'])) . '
'; - } else { - $temp_output[] = ' + } else { + $temp_output[] = ' ' . $deviceState . ' '; + } + } else { + $temp_output[] = '
'; } - } else { - $temp_output[] = '
'; } } -} -if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { - $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id` ORDER BY ' . $serviceOrderBy . ';'; - $services = dbFetchRows($service_query); - if (count($services) > 0) { - foreach ($services as $service) { - if ($service['service_status'] == '0') { - $serviceLabel = "label-success"; - $serviceLabelOld = 'availability-map-oldview-box-up'; - $serviceState = "up"; - $service_up_count++; - } elseif ($service['service_status'] == '1') { - $serviceLabel = "label-warning"; - $serviceLabelOld = 'availability-map-oldview-box-warn'; - $serviceState = "warn"; - $service_warn_count++; - } else { - $serviceLabel = "label-danger"; - $serviceLabelOld = 'availability-map-oldview-box-down'; - $serviceState = "down"; - $service_down_count++; - } + if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { + $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id` ORDER BY ' . $serviceOrderBy . ';'; + $services = dbFetchRows($service_query); + if (count($services) > 0) { + foreach ($services as $service) { + if ($service['service_status'] == '0') { + $serviceLabel = "label-success"; + $serviceLabelOld = 'availability-map-oldview-box-up'; + $serviceState = "up"; + $service_up_count++; + } elseif ($service['service_status'] == '1') { + $serviceLabel = "label-warning"; + $serviceLabelOld = 'availability-map-oldview-box-warn'; + $serviceState = "warn"; + $service_warn_count++; + } else { + $serviceLabel = "label-danger"; + $serviceLabelOld = 'availability-map-oldview-box-down'; + $serviceState = "down"; + $service_down_count++; + } - if ($config['webui']['availability_map_old'] == 0) { - if ($directpage == "yes") { - $deviceIcon = getImage($service); - $temp_output[] = ' + if ($config['webui']['availability_map_old'] == 0) { + if ($directpage == "yes") { + $deviceIcon = getImage($service); + $temp_output[] = '
' . $service["service_type"] . ' @@ -153,101 +171,102 @@ if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { ' . shorthost(ip_to_sysname($service, $service['hostname'])) . '
'; - } else { - $temp_output[] = ' + } else { + $temp_output[] = ' ' . $service['service_type'] . ' - ' . $serviceState . ' '; + } + } else { + $temp_output[] = '
'; } - } else { - $temp_output[] = '
'; } + } else { + $temp_output [] = ''; } - } else { - $temp_output [] = ''; } -} -if ($directpage == "yes") { - $temp_header[] = ' + if ($directpage == "yes") { + $temp_header[] = '
Availability map for +
+
'; + + if (($config['webui']['availability_map_use_device_groups'] != 0) && ($mode == 0 || $mode == 2)) { + $sql = 'SELECT `G`.`id`, `G`.`name` FROM `device_groups` AS `G`'; + $dev_groups = dbFetchRows($sql); + + if ($_SESSION['group_view'] == 0) { $selected = 'selected'; } else { $selected = ''; } - $temp_header[] = ''; - } - } - $temp_header[] = - ' -
-
'; - - if (($config['webui']['availability_map_use_device_groups'] != 0) && ($mode == 0 || $mode == 2)) { - $sql = 'SELECT `G`.`id`, `G`.`name` FROM `device_groups` AS `G`'; - $dev_groups = dbFetchRows($sql); - - if ($_SESSION['group_view'] == 0) { - $selected = 'selected'; - } else { - $selected = ''; - } - - $temp_header[] = ' + $temp_header[] = ' Device group '; } - $temp_header[] = ''; } -} -if ($directpage == "yes") { - $deviceClass = 'page-availability-report-host'; - $serviceClass = 'page-availability-report-host'; -} else { - $deviceClass = 'widget-availability-host'; - $serviceClass = 'widget-availability-service'; -} + if ($directpage == "yes") { + $deviceClass = 'page-availability-report-host'; + $serviceClass = 'page-availability-report-host'; + } else { + $deviceClass = 'widget-availability-host'; + $serviceClass = 'widget-availability-service'; + } -if ($mode == 0 || $mode == 2) { - $temp_header[] = ' + if ($mode == 0 || $mode == 2) { + $temp_header[] = '
Total hosts up: ' . $host_up_count . ' warn: ' . $host_warn_count . ' down: ' . $host_down_count . '
'; -} + } -if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { - $temp_header[] = ' + if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { + $temp_header[] = '
Total services up: ' . $service_up_count . ' warn: ' . $service_warn_count . ' down: ' . $service_down_count . '
'; + } + + $temp_header[] = '
'; + $temp_header[] = '
'; + + $common_output = array_merge($temp_header, $temp_output); } - -$temp_header[] = ''; -$temp_header[] = '
'; - -$common_output = array_merge($temp_header, $temp_output); From 23e31bd030a9e3ec437ddc0ec2943ada12965b52 Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 6 Sep 2016 02:54:13 +0300 Subject: [PATCH 004/126] fix functions.php, sql queries --- html/includes/functions.inc.php | 10 ++-------- sql-schema/133.sql | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 6a8f07b5fb..b4465a5a4f 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -73,14 +73,8 @@ function nicecase($item) case 'nfs-v3-stats': return 'NFS v3 Stats'; - case 'ntp-client': - return 'NTP Client'; - - case 'ntp-server': - return 'NTP Server'; - - case 'os-updates': - return 'OS Updates'; + case 'ntpd': + return 'NTPD (Server)'; case 'powerdns-recursor': return 'PowerDNS Recursor'; diff --git a/sql-schema/133.sql b/sql-schema/133.sql index 6f02164946..b8221686ed 100644 --- a/sql-schema/133.sql +++ b/sql-schema/133.sql @@ -3,4 +3,4 @@ INSERT INTO `config` (`config_name`, `config_value`, `config_default`, `config_d UPDATE `config` SET `config_name` = 'webui.availability_map_old', `config_hidden` = '0' WHERE `config_name` = 'webui.old_availability_map'; UPDATE `config` SET `config_hidden` = '0' WHERE `config_name` = 'webui.availability_map_sort_status'; UPDATE `config` SET `config_descr` = 'Enable usage of device groups filter' WHERE `config_name` = 'webui.availability_map_use_device_groups'; -UPDATE `config` SET `config_descr` = 'Sort devices and services by status` WHERE `config_name` = 'webui.availability_map_sort_status'; +UPDATE `config` SET `config_descr` = 'Sort devices and services by status' WHERE `config_name` = 'webui.availability_map_sort_status'; From d1130818dd4aefeef66306fda7d10258cfd72652 Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 6 Sep 2016 02:55:29 +0300 Subject: [PATCH 005/126] fix functions.php, sql queries --- html/includes/functions.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index b4465a5a4f..48e933266a 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -76,6 +76,9 @@ function nicecase($item) case 'ntpd': return 'NTPD (Server)'; + case 'os-updates': + return 'OS Updates'; + case 'powerdns-recursor': return 'PowerDNS Recursor'; From 05e0d5cc3ab858966a64ee8bac0f012ee5cedfad Mon Sep 17 00:00:00 2001 From: crcro Date: Wed, 14 Sep 2016 01:31:29 +0300 Subject: [PATCH 006/126] sql reindex --- sql-schema/134.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql-schema/134.sql diff --git a/sql-schema/134.sql b/sql-schema/134.sql new file mode 100644 index 0000000000..b8221686ed --- /dev/null +++ b/sql-schema/134.sql @@ -0,0 +1,6 @@ +INSERT INTO `config` (`config_name`, `config_value`, `config_default`, `config_descr`, `config_group`, `config_group_order`, `config_sub_group`, `config_sub_group_order`, `config_hidden`, `config_disabled`) VALUES('webui.availability_map_direct_tile_size', '200', '165', 'Input desired tile width in pixels for direct page mode', 'webui', 0, 'graph', 0, '0', '0'); +INSERT INTO `config` (`config_name`, `config_value`, `config_default`, `config_descr`, `config_group`, `config_group_order`, `config_sub_group`, `config_sub_group_order`, `config_hidden`, `config_disabled`) VALUES('webui.availability_map_old_widget_tile_size', '60', '10', 'Input desired tile width in pixels for widget mode', 'webui', 0, 'graph', 0, '0', '0'); +UPDATE `config` SET `config_name` = 'webui.availability_map_old', `config_hidden` = '0' WHERE `config_name` = 'webui.old_availability_map'; +UPDATE `config` SET `config_hidden` = '0' WHERE `config_name` = 'webui.availability_map_sort_status'; +UPDATE `config` SET `config_descr` = 'Enable usage of device groups filter' WHERE `config_name` = 'webui.availability_map_use_device_groups'; +UPDATE `config` SET `config_descr` = 'Sort devices and services by status' WHERE `config_name` = 'webui.availability_map_sort_status'; From 7b7b8c0c2cef3087e9714c727f69a758de824e99 Mon Sep 17 00:00:00 2001 From: Bennett Blodinger Date: Wed, 14 Sep 2016 08:23:50 -0400 Subject: [PATCH 007/126] Fix nav icons Remove notification overlap and fix mobile navigation view --- html/css/styles.css | 17 ----------------- html/includes/print-menubar.php | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/html/css/styles.css b/html/css/styles.css index e7a5736cdd..9e6c7f6f68 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1763,23 +1763,6 @@ label { font-weight: normal; } -.nav>li>a.dropdown-toggle { - padding: 15px 6px; -} - -.badge-navbar-user{ - background:red; - border-radius: 40%; - font-size: 65%; - height: auto; - margin: 0; - padding:5px; - position:absolute; - right:-3px; - top:5px; - width: auto; - } - @media only screen and (max-width: 480px) { .thumbnail_graph_table b { font-size : 6px;} .thumbnail_graph_table img { diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 6f59a79cd8..e685e87fb0 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -537,7 +537,7 @@ if (is_file("includes/print-menubar-custom.inc.php")) { if (empty($notifications['count']) && empty($notifications['sticky_count'])) { $style = 'style="background-color:grey; color:white;"'; } - echo(''.($notifications['sticky_count']+$notifications['count']).''); + echo(' User'.($notifications['sticky_count']+$notifications['count']).''); ?>