Browse Source

update percent bar to vertical/avail

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@108 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 15 years ago
parent
commit
63cea5ede2
  1. 5
      admin/xcache.css
  2. 11
      admin/xcache.tpl.php

5
admin/xcache.css

@ -9,8 +9,9 @@ th a { color: white; font-weight: bold; display: block; width: 100%; height: 100
span.sortarrow { color: white; text-decoration: none; }
.freeblocks { float: left; margin-right: 4px;}
form {margin: 0; padding: 0}
.percent { border: 1px solid gray; width: 90%; }
.percent .v { background: black; font-size: 1px; line-height: 11px;}
.percent { border: 1px solid black; width: 80%; height: 100%; }
.percent div { font-size: 1px; line-height: 1px; width: 100%;}
.percent .pavail { background: blue; }
.switcher, h1 { text-align: center; display: block; }
.switcher * { color: blue; }
.switcher a.active { font-weight: bold; font-size: 130%; color: black; }

11
admin/xcache.tpl.php

@ -43,7 +43,7 @@ Caches:
<th>Slots</th>
<th>Size</th>
<th>Avail</th>
<th>Used</th>
<th>%</th>
<th>Clear</th>
<th>Compiling</th>
<th>Hits</th>
@ -58,18 +58,19 @@ Caches:
$numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,cached,deleted');
foreach ($cacheinfos as $i => $ci) {
echo "
<tr ", $a->next(), ">";
<tr ", $a->next(), " height=\"20\">";
$pavail = (int) ($ci['avail'] / $ci['size'] * 100);
$pused = 100 - $pavail;
$ci = number_formats($ci, $numkeys);
$ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-';
$ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no';
$percent = (int) (($ci['size'] - $ci['avail']) / $ci['size'] * 100);
echo <<<EOS
<th>{$ci['cache_name']}</th>
<td>{$ci['slots']}</td>
<td>{$ci['size']}</td>
<td>{$ci['avail']}</td>
<td><div class="percent"><div style="width: $percent%" class="v">&nbsp;</div></div></td>
<td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused">&nbsp;</div><div style="height: {$pavail}%" class="pavail">&nbsp;</div></div></td>
<td>
<form method="post">
<div>

Loading…
Cancel
Save