From 2f0a2170339fb966f28cfc8240190690e070a58e Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 10:43:57 -0500 Subject: [PATCH 01/34] QA: Minor lib/rrd.php update --- lib/rrd.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rrd.php b/lib/rrd.php index 969aa05149..83a9622a6a 100644 --- a/lib/rrd.php +++ b/lib/rrd.php @@ -4145,13 +4145,13 @@ function gradient($vname=false, $start_color='#0000a0', $end_color='#f0f0f0', $l $b =round($b1 + $diff_b * $factor); if (($i == $steps) && ($label != false) && (strlen($label) > 2)) { - $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s:"%s" '.RRD_NL, $spline_vname,$i,$r,$g,$b,$alpha,$label); + $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s:"%s" ' . RRD_NL, $spline_vname, $i, $r, $g, $b, $alpha, $label); } else { - $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s '.RRD_NL, $spline_vname,$i,$r,$g,$b,$alpha); + $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s ' . RRD_NL, $spline_vname, $i, $r, $g, $b, $alpha); } } - $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s '.RRD_NL, $spline_vname,$steps,$r2,$g2,$b2,'00',$label); + $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s ' . RRD_NL, $spline_vname, $steps, $r2, $g2, $b2, '00', $label); return $spline; } From 4af24e91512ad3aa550be74578334625a1630923 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 10:48:54 -0500 Subject: [PATCH 02/34] Porting #5239 to 1.3 --- CHANGELOG | 1 + automation_snmp.php | 36 +++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 65de6efa28..d820e2615f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,7 @@ Cacti CHANGELOG -issue#5184: Cacti permission checks generate SQL errors is the user has been deleted -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location +-issue#5239: SNMP-Options - Bulk Walk Maximum Repetitions ignored 1.2.23 -security#4920: Add .htaccess file to scripts folder diff --git a/automation_snmp.php b/automation_snmp.php index 8bdbade826..4759b57c18 100644 --- a/automation_snmp.php +++ b/automation_snmp.php @@ -132,23 +132,25 @@ function form_automation_snmp_save() { get_filter_request_var('id'); /* ==================================================== */ - $save = array(); - $save['id'] = form_input_validate(get_nfilter_request_var('item_id'), '', '^[0-9]+$', false, 3); - $save['snmp_id'] = form_input_validate(get_nfilter_request_var('id'), 'snmp_id', '^[0-9]+$', false, 3); - $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); - $save['snmp_community'] = form_input_validate(get_nfilter_request_var('snmp_community'), 'snmp_community', '', false, 3); - $save['snmp_version'] = form_input_validate(get_nfilter_request_var('snmp_version'), 'snmp_version', '', false, 3); - $save['snmp_username'] = form_input_validate(get_nfilter_request_var('snmp_username'), 'snmp_username', '', true, 3); - $save['snmp_password'] = form_input_validate(get_nfilter_request_var('snmp_password'), 'snmp_password', '', true, 3); - $save['snmp_auth_protocol'] = form_input_validate(get_nfilter_request_var('snmp_auth_protocol'), 'snmp_auth_protocol', '', true, 3); - $save['snmp_priv_passphrase'] = form_input_validate(get_nfilter_request_var('snmp_priv_passphrase'), 'snmp_priv_passphrase', '', true, 3); - $save['snmp_priv_protocol'] = form_input_validate(get_nfilter_request_var('snmp_priv_protocol'), 'snmp_priv_protocol', '', true, 3); - $save['snmp_context'] = form_input_validate(get_nfilter_request_var('snmp_context'), 'snmp_context', '', true, 3); - $save['snmp_engine_id'] = form_input_validate(get_nfilter_request_var('snmp_engine_id'), 'snmp_engine_id', '', true, 3); - $save['snmp_port'] = form_input_validate(get_nfilter_request_var('snmp_port'), 'snmp_port', '^[0-9]+$', false, 3); - $save['snmp_timeout'] = form_input_validate(get_nfilter_request_var('snmp_timeout'), 'snmp_timeout', '^[0-9]+$', false, 3); - $save['snmp_retries'] = form_input_validate(get_nfilter_request_var('snmp_retries'), 'snmp_retries', '^[0-9]+$', false, 3); - $save['max_oids'] = form_input_validate(get_nfilter_request_var('max_oids'), 'max_oids', '^[0-9]+$', false, 3); + $save = array(); + + $save['id'] = form_input_validate(get_nfilter_request_var('item_id'), '', '^[0-9]+$', false, 3); + $save['snmp_id'] = form_input_validate(get_nfilter_request_var('id'), 'snmp_id', '^[0-9]+$', false, 3); + $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); + $save['snmp_community'] = form_input_validate(get_nfilter_request_var('snmp_community'), 'snmp_community', '', false, 3); + $save['snmp_version'] = form_input_validate(get_nfilter_request_var('snmp_version'), 'snmp_version', '', false, 3); + $save['snmp_username'] = form_input_validate(get_nfilter_request_var('snmp_username'), 'snmp_username', '', true, 3); + $save['snmp_password'] = form_input_validate(get_nfilter_request_var('snmp_password'), 'snmp_password', '', true, 3); + $save['snmp_auth_protocol'] = form_input_validate(get_nfilter_request_var('snmp_auth_protocol'), 'snmp_auth_protocol', '', true, 3); + $save['snmp_priv_passphrase'] = form_input_validate(get_nfilter_request_var('snmp_priv_passphrase'), 'snmp_priv_passphrase', '', true, 3); + $save['snmp_priv_protocol'] = form_input_validate(get_nfilter_request_var('snmp_priv_protocol'), 'snmp_priv_protocol', '', true, 3); + $save['snmp_context'] = form_input_validate(get_nfilter_request_var('snmp_context'), 'snmp_context', '', true, 3); + $save['snmp_engine_id'] = form_input_validate(get_nfilter_request_var('snmp_engine_id'), 'snmp_engine_id', '', true, 3); + $save['snmp_port'] = form_input_validate(get_nfilter_request_var('snmp_port'), 'snmp_port', '^[0-9]+$', false, 3); + $save['snmp_timeout'] = form_input_validate(get_nfilter_request_var('snmp_timeout'), 'snmp_timeout', '^[0-9]+$', false, 3); + $save['snmp_retries'] = form_input_validate(get_nfilter_request_var('snmp_retries'), 'snmp_retries', '^[0-9]+$', false, 3); + $save['max_oids'] = form_input_validate(get_nfilter_request_var('max_oids'), 'max_oids', '^[0-9]+$', false, 3); + $save['bulk_walk_size'] = form_input_validate(get_nfilter_request_var('bulk_walk_size'), 'bulk_walk_size', '^[\-0-9]+$', false, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_snmp_items'); From 8f3d597e31814e4b8a098fcd027e9c5fbff4b23b Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 10:52:06 -0500 Subject: [PATCH 03/34] Porting #5243 to 1.3.x - Export issues Template Export missing Graph Template columns multiple and test_source --- CHANGELOG | 1 + lib/export.php | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d820e2615f..4b97ce58d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -84,6 +84,7 @@ Cacti CHANGELOG -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location -issue#5239: SNMP-Options - Bulk Walk Maximum Repetitions ignored +-issue#5243: Template Export missing Graph Template columns multiple and test_source 1.2.23 -security#4920: Add .htaccess file to scripts folder diff --git a/lib/export.php b/lib/export.php index 2030d28709..8abc26ce37 100644 --- a/lib/export.php +++ b/lib/export.php @@ -31,7 +31,7 @@ function graph_template_to_xml($graph_template_id) { $hash['graph_template'] = get_hash_version('graph_template') . get_hash_graph_template($graph_template_id); $xml_text = ''; - $graph_template = db_fetch_row_prepared('SELECT id, name + $graph_template = db_fetch_row_prepared('SELECT * FROM graph_templates WHERE id = ?', array($graph_template_id)); @@ -65,7 +65,12 @@ function graph_template_to_xml($graph_template_id) { return; } - $xml_text .= '\n\t" . xml_character_encode($graph_template['name']) . "\n\t\n"; + $xml_text .= '\n"; + $xml_text .= "\t" . xml_character_encode($graph_template['name']) . "\n"; + $xml_text .= "\t" . xml_character_encode($graph_template['multiple']) . "\n"; + $xml_text .= "\t" . xml_character_encode($graph_template['test_source']) . "\n"; + + $xml_text .= "\t\n"; /* XML Branch: */ foreach ($struct_graph as $field_name => $field_array) { From 2d85f848bfc841073864d41b8d01c7395f1c11fb Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:14:03 -0500 Subject: [PATCH 04/34] Porting #5232 to 1.3.x - Large System Poller Delay * On large systems statistics gathering at the beginning of a poller run lead to excessive polling times --- include/global_settings.php | 21 +++-- poller.php | 182 +++++++++++++++++++++--------------- 2 files changed, 122 insertions(+), 81 deletions(-) diff --git a/include/global_settings.php b/include/global_settings.php index 6910d5457b..ef3ef74fdc 100644 --- a/include/global_settings.php +++ b/include/global_settings.php @@ -1192,12 +1192,12 @@ 'method' => 'font', 'placeholder' => __('Enter Valid Font Config Value'), 'max_length' => '100' - ), + ), 'business_hours_header' => array( 'friendly_name' => __('Business Hours Settings'), 'collapsible' => 'true', 'method' => 'spacer', - ), + ), 'business_hours_start' => array( 'friendly_name' => __('Start of Business Day'), 'description' => __('The time your business hours start. Format: hh:mm'), @@ -1205,7 +1205,7 @@ 'default' => '08:00', 'max_length' => '5', 'size' => '60' - ), + ), 'business_hours_end' => array( 'friendly_name' => __('End of Business Day'), 'description' => __('The time your business hours end. Format: hh:mm'), @@ -1213,19 +1213,19 @@ 'default' => '18:00', 'max_length' => '6', 'size' => '60' - ), + ), 'business_hours_hideWeekends' => array( 'friendly_name' => __('Hide Weekends'), 'description' => __('Only show business hours during weekdays.'), 'method' => 'checkbox', 'default' => '', - ), + ), 'business_hours_enable' => array( 'friendly_name' => __('Show business hours'), 'description' => __('Display business hours on rrd graphs.'), 'method' => 'checkbox', 'default' => '', - ), + ), 'business_hours_color' => array( 'friendly_name' => __('Color to use for business hours'), 'description' => __('The color to be shown for business hours'), @@ -1338,7 +1338,8 @@ '90' => '90', '100' => '100', '150' => '150', - '200' => '200') + '200' => '200' + ) ), 'max_get_size' => array( 'friendly_name' => __('SNMP Get OID Limit'), @@ -1348,6 +1349,12 @@ 'max_length' => '10', 'size' => '5' ), + 'poller_refresh_output_table' => array( + 'friendly_name' => __('Refresh Poller Table Per Cycle'), + 'description' => __('This setting is for a single poller systems only to rebuild the poller output table on each polling cycle to prevent the memory table from swapping on very large systems with large databases that could use swap.'), + 'method' => 'checkbox', + 'default' => '', + ), 'disable_cache_replication' => array( 'friendly_name' => __('Disable Resource Cache Replication'), 'description' => __('By default, the main Cacti Data Collector will cache the entire web site and plugins into a Resource Cache. Then, periodically the Remote Data Collectors will update themselves with any updates from the main Cacti Data Collector. This Resource Cache essentially allows Remote Data Collectors to self upgrade. If you do not wish to use this option, you can disable it using this setting.'), diff --git a/poller.php b/poller.php index 5093a63990..e41403bcaf 100755 --- a/poller.php +++ b/poller.php @@ -280,7 +280,9 @@ function sig_handler($signo) { * agent on a host. */ $total_ports = db_fetch_cell('SELECT COUNT(DISTINCT snmp_port) - FROM poller_item'); + FROM poller_item + WHERE snmp_port > 0'); + set_config_option('total_snmp_ports', $total_ports); /** @@ -290,6 +292,7 @@ function sig_handler($signo) { $active_profiles = db_fetch_cell('SELECT COUNT(DISTINCT data_source_profile_id) FROM data_template_data WHERE local_data_id > 0'); + set_config_option('active_profiles', $active_profiles); /* assume a scheduled task of either 60 or 300 seconds */ @@ -305,6 +308,7 @@ function sig_handler($signo) { define('MAX_POLLER_RUNTIME', $poller_runs * $poller_interval - 2); } else { $sql_where = "WHERE pi.poller_id = $poller_id AND h.disabled = ''"; + $poller_runs = 1; $poller_interval = 300; define('MAX_POLLER_RUNTIME', 298); @@ -316,18 +320,21 @@ function sig_handler($signo) { ON h.id = pi.host_id ' . $sql_where); if (isset($concurrent_processes) && $concurrent_processes > 1) { - $items_perhost = array_rekey(db_fetch_assoc('SELECT ' . SQL_NO_CACHE . " host_id, - COUNT(local_data_id) AS data_sources - FROM poller_item AS pi - INNER JOIN host AS h - ON h.id = pi.host_id - $sql_where - GROUP BY host_id - ORDER BY host_id"), 'host_id', 'data_sources'); + $items_perhost = array_rekey( + db_fetch_assoc('SELECT ' . SQL_NO_CACHE . " host_id, + COUNT(local_data_id) AS data_sources + FROM poller_item AS pi + INNER JOIN host AS h + ON h.id = pi.host_id + $sql_where + GROUP BY host_id + ORDER BY host_id"), + 'host_id', 'data_sources' + ); } if (isset($items_perhost) && cacti_sizeof($items_perhost)) { - $items_per_process = floor($num_polling_items / $concurrent_processes); + $items_per_process = floor($num_polling_items / $concurrent_processes); if ($items_per_process == 0) { $process_leveling = 'off'; @@ -393,34 +400,80 @@ function sig_handler($signo) { $poller_runs_completed = 0; $poller_items_total = 0; +/** + * Update poller statistics once per poller run + */ +$script = $server = $snmp = 0; + +$totals = db_fetch_assoc_prepared('SELECT action, COUNT(*) AS totals + FROM poller_item AS pi + WHERE pi.poller_id = ? + GROUP BY action', + array($poller_id)); + +if (cacti_sizeof($totals)) { + foreach($totals as $value) { + switch($value['action']) { + case '0': // SNMP + $snmp = $value['totals']; + break; + case '1': // Script + $script = $value['totals']; + break; + case '2': // Server + $server = $value['totals']; + break; + } + } +} + +/** + * Update poller data source statistics in the poller table + */ +db_execute_prepared('INSERT INTO poller (id, snmp, script, server, last_status, status) + VALUES (?, ?, ?, ?, NOW(), 1) + ON DUPLICATE KEY UPDATE snmp=VALUES(snmp), script=VALUES(script), + server=VALUES(server), last_status=VALUES(last_status), status=VALUES(status)', + array($poller_id, $snmp, $script, $server), true, $poller_db_cnn_id); + +/** + * Freshen the field mappings in cases where they + * may have gotten out of sync + */ +db_execute('INSERT IGNORE INTO poller_data_template_field_mappings + SELECT dtr.data_template_id, dif.data_name, + GROUP_CONCAT(dtr.data_source_name ORDER BY dtr.data_source_name) AS data_source_names, NOW() + FROM data_template_rrd AS dtr + INNER JOIN data_input_fields AS dif + ON dtr.data_input_field_id = dif.id + WHERE dtr.local_data_id = 0 + GROUP BY dtr.data_template_id, dif.data_name'); + while ($poller_runs_completed < $poller_runs) { // record the start time for this loop $loop_start = microtime(true); - $num_polling_items = db_fetch_cell('SELECT ' . SQL_NO_CACHE . ' COUNT(*) - FROM poller_item AS pi - INNER JOIN host AS h - ON h.id = pi.host_id ' . $sql_where); - if (db_column_exists('sites', 'disabled')) { $sql_where = "AND IFNULL(s.disabled, '') != 'on'"; } else { $sql_where = ''; } - $polling_hosts = db_fetch_assoc_prepared('SELECT ' . SQL_NO_CACHE . " h.id - FROM host h - LEFT JOIN sites s - ON s.id = h.site_id - WHERE poller_id = ? - AND h.deleted = '' - AND IFNULL(h.disabled,'') != 'on' - $sql_where - ORDER BY id", - array($poller_id)); - if ($poller_id == '1') { - if (cacti_sizeof($polling_hosts)) { + $polling_hosts = db_fetch_assoc_prepared('SELECT ' . SQL_NO_CACHE . " h.id + FROM host h + LEFT JOIN sites s + ON s.id = h.site_id + WHERE poller_id = ? + AND h.deleted = '' + AND IFNULL(h.disabled,'') != 'on' + $sql_where + ORDER BY id", + array($poller_id)); + + $total_polling_hosts = cacti_sizeof($polling_hosts); + + if ($total_polling_hosts) { $polling_hosts = array_merge(array(0 => array('id' => '0')), $polling_hosts); } else { $polling_hosts = array(0 => array('id' => '0')); @@ -436,52 +489,13 @@ function sig_handler($signo) { $sql_where ORDER BY id", array($poller_id)); + + $total_polling_hosts = cacti_sizeof($polling_hosts); } $hosts_per_process = 0; $method = 'disabled'; - $script = $server = $snmp = 0; - - $totals = db_fetch_assoc_prepared("SELECT action, COUNT(*) AS totals - FROM poller_item AS pi - INNER JOIN host AS h - ON h.id = pi.host_id - LEFT JOIN sites s - ON s.id = h.site_id - WHERE h.poller_id = ? - AND h.deleted = '' - AND IFNULL(h.disabled, '') != 'on' - $sql_where - GROUP BY action", - array($poller_id)); - - if (cacti_sizeof($totals)) { - foreach ($totals as $value) { - switch($value['action']) { - case '0': // SNMP - $snmp = $value['totals']; - - break; - case '1': // Script - $script = $value['totals']; - - break; - case '2': // Server - $server = $value['totals']; - - break; - } - } - } - - // update statistics - db_execute_prepared('INSERT INTO poller (id, snmp, script, server, last_status, status) - VALUES (?, ?, ?, ?, NOW(), 1) - ON DUPLICATE KEY UPDATE snmp=VALUES(snmp), script=VALUES(script), - server=VALUES(server), last_status=VALUES(last_status), status=VALUES(status)', - array($poller_id, $snmp, $script, $server), true, $poller_db_cnn_id); - // calculate overhead time if ($overhead_time == 0) { $overhead_time = $loop_start - $poller_start; @@ -534,10 +548,12 @@ function sig_handler($signo) { WHERE poller_id = ?', array($poller_id), true, $poller_db_cnn_id); - /* only report issues for the main poller or from bad local + /** + * only report issues for the main poller or from bad local * data ids, other pollers may insert somewhat asynchronously */ $issues = array(); + $issues_limit = 20; $issues_check = ($poller_id == 1 || $config['connection'] == 'online'); $issues_param = array( $current_time, $poller_id, $poller_id ); @@ -581,16 +597,34 @@ function sig_handler($signo) { db_execute_prepared('DELETE po ' . $issues_sql, $issues_param); } + /** + * adjust for recent memory table problems in MariaDB and memory tables + * being pushed into swap + */ + if ($poller_id == 1 && read_config_option('poller_refresh_output_table') == 'on' && $total_pollers == 1) { + db_execute('CREATE TABLE IF NOT EXISTS po LIKE poller_output'); + db_execute('RENAME TABLE poller_output TO poold, po TO poller_output'); + db_execute('DROP TABLE IF EXISTS poold'); + db_execute('ALTER TABLE poller_output ENGINE=MEMORY'); + + // catch the unlikely event that the poller_output_boost is missing + if (!db_table_exists('poller_output_boost')) { + db_execute('CREATE TABLE poller_output_boost LIKE poller_output'); + db_execute('ALTER TABLE poller_output_boost ENGINE=InnoDB'); + } + } + // mainline if (read_config_option('poller_enabled') == 'on') { // determine the number of hosts to process per file - $hosts_per_process = ceil(($poller_id == '1' ? cacti_sizeof($polling_hosts) - 1 : cacti_sizeof($polling_hosts)) / $concurrent_processes); + $hosts_per_process = ceil(($poller_id == '1' ? $total_polling_hosts - 1 : $total_polling_hosts) / $concurrent_processes); $items_launched = 0; // exit poller if spine is selected and file does not exist if (($poller_type == '2') && (!file_exists(read_config_option('path_spine')))) { cacti_log('ERROR: The spine path: ' . read_config_option('path_spine') . ' is invalid. Poller can not continue!', true, 'POLLER'); + admin_email(__('Cacti System Warning'), __('ERROR: The spine path: %s is invalid for Poller[%d]. Poller can not continue!', read_config_option('path_spine'), $poller_id)); exit; @@ -632,7 +666,7 @@ function sig_handler($signo) { } /* Populate each execution file with appropriate information */ - if (cacti_sizeof($polling_hosts)) { + if ($total_polling_hosts) { foreach ($polling_hosts as $item) { if ($host_count == 1) { $first_host = $item['id']; @@ -718,7 +752,7 @@ function sig_handler($signo) { } log_cacti_stats($loop_start, $method, $concurrent_processes, $max_threads, - ($poller_id == '1' ? cacti_sizeof($polling_hosts) - 1 : cacti_sizeof($polling_hosts)), $hosts_per_process, $num_polling_items, $rrds_processed); + ($poller_id == '1' ? $total_polling_hosts - 1 : $total_polling_hosts), $hosts_per_process, $num_polling_items, $rrds_processed); poller_run_stats($loop_start); break; @@ -746,7 +780,7 @@ function sig_handler($signo) { api_plugin_hook_function('poller_exiting'); log_cacti_stats($loop_start, $method, $concurrent_processes, $max_threads, - ($poller_id == '1' ? cacti_sizeof($polling_hosts) - 1 : cacti_sizeof($polling_hosts)), $hosts_per_process, $num_polling_items, $rrds_processed); + ($poller_id == '1' ? $total_polling_hosts - 1 : $total_polling_hosts), $hosts_per_process, $num_polling_items, $rrds_processed); poller_run_stats($loop_start); break; @@ -847,7 +881,7 @@ function sig_handler($signo) { if (!$logged) { log_cacti_stats($loop_start, $method, $concurrent_processes, $max_threads, - ($poller_id == '1' ? cacti_sizeof($polling_hosts) - 1 : cacti_sizeof($polling_hosts)), $hosts_per_process, $num_polling_items, $rrds_processed); + ($poller_id == '1' ? $totalpolling_hosts - 1 : $total_polling_hosts), $hosts_per_process, $num_polling_items, $rrds_processed); poller_run_stats($loop_start); } } From 3791c1a39855897b85858b065adbb4af0087169f Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:16:32 -0500 Subject: [PATCH 05/34] Porting #5236 to 1.3.x - Edit Template Broken Edit Graph Template link missing base_url --- CHANGELOG | 2 ++ lib/html.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4b97ce58d4..e28feaf58a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,8 @@ Cacti CHANGELOG -issue#5184: Cacti permission checks generate SQL errors is the user has been deleted -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location +-issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times +-issue#5236: Edit Graph Template link missing base_url -issue#5239: SNMP-Options - Bulk Walk Maximum Repetitions ignored -issue#5243: Template Export missing Graph Template columns multiple and test_source diff --git a/lib/html.php b/lib/html.php index 5f610f4d18..3cc1576145 100644 --- a/lib/html.php +++ b/lib/html.php @@ -509,7 +509,7 @@ function graph_drilldown_icons($local_graph_id, $type = 'graph_buttons', $tree_i } if (is_realm_allowed(10) && $graph_template_id > 0) { - print ""; + print ""; print '
'; } From af119b952b8898ed417f888907b454ea00cbb551 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:18:44 -0500 Subject: [PATCH 06/34] Porting #5238 to 1.3.x - Poller Item SQL Errors Searching for Poller Items Generates SQL Errors --- CHANGELOG | 1 + utilities.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e28feaf58a..e9b957ae39 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -85,6 +85,7 @@ Cacti CHANGELOG -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url +-issue#5238: Searching for Poller Items Generates SQL Errors -issue#5239: SNMP-Options - Bulk Walk Maximum Repetitions ignored -issue#5243: Template Export missing Graph Template columns multiple and test_source diff --git a/utilities.php b/utilities.php index dd8368808d..a0b1947587 100644 --- a/utilities.php +++ b/utilities.php @@ -1070,7 +1070,7 @@ function clearFilter() { if (get_request_var('host_id') > 0) { $sql_where .= ($sql_where != '' ? ' AND ':' WHERE') . ' ( dtd.name_cache LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ' - OR pi.arg1 LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ' + OR pi.arg1 LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ' OR pi.rrd_path LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; } else { $sql_where .= ($sql_where != '' ? ' AND ':' WHERE') . ' ( From 675b73a4590ea3f46ef7e9403fcb1a8880b638e3 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:28:32 -0500 Subject: [PATCH 07/34] Backport DSV Logging tweak --- lib/functions.php | 48 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index a871939e9c..478f183cd0 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2145,19 +2145,19 @@ function prepare_validate_result(&$result) { /* clean off ugly non-numeric data */ if (is_numeric($result)) { - dsv_log('prepare_validate_result','data is numeric'); + dsv_log('prepare_validate_result', 'data is numeric', POLLER_VERBOSITY_MEDIUM); return true; } if ($result == 'U') { - dsv_log('prepare_validate_result', 'data is U'); + dsv_log('prepare_validate_result', 'data is U', POLLER_VERBOSITY_MEDIUM); return true; } if (is_hexadecimal($result)) { - dsv_log('prepare_validate_result', 'data is hex'); + dsv_log('prepare_validate_result', 'data is hex', POLLER_VERBOSITY_MEDIUM); return hexdec($result); } @@ -2165,7 +2165,7 @@ function prepare_validate_result(&$result) { if (substr_count($result, ':') || substr_count($result, '!')) { /* looking for name value pairs */ if (substr_count($result, ' ') == 0) { - dsv_log('prepare_validate_result', 'data has no spaces'); + dsv_log('prepare_validate_result', 'data has no spaces', POLLER_VERBOSITY_MEDIUM); return true; } else { @@ -2178,7 +2178,8 @@ function prepare_validate_result(&$result) { } $space_cnt = substr_count(trim($result), ' '); - dsv_log('prepare_validate_result', "data has $space_cnt spaces and $delim_cnt fields which is " . (($space_cnt + 1 == $delim_cnt) ? 'NOT ' : '') . ' okay'); + + dsv_log('prepare_validate_result', "data has $space_cnt spaces and $delim_cnt fields which is " . (($space_cnt + 1 == $delim_cnt) ? '' : 'NOT') . ' okay', POLLER_VERBOSITY_MEDIUM); return ($space_cnt + 1 == $delim_cnt); } @@ -2236,9 +2237,13 @@ function is_valid_pathname($path) { * @param $message - the message to output to the log * @param $data - the data to be carried with the message */ -function dsv_log($message,$data) { +function dsv_log($message, $data, $level = POLLER_VERBOSITY_LOW) { if (read_config_option('data_source_trace') == 'on') { - cacti_log(($message . ' = ') . (is_array($data) ? json_encode($data) : $data), false, 'DSTRACE'); + $verbosity = read_config_option('log_verbosity'); + + if ($verbosity >= $level) { + cacti_log(($message . ' = ') . (is_array($data) ? json_encode($data) : $data), false, 'DSTRACE'); + } } } @@ -2311,6 +2316,7 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp $called_by_script_server = true; dsv_log('test_data_source', array( 'data_template_id' => $data_template_id, 'host_id' => $host_id, 'snmp_query_id' => $snmp_query_id, 'snmp_index' => $snmp_index, 'suggested_vals' => $suggested_vals)); + $data_input = db_fetch_row_prepared('SELECT ' . SQL_NO_CACHE . ' di.id, di.type_id, dtd.id AS data_template_data_id, dtd.data_template_id, dtd.active, dtd.rrd_step, di.name @@ -2339,6 +2345,7 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp ($data_input['type_id'] == DATA_INPUT_TYPE_SCRIPT_QUERY) || ($data_input['type_id'] == DATA_INPUT_TYPE_QUERY_SCRIPT_SERVER)) { $field = data_query_field_list($data_template_data_id); + dsv_log('query field', $field); $params = array(); @@ -2378,6 +2385,7 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp } $script_path = get_full_test_script_path($data_template_id, $host_id); + dsv_log('script_path', $script_path); $num_output_fields_sql = 'SELECT ' . SQL_NO_CACHE . ' id @@ -2385,9 +2393,11 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp WHERE data_input_id = ? AND input_output = "out" AND update_rra="on"'; + dsv_log('num_output_fields_sql',$num_output_fields_sql); $num_output_fields = cacti_sizeof(db_fetch_assoc_prepared($num_output_fields_sql, array($data_input['id']))); + dsv_log('num_output_fields', $num_output_fields); if ($num_output_fields == 1) { @@ -2407,6 +2417,7 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp if ($action == POLLER_ACTION_SCRIPT) { dsv_log('script_path', $script_path); + $output = shell_exec($script_path); } else { // Script server is a bit more complicated @@ -2421,10 +2432,13 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp $script = implode(' ', $parts); dsv_log('script', $script); + $output = shell_exec("$php -q $script"); if ($output == '' || $output == false) { $output = 'U'; + } elseif (strpos($output, ':U') !== false) { + $output = 'U'; } } else { $output = 'U'; @@ -2455,6 +2469,7 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp WHERE (type_code LIKE "snmp_%" OR type_code IN("hostname","host_id")) AND did.data_template_data_id = ? AND did.value != ""'; + dsv_log('host_fields_sql',$host_fields_sql); dsv_log('host_fields_sql_params', array('data_template_data_id' => $data_template_data_id)); @@ -2480,21 +2495,26 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp foreach ($data_template_data as $field) { $key = $field['type_code']; $value = $field['value']; + dsv_log('SNMP field', $field); - //dsv_log('SNMP suggested_val', $suggested_vals['custom_data'][$data_template_id]); + dsv_log('SNMP suggested_val', $suggested_vals['custom_data'][$data_template_id]); + if (!empty($suggested_vals['custom_data'][$data_template_id][$field['id']])) { $value = $suggested_vals['custom_data'][$data_template_id][$field['id']]; + dsv_log("SNMP value replace suggested $key", $value); } if (!empty($value) && !isset($host_fields[$key])) { $host_fields[$key] = $value; + dsv_log("SNMP value replace template $key", $value); } } } dsv_log('SNMP [updated] host_fields', $host_fields); + $host = array_merge($host, $host_fields); dsv_log('SNMP [updated] host', $host); @@ -2548,15 +2568,19 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp foreach ($data_template_data as $field) { $key = $field['type_code']; $value = $field['value']; + dsv_log('SNMP_QUERY field', $field); - //dsv_log('SNMP_QUERY suggested_val', $suggested_vals['custom_data'][$data_template_id]); + dsv_log('SNMP_QUERY suggested_val', $suggested_vals['custom_data'][$data_template_id]); + if (!empty($suggested_vals['custom_data'][$data_template_id][$field['id']])) { $value = $suggested_vals['custom_data'][$data_template_id][$field['id']]; + dsv_log("SNMP_QUERY value replace suggested $key", $value); } if (!empty($value) && !isset($host_fields[$key])) { $host_fields[$key] = $value; + dsv_log("SNMP_QUERY value replace template $key", $value); } } @@ -2639,15 +2663,19 @@ function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp foreach ($data_template_data as $field) { $key = $field['type_code']; $value = $field['value']; + dsv_log('SCRIPT field', $field); - //dsv_log('SCRIPT suggested_val', $suggested_vals['custom_data'][$data_template_id]); + dsv_log('SCRIPT suggested_val', $suggested_vals['custom_data'][$data_template_id]); + if (!empty($suggested_vals['custom_data'][$data_template_id][$field['id']])) { $value = $suggested_vals['custom_data'][$data_template_id][$field['id']]; + dsv_log("SCRIPT value replace suggested $key", $value); } if (!empty($value) && !isset($host_fields[$key])) { $host_fields[$key] = $value; + dsv_log("SCRIPT value replace template $key", $value); } } From c2e77281099fd1ef1380825089a74807715d3e66 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:41:12 -0500 Subject: [PATCH 08/34] Porting #5190 to 1.3.x - Gradient Updates When using Gradient Support GPRINT Text Format is misaligned --- CHANGELOG | 1 + lib/rrd.php | 73 +++++++++++++++++++++++++++-------------------------- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e9b957ae39..88694389de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,7 @@ Cacti CHANGELOG -issue#5184: Cacti permission checks generate SQL errors is the user has been deleted -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location +-issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/rrd.php b/lib/rrd.php index 83a9622a6a..ada4abc151 100644 --- a/lib/rrd.php +++ b/lib/rrd.php @@ -2400,7 +2400,7 @@ function rrdtool_function_graph($local_graph_id, $rra_id, $graph_data_array, $rr if (read_config_option('enable_rrdtool_gradient_support') == 'on') { /* End color is a 40% (0.4) darkened (negative number) version of the original color */ $end_color = colourBrightness('#' . $graph_item['hex'], -0.4); - $txt_graph_items .= gradient($data_source_name, $graph_item_color_code, $end_color . $graph_item['alpha'], cacti_escapeshellarg($graph_variables['text_format'][$graph_item_id] . $hardreturn[$graph_item_id]), 20, false, $graph_item['alpha']); + $txt_graph_items .= gradient($data_source_name, $graph_item_color_code, $end_color . $graph_item['alpha'], cacti_escapeshellarg($text_format . $hardreturn[$graph_item_id]), 20, false, $graph_item['alpha']); } else { $txt_graph_items .= $graph_item_types[$graph_item['graph_type_id']] . ':' . $data_source_name . $graph_item_color_code . ':' . cacti_escapeshellarg($text_format . $hardreturn[$graph_item_id]) . ' '; } @@ -2412,7 +2412,7 @@ function rrdtool_function_graph($local_graph_id, $rra_id, $graph_data_array, $rr break; case GRAPH_ITEM_TYPE_STACK: - $text_format = rrdtool_escape_string(html_escape($graph_variables['text_format'][$graph_item_id] != '' ? str_pad($graph_variables['text_format'][$graph_item_id],$pad_number):'')); + $text_format = rrdtool_escape_string(html_escape($graph_variables['text_format'][$graph_item_id] != '' ? str_pad($graph_variables['text_format'][$graph_item_id], $pad_number):'')); $txt_graph_items .= 'AREA:' . $data_source_name . $graph_item_color_code . ':' . cacti_escapeshellarg($text_format . $hardreturn[$graph_item_id]) . ':STACK'; @@ -4097,28 +4097,28 @@ function rrdtool_create_error_image($string, $width = '', $height = '') { * License: GPLv2 * Original Code: https://github.com/lingej/pnp4nagios/blob/master/share/pnp/application/helpers/rrd.php */ -function gradient($vname=false, $start_color='#0000a0', $end_color='#f0f0f0', $label=false, $steps=20, $lower=false, $alpha='FF') { +function gradient($vname = false, $start_color = '#0000a0', $end_color = '#f0f0f0', $label = false, $steps = 20, $lower = false, $alpha = 'FF') { $label = preg_replace("/'/", '', $label); $label = preg_replace('/:/', "\:", $label); - if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i',$start_color,$matches)) { - $r1=hexdec($matches[1]); - $g1=hexdec($matches[2]); - $b1=hexdec($matches[3]); + if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i', $start_color, $matches)) { + $r1 = hexdec($matches[1]); + $g1 = hexdec($matches[2]); + $b1 = hexdec($matches[3]); } - if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i',$end_color,$matches)) { - $r2=hexdec($matches[1]); - $g2=hexdec($matches[2]); - $b2=hexdec($matches[3]); + if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i', $end_color, $matches)) { + $r2 = hexdec($matches[1]); + $g2 = hexdec($matches[2]); + $b2 = hexdec($matches[3]); } - $diff_r =$r2 - $r1; - $diff_g =$g2 - $g1; - $diff_b =$b2 - $b1; + $diff_r = $r2 - $r1; + $diff_g = $g2 - $g1; + $diff_b = $b2 - $b1; $spline = ''; - $spline_vname = 'var'.substr(sha1(rand()),1,4); - $vnamet = $vname.substr(sha1(rand()),1,4); + $spline_vname = 'var' . substr(sha1(rand()), 1, 4); + $vnamet = $vname . substr(sha1(rand()), 1, 4); if (preg_match('/^([0-9]{1,3})%$/', $lower, $matches)) { $lower = $matches[1]; @@ -4131,20 +4131,21 @@ function gradient($vname=false, $start_color='#0000a0', $end_color='#f0f0f0', $l $spline .= sprintf('CDEF:%sminimum=%s,%s,- '.RRD_NL, $vnamet, $vname, $vname); } - for ($i=$steps; $i > 0; $i--) { - $spline .= sprintf('CDEF:%s%d=%s,%sminimum,-,%d,/,%d,*,%sminimum,+ '.RRD_NL,$spline_vname,$i,$vname,$vnamet,$steps,$i,$vnamet); + for ($i = $steps; $i > 0; $i--) { + $spline .= sprintf('CDEF:%s%d=%s,%sminimum,-,%d,/,%d,*,%sminimum,+ ' . RRD_NL, $spline_vname, $i, $vname, $vnamet, $steps, $i, $vnamet); } // We don't use alpha blending for the area right now $alpha = 'ff'; for ($i=$steps; $i > 0; $i--) { - $factor=$i / $steps; - $r =round($r1 + $diff_r * $factor); - $g =round($g1 + $diff_g * $factor); - $b =round($b1 + $diff_b * $factor); + $factor = $i / $steps; + + $r = round($r1 + $diff_r * $factor); + $g = round($g1 + $diff_g * $factor); + $b = round($b1 + $diff_b * $factor); - if (($i == $steps) && ($label != false) && (strlen($label) > 2)) { + if ($i == $steps && $label != false && strlen($label) > 2) { $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s:"%s" ' . RRD_NL, $spline_vname, $i, $r, $g, $b, $alpha, $label); } else { $spline .= sprintf('AREA:%s%d#%02X%02X%02X%s ' . RRD_NL, $spline_vname, $i, $r, $g, $b, $alpha); @@ -4171,16 +4172,16 @@ function colourBrightness($hex, $percent) { // Work out if hash given $hash = ''; - if (stristr($hex,'#')) { - $hex = str_replace('#','',$hex); + if (stristr($hex, '#')) { + $hex = str_replace('#', '', $hex); $hash = '#'; } /// HEX TO RGB - $rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2))); + $rgb = array(hexdec(substr($hex, 0, 2)), hexdec(substr($hex, 2, 2)), hexdec(substr($hex, 4, 2))); //// CALCULATE - for ($i=0; $i < 3; $i++) { // See if brighter or darker + for ($i = 0; $i < 3; $i++) { // See if brighter or darker if ($percent > 0) { // Lighter $rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1 - $percent)); @@ -4199,7 +4200,7 @@ function colourBrightness($hex, $percent) { //// RBG to Hex $hex = ''; - for ($i=0; $i < 3; $i++) { + for ($i = 0; $i < 3; $i++) { // Convert the decimal digit to hex $hexDigit = dechex($rgb[$i]); @@ -4236,8 +4237,8 @@ function add_business_hours($data) { preg_match('/(\d+)\:(\d+)/',read_config_option('business_hours_start'), $bh_start_matches); preg_match('/(\d+)\:(\d+)/',read_config_option('business_hours_end'), $bh_end_matches); - $start_bh_time = mktime($bh_start_matches[1],$bh_start_matches[2],0,date('m',$bh_graph_start),date('d',$bh_graph_start),date('Y',$bh_graph_start)); - $end_bh_time = mktime($bh_end_matches[1],$bh_end_matches[2],0,date('m',$bh_graph_end),date('d',$bh_graph_end),date('Y',$bh_graph_end)); + $start_bh_time = mktime($bh_start_matches[1], $bh_start_matches[2], 0, date('m', $bh_graph_start), date('d', $bh_graph_start), date('Y', $bh_graph_start)); + $end_bh_time = mktime($bh_end_matches[1], $bh_end_matches[2], 0, date('m', $bh_graph_end), date('d', $bh_graph_end), date('Y', $bh_graph_end)); if ($start_bh_time < $bh_graph_start) { if ($start_bh_time < $end_bh_time) { @@ -4253,8 +4254,8 @@ function add_business_hours($data) { if ($num_of_days <= read_config_option('business_hours_max_days')) { for ($day=0; $day < $num_of_days; $day++) { - $current_start_bh_time = mktime($bh_start_matches[1],$bh_start_matches[2],0,date('m',$start_bh_time),date('d',$start_bh_time) + $day,date('Y',$start_bh_time)); - $current_end_bh_time = mktime($bh_end_matches[1],$bh_end_matches[2],0,date('m',$start_bh_time),date('d',$start_bh_time) + $day,date('Y',$start_bh_time)); + $current_start_bh_time = mktime($bh_start_matches[1], $bh_start_matches[2], 0, date('m', $start_bh_time), date('d', $start_bh_time) + $day, date('Y', $start_bh_time)); + $current_end_bh_time = mktime($bh_end_matches[1], $bh_end_matches[2], 0, date('m', $start_bh_time), date('d', $start_bh_time) + $day, date('Y', $start_bh_time)); if ($current_start_bh_time < $bh_graph_start) { $current_start_bh_time = $bh_graph_start; @@ -4267,18 +4268,18 @@ function add_business_hours($data) { $data['graph_defs'] .= 'CDEF:officehours' . $day . '=a,POP,TIME,' . $current_start_bh_time . ',LT,1,0,IF,TIME,' . $current_end_bh_time . ',GT,1,0,IF,MAX,0,GT,0,1,IF' . RRD_NL; $data['graph_defs'] .= 'CDEF:dslimit' . $day . '=INF,officehours' . $day . ',*' . RRD_NL; - if (preg_match('/[0-9A-Fa-f]{6,8}/',read_config_option('business_hours_color'))) { + if (preg_match('/[0-9A-Fa-f]{6,8}/', read_config_option('business_hours_color'))) { $bh_color = read_config_option('business_hours_color'); } else { $bh_color = 'ccccccff'; } - if (date('N',$current_start_bh_time) < 6) { + if (date('N', $current_start_bh_time) < 6) { $data['graph_defs'] .= 'AREA:dslimit' . $day . '#' . $bh_color . RRD_NL; } - if ((date('N',$current_start_bh_time) > 5) && (read_config_option('business_hours_hideWeekends') == '')) { - $data['graph_defs'] .= 'AREA:dslimit' . $day . '#'.$bh_color . RRD_NL; + if (date('N', $current_start_bh_time) > 5 && read_config_option('business_hours_hideWeekends') == '') { + $data['graph_defs'] .= 'AREA:dslimit' . $day . '#'. $bh_color . RRD_NL; } } } From 7c8be4bbd45a84bf1823af03a9d6b0b0bb9feb6e Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:43:24 -0500 Subject: [PATCH 09/34] Porting #5188 to 1.3.x - Template Filtering Device Template Filter broken --- CHANGELOG | 1 + host_templates.php | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 88694389de..eba61b3704 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,7 @@ Cacti CHANGELOG -issue#5184: Cacti permission checks generate SQL errors is the user has been deleted -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location +-issue#5188: Device Template Filter broken -issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url diff --git a/host_templates.php b/host_templates.php index 88bfe3439b..0695ce06b0 100644 --- a/host_templates.php +++ b/host_templates.php @@ -837,20 +837,18 @@ function clearFilter() { html_end_box(); /* form the 'where' clause for our main sql query */ + $sql_where = ''; + if (get_request_var('filter') != '') { - $sql_where = 'WHERE (host_template.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; - } else { - $sql_where = ''; + $sql_where .= 'WHERE (host_template.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; } if (get_request_var('class') != '-1') { - $sql_where = 'WHERE (host_template.class = ' . db_qstr(get_request_var('class')) . ')'; - } else { - $sql_where = ''; + $sql_where .= 'WHERE (host_template.class = ' . db_qstr(get_request_var('class')) . ')'; } if (get_request_var('has_hosts') == 'true') { - $sql_having = 'HAVING hosts>0'; + $sql_having = 'HAVING hosts > 0'; } else { $sql_having = ''; } From 9ab899d70b714f77454f45b5575196dd5212c227 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:46:40 -0500 Subject: [PATCH 10/34] Porting #5195 to 1.3.x - Spikekill errors Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given --- CHANGELOG | 1 + lib/spikekill.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index eba61b3704..9824558b1e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -85,6 +85,7 @@ Cacti CHANGELOG -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location -issue#5188: Device Template Filter broken -issue#5190: When using Gradient Support GPRINT Text Format is misaligned +-issue#5195: Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/spikekill.php b/lib/spikekill.php index 618d286a17..635e2f7a21 100644 --- a/lib/spikekill.php +++ b/lib/spikekill.php @@ -791,7 +791,15 @@ private function calculateVarianceAverages(&$rra, &$samples) { $rra[$rra_num][$ds_num]['variance_avg'] = 'NAN'; } else { $myds = $ds; - $myds = array_filter($myds, array($this, 'removeNanFromSamples')); + + /* remove NaN entries from the data set */ + if (cacti_sizeof($myds)) { + foreach($myds as $timestamp => $value) { + if (stripos($value, 'nan') !== false) { + unset($myds[$timestamp]); + } + } + } /* remove high outliers */ rsort($myds, SORT_NUMERIC); @@ -824,10 +832,6 @@ private function calculateVarianceAverages(&$rra, &$samples) { } } - private function removeNanFromSamples(&$string) { - return stripos($string, 'nan') === false; - } - private function calculateOverallStatistics(&$rra, &$samples) { $rra_num = 0; From 3b298637b97dbbc543fed51a54fc488965591c06 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:50:32 -0500 Subject: [PATCH 11/34] Porting #5196 to 1.3.x - Gradient Issues Gradient support breaks certain Graphs with special characters in them --- CHANGELOG | 1 + lib/rrd.php | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9824558b1e..9ccf89dc73 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -86,6 +86,7 @@ Cacti CHANGELOG -issue#5188: Device Template Filter broken -issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5195: Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given +-issue#5196: Gradient support breaks certain Graphs with special characters in them -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/rrd.php b/lib/rrd.php index ada4abc151..46fca32786 100644 --- a/lib/rrd.php +++ b/lib/rrd.php @@ -4098,9 +4098,6 @@ function rrdtool_create_error_image($string, $width = '', $height = '') { * Original Code: https://github.com/lingej/pnp4nagios/blob/master/share/pnp/application/helpers/rrd.php */ function gradient($vname = false, $start_color = '#0000a0', $end_color = '#f0f0f0', $label = false, $steps = 20, $lower = false, $alpha = 'FF') { - $label = preg_replace("/'/", '', $label); - $label = preg_replace('/:/', "\:", $label); - if (preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i', $start_color, $matches)) { $r1 = hexdec($matches[1]); $g1 = hexdec($matches[2]); From f2ffc397ae3e34e51706c94f7dbf4bd60f07e54f Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:55:46 -0500 Subject: [PATCH 12/34] Porting #5198 to 1.3.x - PHP8 Errors PHP Diff Renderer throws warnings --- CHANGELOG | 1 + .../vendor/phpdiff/Renderer/Html/Array.php | 47 ++++++++++++------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9ccf89dc73..d061c6bfad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -87,6 +87,7 @@ Cacti CHANGELOG -issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5195: Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given -issue#5196: Gradient support breaks certain Graphs with special characters in them +-issue#5198: PHP Diff Renderer throws warnings -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/include/vendor/phpdiff/Renderer/Html/Array.php b/include/vendor/phpdiff/Renderer/Html/Array.php index 6203c0b27d..b581a07f15 100644 --- a/include/vendor/phpdiff/Renderer/Html/Array.php +++ b/include/vendor/phpdiff/Renderer/Html/Array.php @@ -5,10 +5,10 @@ * PHP version 5 * * Copyright (c) 2009 Chris Boulton - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, @@ -16,20 +16,20 @@ * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * - Neither the name of the Chris Boulton nor the names of its contributors - * may be used to endorse or promote products derived from this software + * - Neither the name of the Chris Boulton nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package DiffLib @@ -190,14 +190,25 @@ protected function formatLines($lines) */ private function fixSpaces(array $matches) { - $spaces = $matches[1]; - $count = strlen($spaces); - if($count == 0) { + if (isset($matches[1])) { + $spaces = $matches[1]; + + if ($spaces != '') { + $count = strlen($spaces); + + if ($count == 0) { + return ''; + } + } else { + return ''; + } + } else { return ''; } $div = floor($count / 2); $mod = $count % 2; + return str_repeat('  ', $div).str_repeat(' ', $mod); } From a70894748a9ddc909056f18a8e2055827cb72dad Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 11:59:56 -0500 Subject: [PATCH 13/34] Porting #5197 to 1.3.x - Realtime Issues Realtime graph on remote poller not working in 1.2.23 --- CHANGELOG | 1 + remote_agent.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d061c6bfad..3d2310823d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -87,6 +87,7 @@ Cacti CHANGELOG -issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5195: Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given -issue#5196: Gradient support breaks certain Graphs with special characters in them +-issue#5197: Realtime graph on remote poller not working in 1.2.23 -issue#5198: PHP Diff Renderer throws warnings -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url diff --git a/remote_agent.php b/remote_agent.php index a0f2796001..0b56f5a31d 100644 --- a/remote_agent.php +++ b/remote_agent.php @@ -305,9 +305,14 @@ function poll_for_data() { $local_data_ids = get_nfilter_request_var('local_data_ids'); $host_id = get_filter_request_var('host_id'); - $poller_id = get_filter_request_var('poller_id'); + $poller_id = get_nfilter_request_var('poller_id'); $return = array(); + /* ensure we have a valid poller_id */ + if (!preg_match('/^[a-z0-9]+$/i', $poller_id)) { + return array(); + } + $i = 0; if (cacti_sizeof($local_data_ids)) { From 99cd111099886584f8829ae0d37fef93e0b34794 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 12:02:56 -0500 Subject: [PATCH 14/34] Porting #5199 to 1.3.x - Mask additional errors When trying to obtain data, cacti should not log Transport Read errors --- CHANGELOG | 1 + lib/functions.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3d2310823d..19b7d41495 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -89,6 +89,7 @@ Cacti CHANGELOG -issue#5196: Gradient support breaks certain Graphs with special characters in them -issue#5197: Realtime graph on remote poller not working in 1.2.23 -issue#5198: PHP Diff Renderer throws warnings +-issue#5199: When trying to obtain data, cacti should not log Transport Read errors -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/functions.php b/lib/functions.php index 478f183cd0..b2f53726e0 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -6263,6 +6263,7 @@ function IgnoreErrorHandler($message) { $general_ignore = array( 'unable to read from socket', # ping.php line 387 socket refusal 'Maximum execution time of', + 'transport read', ); foreach ($general_ignore as $i) { From 7960ea491f306eb95869d98d3cbd6f1c9a9522ee Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 12:05:34 -0500 Subject: [PATCH 15/34] Porting #5200 to 1.3.x - Top Tab issues with Classic Cacti function throws errors when attempting to render classic images in PHP8 --- CHANGELOG | 1 + lib/functions.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 19b7d41495..9d652a8643 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -90,6 +90,7 @@ Cacti CHANGELOG -issue#5197: Realtime graph on remote poller not working in 1.2.23 -issue#5198: PHP Diff Renderer throws warnings -issue#5199: When trying to obtain data, cacti should not log Transport Read errors +-issue#5200: Cacti function throws errors when attempting to render classic images in PHP8 -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/functions.php b/lib/functions.php index b2f53726e0..6dced49b55 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -6204,9 +6204,9 @@ function get_classic_tabimage($text, $down = false) { foreach ($lines as $line) { if ($ttf_functions) { - imagettftext($tab, $line[2], 0, $line[3], $line[4], $white, $line[1], $line[0]); + imagettftext($tab, $line[2], 0, intval($line[3]), intval($line[4]), $white, $line[1], $line[0]); } else { - imagestring($tab, $line[1], $line[3], $line[4], $line[0], $white); + imagestring($tab, $line[1], intval($line[3]), intval($line[4]), $line[0], $white); } } From 4a6c04d81ddab28e63377852f0ada2223773167b Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 12:09:51 -0500 Subject: [PATCH 16/34] Porting #5201 to 1.3.x - Themes and WeatherMap Minor issues in modern and dark prevent weathermaps from rendering correctly --- CHANGELOG | 1 + include/themes/dark/main.css | 8 ++++---- include/themes/modern/main.css | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d652a8643..7290b92aaf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -91,6 +91,7 @@ Cacti CHANGELOG -issue#5198: PHP Diff Renderer throws warnings -issue#5199: When trying to obtain data, cacti should not log Transport Read errors -issue#5200: Cacti function throws errors when attempting to render classic images in PHP8 +-issue#5201: Minor issues in modern and dark prevent weathermaps from rendering correctly -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/include/themes/dark/main.css b/include/themes/dark/main.css index 019d5a4c6a..63f6e804fd 100644 --- a/include/themes/dark/main.css +++ b/include/themes/dark/main.css @@ -855,7 +855,7 @@ ul#breadcrumbs { background: #161616 none repeat scroll 0 0; width: 100%; vertical-align: top; - padding-top: 56px; + padding-top: 62px; } .cactiTreeNavigationArea { @@ -1089,7 +1089,7 @@ legend { .cactiGraphContentArea { background: #161616; - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; display: none; @@ -1102,7 +1102,7 @@ legend { .cactiGraphContentAreaPreview { height: 100vh; background: #161616; - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; display: none; @@ -1113,7 +1113,7 @@ legend { .cactiConsoleContentArea { background: #161616; - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; vertical-align: top; diff --git a/include/themes/modern/main.css b/include/themes/modern/main.css index d18859bd00..1447399dff 100644 --- a/include/themes/modern/main.css +++ b/include/themes/modern/main.css @@ -869,7 +869,7 @@ ul#breadcrumbs { clear: both; width: 100%; vertical-align: top; - padding-top: 56px; + padding-top: 62px; } .cactiTreeNavigationArea { @@ -1109,7 +1109,7 @@ legend { .cactiGraphContentArea { height: 100vh; - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; display: none; @@ -1120,7 +1120,7 @@ legend { .cactiGraphContentAreaPreview { height: 100vh; - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; display: none; @@ -1130,7 +1130,7 @@ legend { } .cactiConsoleContentArea { - padding-top: 10px; + padding-top: 5px; padding-right: 5px; padding-left: 5px; vertical-align: top; @@ -2250,8 +2250,8 @@ tr.selected a { ul#nav { list-style: none; - padding: 0; - padding-top: 4px; + padding: 0px; + padding-top: 0px; width: 100%; } From 95e345ae32552ae9b5d6aa9930ca146a620ba93e Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 12:20:35 -0500 Subject: [PATCH 17/34] Porting #5202 to 1.3.x - Import Issues When importing packages, Graph Size does not get updated to Graph Templates --- CHANGELOG | 1 + lib/import.php | 30 +++++++++++++++++++----------- templates_import.php | 14 +++++++------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7290b92aaf..7364c2057a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -92,6 +92,7 @@ Cacti CHANGELOG -issue#5199: When trying to obtain data, cacti should not log Transport Read errors -issue#5200: Cacti function throws errors when attempting to render classic images in PHP8 -issue#5201: Minor issues in modern and dark prevent weathermaps from rendering correctly +-issue#5202: When importing packages, Graph Size does not get updated to Graph Templates -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/import.php b/lib/import.php index 6206f49ede..ff0306d2aa 100644 --- a/lib/import.php +++ b/lib/import.php @@ -696,18 +696,26 @@ function xml_to_graph_template($hash, &$xml_array, &$hash_cache, $hash_version, /* make sure this field exists in the xml array first */ if (isset($xml_array['graph'][$field_name])) { - /** - * Cacti pre 0.8.5 did handle a unit_exponent=0 differently - * so we need to know the version of the current hash code we're just working on - */ - if (($field_name == 'unit_exponent_value') && (get_version_index($hash_version) < get_version_index('0.8.5')) && ($xml_array['graph'][$field_name] == '0')) { /* backwards compatability */ + if ($field_name == 'unit_exponent_value' && $xml_array['graph'][$field_name] == '0') { $save[$field_name] = ''; - } elseif ($field_name == 'graph_width' && isset_request_var('graph_width')) { - $save[$field_name] = get_filter_request_var('graph_width'); - } elseif ($field_name == 'graph_height' && isset_request_var('graph_height')) { - $save[$field_name] = get_filter_request_var('graph_height'); - } elseif ($field_name == 'image_format_id' && isset_request_var('image_format')) { - $save[$field_name] = get_filter_request_var('image_format'); + } elseif ($field_name == 'graph_width') { + if (isset_request_var('graph_width') && !isempty_request_var('graph_width')) { + $save[$field_name] = get_filter_request_var('graph_width'); + } else { + $save[$field_name] = read_config_option('default_graph_width'); + } + } elseif ($field_name == 'graph_height') { + if (isset_request_var('graph_height') && !isempty_request_var('graph_height')) { + $save[$field_name] = get_filter_request_var('graph_height'); + } else { + $save[$field_name] = read_config_option('default_graph_height'); + } + } elseif ($field_name == 'image_format_id') { + if (isset_request_var('image_format') && !isempty_request_var('image_format')) { + $save[$field_name] = get_filter_request_var('image_format'); + } else { + $save[$field_name] = read_config_option('default_image_format'); + } } else { $save[$field_name] = xml_character_decode($xml_array['graph'][$field_name]); } diff --git a/templates_import.php b/templates_import.php index f69dc74163..c8ffdae873 100644 --- a/templates_import.php +++ b/templates_import.php @@ -275,6 +275,8 @@ function display_template_data(&$templates) { html_header_checkbox($display_text, false, '', true, 'import'); + $templates = array_reverse($templates); + foreach ($templates as $hash => $detail) { $id = base64_encode( json_encode( @@ -334,15 +336,13 @@ function display_template_data(&$templates) { $diff_array = array(); $orphan_array = array(); - foreach ($detail['vals'] as $package => $diffs) { - if (isset($diffs['differences'])) { - foreach ($diffs['differences'] as $item) { + foreach ($detail['vals'] as $type => $diffs) { + if ($type == 'differences') { + foreach($diffs as $item) { $diff_array[$item] = $item; } - } - - if (isset($diffs['orphans'])) { - foreach ($diffs['orphans'] as $item) { + } elseif ($type == 'orphans') { + foreach($diffs as $item) { $orphan_array[$item] = $item; } } From 7dd8de81b4ff9455489a477ed34f0e5c942c18fc Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 13:41:28 -0500 Subject: [PATCH 18/34] Porting #5203 to 1.2.x - NetSNMP overflow handling Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 --- CHANGELOG | 1 + scripts/ss_net_snmp_disk_bytes.php | 24 ++++++++++++++++++++---- scripts/ss_net_snmp_disk_io.php | 24 ++++++++++++++++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7364c2057a..3f1a72ed90 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -93,6 +93,7 @@ Cacti CHANGELOG -issue#5200: Cacti function throws errors when attempting to render classic images in PHP8 -issue#5201: Minor issues in modern and dark prevent weathermaps from rendering correctly -issue#5202: When importing packages, Graph Size does not get updated to Graph Templates +-issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/scripts/ss_net_snmp_disk_bytes.php b/scripts/ss_net_snmp_disk_bytes.php index 9118a26677..0cd5bd55e0 100644 --- a/scripts/ss_net_snmp_disk_bytes.php +++ b/scripts/ss_net_snmp_disk_bytes.php @@ -162,9 +162,17 @@ function ss_net_snmp_disk_bytes($host_id_or_hostname = '') { } elseif (!isset($previous["br$index"])) { $bytesread = 'U'; } elseif ($previous["br$index"] > $measure['value']) { - $bytesread += $measure['value'] + 18446744073709551615 - $previous["br$index"] - $previous["br$index"]; + if ($bytesread != 'U') { + $bytesread += $measure['value'] + 18446744073709551615 - $previous["br$index"] - $previous["br$index"]; + } else { + $bytesread = $measure['value'] + 18446744073709551615 - $previous["br$index"] - $previous["br$index"]; + } } else { - $bytesread += $measure['value'] - $previous["br$index"]; + if ($bytesread != 'U') { + $bytesread += $measure['value'] - $previous["br$index"]; + } else { + $bytesread = $measure['value'] - $previous["br$index"]; + } } $current["br$index"] = $measure['value']; @@ -200,9 +208,17 @@ function ss_net_snmp_disk_bytes($host_id_or_hostname = '') { } elseif (!isset($previous["bw$index"])) { $byteswritten = 'U'; } elseif ($previous["bw$index"] > $measure['value']) { - $byteswritten += $measure['value'] + 18446744073709551615 - $previous["bw$index"] - $previous["bw$index"]; + if ($byteswritten != 'U') { + $byteswritten += $measure['value'] + 18446744073709551615 - $previous["bw$index"] - $previous["bw$index"]; + } else { + $byteswritten = $measure['value'] + 18446744073709551615 - $previous["bw$index"] - $previous["bw$index"]; + } } else { - $byteswritten += $measure['value'] - $previous["bw$index"]; + if ($byteswritten != 'U') { + $byteswritten += $measure['value'] - $previous["bw$index"]; + } else { + $byteswritten = $measure['value'] - $previous["bw$index"]; + } } $current["bw$index"] = $measure['value']; diff --git a/scripts/ss_net_snmp_disk_io.php b/scripts/ss_net_snmp_disk_io.php index 504bd2e79a..2f52e3db7c 100644 --- a/scripts/ss_net_snmp_disk_io.php +++ b/scripts/ss_net_snmp_disk_io.php @@ -161,9 +161,17 @@ function ss_net_snmp_disk_io($host_id_or_hostname = '') { } elseif (!isset($previous["dr$index"])) { $reads = 'U'; } elseif ($previous["dr$index"] > $measure['value']) { - $reads += $measure['value'] + 4294967295 - $previous["dr$index"] - $previous["dr$index"]; + if ($reads != 'U') { + $reads += intval($measure['value']) + 4294967295 - intval($previous["dr$index"]) - intval($previous["dr$index"]); + } else { + $reads = intval($measure['value']) + 4294967295 - intval($previous["dr$index"]) - intval($previous["dr$index"]); + } } else { - $reads += $measure['value'] - $previous["dr$index"]; + if ($reads != 'U') { + $reads += $measure['value'] - $previous["dr$index"]; + } else { + $reads = $measure['value'] - $previous["dr$index"]; + } } $current["dr$index"] = $measure['value']; @@ -199,9 +207,17 @@ function ss_net_snmp_disk_io($host_id_or_hostname = '') { } elseif (!isset($previous["dw$index"])) { $writes = 'U'; } elseif ($previous["dw$index"] > $measure['value']) { - $writes += $measure['value'] + 4294967295 - $previous["dw$index"] - $previous["dw$index"]; + if ($writes != 'U') { + $writes += $measure['value'] + 4294967295 - $previous["dw$index"] - $previous["dw$index"]; + } else { + $writes = $measure['value'] + 4294967295 - $previous["dw$index"] - $previous["dw$index"]; + } } else { - $writes += $measure['value'] - $previous["dw$index"]; + if ($writes != 'U') { + $writes += $measure['value'] - $previous["dw$index"]; + } else { + $writes = $measure['value'] - $previous["dw$index"]; + } } $current["dw$index"] = $measure['value']; From 0da0b2b20670a3cca1d61856ca72a8ce055e1d97 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 13:52:12 -0500 Subject: [PATCH 19/34] Porting #4204 to 1.3.x Audit Schema Issues --- CHANGELOG | 1 + cli/audit_database.php | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3f1a72ed90..472d3fed9d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -94,6 +94,7 @@ Cacti CHANGELOG -issue#5201: Minor issues in modern and dark prevent weathermaps from rendering correctly -issue#5202: When importing packages, Graph Size does not get updated to Graph Templates -issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 +-issue#5204: Compatibility improvements for Audit Database under PHP 8.x -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/cli/audit_database.php b/cli/audit_database.php index cb5e97982b..81cbe45dbf 100755 --- a/cli/audit_database.php +++ b/cli/audit_database.php @@ -427,9 +427,9 @@ function report_audit_results($output = true) { $status = db_fetch_row('SHOW TABLE STATUS LIKE "' . $table_name . '"'); if ($status['Collation'] == 'utf8mb4_unicode_ci' || $status['Collation'] == 'utf8_general_ci') { - $text = 'mediumtext'; + $collation = 'utf8'; } else { - $text = 'text'; + $collation = 'latin'; } if ($output) { @@ -516,8 +516,8 @@ function report_audit_results($output = true) { } else { foreach ($cols as $dbcol => $col) { if ($col == 'Type' && $dbc[$dbcol] == 'text') { - if ($text == 'mediumtext') { - $dbc[$dbcol] = $text; + if ($collation == 'latin') { + $dbc[$dbcol] = 'mediumtext'; } } @@ -741,9 +741,14 @@ function report_audit_results($output = true) { function make_column_props(&$dbc) { $alter_cmd = ''; - $dbc['table_default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_default']); - $dbc['table_extra'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_extra']); - $dbc['table_extra'] = trim(str_replace('DEFAULT_GENERATED', '', $dbc['table_extra'])); + if (isset($dbc['table_default'])) { + $dbc['table_default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_default']); + } + + if (isset($dbc['table_extra'])) { + $dbc['table_extra'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_extra']); + $dbc['table_extra'] = trim(str_replace('DEFAULT_GENERATED', '', $dbc['table_extra'])); + } if ($dbc['table_null'] == 'YES') { if ($dbc['table_default'] == 'NULL') { From 6c5c9d65df5384bbdff3ad200b16bf549f89f1b0 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 13:59:42 -0500 Subject: [PATCH 20/34] Porting #5205 to 1.3.x - Diff CSS Changes * When using Diff Viewer, rendering is not always correct under certain themes * Remove some c3.css files too --- CHANGELOG | 1 + include/themes/cacti/Diff.css | 24 +- include/themes/cacti/billboard.css | 448 ++++++++++++------------ include/themes/cacti/c3.css | 167 --------- include/themes/carrot/Diff.css | 24 +- include/themes/carrot/billboard.css | 224 ++++++++++++ include/themes/carrot/c3.css | 167 --------- include/themes/classic/Diff.css | 24 +- include/themes/dark/Diff.css | 56 ++- include/themes/hollyberry/Diff.css | 24 +- include/themes/hollyberry/billboard.css | 224 ++++++++++++ include/themes/hollyberry/c3.css | 167 --------- include/themes/midwinter/Diff.css | 56 ++- include/themes/modern/Diff.css | 24 +- include/themes/paper-plane/Diff.css | 24 +- include/themes/paw/Diff.css | 24 +- include/themes/raspberry/Diff.css | 24 +- include/themes/raspberry/billboard.css | 224 ++++++++++++ include/themes/raspberry/c3.css | 167 --------- include/themes/sunrise/Diff.css | 56 ++- 20 files changed, 1139 insertions(+), 1010 deletions(-) delete mode 100644 include/themes/cacti/c3.css create mode 100644 include/themes/carrot/billboard.css delete mode 100644 include/themes/carrot/c3.css create mode 100644 include/themes/hollyberry/billboard.css delete mode 100644 include/themes/hollyberry/c3.css create mode 100644 include/themes/raspberry/billboard.css delete mode 100644 include/themes/raspberry/c3.css diff --git a/CHANGELOG b/CHANGELOG index 472d3fed9d..35277401b7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -95,6 +95,7 @@ Cacti CHANGELOG -issue#5202: When importing packages, Graph Size does not get updated to Graph Templates -issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 -issue#5204: Compatibility improvements for Audit Database under PHP 8.x +-issue#5205: When using Diff Viewer, rendering is not always correct under certain themes -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/include/themes/cacti/Diff.css b/include/themes/cacti/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/cacti/Diff.css +++ b/include/themes/cacti/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/cacti/billboard.css b/include/themes/cacti/billboard.css index 5eb5f555c9..3f3ce57288 100644 --- a/include/themes/cacti/billboard.css +++ b/include/themes/cacti/billboard.css @@ -1,224 +1,224 @@ -/*! - * Copyright (c) 2017 ~ present NAVER Corp. - * billboard.js project is licensed under the MIT license - * - * billboard.js, JavaScript chart library - * https://naver.github.io/billboard.js/ - * - * @version 3.0.2 - */ -/*-- Chart --*/ -.bb svg { - font: 10px sans-serif; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } - -.bb path, .bb line { - fill: none; - stroke: #000; } - -.bb text, .bb .bb-button { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.bb-legend-item-tile, -.bb-xgrid-focus, -.bb-ygrid-focus, -.bb-ygrid, -.bb-event-rect, -.bb-bars path { - shape-rendering: crispEdges; } - -.bb-chart-arc .bb-gauge-value { - fill: #000; } - -.bb-chart-arc path { - stroke: #fff; } - -.bb-chart-arc rect { - stroke: #fff; - stroke-width: 1; } - -.bb-chart-arc text { - fill: #fff; - font-size: 13px; } - -/*-- Axis --*/ -.bb-axis { - shape-rendering: crispEdges; } - -/*-- Grid --*/ -.bb-grid line { - stroke: #aaa; } - -.bb-grid text { - fill: #aaa; } - -.bb-xgrid, .bb-ygrid { - stroke-dasharray: 3 3; } - -/*-- Text on Chart --*/ -.bb-text.bb-empty { - fill: #808080; - font-size: 2em; } - -/*-- Line --*/ -.bb-line { - stroke-width: 1px; } - -/*-- Point --*/ -.bb-circle._expanded_ { - stroke-width: 1px; - stroke: white; } - -.bb-selected-circle { - fill: white; - stroke-width: 2px; } - -/*-- Bar --*/ -.bb-bar { - stroke-width: 0; } - .bb-bar._expanded_ { - fill-opacity: 0.75; } - -/*-- Focus --*/ -.bb-target.bb-focused, .bb-circles.bb-focused { - opacity: 1; } - -.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step, .bb-circles.bb-focused path.bb-line, .bb-circles.bb-focused path.bb-step { - stroke-width: 2px; } - -.bb-target.bb-defocused, .bb-circles.bb-defocused { - opacity: 0.3 !important; } - .bb-target.bb-defocused .text-overlapping, .bb-circles.bb-defocused .text-overlapping { - opacity: .05 !important; } - -/*-- Region --*/ -.bb-region { - fill: steelblue; - fill-opacity: .1; } - -/*-- Zoom region --*/ -.bb-zoom-brush { - fill-opacity: .1; } - -/*-- Brush --*/ -.bb-brush .extent { - fill-opacity: .1; } - -/*-- Select - Drag --*/ -/*-- Legend --*/ -.bb-legend-item { - font-size: 12px; - user-select: none; } - -.bb-legend-item-hidden { - opacity: 0.15; } - -.bb-legend-background { - opacity: 0.75; - fill: white; - stroke: lightgray; - stroke-width: 1; } - -/*-- Title --*/ -.bb-title { - font: 14px sans-serif; } - -/*-- Tooltip --*/ -.bb-tooltip-container { - z-index: 10; - user-select: none; } - -.bb-tooltip { - border-collapse: collapse; - border-spacing: 0; - background-color: #fff; - empty-cells: show; - opacity: 0.9; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; } - .bb-tooltip tr { - border: 1px solid #CCC; } - .bb-tooltip th { - background-color: #aaa; - font-size: 14px; - padding: 2px 5px; - text-align: left; - color: #FFF; } - .bb-tooltip td { - font-size: 13px; - padding: 3px 6px; - background-color: #fff; - border-left: 1px dotted #999; } - .bb-tooltip td > span, .bb-tooltip td > svg { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 6px; } - .bb-tooltip.value { - text-align: right; } - -/*-- Area --*/ -.bb-area { - stroke-width: 0; - opacity: 0.2; } - -/*-- Arc --*/ -.bb-chart-arcs-title { - dominant-baseline: middle; - font-size: 1.3em; } - -.bb-chart-arcs-gauge-title { - dominant-baseline: middle; - font-size: 2.7em; } - -.bb-chart-arcs .bb-chart-arcs-background { - fill: #e0e0e0; - stroke: #fff; } - -.bb-chart-arcs .bb-chart-arcs-gauge-unit { - fill: #000; - font-size: 16px; } - -.bb-chart-arcs .bb-chart-arcs-gauge-max { - fill: #777; } - -.bb-chart-arcs .bb-chart-arcs-gauge-min { - fill: #777; } - -/*-- Radar --*/ -.bb-chart-radars .bb-levels polygon { - fill: none; - stroke: #848282; - stroke-width: .5px; } - -.bb-chart-radars .bb-levels text { - fill: #848282; } - -.bb-chart-radars .bb-axis line { - stroke: #848282; - stroke-width: .5px; } - -.bb-chart-radars .bb-axis text { - font-size: 1.15em; - cursor: default; } - -.bb-chart-radars .bb-shapes polygon { - fill-opacity: .2; - stroke-width: 1px; } - -/*-- Button --*/ -.bb-button { - position: absolute; - top: 10px; - right: 10px; } - .bb-button .bb-zoom-reset { - font-size: 11px; - border: solid 1px #ccc; - background-color: #fff; - padding: 5px; - border-radius: 5px; - cursor: pointer; } - +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * https://naver.github.io/billboard.js/ + * + * @version 3.0.2 + */ +/*-- Chart --*/ +.bb svg { + font: 10px sans-serif; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.bb path, .bb line { + fill: none; + stroke: #000; } + +.bb text, .bb .bb-button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.bb-legend-item-tile, +.bb-xgrid-focus, +.bb-ygrid-focus, +.bb-ygrid, +.bb-event-rect, +.bb-bars path { + shape-rendering: crispEdges; } + +.bb-chart-arc .bb-gauge-value { + fill: #000; } + +.bb-chart-arc path { + stroke: #fff; } + +.bb-chart-arc rect { + stroke: #fff; + stroke-width: 1; } + +.bb-chart-arc text { + fill: #fff; + font-size: 13px; } + +/*-- Axis --*/ +.bb-axis { + shape-rendering: crispEdges; } + +/*-- Grid --*/ +.bb-grid line { + stroke: #aaa; } + +.bb-grid text { + fill: #aaa; } + +.bb-xgrid, .bb-ygrid { + stroke-dasharray: 3 3; } + +/*-- Text on Chart --*/ +.bb-text.bb-empty { + fill: #808080; + font-size: 2em; } + +/*-- Line --*/ +.bb-line { + stroke-width: 1px; } + +/*-- Point --*/ +.bb-circle._expanded_ { + stroke-width: 1px; + stroke: white; } + +.bb-selected-circle { + fill: white; + stroke-width: 2px; } + +/*-- Bar --*/ +.bb-bar { + stroke-width: 0; } + .bb-bar._expanded_ { + fill-opacity: 0.75; } + +/*-- Focus --*/ +.bb-target.bb-focused, .bb-circles.bb-focused { + opacity: 1; } + +.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step, .bb-circles.bb-focused path.bb-line, .bb-circles.bb-focused path.bb-step { + stroke-width: 2px; } + +.bb-target.bb-defocused, .bb-circles.bb-defocused { + opacity: 0.3 !important; } + .bb-target.bb-defocused .text-overlapping, .bb-circles.bb-defocused .text-overlapping { + opacity: .05 !important; } + +/*-- Region --*/ +.bb-region { + fill: steelblue; + fill-opacity: .1; } + +/*-- Zoom region --*/ +.bb-zoom-brush { + fill-opacity: .1; } + +/*-- Brush --*/ +.bb-brush .extent { + fill-opacity: .1; } + +/*-- Select - Drag --*/ +/*-- Legend --*/ +.bb-legend-item { + font-size: 12px; + user-select: none; } + +.bb-legend-item-hidden { + opacity: 0.15; } + +.bb-legend-background { + opacity: 0.75; + fill: white; + stroke: lightgray; + stroke-width: 1; } + +/*-- Title --*/ +.bb-title { + font: 14px sans-serif; } + +/*-- Tooltip --*/ +.bb-tooltip-container { + z-index: 10; + user-select: none; } + +.bb-tooltip { + border-collapse: collapse; + border-spacing: 0; + background-color: #fff; + empty-cells: show; + opacity: 0.9; + -webkit-box-shadow: 7px 7px 12px -9px #777777; + -moz-box-shadow: 7px 7px 12px -9px #777777; + box-shadow: 7px 7px 12px -9px #777777; } + .bb-tooltip tr { + border: 1px solid #CCC; } + .bb-tooltip th { + background-color: #aaa; + font-size: 14px; + padding: 2px 5px; + text-align: left; + color: #FFF; } + .bb-tooltip td { + font-size: 13px; + padding: 3px 6px; + background-color: #fff; + border-left: 1px dotted #999; } + .bb-tooltip td > span, .bb-tooltip td > svg { + display: inline-block; + width: 10px; + height: 10px; + margin-right: 6px; } + .bb-tooltip.value { + text-align: right; } + +/*-- Area --*/ +.bb-area { + stroke-width: 0; + opacity: 0.2; } + +/*-- Arc --*/ +.bb-chart-arcs-title { + dominant-baseline: middle; + font-size: 1.3em; } + +.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 2.7em; } + +.bb-chart-arcs .bb-chart-arcs-background { + fill: #e0e0e0; + stroke: #fff; } + +.bb-chart-arcs .bb-chart-arcs-gauge-unit { + fill: #000; + font-size: 16px; } + +.bb-chart-arcs .bb-chart-arcs-gauge-max { + fill: #777; } + +.bb-chart-arcs .bb-chart-arcs-gauge-min { + fill: #777; } + +/*-- Radar --*/ +.bb-chart-radars .bb-levels polygon { + fill: none; + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-levels text { + fill: #848282; } + +.bb-chart-radars .bb-axis line { + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-axis text { + font-size: 1.15em; + cursor: default; } + +.bb-chart-radars .bb-shapes polygon { + fill-opacity: .2; + stroke-width: 1px; } + +/*-- Button --*/ +.bb-button { + position: absolute; + top: 10px; + right: 10px; } + .bb-button .bb-zoom-reset { + font-size: 11px; + border: solid 1px #ccc; + background-color: #fff; + padding: 5px; + border-radius: 5px; + cursor: pointer; } + diff --git a/include/themes/cacti/c3.css b/include/themes/cacti/c3.css deleted file mode 100644 index fda4242726..0000000000 --- a/include/themes/cacti/c3.css +++ /dev/null @@ -1,167 +0,0 @@ -/*-- Chart --*/ -.c3 svg { - font: 10px sans-serif; - -webkit-tap-highlight-color: transparent; } - -.c3 path, .c3 line { - fill: none; - stroke: #000; } - -.c3 text { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.c3-legend-item-tile, -.c3-xgrid-focus, -.c3-ygrid, -.c3-event-rect, -.c3-bars path { - shape-rendering: crispEdges; } - -.c3-chart-arc path { - stroke: #fff; } - -.c3-chart-arc text { - fill: #fff; - font-size: 13px; } - -/*-- Axis --*/ -/*-- Grid --*/ -.c3-grid line { - stroke: #aaa; } - -.c3-grid text { - fill: #aaa; } - -.c3-xgrid, .c3-ygrid { - stroke-dasharray: 3 3; } - -/*-- Text on Chart --*/ -.c3-text.c3-empty { - fill: #808080; - font-size: 2em; } - -/*-- Line --*/ -.c3-line { - stroke-width: 1px; } - -/*-- Point --*/ -.c3-circle._expanded_ { - stroke-width: 1px; - stroke: white; } - -.c3-selected-circle { - fill: white; - stroke-width: 2px; } - -/*-- Bar --*/ -.c3-bar { - stroke-width: 0; } - -.c3-bar._expanded_ { - fill-opacity: 0.75; } - -/*-- Focus --*/ -.c3-target.c3-focused { - opacity: 1; } - -.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step { - stroke-width: 2px; } - -.c3-target.c3-defocused { - opacity: 0.3 !important; } - -/*-- Region --*/ -.c3-region { - fill: steelblue; - fill-opacity: .1; } - -/*-- Brush --*/ -.c3-brush .extent { - fill-opacity: .1; } - -/*-- Select - Drag --*/ -/*-- Legend --*/ -.c3-legend-item { - font-size: 12px; } - -.c3-legend-item-hidden { - opacity: 0.15; } - -.c3-legend-background { - opacity: 0.75; - fill: white; - stroke: lightgray; - stroke-width: 1; } - -/*-- Title --*/ -.c3-title { - font: 14px sans-serif; } - -/*-- Tooltip --*/ -.c3-tooltip-container { - z-index: 10; } - -.c3-tooltip { - border-collapse: collapse; - border-spacing: 0; - background-color: #fff; - empty-cells: show; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; - opacity: 0.9; } - -.c3-tooltip tr { - border: 1px solid #CCC; } - -.c3-tooltip th { - background-color: #aaa; - font-size: 14px; - padding: 2px 5px; - text-align: left; - color: #FFF; } - -.c3-tooltip td { - font-size: 13px; - padding: 3px 6px; - background-color: #fff; - border-left: 1px dotted #999; } - -.c3-tooltip td > span { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 6px; } - -.c3-tooltip td.value { - text-align: right; } - -/*-- Area --*/ -.c3-area { - stroke-width: 0; - opacity: 0.2; } - -/*-- Arc --*/ -.c3-chart-arcs-title { - dominant-baseline: middle; - font-size: 1.3em; } - -.c3-chart-arcs .c3-chart-arcs-background { - fill: #e0e0e0; - stroke: none; } - -.c3-chart-arcs .c3-chart-arcs-gauge-unit { - fill: #000; - font-size: 16px; } - -.c3-chart-arcs .c3-chart-arcs-gauge-max { - fill: #777; } - -.c3-chart-arcs .c3-chart-arcs-gauge-min { - fill: #777; } - -.c3-chart-arc .c3-gauge-value { - fill: #000; - /* font-size: 28px !important;*/ } diff --git a/include/themes/carrot/Diff.css b/include/themes/carrot/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/carrot/Diff.css +++ b/include/themes/carrot/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/carrot/billboard.css b/include/themes/carrot/billboard.css new file mode 100644 index 0000000000..3f3ce57288 --- /dev/null +++ b/include/themes/carrot/billboard.css @@ -0,0 +1,224 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * https://naver.github.io/billboard.js/ + * + * @version 3.0.2 + */ +/*-- Chart --*/ +.bb svg { + font: 10px sans-serif; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.bb path, .bb line { + fill: none; + stroke: #000; } + +.bb text, .bb .bb-button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.bb-legend-item-tile, +.bb-xgrid-focus, +.bb-ygrid-focus, +.bb-ygrid, +.bb-event-rect, +.bb-bars path { + shape-rendering: crispEdges; } + +.bb-chart-arc .bb-gauge-value { + fill: #000; } + +.bb-chart-arc path { + stroke: #fff; } + +.bb-chart-arc rect { + stroke: #fff; + stroke-width: 1; } + +.bb-chart-arc text { + fill: #fff; + font-size: 13px; } + +/*-- Axis --*/ +.bb-axis { + shape-rendering: crispEdges; } + +/*-- Grid --*/ +.bb-grid line { + stroke: #aaa; } + +.bb-grid text { + fill: #aaa; } + +.bb-xgrid, .bb-ygrid { + stroke-dasharray: 3 3; } + +/*-- Text on Chart --*/ +.bb-text.bb-empty { + fill: #808080; + font-size: 2em; } + +/*-- Line --*/ +.bb-line { + stroke-width: 1px; } + +/*-- Point --*/ +.bb-circle._expanded_ { + stroke-width: 1px; + stroke: white; } + +.bb-selected-circle { + fill: white; + stroke-width: 2px; } + +/*-- Bar --*/ +.bb-bar { + stroke-width: 0; } + .bb-bar._expanded_ { + fill-opacity: 0.75; } + +/*-- Focus --*/ +.bb-target.bb-focused, .bb-circles.bb-focused { + opacity: 1; } + +.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step, .bb-circles.bb-focused path.bb-line, .bb-circles.bb-focused path.bb-step { + stroke-width: 2px; } + +.bb-target.bb-defocused, .bb-circles.bb-defocused { + opacity: 0.3 !important; } + .bb-target.bb-defocused .text-overlapping, .bb-circles.bb-defocused .text-overlapping { + opacity: .05 !important; } + +/*-- Region --*/ +.bb-region { + fill: steelblue; + fill-opacity: .1; } + +/*-- Zoom region --*/ +.bb-zoom-brush { + fill-opacity: .1; } + +/*-- Brush --*/ +.bb-brush .extent { + fill-opacity: .1; } + +/*-- Select - Drag --*/ +/*-- Legend --*/ +.bb-legend-item { + font-size: 12px; + user-select: none; } + +.bb-legend-item-hidden { + opacity: 0.15; } + +.bb-legend-background { + opacity: 0.75; + fill: white; + stroke: lightgray; + stroke-width: 1; } + +/*-- Title --*/ +.bb-title { + font: 14px sans-serif; } + +/*-- Tooltip --*/ +.bb-tooltip-container { + z-index: 10; + user-select: none; } + +.bb-tooltip { + border-collapse: collapse; + border-spacing: 0; + background-color: #fff; + empty-cells: show; + opacity: 0.9; + -webkit-box-shadow: 7px 7px 12px -9px #777777; + -moz-box-shadow: 7px 7px 12px -9px #777777; + box-shadow: 7px 7px 12px -9px #777777; } + .bb-tooltip tr { + border: 1px solid #CCC; } + .bb-tooltip th { + background-color: #aaa; + font-size: 14px; + padding: 2px 5px; + text-align: left; + color: #FFF; } + .bb-tooltip td { + font-size: 13px; + padding: 3px 6px; + background-color: #fff; + border-left: 1px dotted #999; } + .bb-tooltip td > span, .bb-tooltip td > svg { + display: inline-block; + width: 10px; + height: 10px; + margin-right: 6px; } + .bb-tooltip.value { + text-align: right; } + +/*-- Area --*/ +.bb-area { + stroke-width: 0; + opacity: 0.2; } + +/*-- Arc --*/ +.bb-chart-arcs-title { + dominant-baseline: middle; + font-size: 1.3em; } + +.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 2.7em; } + +.bb-chart-arcs .bb-chart-arcs-background { + fill: #e0e0e0; + stroke: #fff; } + +.bb-chart-arcs .bb-chart-arcs-gauge-unit { + fill: #000; + font-size: 16px; } + +.bb-chart-arcs .bb-chart-arcs-gauge-max { + fill: #777; } + +.bb-chart-arcs .bb-chart-arcs-gauge-min { + fill: #777; } + +/*-- Radar --*/ +.bb-chart-radars .bb-levels polygon { + fill: none; + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-levels text { + fill: #848282; } + +.bb-chart-radars .bb-axis line { + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-axis text { + font-size: 1.15em; + cursor: default; } + +.bb-chart-radars .bb-shapes polygon { + fill-opacity: .2; + stroke-width: 1px; } + +/*-- Button --*/ +.bb-button { + position: absolute; + top: 10px; + right: 10px; } + .bb-button .bb-zoom-reset { + font-size: 11px; + border: solid 1px #ccc; + background-color: #fff; + padding: 5px; + border-radius: 5px; + cursor: pointer; } + diff --git a/include/themes/carrot/c3.css b/include/themes/carrot/c3.css deleted file mode 100644 index fda4242726..0000000000 --- a/include/themes/carrot/c3.css +++ /dev/null @@ -1,167 +0,0 @@ -/*-- Chart --*/ -.c3 svg { - font: 10px sans-serif; - -webkit-tap-highlight-color: transparent; } - -.c3 path, .c3 line { - fill: none; - stroke: #000; } - -.c3 text { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.c3-legend-item-tile, -.c3-xgrid-focus, -.c3-ygrid, -.c3-event-rect, -.c3-bars path { - shape-rendering: crispEdges; } - -.c3-chart-arc path { - stroke: #fff; } - -.c3-chart-arc text { - fill: #fff; - font-size: 13px; } - -/*-- Axis --*/ -/*-- Grid --*/ -.c3-grid line { - stroke: #aaa; } - -.c3-grid text { - fill: #aaa; } - -.c3-xgrid, .c3-ygrid { - stroke-dasharray: 3 3; } - -/*-- Text on Chart --*/ -.c3-text.c3-empty { - fill: #808080; - font-size: 2em; } - -/*-- Line --*/ -.c3-line { - stroke-width: 1px; } - -/*-- Point --*/ -.c3-circle._expanded_ { - stroke-width: 1px; - stroke: white; } - -.c3-selected-circle { - fill: white; - stroke-width: 2px; } - -/*-- Bar --*/ -.c3-bar { - stroke-width: 0; } - -.c3-bar._expanded_ { - fill-opacity: 0.75; } - -/*-- Focus --*/ -.c3-target.c3-focused { - opacity: 1; } - -.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step { - stroke-width: 2px; } - -.c3-target.c3-defocused { - opacity: 0.3 !important; } - -/*-- Region --*/ -.c3-region { - fill: steelblue; - fill-opacity: .1; } - -/*-- Brush --*/ -.c3-brush .extent { - fill-opacity: .1; } - -/*-- Select - Drag --*/ -/*-- Legend --*/ -.c3-legend-item { - font-size: 12px; } - -.c3-legend-item-hidden { - opacity: 0.15; } - -.c3-legend-background { - opacity: 0.75; - fill: white; - stroke: lightgray; - stroke-width: 1; } - -/*-- Title --*/ -.c3-title { - font: 14px sans-serif; } - -/*-- Tooltip --*/ -.c3-tooltip-container { - z-index: 10; } - -.c3-tooltip { - border-collapse: collapse; - border-spacing: 0; - background-color: #fff; - empty-cells: show; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; - opacity: 0.9; } - -.c3-tooltip tr { - border: 1px solid #CCC; } - -.c3-tooltip th { - background-color: #aaa; - font-size: 14px; - padding: 2px 5px; - text-align: left; - color: #FFF; } - -.c3-tooltip td { - font-size: 13px; - padding: 3px 6px; - background-color: #fff; - border-left: 1px dotted #999; } - -.c3-tooltip td > span { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 6px; } - -.c3-tooltip td.value { - text-align: right; } - -/*-- Area --*/ -.c3-area { - stroke-width: 0; - opacity: 0.2; } - -/*-- Arc --*/ -.c3-chart-arcs-title { - dominant-baseline: middle; - font-size: 1.3em; } - -.c3-chart-arcs .c3-chart-arcs-background { - fill: #e0e0e0; - stroke: none; } - -.c3-chart-arcs .c3-chart-arcs-gauge-unit { - fill: #000; - font-size: 16px; } - -.c3-chart-arcs .c3-chart-arcs-gauge-max { - fill: #777; } - -.c3-chart-arcs .c3-chart-arcs-gauge-min { - fill: #777; } - -.c3-chart-arc .c3-gauge-value { - fill: #000; - /* font-size: 28px !important;*/ } diff --git a/include/themes/classic/Diff.css b/include/themes/classic/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/classic/Diff.css +++ b/include/themes/classic/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/dark/Diff.css b/include/themes/dark/Diff.css index 8e7928f214..228e867a12 100644 --- a/include/themes/dark/Diff.css +++ b/include/themes/dark/Diff.css @@ -8,79 +8,99 @@ .Differences thead th { text-align: left; border-bottom: 1px solid #000; - background: #aaa; - color: #000; + background: rgba(46, 46, 46, 0.8); + color: snow; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { text-align: right; - background: #ccc; + background: rgba(34, 34, 34, 0.8); width: 4em; padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; } .DifferencesSideBySide .ChangeInsert td.Left { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeInsert td.Right { - background: #cfc; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: rgba(46, 160, 67, 0.15); + color: snow; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace td.Left del { + background: rgba(248, 81, 73, 0.40); + color: snow; +} + +.DifferencesSideBySide .ChangeReplace td.Right ins { + background: rgba(46, 160, 67, 0.40); + color: snow; } .Differences .Skipped { - background: #f7f7f7; + background: rgba(47, 47, 47, 0.6); + color: snow; } .DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeDelete .Left { - background: #fdd; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesInline .ChangeReplace .Right, .DifferencesInline .ChangeInsert .Right { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesInline .ChangeReplace ins { - background: #9e9; + background: rgba(46, 160, 67, 0.40); + color: snow; } .DifferencesInline .ChangeReplace del { - background: #e99; + background: rgba(248, 81, 73, 0.40); + color: snow; } pre { diff --git a/include/themes/hollyberry/Diff.css b/include/themes/hollyberry/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/hollyberry/Diff.css +++ b/include/themes/hollyberry/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/hollyberry/billboard.css b/include/themes/hollyberry/billboard.css new file mode 100644 index 0000000000..3f3ce57288 --- /dev/null +++ b/include/themes/hollyberry/billboard.css @@ -0,0 +1,224 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * https://naver.github.io/billboard.js/ + * + * @version 3.0.2 + */ +/*-- Chart --*/ +.bb svg { + font: 10px sans-serif; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.bb path, .bb line { + fill: none; + stroke: #000; } + +.bb text, .bb .bb-button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.bb-legend-item-tile, +.bb-xgrid-focus, +.bb-ygrid-focus, +.bb-ygrid, +.bb-event-rect, +.bb-bars path { + shape-rendering: crispEdges; } + +.bb-chart-arc .bb-gauge-value { + fill: #000; } + +.bb-chart-arc path { + stroke: #fff; } + +.bb-chart-arc rect { + stroke: #fff; + stroke-width: 1; } + +.bb-chart-arc text { + fill: #fff; + font-size: 13px; } + +/*-- Axis --*/ +.bb-axis { + shape-rendering: crispEdges; } + +/*-- Grid --*/ +.bb-grid line { + stroke: #aaa; } + +.bb-grid text { + fill: #aaa; } + +.bb-xgrid, .bb-ygrid { + stroke-dasharray: 3 3; } + +/*-- Text on Chart --*/ +.bb-text.bb-empty { + fill: #808080; + font-size: 2em; } + +/*-- Line --*/ +.bb-line { + stroke-width: 1px; } + +/*-- Point --*/ +.bb-circle._expanded_ { + stroke-width: 1px; + stroke: white; } + +.bb-selected-circle { + fill: white; + stroke-width: 2px; } + +/*-- Bar --*/ +.bb-bar { + stroke-width: 0; } + .bb-bar._expanded_ { + fill-opacity: 0.75; } + +/*-- Focus --*/ +.bb-target.bb-focused, .bb-circles.bb-focused { + opacity: 1; } + +.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step, .bb-circles.bb-focused path.bb-line, .bb-circles.bb-focused path.bb-step { + stroke-width: 2px; } + +.bb-target.bb-defocused, .bb-circles.bb-defocused { + opacity: 0.3 !important; } + .bb-target.bb-defocused .text-overlapping, .bb-circles.bb-defocused .text-overlapping { + opacity: .05 !important; } + +/*-- Region --*/ +.bb-region { + fill: steelblue; + fill-opacity: .1; } + +/*-- Zoom region --*/ +.bb-zoom-brush { + fill-opacity: .1; } + +/*-- Brush --*/ +.bb-brush .extent { + fill-opacity: .1; } + +/*-- Select - Drag --*/ +/*-- Legend --*/ +.bb-legend-item { + font-size: 12px; + user-select: none; } + +.bb-legend-item-hidden { + opacity: 0.15; } + +.bb-legend-background { + opacity: 0.75; + fill: white; + stroke: lightgray; + stroke-width: 1; } + +/*-- Title --*/ +.bb-title { + font: 14px sans-serif; } + +/*-- Tooltip --*/ +.bb-tooltip-container { + z-index: 10; + user-select: none; } + +.bb-tooltip { + border-collapse: collapse; + border-spacing: 0; + background-color: #fff; + empty-cells: show; + opacity: 0.9; + -webkit-box-shadow: 7px 7px 12px -9px #777777; + -moz-box-shadow: 7px 7px 12px -9px #777777; + box-shadow: 7px 7px 12px -9px #777777; } + .bb-tooltip tr { + border: 1px solid #CCC; } + .bb-tooltip th { + background-color: #aaa; + font-size: 14px; + padding: 2px 5px; + text-align: left; + color: #FFF; } + .bb-tooltip td { + font-size: 13px; + padding: 3px 6px; + background-color: #fff; + border-left: 1px dotted #999; } + .bb-tooltip td > span, .bb-tooltip td > svg { + display: inline-block; + width: 10px; + height: 10px; + margin-right: 6px; } + .bb-tooltip.value { + text-align: right; } + +/*-- Area --*/ +.bb-area { + stroke-width: 0; + opacity: 0.2; } + +/*-- Arc --*/ +.bb-chart-arcs-title { + dominant-baseline: middle; + font-size: 1.3em; } + +.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 2.7em; } + +.bb-chart-arcs .bb-chart-arcs-background { + fill: #e0e0e0; + stroke: #fff; } + +.bb-chart-arcs .bb-chart-arcs-gauge-unit { + fill: #000; + font-size: 16px; } + +.bb-chart-arcs .bb-chart-arcs-gauge-max { + fill: #777; } + +.bb-chart-arcs .bb-chart-arcs-gauge-min { + fill: #777; } + +/*-- Radar --*/ +.bb-chart-radars .bb-levels polygon { + fill: none; + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-levels text { + fill: #848282; } + +.bb-chart-radars .bb-axis line { + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-axis text { + font-size: 1.15em; + cursor: default; } + +.bb-chart-radars .bb-shapes polygon { + fill-opacity: .2; + stroke-width: 1px; } + +/*-- Button --*/ +.bb-button { + position: absolute; + top: 10px; + right: 10px; } + .bb-button .bb-zoom-reset { + font-size: 11px; + border: solid 1px #ccc; + background-color: #fff; + padding: 5px; + border-radius: 5px; + cursor: pointer; } + diff --git a/include/themes/hollyberry/c3.css b/include/themes/hollyberry/c3.css deleted file mode 100644 index fda4242726..0000000000 --- a/include/themes/hollyberry/c3.css +++ /dev/null @@ -1,167 +0,0 @@ -/*-- Chart --*/ -.c3 svg { - font: 10px sans-serif; - -webkit-tap-highlight-color: transparent; } - -.c3 path, .c3 line { - fill: none; - stroke: #000; } - -.c3 text { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.c3-legend-item-tile, -.c3-xgrid-focus, -.c3-ygrid, -.c3-event-rect, -.c3-bars path { - shape-rendering: crispEdges; } - -.c3-chart-arc path { - stroke: #fff; } - -.c3-chart-arc text { - fill: #fff; - font-size: 13px; } - -/*-- Axis --*/ -/*-- Grid --*/ -.c3-grid line { - stroke: #aaa; } - -.c3-grid text { - fill: #aaa; } - -.c3-xgrid, .c3-ygrid { - stroke-dasharray: 3 3; } - -/*-- Text on Chart --*/ -.c3-text.c3-empty { - fill: #808080; - font-size: 2em; } - -/*-- Line --*/ -.c3-line { - stroke-width: 1px; } - -/*-- Point --*/ -.c3-circle._expanded_ { - stroke-width: 1px; - stroke: white; } - -.c3-selected-circle { - fill: white; - stroke-width: 2px; } - -/*-- Bar --*/ -.c3-bar { - stroke-width: 0; } - -.c3-bar._expanded_ { - fill-opacity: 0.75; } - -/*-- Focus --*/ -.c3-target.c3-focused { - opacity: 1; } - -.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step { - stroke-width: 2px; } - -.c3-target.c3-defocused { - opacity: 0.3 !important; } - -/*-- Region --*/ -.c3-region { - fill: steelblue; - fill-opacity: .1; } - -/*-- Brush --*/ -.c3-brush .extent { - fill-opacity: .1; } - -/*-- Select - Drag --*/ -/*-- Legend --*/ -.c3-legend-item { - font-size: 12px; } - -.c3-legend-item-hidden { - opacity: 0.15; } - -.c3-legend-background { - opacity: 0.75; - fill: white; - stroke: lightgray; - stroke-width: 1; } - -/*-- Title --*/ -.c3-title { - font: 14px sans-serif; } - -/*-- Tooltip --*/ -.c3-tooltip-container { - z-index: 10; } - -.c3-tooltip { - border-collapse: collapse; - border-spacing: 0; - background-color: #fff; - empty-cells: show; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; - opacity: 0.9; } - -.c3-tooltip tr { - border: 1px solid #CCC; } - -.c3-tooltip th { - background-color: #aaa; - font-size: 14px; - padding: 2px 5px; - text-align: left; - color: #FFF; } - -.c3-tooltip td { - font-size: 13px; - padding: 3px 6px; - background-color: #fff; - border-left: 1px dotted #999; } - -.c3-tooltip td > span { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 6px; } - -.c3-tooltip td.value { - text-align: right; } - -/*-- Area --*/ -.c3-area { - stroke-width: 0; - opacity: 0.2; } - -/*-- Arc --*/ -.c3-chart-arcs-title { - dominant-baseline: middle; - font-size: 1.3em; } - -.c3-chart-arcs .c3-chart-arcs-background { - fill: #e0e0e0; - stroke: none; } - -.c3-chart-arcs .c3-chart-arcs-gauge-unit { - fill: #000; - font-size: 16px; } - -.c3-chart-arcs .c3-chart-arcs-gauge-max { - fill: #777; } - -.c3-chart-arcs .c3-chart-arcs-gauge-min { - fill: #777; } - -.c3-chart-arc .c3-gauge-value { - fill: #000; - /* font-size: 28px !important;*/ } diff --git a/include/themes/midwinter/Diff.css b/include/themes/midwinter/Diff.css index 8e7928f214..1e55b8c6f5 100644 --- a/include/themes/midwinter/Diff.css +++ b/include/themes/midwinter/Diff.css @@ -8,79 +8,99 @@ .Differences thead th { text-align: left; border-bottom: 1px solid #000; - background: #aaa; - color: #000; + background: rgba(255, 255, 255, 0.2); + color: rgb(214, 215, 219); padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { text-align: right; - background: #ccc; + background: rgb(35, 37, 52); width: 4em; padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; } .DifferencesSideBySide .ChangeInsert td.Left { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeInsert td.Right { - background: #cfc; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: rgba(46, 160, 67, 0.15); + color: snow; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace td.Left del { + background: rgba(248, 81, 73, 0.40); + color: snow; +} + +.DifferencesSideBySide .ChangeReplace td.Right ins { + background: rgba(46, 160, 67, 0.40); + color: snow; } .Differences .Skipped { - background: #f7f7f7; + background: rgba(47, 47, 47, 0.6); + color: snow; } .DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeDelete .Left { - background: #fdd; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesInline .ChangeReplace .Right, .DifferencesInline .ChangeInsert .Right { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesInline .ChangeReplace ins { - background: #9e9; + background: rgba(46, 160, 67, 0.40); + color: snow; } .DifferencesInline .ChangeReplace del { - background: #e99; + background: rgba(248, 81, 73, 0.40); + color: snow; } pre { diff --git a/include/themes/modern/Diff.css b/include/themes/modern/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/modern/Diff.css +++ b/include/themes/modern/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/paper-plane/Diff.css b/include/themes/paper-plane/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/paper-plane/Diff.css +++ b/include/themes/paper-plane/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/paw/Diff.css b/include/themes/paw/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/paw/Diff.css +++ b/include/themes/paw/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/raspberry/Diff.css b/include/themes/raspberry/Diff.css index 8e7928f214..3c4d35f47e 100644 --- a/include/themes/raspberry/Diff.css +++ b/include/themes/raspberry/Diff.css @@ -11,6 +11,8 @@ background: #aaa; color: #000; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { @@ -20,13 +22,15 @@ padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .DifferencesSideBySide .ChangeInsert td.Left { @@ -38,27 +42,31 @@ } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: #fdd; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: #dfd; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: #fdd; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: #dfd; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace .Right ins{ + background: #9e9; +} + +.DifferencesSideBySide .ChangeReplace .Left del { + background: #e99; } .Differences .Skipped { diff --git a/include/themes/raspberry/billboard.css b/include/themes/raspberry/billboard.css new file mode 100644 index 0000000000..3f3ce57288 --- /dev/null +++ b/include/themes/raspberry/billboard.css @@ -0,0 +1,224 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * https://naver.github.io/billboard.js/ + * + * @version 3.0.2 + */ +/*-- Chart --*/ +.bb svg { + font: 10px sans-serif; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.bb path, .bb line { + fill: none; + stroke: #000; } + +.bb text, .bb .bb-button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.bb-legend-item-tile, +.bb-xgrid-focus, +.bb-ygrid-focus, +.bb-ygrid, +.bb-event-rect, +.bb-bars path { + shape-rendering: crispEdges; } + +.bb-chart-arc .bb-gauge-value { + fill: #000; } + +.bb-chart-arc path { + stroke: #fff; } + +.bb-chart-arc rect { + stroke: #fff; + stroke-width: 1; } + +.bb-chart-arc text { + fill: #fff; + font-size: 13px; } + +/*-- Axis --*/ +.bb-axis { + shape-rendering: crispEdges; } + +/*-- Grid --*/ +.bb-grid line { + stroke: #aaa; } + +.bb-grid text { + fill: #aaa; } + +.bb-xgrid, .bb-ygrid { + stroke-dasharray: 3 3; } + +/*-- Text on Chart --*/ +.bb-text.bb-empty { + fill: #808080; + font-size: 2em; } + +/*-- Line --*/ +.bb-line { + stroke-width: 1px; } + +/*-- Point --*/ +.bb-circle._expanded_ { + stroke-width: 1px; + stroke: white; } + +.bb-selected-circle { + fill: white; + stroke-width: 2px; } + +/*-- Bar --*/ +.bb-bar { + stroke-width: 0; } + .bb-bar._expanded_ { + fill-opacity: 0.75; } + +/*-- Focus --*/ +.bb-target.bb-focused, .bb-circles.bb-focused { + opacity: 1; } + +.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step, .bb-circles.bb-focused path.bb-line, .bb-circles.bb-focused path.bb-step { + stroke-width: 2px; } + +.bb-target.bb-defocused, .bb-circles.bb-defocused { + opacity: 0.3 !important; } + .bb-target.bb-defocused .text-overlapping, .bb-circles.bb-defocused .text-overlapping { + opacity: .05 !important; } + +/*-- Region --*/ +.bb-region { + fill: steelblue; + fill-opacity: .1; } + +/*-- Zoom region --*/ +.bb-zoom-brush { + fill-opacity: .1; } + +/*-- Brush --*/ +.bb-brush .extent { + fill-opacity: .1; } + +/*-- Select - Drag --*/ +/*-- Legend --*/ +.bb-legend-item { + font-size: 12px; + user-select: none; } + +.bb-legend-item-hidden { + opacity: 0.15; } + +.bb-legend-background { + opacity: 0.75; + fill: white; + stroke: lightgray; + stroke-width: 1; } + +/*-- Title --*/ +.bb-title { + font: 14px sans-serif; } + +/*-- Tooltip --*/ +.bb-tooltip-container { + z-index: 10; + user-select: none; } + +.bb-tooltip { + border-collapse: collapse; + border-spacing: 0; + background-color: #fff; + empty-cells: show; + opacity: 0.9; + -webkit-box-shadow: 7px 7px 12px -9px #777777; + -moz-box-shadow: 7px 7px 12px -9px #777777; + box-shadow: 7px 7px 12px -9px #777777; } + .bb-tooltip tr { + border: 1px solid #CCC; } + .bb-tooltip th { + background-color: #aaa; + font-size: 14px; + padding: 2px 5px; + text-align: left; + color: #FFF; } + .bb-tooltip td { + font-size: 13px; + padding: 3px 6px; + background-color: #fff; + border-left: 1px dotted #999; } + .bb-tooltip td > span, .bb-tooltip td > svg { + display: inline-block; + width: 10px; + height: 10px; + margin-right: 6px; } + .bb-tooltip.value { + text-align: right; } + +/*-- Area --*/ +.bb-area { + stroke-width: 0; + opacity: 0.2; } + +/*-- Arc --*/ +.bb-chart-arcs-title { + dominant-baseline: middle; + font-size: 1.3em; } + +.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 2.7em; } + +.bb-chart-arcs .bb-chart-arcs-background { + fill: #e0e0e0; + stroke: #fff; } + +.bb-chart-arcs .bb-chart-arcs-gauge-unit { + fill: #000; + font-size: 16px; } + +.bb-chart-arcs .bb-chart-arcs-gauge-max { + fill: #777; } + +.bb-chart-arcs .bb-chart-arcs-gauge-min { + fill: #777; } + +/*-- Radar --*/ +.bb-chart-radars .bb-levels polygon { + fill: none; + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-levels text { + fill: #848282; } + +.bb-chart-radars .bb-axis line { + stroke: #848282; + stroke-width: .5px; } + +.bb-chart-radars .bb-axis text { + font-size: 1.15em; + cursor: default; } + +.bb-chart-radars .bb-shapes polygon { + fill-opacity: .2; + stroke-width: 1px; } + +/*-- Button --*/ +.bb-button { + position: absolute; + top: 10px; + right: 10px; } + .bb-button .bb-zoom-reset { + font-size: 11px; + border: solid 1px #ccc; + background-color: #fff; + padding: 5px; + border-radius: 5px; + cursor: pointer; } + diff --git a/include/themes/raspberry/c3.css b/include/themes/raspberry/c3.css deleted file mode 100644 index fda4242726..0000000000 --- a/include/themes/raspberry/c3.css +++ /dev/null @@ -1,167 +0,0 @@ -/*-- Chart --*/ -.c3 svg { - font: 10px sans-serif; - -webkit-tap-highlight-color: transparent; } - -.c3 path, .c3 line { - fill: none; - stroke: #000; } - -.c3 text { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.c3-legend-item-tile, -.c3-xgrid-focus, -.c3-ygrid, -.c3-event-rect, -.c3-bars path { - shape-rendering: crispEdges; } - -.c3-chart-arc path { - stroke: #fff; } - -.c3-chart-arc text { - fill: #fff; - font-size: 13px; } - -/*-- Axis --*/ -/*-- Grid --*/ -.c3-grid line { - stroke: #aaa; } - -.c3-grid text { - fill: #aaa; } - -.c3-xgrid, .c3-ygrid { - stroke-dasharray: 3 3; } - -/*-- Text on Chart --*/ -.c3-text.c3-empty { - fill: #808080; - font-size: 2em; } - -/*-- Line --*/ -.c3-line { - stroke-width: 1px; } - -/*-- Point --*/ -.c3-circle._expanded_ { - stroke-width: 1px; - stroke: white; } - -.c3-selected-circle { - fill: white; - stroke-width: 2px; } - -/*-- Bar --*/ -.c3-bar { - stroke-width: 0; } - -.c3-bar._expanded_ { - fill-opacity: 0.75; } - -/*-- Focus --*/ -.c3-target.c3-focused { - opacity: 1; } - -.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step { - stroke-width: 2px; } - -.c3-target.c3-defocused { - opacity: 0.3 !important; } - -/*-- Region --*/ -.c3-region { - fill: steelblue; - fill-opacity: .1; } - -/*-- Brush --*/ -.c3-brush .extent { - fill-opacity: .1; } - -/*-- Select - Drag --*/ -/*-- Legend --*/ -.c3-legend-item { - font-size: 12px; } - -.c3-legend-item-hidden { - opacity: 0.15; } - -.c3-legend-background { - opacity: 0.75; - fill: white; - stroke: lightgray; - stroke-width: 1; } - -/*-- Title --*/ -.c3-title { - font: 14px sans-serif; } - -/*-- Tooltip --*/ -.c3-tooltip-container { - z-index: 10; } - -.c3-tooltip { - border-collapse: collapse; - border-spacing: 0; - background-color: #fff; - empty-cells: show; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; - opacity: 0.9; } - -.c3-tooltip tr { - border: 1px solid #CCC; } - -.c3-tooltip th { - background-color: #aaa; - font-size: 14px; - padding: 2px 5px; - text-align: left; - color: #FFF; } - -.c3-tooltip td { - font-size: 13px; - padding: 3px 6px; - background-color: #fff; - border-left: 1px dotted #999; } - -.c3-tooltip td > span { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 6px; } - -.c3-tooltip td.value { - text-align: right; } - -/*-- Area --*/ -.c3-area { - stroke-width: 0; - opacity: 0.2; } - -/*-- Arc --*/ -.c3-chart-arcs-title { - dominant-baseline: middle; - font-size: 1.3em; } - -.c3-chart-arcs .c3-chart-arcs-background { - fill: #e0e0e0; - stroke: none; } - -.c3-chart-arcs .c3-chart-arcs-gauge-unit { - fill: #000; - font-size: 16px; } - -.c3-chart-arcs .c3-chart-arcs-gauge-max { - fill: #777; } - -.c3-chart-arcs .c3-chart-arcs-gauge-min { - fill: #777; } - -.c3-chart-arc .c3-gauge-value { - fill: #000; - /* font-size: 28px !important;*/ } diff --git a/include/themes/sunrise/Diff.css b/include/themes/sunrise/Diff.css index 8e7928f214..228e867a12 100644 --- a/include/themes/sunrise/Diff.css +++ b/include/themes/sunrise/Diff.css @@ -8,79 +8,99 @@ .Differences thead th { text-align: left; border-bottom: 1px solid #000; - background: #aaa; - color: #000; + background: rgba(46, 46, 46, 0.8); + color: snow; padding: 4px; + font-size: 11px; + font-weight: normal; } .Differences tbody th { text-align: right; - background: #ccc; + background: rgba(34, 34, 34, 0.8); width: 4em; padding: 1px 2px; border-right: 1px solid #000; vertical-align: top; - font-size: 13px; + font-size: 11px; + font-weight: normal; } .Differences td { padding: 1px 2px; font-family: Consolas, monospace; - font-size: 13px; + font-size: 11px; } .DifferencesSideBySide .ChangeInsert td.Left { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeInsert td.Right { - background: #cfc; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; + background: rgba(46, 160, 67, 0.15); + color: snow; } .Differences ins, .Differences del { text-decoration: none; } -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; +.DifferencesSideBySide .ChangeReplace td.Left del { + background: rgba(248, 81, 73, 0.40); + color: snow; +} + +.DifferencesSideBySide .ChangeReplace td.Right ins { + background: rgba(46, 160, 67, 0.40); + color: snow; } .Differences .Skipped { - background: #f7f7f7; + background: rgba(47, 47, 47, 0.6); + color: snow; } .DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeDelete .Left { - background: #fdd; + background: rgba(248, 81, 73, 0.15); + color: snow; } .DifferencesInline .ChangeReplace .Right, .DifferencesInline .ChangeInsert .Right { - background: #dfd; + background: rgba(46, 160, 67, 0.15); + color: snow; } .DifferencesInline .ChangeReplace ins { - background: #9e9; + background: rgba(46, 160, 67, 0.40); + color: snow; } .DifferencesInline .ChangeReplace del { - background: #e99; + background: rgba(248, 81, 73, 0.40); + color: snow; } pre { From 3e09fd18f3b6ab65959ffc6745afc98db965ab7f Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 14:04:10 -0500 Subject: [PATCH 21/34] Porting #5208 to 1.3.x - Text domains incorrect Package form objects use the wrong text domain in their i18n strings --- CHANGELOG | 1 + include/global_form.php | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 35277401b7..1db8d73c2f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,6 +96,7 @@ Cacti CHANGELOG -issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 -issue#5204: Compatibility improvements for Audit Database under PHP 8.x -issue#5205: When using Diff Viewer, rendering is not always correct under certain themes +-issue#5208: Package form objects use the wrong text domain in their i18n strings -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/include/global_form.php b/include/global_form.php index 4c6b10758f..85d8e69ec9 100644 --- a/include/global_form.php +++ b/include/global_form.php @@ -1694,7 +1694,7 @@ 'method' => 'file' ), 'data_header' => array( - 'friendly_name' => __('Data Source Overrides', 'package'), + 'friendly_name' => __('Data Source Overrides'), 'collapsible' => 'true', 'method' => 'spacer', ), @@ -1708,7 +1708,7 @@ 'default' => '1' ), 'graph_header' => array( - 'friendly_name' => __('Graph/Data Template Overrides', 'package'), + 'friendly_name' => __('Graph/Data Template Overrides'), 'collapsible' => 'true', 'method' => 'spacer', ), @@ -1727,23 +1727,23 @@ 'default' => '' ), 'image_format' => array( - 'friendly_name' => __('Graph Template Image Format', 'package'), - 'description' => __('The Image Format to be used when importing or updating Graph Templates.', 'package'), + 'friendly_name' => __('Graph Template Image Format'), + 'description' => __('The Image Format to be used when importing or updating Graph Templates.'), 'method' => 'drop_array', 'default' => read_config_option('default_image_format'), 'array' => $image_types, ), 'graph_height' => array( 'friendly_name' => __('Graph Template Height', 'pagkage'), - 'description' => __('The Height to be used when importing or updating Graph Templates.', 'package'), + 'description' => __('The Height to be used when importing or updating Graph Templates.'), 'method' => 'textbox', 'default' => read_config_option('default_graph_height'), 'size' => '5', 'max_length' => '5' ), 'graph_width' => array( - 'friendly_name' => __('Graph Template Width', 'package'), - 'description' => __('The Width to be used when importing or updating Graph Templates.', 'package'), + 'friendly_name' => __('Graph Template Width'), + 'description' => __('The Width to be used when importing or updating Graph Templates.'), 'method' => 'textbox', 'default' => read_config_option('default_graph_width'), 'size' => '5', From 41401eaaa8c7ab8d8aad71956c5364221c49c625 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 14:09:46 -0500 Subject: [PATCH 22/34] Porting #5211 to 1.3.x - Auth Issues Undefined variable $user_id when creating new graph --- CHANGELOG | 1 + lib/auth.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1db8d73c2f..7502f74eff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -97,6 +97,7 @@ Cacti CHANGELOG -issue#5204: Compatibility improvements for Audit Database under PHP 8.x -issue#5205: When using Diff Viewer, rendering is not always correct under certain themes -issue#5208: Package form objects use the wrong text domain in their i18n strings +-issue#5211: Undefined variable $user_id when creating new graph -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/lib/auth.php b/lib/auth.php index 593612e4d3..21ae7ed32c 100644 --- a/lib/auth.php +++ b/lib/auth.php @@ -3294,6 +3294,8 @@ function get_host_array() { * settings */ function get_allowed_ajax_hosts($include_any = true, $include_none = true, $sql_where = '') { + $user_id = $_SESSION['sess_user_id']; + if (!auth_valid_user($user_id)) { return array(); } @@ -3348,6 +3350,8 @@ function get_allowed_ajax_hosts($include_any = true, $include_none = true, $sql_ * settings */ function get_allowed_ajax_graph_templates($include_any = true, $include_none = true, $sql_where = '') { + $user_id = $_SESSION['sess_user_id']; + if (!auth_valid_user($user_id)) { return array(); } @@ -3397,11 +3401,14 @@ function get_allowed_ajax_graph_templates($include_any = true, $include_none = t * settings */ function get_allowed_ajax_graph_items($include_none = true, $sql_where = '') { - $return = array(); + $user_id = $_SESSION['sess_user_id']; + if (!auth_valid_user($user_id)) { return array(); } + $return = array(); + $term = get_filter_request_var('term', FILTER_CALLBACK, array('options' => 'sanitize_search_string')); if ($term != '') { @@ -3439,6 +3446,8 @@ function get_allowed_ajax_graph_items($include_none = true, $sql_where = '') { * settings */ function get_allowed_ajax_graphs($sql_where = '') { + $user_id = $_SESSION['sess_user_id']; + if (!auth_valid_user($user_id)) { return array(); } From abf513b1b759c756bc049daa62378eea08c92b2e Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 14:13:27 -0500 Subject: [PATCH 23/34] Porting #5207 to 1.3.x - Installer Errors Compatibility improvements for Installer under PHP 8.x --- CHANGELOG | 1 + lib/installer.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7502f74eff..3fa24dece6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,6 +96,7 @@ Cacti CHANGELOG -issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 -issue#5204: Compatibility improvements for Audit Database under PHP 8.x -issue#5205: When using Diff Viewer, rendering is not always correct under certain themes +-issue#5207: Compatibility improvements for Installer under PHP 8.x -issue#5208: Package form objects use the wrong text domain in their i18n strings -issue#5211: Undefined variable $user_id when creating new graph -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times diff --git a/lib/installer.php b/lib/installer.php index da98a13b4c..08ed926cf9 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -2865,7 +2865,7 @@ public function processStepInstall() { '' . '' . '' . - '' . + '' . '' . '
Refresh in ProgressLast updated: ' . date('H:i:s', $time) . 'ProgressLast updated: ' . date('H:i:s', intval($time)) . '
' . '
' . From a3e79434f40deb3c9c0340de42d556683e888e81 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 20 Feb 2023 14:17:48 -0500 Subject: [PATCH 24/34] Porting #5214 to 1.3.x - Basic auth auto logout Basic Auth is timing out and logging users off automatically --- CHANGELOG | 1 + include/global_session.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3fa24dece6..b8aa1f344b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -99,6 +99,7 @@ Cacti CHANGELOG -issue#5207: Compatibility improvements for Installer under PHP 8.x -issue#5208: Package form objects use the wrong text domain in their i18n strings -issue#5211: Undefined variable $user_id when creating new graph +-issue#5214: Basic Auth is timing out and logging users off automatically -issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times -issue#5236: Edit Graph Template link missing base_url -issue#5238: Searching for Poller Items Generates SQL Errors diff --git a/include/global_session.php b/include/global_session.php index 6cc7337917..7b456c6cea 100644 --- a/include/global_session.php +++ b/include/global_session.php @@ -127,6 +127,13 @@ $refreshIsLogout = 'false'; } +/* basic auth times out when the auth provider times out */ +if (read_config_option('auth_method') == 2) { + $myrefresh['seconds'] = 99999999; + $myrefresh['page'] = sanitize_uri($_SERVER['REQUEST_URI']); + $refreshIsLogout = 'false'; +} + ?>