- Timestamp:
- 02/17/2008 02:27:05 PM (8 months ago)
- Location:
- trunk/admin
- Files:
-
- 5 modified
-
common-zh-simplified-utf-8.lang.php (modified) (1 diff)
-
common-zh-traditional-utf-8.lang.php (modified) (1 diff)
-
xcache.css (modified) (2 diffs)
-
xcache.php (modified) (5 diffs)
-
xcache.tpl.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/common-zh-simplified-utf-8.lang.php
r456 r521 71 71 'GC' 72 72 => 'GC', 73 'Total' 74 => '总共', 73 75 'Cache' 74 76 => '缓冲区', -
trunk/admin/common-zh-traditional-utf-8.lang.php
r456 r521 71 71 'GC' 72 72 => 'GC', 73 'Total' 74 => '总共', 73 75 'Cache' 74 76 => '快取', -
trunk/admin/xcache.css
r518 r521 18 18 .button { } 19 19 span.sortarrow { color: white; text-decoration: none; } 20 .freeblocks { float: left; margin-right: 4px;}21 .freeblocks td { text-align: right; }22 20 form {margin: 0; padding: 0} 23 21 … … 26 24 .percent .pavail { background: green; } 27 25 28 . usagegraph { height: 16px; }29 . usagegraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; }30 . usagegraph { border: 1px solid gray; border-bottom: 0px; }26 .freeblockgraph { height: 16px; } 27 .freeblockgraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; } 28 .freeblockgraph { border: 1px solid gray; border-bottom: 0px; } 31 29 32 30 .switcher, h1, h2 { text-align: center; display: block; } -
trunk/admin/xcache.php
r520 r521 169 169 $cacheid = (int) (isset($_POST['cacheid']) ? $_POST['cacheid'] : 0); 170 170 if (isset($_POST['clearcache'])) { 171 xcache_clear_cache($type, $cacheid); 171 $count = xcache_count($type); 172 if ($cacheid == $count) { 173 for ($cacheid = 0; $cacheid < $count; $cacheid ++) { 174 xcache_clear_cache($type, $cacheid); 175 } 176 } 177 else { 178 xcache_clear_cache($type, $cacheid); 179 } 172 180 } 173 181 } … … 177 185 // {{{ load info/list 178 186 $cacheinfos = array(); 187 $total = array(); 179 188 for ($i = 0; $i < $pcnt; $i ++) { 180 189 $data = xcache_info(XC_TYPE_PHP, $i); … … 186 195 $data['cacheid'] = $i; 187 196 $cacheinfos[] = $data; 188 } 197 if ($pcnt >= 2) { 198 foreach ($data as $k => $v) { 199 switch ($k) { 200 case 'type': 201 case 'cache_name': 202 case 'cacheid': 203 case 'free_blocks': 204 continue 2; 205 } 206 if (!isset($total[$k])) { 207 $total[$k] = $v; 208 } 209 else { 210 $total[$k] += $v; 211 } 212 } 213 } 214 } 215 216 if ($pcnt >= 2) { 217 $total['type'] = XC_TYPE_PHP; 218 $total['cache_name'] = _T('Total'); 219 $total['cacheid'] = $pcnt; 220 $total['gc'] = null; 221 $total['istotal'] = true; 222 $cacheinfos[] = $total; 223 } 224 225 $total = array(); 189 226 for ($i = 0; $i < $vcnt; $i ++) { 190 227 $data = xcache_info(XC_TYPE_VAR, $i); … … 196 233 $data['cacheid'] = $i; 197 234 $cacheinfos[] = $data; 235 if ($pcnt >= 2) { 236 foreach ($data as $k => $v) { 237 switch ($k) { 238 case 'type': 239 case 'cache_name': 240 case 'cacheid': 241 case 'free_blocks': 242 case 'gc': 243 continue 2; 244 } 245 if (!isset($total[$k])) { 246 $total[$k] = $v; 247 } 248 else { 249 $total[$k] += $v; 250 } 251 } 252 } 253 } 254 255 if ($vcnt >= 2) { 256 $total['type'] = XC_TYPE_VAR; 257 $total['cache_name'] = _T('Total'); 258 $total['cacheid'] = $vcnt; 259 $total['gc'] = null; 260 $total['istotal'] = true; 261 $cacheinfos[] = $total; 198 262 } 199 263 // }}} … … 210 274 } 211 275 foreach ($cacheinfos as $i => $c) { 276 if (!empty($c['istotal'])) { 277 continue; 278 } 212 279 if ($c['type'] == $type && isset($c['cache_list'])) { 213 280 foreach ($c['cache_list'] as $e) { -
trunk/admin/xcache.tpl.php
r519 r521 51 51 $pused = 100 - $pavail; 52 52 53 $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']);54 53 $w = $free_graph_width; 55 54 $tdwidth = $w + 2; 55 if (empty($ci['istotal'])) { 56 $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']); 57 $freeblockgraph = "<div class=\"freeblockgraph\" style=\"width: {$w}px\">{$graph}</div>"; 58 } 59 else { 60 $freeblockgraph = ''; 61 } 56 62 57 63 $ci_slots = size($ci['slots']); … … 59 65 $ci_avail = size($ci['avail']); 60 66 $ci = number_formats($ci, $numkeys); 61 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 62 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 67 if (!empty($ci['istotal'])) { 68 $ci['compiling'] = '-'; 69 $ci['can_readonly'] = '-'; 70 } 71 else { 72 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 73 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 74 } 63 75 echo <<<EOS 64 76 <th>{$ci['cache_name']}</th> … … 71 83 ><div style="width: {$pused}%" class="pused"></div 72 84 ></div 73 ><div class="usagegraph" style="width: {$w}px">{$graph}</div 74 ></td> 85 >{$freeblockgraph}</td> 75 86 <td 76 87 ><form method="post"

