Skip to content

Commit 5881a91

Browse files
aleksashkanetniV
authored andcommitted
Fix even/odd classes for rows in the syslog report (#100)
Only even classes are used. Fix resolves to correct usage of even/odd clases for even/odd rows within the report
1 parent b74cb90 commit 5881a91

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ The sylog plugin has been in development for well over a decade with increasing
7979

8080
--- develop ---
8181

82+
* issue#100: Fix odd/even classes generation in report
8283
* issue#96: Syslog filtering does not work with some international characters
8384
* issue#87: Program data is not sync with syslog_incoming under PHP 7.2
8485

syslog_process.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,13 @@
664664

665665
$classes = array('even', 'odd');
666666

667-
$i = 0;
668667
if (cacti_sizeof($items)) {
669-
$class = $classes[$i % 2];
668+
$i = 0;
670669
foreach($items as $item) {
670+
$class = $classes[$i % 2];
671671
$reptext .= '<tr class="' . $class . '"><td class="host">' . $item['host'] . '</td><td class="date">' . $item['logtime'] . '</td><td class="message">' . html_escape($item['message']) . "</td></tr>\n";
672+
$i++;
672673
}
673-
$i++;
674674
}
675675

676676
if ($reptext != '') {

0 commit comments

Comments
 (0)