Changeset 526 for trunk/admin
- Timestamp:
- 02/18/2008 01:28:31 PM (11 months ago)
- Location:
- trunk/admin
- Files:
-
- 7 modified
-
common-zh-simplified-utf-8.lang.php (modified) (1 diff)
-
common-zh-traditional-utf-8.lang.php (modified) (1 diff)
-
common.php (modified) (1 diff)
-
config.php.example (modified) (1 diff)
-
xcache.css (modified) (1 diff)
-
xcache.php (modified) (2 diffs)
-
xcache.tpl.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/common-zh-simplified-utf-8.lang.php
r522 r526 24 24 'Compiling' 25 25 => '编译中', 26 '%' 27 => '%', 26 '% Free' 27 => '% 剩余', 28 '% Used' 29 => '% 已用', 28 30 'Hits' 29 31 => '命中', -
trunk/admin/common-zh-traditional-utf-8.lang.php
r522 r526 24 24 'Compiling' 25 25 => '編譯中', 26 '%' 27 => '%', 26 '% Free' 27 => '% 剩余', 28 '% Used' 29 => '% 已用', 28 30 'Hits' 29 31 => '命中', -
trunk/admin/common.php
r517 r526 109 109 $lang = 'en-us'; 110 110 } 111 if (!isset($ free_graph_width)) {112 $ free_graph_width = 120;111 if (!isset($usage_graph_width) && !isset($free_graph_width)) { 112 $usage_graph_width = 120; 113 113 } 114 $graph_width = isset($free_graph_width) ? $free_graph_width : $usage_graph_width; 114 115 115 116 ?> -
trunk/admin/config.php.example
r523 r526 12 12 $show_todo_strings = false; 13 13 14 // width of graph for free blocks 15 $free_graph_width = 120; 14 // width of graph for free or usage blocks 15 $usage_graph_width = 120; 16 // do not define both with 17 // $free_graph_width = 120; 16 18 17 19 // this function is detected by xcache.tpl.php, and enabled if function_exists -
trunk/admin/xcache.css
r522 r526 20 20 form {margin: 0; padding: 0} 21 21 22 .percent { height: 3px; margin-bottom: 1px; background: gray; border: 1px solid gray; border-top: 0px; border-bottom: 0px;}22 .percent { height: 3px; margin-bottom: 1px; background: gray; border: 1px solid gray; } 23 23 .percent div { float: left; height: 100%; } 24 .percent .p avail { background:green; }24 .percent .pvalue { background: limegreen; } 25 25 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; }26 .blocksgraph { height: 16px; } 27 .blocksgraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; } 28 .blocksgraph { border: 1px solid gray; border-bottom: 0px; } 29 29 30 30 .hitsgraph { height: 20px; border: solid gray; border-width: 1px 0 1px 0; margin: auto; } -
trunk/admin/xcache.php
r522 r526 77 77 function freeblock_to_graph($freeblocks, $size) 78 78 { 79 global $ free_graph_width;79 global $graph_width, $usage_graph_width, $free_graph_width; 80 80 81 81 // cached in static variable 82 82 static $graph_initial; 83 83 if (!isset($graph_initial)) { 84 for ($i = 0; $i < $free_graph_width; $i ++) { 85 $graph_initial[$i] = 0; 86 } 84 $graph_initial = array_fill(0, $graph_width, 0); 87 85 } 88 86 $graph = $graph_initial; 89 87 foreach ($freeblocks as $b) { 90 $begin = $b['offset'] / $size * $ free_graph_width;91 $end = ($b['offset'] + $b['size']) / $size * $ free_graph_width;88 $begin = $b['offset'] / $size * $graph_width; 89 $end = ($b['offset'] + $b['size']) / $size * $graph_width; 92 90 93 91 if ((int) $begin == (int) $end) { … … 106 104 $c = 255; 107 105 foreach ($graph as $k => $v) { 106 if (!isset($free_graph_width)) { 107 $v = 1 - $v; 108 } 108 109 $v = (int) ($v * $c); 109 110 $r = $g = $c - $v; -
trunk/admin/xcache.tpl.php
r522 r526 31 31 <th><?php echo _T('Size'); ?></th> 32 32 <th><?php echo _T('Avail'); ?></th> 33 <th><?php echo _T( '%'); ?></th>33 <th><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></th> 34 34 <th><?php echo _T('Clear'); ?></th> 35 35 <th><?php echo _T('Compiling'); ?></th> … … 54 54 echo " 55 55 <tr ", $a->next(), ">"; 56 $pavail = (int) ($ci['avail'] / $ci['size'] * 100); 57 $pused = 100 - $pavail; 58 59 $w = $free_graph_width; 56 $pvalue = (int) ($ci['avail'] / $ci['size'] * 100); 57 $pempty = 100 - $pvalue; 58 if (!isset($free_graph_width)) { 59 // swap 60 $tmp = $pvalue; 61 $pvalue = $pempty; 62 $pempty = $tmp; 63 } 64 65 $w = $graph_width; 60 66 $tdwidth = $w + 2; 61 67 if (empty($ci['istotal'])) { 62 68 $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']); 63 $ freeblockgraph = "<div class=\"freeblockgraph\" style=\"width: {$w}px\">{$graph}</div>";69 $blocksgraph = "<div class=\"blocksgraph\" style=\"width: {$w}px\">{$graph}</div>"; 64 70 } 65 71 else { 66 $ freeblockgraph = '';72 $blocksgraph = ''; 67 73 } 68 74 … … 90 96 <td title="{$ci['size']}">{$ci_size}</td> 91 97 <td title="{$ci['avail']}">{$ci_avail}</td> 92 <td title="{$p avail} %" width="{$tdwidth}"98 <td title="{$pvalue} %" width="{$tdwidth}" 93 99 ><div class="percent" style="width: {$w}px" 94 ><div style="width: {$p avail}%" class="pavail"></div95 ><div style="width: {$p used}%" class="pused"></div100 ><div style="width: {$pvalue}%" class="pvalue"></div 101 ><div style="width: {$pempty}%" class="pempty"></div 96 102 ></div 97 >{$ freeblockgraph}</td>103 >{$blocksgraph}</td> 98 104 <td 99 105 ><form method="post"

