Changeset 1084
- Timestamp:
- 07/30/2012 07:28:15 AM (10 months ago)
- Location:
- trunk/htdocs/cacher
- Files:
-
- 3 modified
-
cacher.css (modified) (1 diff)
-
index.php (modified) (2 diffs)
-
sub/summary.tpl.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/cacher/cacher.css
r1078 r1084 6 6 7 7 .blocksgraph { height: 13px; } 8 .blocksgraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0 1px 0; }8 .blocksgraph div { float: left; height: 3px; width: 4px; border: 0 solid gray; border-width: 0 0 1px 0; } 9 9 .blocksgraph { border: 1px solid gray; border-bottom: 0; } 10 10 .percent *, .blocksgraph *, .hitsgraph * { font-size: 1px; font-height: 1px; } 11 11 12 12 .hitsgraph { margin: auto; } 13 .hitsgraph div { float: left; width: 2px; height: 100%; } 14 .hitsgraph div:hover { background: gray; } 15 .hitsgraph div div { float: none; width: 100%; } 16 .hitsgraph div div.barf { border: 0 solid gray; border-width: 1px 0 0 0; } 17 .hitsgraph div div.barv { border: 0 solid gray; border-width: 0 0 1px 0; } 18 .hitsgraph div div.barf.active { border-color: yellow; } 19 .hitsgraph div div.barv.active { border-color: yellow; } 13 .hitsgraph a { float: left; border: 0 solid gray; } 14 .hitsgraph a.active { border-top-color: yellow; } 15 .hitsgraph a:hover { background: gray; } 16 .hitsgraph a div { float: none; } 20 17 21 18 dl { overflow: hidden; } -
trunk/htdocs/cacher/index.php
r1081 r1084 85 85 $g = $b = 220 - (int) ($percent * 220); 86 86 $percent = (int) ($percent * 100); 87 $a = $active ? ' active' : '';88 $height = 20 ;87 $a = $active ? ' class="active"' : ''; 88 $height = 20 - 1 * 2; 89 89 $valueHeight = ceil($height * $percent / 100); 90 90 $paddingHeight = $height - $valueHeight; 91 91 $valueHeight = $valueHeight ? $valueHeight . "px" : 0; 92 92 $paddingHeight = $paddingHeight ? $paddingHeight . "px" : 0; 93 return '< div title="' . $v . '">'94 . '<div class="barf' . $a . '" style="height: ' . $paddingHeight . '"></div>'95 . '<div class="barv' . $a . '" style="background: rgb(' . "$r,$g,$b" . '); height: ' . $valueHeight . '"></div>'96 . '</ div>';93 return '<a title="' . $v . '" href="javascript:;"' . $a . '>' 94 . ($paddingHeight ? '<div style="height: ' . $paddingHeight . '"></div>' : '') 95 . ($valueHeight ? '<div style="background: rgb(' . "$r,$g,$b" . '); height: ' . $valueHeight . '"></div>' : '') 96 . '</a>'; 97 97 } 98 98 // }}} … … 110 110 } 111 111 $t = (time() / (60 * 60)) % 24; 112 112 113 $html = array(); 114 static $cssOut = false; 115 if (!$cssOut) { 116 $cssOut = true; 117 $html[] = '<style type="text/css">'; 118 $html[] = '.hitsgraph a { width: 2px; height: 20px; border-top-width: 1px; border-bottom-width: 1px; }'; 119 $html[] = '</style>'; 120 } 121 122 $width = count($ci[$key]) * 2; 123 $html[] = '<div class="hitsgraph" style="width: ' . $width . 'px">'; 113 124 foreach ($ci[$key] as $i => $v) { 114 125 $html[] = bar_hits_percent($v, $v / $max, $i == $t); 115 126 } 127 $html[] = "</div>"; 116 128 return implode('', $html); 117 129 } -
trunk/htdocs/cacher/sub/summary.tpl.php
r1078 r1084 67 67 $hits_avg_s = number_format(array_avg($ci['hits_by_second']), 2); 68 68 $hits_graph_h = get_cache_hits_graph($ci, 'hits_by_hour'); 69 $hits_graph_h_w = count($ci['hits_by_hour']) * 2;70 69 71 70 if (!empty($ci['istotal'])) { … … 113 112 <td>{$ci['status']}</td> 114 113 <td align="right">{$ci['hits']}</td> 115 <td> <div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td>114 <td>{$hits_graph_h}</td> 116 115 <td align="right">{$hits_avg_h}</td> 117 116 <td align="right">{$hits_avg_s}</td>

