| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 3 | <head> |
|---|
| 4 | <meta http-equiv="Content-Language" content="en-us" /> |
|---|
| 5 | <?php |
|---|
| 6 | echo <<<HEAD |
|---|
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=$charset" /> |
|---|
| 8 | <script type="text/javascript" src="tablesort.js" charset="$charset"></script> |
|---|
| 9 | HEAD; |
|---|
| 10 | ?> |
|---|
| 11 | |
|---|
| 12 | <link rel="stylesheet" type="text/css" href="xcache.css" /> |
|---|
| 13 | <title>XCache <?php echo $xcache_version; ?> Administration</title> |
|---|
| 14 | </head> |
|---|
| 15 | |
|---|
| 16 | <body> |
|---|
| 17 | <h1>XCache <?php echo $xcache_version; ?> Administration</h1> |
|---|
| 18 | <a href="help.php" target="_blank" id="help">Help »</a> |
|---|
| 19 | <span class="switcher"><?php echo switcher("type", $types); ?></span> |
|---|
| 20 | <?php |
|---|
| 21 | $a = new Cycle('class="col1"', 'class="col2"'); |
|---|
| 22 | $b = new Cycle('class="col1"', 'class="col2"'); |
|---|
| 23 | ?> |
|---|
| 24 | Caches: |
|---|
| 25 | <table cellspacing="0" cellpadding="4" class="cycles"> |
|---|
| 26 | <col /> |
|---|
| 27 | <col align="right" /> |
|---|
| 28 | <col align="right" /> |
|---|
| 29 | <col align="right" /> |
|---|
| 30 | <col /> |
|---|
| 31 | <col /> |
|---|
| 32 | <col align="right" /> |
|---|
| 33 | <col align="right" /> |
|---|
| 34 | <col align="right" /> |
|---|
| 35 | <col align="right" /> |
|---|
| 36 | <col align="right" /> |
|---|
| 37 | <col align="right" /> |
|---|
| 38 | <col align="right" /> |
|---|
| 39 | <col align="right" /> |
|---|
| 40 | <col /> |
|---|
| 41 | <tr <?php echo $a->next(); ?>> |
|---|
| 42 | <th>-</th> |
|---|
| 43 | <th>Slots</th> |
|---|
| 44 | <th>Size</th> |
|---|
| 45 | <th>Avail</th> |
|---|
| 46 | <th>%</th> |
|---|
| 47 | <th>Clear</th> |
|---|
| 48 | <th>Compiling</th> |
|---|
| 49 | <th>Hits</th> |
|---|
| 50 | <th>Misses</th> |
|---|
| 51 | <th>Clogs</th> |
|---|
| 52 | <th>OOMs</th> |
|---|
| 53 | <th>Protected</th> |
|---|
| 54 | <th>Cached</th> |
|---|
| 55 | <th>Deleted</th> |
|---|
| 56 | </tr> |
|---|
| 57 | <?php |
|---|
| 58 | $numkeys = explode(',', 'hits,misses,clogs,ooms,cached,deleted'); |
|---|
| 59 | foreach ($cacheinfos as $i => $ci) { |
|---|
| 60 | echo " |
|---|
| 61 | <tr ", $a->next(), " height=\"20\">"; |
|---|
| 62 | $pavail = (int) ($ci['avail'] / $ci['size'] * 100); |
|---|
| 63 | $pused = 100 - $pavail; |
|---|
| 64 | |
|---|
| 65 | $ci = number_formats($ci, $numkeys); |
|---|
| 66 | $ci['slots'] = size($ci['slots']); |
|---|
| 67 | $ci['size'] = size($ci['size']); |
|---|
| 68 | $ci['avail'] = size($ci['avail']); |
|---|
| 69 | $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; |
|---|
| 70 | $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; |
|---|
| 71 | echo <<<EOS |
|---|
| 72 | <th>{$ci['cache_name']}</th> |
|---|
| 73 | <td>{$ci['slots']}</td> |
|---|
| 74 | <td>{$ci['size']}</td> |
|---|
| 75 | <td>{$ci['avail']}</td> |
|---|
| 76 | <td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused"> </div><div style="height: {$pavail}%" class="pavail"> </div></div></td> |
|---|
| 77 | <td> |
|---|
| 78 | <form method="post"> |
|---|
| 79 | <div> |
|---|
| 80 | <input type="hidden" name="type" value="{$ci['type']}"> |
|---|
| 81 | <input type="hidden" name="cacheid" value="{$ci['cacheid']}"> |
|---|
| 82 | <input type="submit" name="clearcache" value="Clear" class="submit" onclick="return confirm('Sure to clear?');" /> |
|---|
| 83 | </div> |
|---|
| 84 | </form> |
|---|
| 85 | </td> |
|---|
| 86 | <td>{$ci['compiling']}</td> |
|---|
| 87 | <td>{$ci['hits']}</td> |
|---|
| 88 | <td>{$ci['misses']}</td> |
|---|
| 89 | <td>{$ci['clogs']}</td> |
|---|
| 90 | <td>{$ci['ooms']}</td> |
|---|
| 91 | <td>{$ci['can_readonly']}</td> |
|---|
| 92 | <td>{$ci['cached']}</td> |
|---|
| 93 | <td>{$ci['deleted']}</td> |
|---|
| 94 | EOS; |
|---|
| 95 | |
|---|
| 96 | $b->reset(); |
|---|
| 97 | ?> |
|---|
| 98 | </tr> |
|---|
| 99 | <?php } ?> |
|---|
| 100 | </table> |
|---|
| 101 | Free Blocks: |
|---|
| 102 | <?php |
|---|
| 103 | foreach ($cacheinfos as $i => $ci) { |
|---|
| 104 | $b->reset(); |
|---|
| 105 | ?> |
|---|
| 106 | <table cellspacing="0" cellpadding="4" class="cycles freeblocks"> |
|---|
| 107 | <tr> |
|---|
| 108 | <th><?php echo $ci['cache_name']; ?> size<br>offset</th> |
|---|
| 109 | <?php |
|---|
| 110 | foreach ($ci['free_blocks'] as $block) { |
|---|
| 111 | $size = size($block['size']); |
|---|
| 112 | $offset = size($block['offset']); |
|---|
| 113 | |
|---|
| 114 | $c = $b->next(); |
|---|
| 115 | echo " |
|---|
| 116 | <td $c><nobr>$size<br>$offset</nobr></td>"; |
|---|
| 117 | } |
|---|
| 118 | ?> |
|---|
| 119 | |
|---|
| 120 | </tr> |
|---|
| 121 | </table> |
|---|
| 122 | <?php |
|---|
| 123 | } |
|---|
| 124 | ?> |
|---|
| 125 | <div style="clear: both"> </div> |
|---|
| 126 | <?php |
|---|
| 127 | |
|---|
| 128 | if ($cachelist) { |
|---|
| 129 | $isphp = $cachelist['type'] == $type_php; |
|---|
| 130 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 131 | ob_start("ob_filter_path_nicer"); |
|---|
| 132 | } |
|---|
| 133 | foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { |
|---|
| 134 | $a->reset(); |
|---|
| 135 | echo " |
|---|
| 136 | <caption>{$cachelist['type_name']} $listname</caption>"; |
|---|
| 137 | ?> |
|---|
| 138 | |
|---|
| 139 | <table cellspacing="0" cellpadding="4" class="cycles entrys" width="100%"> |
|---|
| 140 | <col /> |
|---|
| 141 | <col /> |
|---|
| 142 | <col align="right" /> |
|---|
| 143 | <col align="right" /> |
|---|
| 144 | <col align="right" /> |
|---|
| 145 | <col align="right" /> |
|---|
| 146 | <col align="right" /> |
|---|
| 147 | <col align="right" /> |
|---|
| 148 | <?php |
|---|
| 149 | if ($listname == 'Deleted') { |
|---|
| 150 | echo '<col align="right" />'; |
|---|
| 151 | } |
|---|
| 152 | if ($isphp) { |
|---|
| 153 | echo '<col align="right" />'; |
|---|
| 154 | echo '<col align="right" />'; |
|---|
| 155 | echo '<col align="right" />'; |
|---|
| 156 | } |
|---|
| 157 | |
|---|
| 158 | echo " |
|---|
| 159 | <tr ", $a->next(), ">"; |
|---|
| 160 | ?> |
|---|
| 161 | |
|---|
| 162 | <th><a href="javascript:" onclick="resort(this); return false">Cache</a></th> |
|---|
| 163 | <th><a href="javascript:" onclick="resort(this); return false">entry</a></th> |
|---|
| 164 | <th><a href="javascript:" onclick="resort(this); return false">Hits</a></th> |
|---|
| 165 | <th><a href="javascript:" onclick="resort(this); return false">Ref count</a></th> |
|---|
| 166 | <th><a href="javascript:" onclick="resort(this); return false">Size</a></th> |
|---|
| 167 | <?php if ($isphp) { ?> |
|---|
| 168 | <th><a href="javascript:" onclick="resort(this); return false">SrcSize</a></th> |
|---|
| 169 | <th><a href="javascript:" onclick="resort(this); return false">Modify</a></th> |
|---|
| 170 | <?php if ($haveinode) { ?> |
|---|
| 171 | <th><a href="javascript:" onclick="resort(this); return false">device</a></th> |
|---|
| 172 | <th><a href="javascript:" onclick="resort(this); return false">inode</a></th> |
|---|
| 173 | <?php } ?> |
|---|
| 174 | <?php } ?> |
|---|
| 175 | <th><a href="javascript:" onclick="resort(this); return false">Access</a></th> |
|---|
| 176 | <th><a href="javascript:" onclick="resort(this); return false">Create</a></th> |
|---|
| 177 | <?php if ($listname == 'Deleted') { ?> |
|---|
| 178 | <th><a href="javascript:" onclick="resort(this); return false">Delete</a></th> |
|---|
| 179 | <?php } ?> |
|---|
| 180 | </tr> |
|---|
| 181 | <?php |
|---|
| 182 | foreach ($entries as $i => $entry) { |
|---|
| 183 | echo " |
|---|
| 184 | <tr ", $a->next(), ">"; |
|---|
| 185 | $name = htmlspecialchars($entry['name']); |
|---|
| 186 | $hits = number_format($entry['hits']); |
|---|
| 187 | $refcount = number_format($entry['refcount']); |
|---|
| 188 | $size = size($entry['size']); |
|---|
| 189 | if ($isphp) { |
|---|
| 190 | $sourcesize = size($entry['sourcesize']); |
|---|
| 191 | } |
|---|
| 192 | |
|---|
| 193 | if ($isphp) { |
|---|
| 194 | $mtime = age($entry['mtime']); |
|---|
| 195 | } |
|---|
| 196 | $ctime = age($entry['ctime']); |
|---|
| 197 | $atime = age($entry['atime']); |
|---|
| 198 | $dtime = age($entry['dtime']); |
|---|
| 199 | |
|---|
| 200 | echo <<<ENTRY |
|---|
| 201 | <td>{$entry['cache_name']} {$i}</td> |
|---|
| 202 | <td>{$name}</td> |
|---|
| 203 | <td int="{$entry['hits']}">{$entry['hits']}</td> |
|---|
| 204 | <td int="{$entry['refcount']}">{$entry['refcount']}</td> |
|---|
| 205 | <td int="{$entry['size']}">{$size}</td> |
|---|
| 206 | ENTRY; |
|---|
| 207 | if ($isphp) { |
|---|
| 208 | echo <<<ENTRY |
|---|
| 209 | <td int="{$entry['sourcesize']}">{$sourcesize}</td> |
|---|
| 210 | <td int="{$entry['mtime']}">{$mtime}</td> |
|---|
| 211 | ENTRY; |
|---|
| 212 | if (isset($entry['inode'])) { |
|---|
| 213 | echo <<<ENTRY |
|---|
| 214 | <td int="{$entry['device']}">{$entry['device']}</td> |
|---|
| 215 | <td int="{$entry['inode']}">{$entry['inode']}</td> |
|---|
| 216 | ENTRY; |
|---|
| 217 | } |
|---|
| 218 | } |
|---|
| 219 | echo <<<ENTRY |
|---|
| 220 | <td int="{$entry['atime']}">{$atime}</td> |
|---|
| 221 | <td int="{$entry['ctime']}">{$ctime}</td> |
|---|
| 222 | ENTRY; |
|---|
| 223 | if ($listname == 'Deleted') { |
|---|
| 224 | echo <<<ENTRY |
|---|
| 225 | <td int="{$entry['dtime']}">{$dtime}</td> |
|---|
| 226 | ENTRY; |
|---|
| 227 | } |
|---|
| 228 | |
|---|
| 229 | echo " |
|---|
| 230 | </tr> |
|---|
| 231 | "; |
|---|
| 232 | } |
|---|
| 233 | ?> |
|---|
| 234 | |
|---|
| 235 | </table> |
|---|
| 236 | <?php |
|---|
| 237 | } |
|---|
| 238 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 239 | ob_end_flush(); |
|---|
| 240 | } |
|---|
| 241 | } |
|---|
| 242 | ?> |
|---|
| 243 | <div class="footnote"> |
|---|
| 244 | <?php echo <<<EOS |
|---|
| 245 | Powered By: {$xcache_version}, {$xcache_modules} |
|---|
| 246 | EOS; |
|---|
| 247 | ?> |
|---|
| 248 | </div> |
|---|
| 249 | |
|---|
| 250 | </body> |
|---|
| 251 | </html> |
|---|