diff --git a/css/search.css b/css/search.css index 9043325..31f42fd 100644 --- a/css/search.css +++ b/css/search.css @@ -609,7 +609,6 @@ #syslog_workspace tr.syslogRow.logNotice td:first-child { border-left-color: #3478b5; } #syslog_workspace tr.syslogRow.logInfo td:first-child { border-left-color: #5b9b4b; } #syslog_workspace tr.syslogRow.logDebug td:first-child { border-left-color: #8b9690; } -#syslog_workspace tr.syslogAlertRow td:first-child { border-left: 4px solid #c0392b; } #syslog_workspace:is([data-theme='dark'], [data-theme='midwinter']) tr.syslogRow { --syslog-tint-even: #2b3530; --syslog-tint-hover: #34443a; } #syslog_workspace:is([data-theme='dark'], [data-theme='midwinter']) tr.syslogRow.logEmergency { --syslog-tint: #5c2626; --syslog-tint-even: #552424; --syslog-tint-hover: #663030; } #syslog_workspace:is([data-theme='dark'], [data-theme='midwinter']) tr.syslogRow.logAlert { --syslog-tint: #57302a; --syslog-tint-even: #502c27; --syslog-tint-hover: #613832; } diff --git a/functions.php b/functions.php index e4bb89e..f0b47bd 100644 --- a/functions.php +++ b/functions.php @@ -2818,6 +2818,15 @@ function syslog_remove_items($table, $max_seq) { /** * Sets the CSS class for each alert log row of the syslog table as it is + * displayed. The classes reuse the same Kiwi-style pastel tints that the + * main syslog table applies per priority, so both tables share one look. + * + * @param mixed $severity The alert severity of the row. + * @param mixed $tip_title The row tooltip title (unused, kept for compatibility). + * + * @return void + */ +function syslog_log_row_color($severity, $tip_title): void { * displayed. It supports both the legacy as well as the new approach to * controlling these colors. * @@ -2845,7 +2854,7 @@ function syslog_log_row_color($severity, $tip_title): void { break; } - print "\n"; + print "\n"; } /** @@ -3141,7 +3150,7 @@ function syslog_export($tab) { $sql_where = ''; $messages = get_syslog_messages($sql_where, 100000, $tab); - $line = ['name', 'severity', 'date', 'message', 'host', 'facility', 'priority', 'count']; + $line = ['date', 'device', 'severity', 'alertname', 'message', 'count', 'facility', 'priority']; $fp = fopen('php://output', 'w'); @@ -3160,14 +3169,14 @@ function syslog_export($tab) { } $line = [ - syslog_csv_safe($message['name']), - syslog_csv_safe($severity), $message['logtime'], - syslog_csv_safe($message['logmsg']), syslog_csv_safe($message['host']), + syslog_csv_safe($severity), + syslog_csv_safe($message['name']), + syslog_csv_safe($message['logmsg']), + $message['count'], syslog_csv_safe(ucfirst($message['facility'])), - syslog_csv_safe(ucfirst($message['priority'])), - $message['count'] + syslog_csv_safe(ucfirst($message['priority'])) ]; fputcsv($fp, $line, ',', '"', ''); diff --git a/syslog.php b/syslog.php index a4ac9ff..66a2e36 100644 --- a/syslog.php +++ b/syslog.php @@ -1699,9 +1699,8 @@ function syslog_log_legend(): void { html_start_box('', '100%', '', '3', 'center', ''); print ''; - print "" . __('Critical', 'syslog') . ''; + print "" . __('Alert', 'syslog') . ''; print "" . __('Warning', 'syslog') . ''; - print "" . __('Notice', 'syslog') . ''; print "" . __('Informational', 'syslog') . ''; print ''; html_end_box(false); @@ -1944,14 +1943,14 @@ function syslog_messages(string $tab = 'syslog'): void { ['display' => __('Alert Name', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], - 'severity' => ['display' => __('Severity', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], 'logtime' => ['display' => __('Date', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], + 'host' => ['display' => __('Device', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], + 'severity' => ['display' => __('Severity', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], + 'name' => ['display' => __('Alert Name', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], 'logmsg' => ['display' => __('Message', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], 'count' => ['display' => __('Count', 'syslog'), 'sort' => 'ASC', 'align' => 'right'], - 'host' => ['display' => __('Device', 'syslog'), 'sort' => 'ASC', 'align' => 'right'], - 'facility_id' => ['display' => __('Facility', 'syslog'), 'sort' => 'ASC', 'align' => 'right'], - 'priority_id' => ['display' => __('Priority', 'syslog'), 'sort' => 'ASC', 'align' => 'right'] + 'facility_id' => ['display' => __('Facility', 'syslog'), 'sort' => 'ASC', 'align' => 'left'], + 'priority_id' => ['display' => __('Priority', 'syslog'), 'sort' => 'ASC', 'align' => 'left'] ]; $nav = html_nav_bar("syslog.php?tab=$tab", MAX_DISPLAY_PAGES, get_request_var_request('page'), $rows, $total_rows, cacti_sizeof($display_text), __('Alert Log Rows', 'syslog'), 'page', 'main'); @@ -1968,16 +1967,15 @@ function syslog_messages(string $tab = 'syslog'): void { syslog_log_row_color($log['severity'], $title); - form_selectable_cell(filter_value($log['name'] != '' ? $log['name'] : __('Alert Removed', 'syslog'), get_request_var('rfilter'), $config['url_path'] . 'plugins/syslog/syslog.php?id=' . $log['seq'] . '&tab=current'), $log['seq'], '', 'left'); - - form_selectable_cell(isset($severities[$log['severity']]) ? $severities[$log['severity']] : __('Unknown', 'syslog'), $log['seq'], '', 'left'); form_selectable_cell($log['logtime'], $log['seq'], '', 'left'); + print "" . syslog_value_filter_button($log['host'], 'host') . ''; + form_selectable_cell(isset($severities[$log['severity']]) ? $severities[$log['severity']] : __('Unknown', 'syslog'), $log['seq'], '', 'left'); + form_selectable_cell(filter_value($log['name'] != '' ? $log['name'] : __('Alert Removed', 'syslog'), get_request_var('rfilter'), $config['url_path'] . 'plugins/syslog/syslog.php?id=' . $log['seq'] . '&tab=current'), $log['seq'], '', 'left'); form_selectable_cell(syslog_message_button($log['logmsg'], $log['host'], $log['program'] ?? '', $log['facility'], $log['priority'], $log['logtime']), $log['seq'], '', 'syslogMessage left'); form_selectable_cell($log['count'], $log['seq'], '', 'right'); - print "" . syslog_value_filter_button($log['host'], 'host') . ''; - form_selectable_cell(ucfirst($log['facility']), $log['seq'], '', 'right'); - print "" . syslog_value_filter_button(ucfirst($log['priority']), 'priority') . ''; + form_selectable_cell(ucfirst($log['facility']), $log['seq'], '', 'left'); + print "" . syslog_value_filter_button(ucfirst($log['priority']), 'priority') . ''; form_end_row(); }