Changeset 623 for branches/1.3/admin/xcache.tpl.php
- Timestamp:
- 07/05/2009 10:41:16 AM (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
admin/xcache.tpl.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/admin/xcache.tpl.php
r604 r623 1 1 <?php include("header.tpl.php"); ?> 2 <a href="help.php" target="_blank" id="help"><?php echo _T("Help") ?> »</a> 3 <span class="switcher"><?php echo switcher("type", $types); ?></span> 2 <div id="help"> 3 <a href="help.php"><?php echo _T("Help") ?> »</a> 4 </div> 5 <div class="switcher"><?php echo switcher("type", $types); ?></div> 4 6 <?php 5 7 $a = new Cycle('class="col1"', 'class="col2"'); 6 8 $b = new Cycle('class="col1"', 'class="col2"'); 7 9 ?> 8 <?php echo _T('Caches'); ?>:9 10 <table cellspacing="0" cellpadding="4" class="cycles"> 10 <col /> 11 <col align="right" /> 12 <col align="right" /> 13 <col align="right" /> 14 <col /> 15 <col /> 16 <col align="right" /> 11 <caption><?php echo _T('Caches'); ?></caption> 12 <col /> 13 <col align="right" /> 14 <col align="right" /> 15 <col align="right" /> 16 <col /> 17 <col /> 18 <col align="right" /> 19 <col align="right" /> 20 <col align="right" /> 21 <col /> 17 22 <col align="right" /> 18 23 <col align="right" /> … … 28 33 <th><?php echo _T('Size'); ?></th> 29 34 <th><?php echo _T('Avail'); ?></th> 30 <th><?php echo _T( '%'); ?></th>35 <th><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></th> 31 36 <th><?php echo _T('Clear'); ?></th> 32 37 <th><?php echo _T('Compiling'); ?></th> 33 38 <th><?php echo _T('Hits'); ?></th> 39 <th><?php echo _T('Hits/H'); ?></th> 40 <th><?php echo _T('Hits 24H'); ?></th> 41 <th><?php echo _T('Hits/S'); ?></th> 34 42 <th><?php echo _T('Misses'); ?></th> 35 43 <th><?php echo _T('Clogs'); ?></th> … … 48 56 echo " 49 57 <tr ", $a->next(), ">"; 50 $pavail = (int) ($ci['avail'] / $ci['size'] * 100); 51 $pused = 100 - $pavail; 58 $pvalue = (int) ($ci['avail'] / $ci['size'] * 100); 59 $pempty = 100 - $pvalue; 60 if (!isset($free_graph_width)) { 61 // swap 62 $tmp = $pvalue; 63 $pvalue = $pempty; 64 $pempty = $tmp; 65 } 66 67 $w = $graph_width; 68 if (empty($ci['istotal'])) { 69 $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']); 70 $blocksgraph = "<div class=\"blocksgraph\" style=\"width: {$w}px\">{$graph}</div>"; 71 } 72 else { 73 $blocksgraph = ''; 74 } 52 75 53 76 $ci_slots = size($ci['slots']); … … 55 78 $ci_avail = size($ci['avail']); 56 79 $ci = number_formats($ci, $numkeys); 57 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 58 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 80 81 $hits_avg_h = number_format(array_avg($ci['hits_by_hour']), 2); 82 $hits_avg_s = number_format(array_avg($ci['hits_by_second']), 2); 83 $hits_graph_h = hits_to_graph($ci['hits_by_hour']); 84 $hits_graph_h_w = count($ci['hits_by_hour']) * 2; 85 86 if (!empty($ci['istotal'])) { 87 $ci['compiling'] = '-'; 88 $ci['can_readonly'] = '-'; 89 } 90 else { 91 $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; 92 $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 93 } 59 94 echo <<<EOS 60 95 <th>{$ci['cache_name']}</th> … … 62 97 <td title="{$ci['size']}">{$ci_size}</td> 63 98 <td title="{$ci['avail']}">{$ci_avail}</td> 64 <td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused"> </div><div style="height: {$pavail}%" class="pavail"> </div></div></td> 65 <td> 66 <form method="post"> 67 <div> 68 <input type="hidden" name="type" value="{$ci['type']}"> 69 <input type="hidden" name="cacheid" value="{$ci['cacheid']}"> 70 <input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" /> 71 </div> 72 </form> 73 </td> 99 <td title="{$pvalue} %" 100 ><div class="percent" style="width: {$w}px" 101 ><div style="width: {$pvalue}%" class="pvalue"></div 102 ><div style="width: {$pempty}%" class="pempty"></div 103 ></div 104 >{$blocksgraph}</td> 105 <td 106 ><form method="post" action="" 107 ><div 108 ><input type="hidden" name="type" value="{$ci['type']}" 109 /><input type="hidden" name="cacheid" value="{$ci['cacheid']}" 110 /><input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" 111 /></div 112 ></form 113 ></td> 74 114 <td>{$ci['compiling']}</td> 75 115 <td>{$ci['hits']}</td> 116 <td>{$hits_avg_h}</td> 117 <td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td> 118 <td>{$hits_avg_s}</td> 76 119 <td>{$ci['misses']}</td> 77 120 <td>{$ci['clogs']}</td> … … 89 132 <?php } ?> 90 133 </table> 91 <div> 92 <?php echo _T('Free Blocks'); ?>: 134 <div class="blockarea legends"> 135 <div class="legendtitle"><?php echo _T('Legends:'); ?></div> 136 <div class="legend pvalue"> </div> 137 <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></div> 138 <div class="legend" style="background: rgb(0,0,255)"> </div> 139 <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? 'Free Blocks' : 'Used Blocks'); ?></div> 140 <div class="legend" style="background: rgb(255,0,0)"> </div> 141 <div class="legendtitle"><?php echo _T('Hits'); ?></div> 93 142 </div> 94 <?php95 foreach ($cacheinfos as $i => $ci) {96 $b->reset();97 ?>98 <table cellspacing="0" cellpadding="4" class="cycles freeblocks">99 <tr>100 <th><?php echo $ci['cache_name']; ?> <?php echo _T("size"); ?><br><?php echo _T("offset"); ?></th>101 <?php102 foreach ($ci['free_blocks'] as $block) {103 $size = size($block['size']);104 $offset = size($block['offset']);105 106 $c = $b->next();107 echo "108 <td $c><nobr>$size<br>$offset</nobr></td>";109 }110 ?>111 112 </tr>113 </table>114 <?php115 }116 ?>117 <div style="clear: both"> </div>118 143 <?php 119 144 … … 125 150 foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { 126 151 $a->reset(); 127 echo "128 <caption>", _T("{$cachelist['type_name']} $listname"), "</caption>";129 152 ?> 130 153 131 154 <form action="" method="post"> 132 <table cellspacing="0" cellpadding="4" class="cycles entrys" width="100%"> 155 <table cellspacing="0" cellpadding="4" class="cycles entries" width="100%"> 156 <caption><?php echo _T("{$cachelist['type_name']} $listname"); ?></caption> 133 157 <col /> 134 158 <col />

