diff --git a/admin/xcache.css b/admin/xcache.css index 5546343..19cf5d1 100644 --- a/admin/xcache.css +++ b/admin/xcache.css @@ -28,9 +28,13 @@ form {margin: 0; padding: 0} .blocksgraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; } .blocksgraph { border: 1px solid gray; border-bottom: 0px; } -.hitsgraph { height: 20px; border: solid gray; border-width: 1px 0 1px 0; margin: auto; } +.hitsgraph { height: 20px; margin: auto; } .hitsgraph div { float: left; width: 2px; height: 100%; } -.bitsgraph div div { float: none; width: 100%; } +.hitsgraph div div { float: none; width: 100%; } +.hitsgraph div div.barf { border: 0px solid gray; border-width: 1px 0 0 0; } +.hitsgraph div div.barv { border: 0px solid gray; border-width: 0 0 1px 0; } +.hitsgraph div div.barf.active { border-color: yellow; } +.hitsgraph div div.barv.active { border-color: yellow; } .switcher, h1 { text-align: center; display: block; } .switcher * { color: blue; } diff --git a/admin/xcache.php b/admin/xcache.php index 7f7db12..3d386ba 100644 --- a/admin/xcache.php +++ b/admin/xcache.php @@ -151,14 +151,15 @@ function array_avg($a) return array_sum($a) / count($a); } -function bar_percent($percent) +function bar_percent($percent, $active) { $r = 220 + (int) ($percent * 25); $g = $b = 220 - (int) ($percent * 220); $percent = (int) ($percent * 100); + $a = $active ? ' active' : ''; return '
' - . '
' - . '
' + . '
' + . '
' . '
'; } @@ -173,9 +174,10 @@ function hits_to_graph($hits) if (!$max) { return ''; } + $t = (time() / (60 * 60)) % 24; $html = array(); - foreach ($hits as $v) { - $html[] = bar_percent($v / $max); + foreach ($hits as $i => $v) { + $html[] = bar_percent($v / $max, $i == $t); } return implode('', $html); }