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 | <?php |
---|
5 | echo <<<HEAD |
---|
6 | <meta http-equiv="Content-Type" content="text/html; charset=$charset" /> |
---|
7 | <meta http-equiv="Content-Language" content="$lang" /> |
---|
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><?php echo sprintf(_T("XCache %s Administration"), $xcache_version); ?></title> |
---|
14 | </head> |
---|
15 | |
---|
16 | <body> |
---|
17 | <h1><?php echo sprintf(_T("XCache %s Administration"), $xcache_version); ?></h1> |
---|
18 | <a href="help.php" target="_blank" id="help"><?php echo _T("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 | <?php echo _T('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><?php echo _T('Slots'); ?></th> |
---|
44 | <th><?php echo _T('Size'); ?></th> |
---|
45 | <th><?php echo _T('Avail'); ?></th> |
---|
46 | <th><?php echo _T('%'); ?></th> |
---|
47 | <th><?php echo _T('Clear'); ?></th> |
---|
48 | <th><?php echo _T('Compiling'); ?></th> |
---|
49 | <th><?php echo _T('Hits'); ?></th> |
---|
50 | <th><?php echo _T('Misses'); ?></th> |
---|
51 | <th><?php echo _T('Clogs'); ?></th> |
---|
52 | <th><?php echo _T('OOMs'); ?></th> |
---|
53 | <th><?php echo _T('Protected'); ?></th> |
---|
54 | <th><?php echo _T('Cached'); ?></th> |
---|
55 | <th><?php echo _T('Deleted'); ?></th> |
---|
56 | <th><?php echo _T('GC'); ?></th> |
---|
57 | </tr> |
---|
58 | <?php |
---|
59 | $numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,cached,deleted'); |
---|
60 | $l_clear = _T('Clear'); |
---|
61 | $l_clear_confirm = _T('Sure to clear?'); |
---|
62 | foreach ($cacheinfos as $i => $ci) { |
---|
63 | echo " |
---|
64 | <tr ", $a->next(), ">"; |
---|
65 | $pavail = (int) ($ci['avail'] / $ci['size'] * 100); |
---|
66 | $pused = 100 - $pavail; |
---|
67 | |
---|
68 | $ci_slots = size($ci['slots']); |
---|
69 | $ci_size = size($ci['size']); |
---|
70 | $ci_avail = size($ci['avail']); |
---|
71 | $ci = number_formats($ci, $numkeys); |
---|
72 | $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; |
---|
73 | $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; |
---|
74 | echo <<<EOS |
---|
75 | <th>{$ci['cache_name']}</th> |
---|
76 | <td title="{$ci['slots']}">{$ci_slots}</td> |
---|
77 | <td title="{$ci['size']}">{$ci_size}</td> |
---|
78 | <td title="{$ci['avail']}">{$ci_avail}</td> |
---|
79 | <td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused"> </div><div style="height: {$pavail}%" class="pavail"> </div></div></td> |
---|
80 | <td> |
---|
81 | <form method="post"> |
---|
82 | <div> |
---|
83 | <input type="hidden" name="type" value="{$ci['type']}"> |
---|
84 | <input type="hidden" name="cacheid" value="{$ci['cacheid']}"> |
---|
85 | <input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" /> |
---|
86 | </div> |
---|
87 | </form> |
---|
88 | </td> |
---|
89 | <td>{$ci['compiling']}</td> |
---|
90 | <td>{$ci['hits']}</td> |
---|
91 | <td>{$ci['misses']}</td> |
---|
92 | <td>{$ci['clogs']}</td> |
---|
93 | <td>{$ci['ooms']}</td> |
---|
94 | <td>{$ci['can_readonly']}</td> |
---|
95 | <td>{$ci['cached']}</td> |
---|
96 | <td>{$ci['deleted']}</td> |
---|
97 | <td>{$ci['gc']}</td> |
---|
98 | EOS; |
---|
99 | |
---|
100 | $b->reset(); |
---|
101 | ?> |
---|
102 | </tr> |
---|
103 | <?php } ?> |
---|
104 | </table> |
---|
105 | <div> |
---|
106 | <?php echo _T('Free Blocks'); ?>: |
---|
107 | </div> |
---|
108 | <?php |
---|
109 | foreach ($cacheinfos as $i => $ci) { |
---|
110 | $b->reset(); |
---|
111 | ?> |
---|
112 | <table cellspacing="0" cellpadding="4" class="cycles freeblocks"> |
---|
113 | <tr> |
---|
114 | <th><?php echo $ci['cache_name']; ?> <?php echo _T("size"); ?><br><?php echo _T("offset"); ?></th> |
---|
115 | <?php |
---|
116 | foreach ($ci['free_blocks'] as $block) { |
---|
117 | $size = size($block['size']); |
---|
118 | $offset = size($block['offset']); |
---|
119 | |
---|
120 | $c = $b->next(); |
---|
121 | echo " |
---|
122 | <td $c><nobr>$size<br>$offset</nobr></td>"; |
---|
123 | } |
---|
124 | ?> |
---|
125 | |
---|
126 | </tr> |
---|
127 | </table> |
---|
128 | <?php |
---|
129 | } |
---|
130 | ?> |
---|
131 | <div style="clear: both"> </div> |
---|
132 | <?php |
---|
133 | |
---|
134 | if ($cachelist) { |
---|
135 | $isphp = $cachelist['type'] == $type_php; |
---|
136 | if (function_exists("ob_filter_path_nicer")) { |
---|
137 | ob_start("ob_filter_path_nicer"); |
---|
138 | } |
---|
139 | foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { |
---|
140 | $a->reset(); |
---|
141 | echo " |
---|
142 | <caption>", _T("{$cachelist['type_name']} $listname"), "</caption>"; |
---|
143 | ?> |
---|
144 | |
---|
145 | <table cellspacing="0" cellpadding="4" class="cycles entrys" width="100%"> |
---|
146 | <col /> |
---|
147 | <col /> |
---|
148 | <col align="right" /> |
---|
149 | <col align="right" /> |
---|
150 | <col align="right" /> |
---|
151 | <col align="right" /> |
---|
152 | <col align="right" /> |
---|
153 | <col align="right" /> |
---|
154 | <?php |
---|
155 | if ($listname == 'Deleted') { |
---|
156 | echo '<col align="right" />'; |
---|
157 | } |
---|
158 | if ($isphp) { |
---|
159 | echo '<col align="right" />'; |
---|
160 | echo '<col align="right" />'; |
---|
161 | echo '<col align="right" />'; |
---|
162 | } |
---|
163 | |
---|
164 | echo " |
---|
165 | <tr ", $a->next(), ">"; |
---|
166 | ?> |
---|
167 | |
---|
168 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Cache'); ?></a></th> |
---|
169 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('entry'); ?></a></th> |
---|
170 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Hits'); ?></a></th> |
---|
171 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Refcount'); ?></a></th> |
---|
172 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Size'); ?></a></th> |
---|
173 | <?php if ($isphp) { ?> |
---|
174 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('SrcSize'); ?></a></th> |
---|
175 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Modify'); ?></a></th> |
---|
176 | <?php if ($haveinode) { ?> |
---|
177 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('device'); ?></a></th> |
---|
178 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('inode'); ?></a></th> |
---|
179 | <?php } ?> |
---|
180 | <?php } ?> |
---|
181 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Access'); ?></a></th> |
---|
182 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Create'); ?></a></th> |
---|
183 | <?php if ($listname == 'Deleted') { ?> |
---|
184 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Delete'); ?></a></th> |
---|
185 | <?php } ?> |
---|
186 | </tr> |
---|
187 | <?php |
---|
188 | foreach ($entries as $i => $entry) { |
---|
189 | echo " |
---|
190 | <tr ", $a->next(), ">"; |
---|
191 | $name = htmlspecialchars($entry['name']); |
---|
192 | $hits = number_format($entry['hits']); |
---|
193 | $refcount = number_format($entry['refcount']); |
---|
194 | $size = size($entry['size']); |
---|
195 | if ($isphp) { |
---|
196 | $sourcesize = size($entry['sourcesize']); |
---|
197 | } |
---|
198 | |
---|
199 | if ($isphp) { |
---|
200 | $mtime = age($entry['mtime']); |
---|
201 | } |
---|
202 | $ctime = age($entry['ctime']); |
---|
203 | $atime = age($entry['atime']); |
---|
204 | if ($listname == 'Deleted') { |
---|
205 | $dtime = age($entry['dtime']); |
---|
206 | } |
---|
207 | |
---|
208 | echo <<<ENTRY |
---|
209 | <td>{$entry['cache_name']} {$i}</td> |
---|
210 | <td>{$name}</td> |
---|
211 | <td int="{$entry['hits']}">{$entry['hits']}</td> |
---|
212 | <td int="{$entry['refcount']}">{$entry['refcount']}</td> |
---|
213 | <td int="{$entry['size']}">{$size}</td> |
---|
214 | ENTRY; |
---|
215 | if ($isphp) { |
---|
216 | echo <<<ENTRY |
---|
217 | <td int="{$entry['sourcesize']}">{$sourcesize}</td> |
---|
218 | <td int="{$entry['mtime']}">{$mtime}</td> |
---|
219 | ENTRY; |
---|
220 | if (isset($entry['inode'])) { |
---|
221 | echo <<<ENTRY |
---|
222 | <td int="{$entry['device']}">{$entry['device']}</td> |
---|
223 | <td int="{$entry['inode']}">{$entry['inode']}</td> |
---|
224 | ENTRY; |
---|
225 | } |
---|
226 | } |
---|
227 | echo <<<ENTRY |
---|
228 | <td int="{$entry['atime']}">{$atime}</td> |
---|
229 | <td int="{$entry['ctime']}">{$ctime}</td> |
---|
230 | ENTRY; |
---|
231 | if ($listname == 'Deleted') { |
---|
232 | echo <<<ENTRY |
---|
233 | <td int="{$entry['dtime']}">{$dtime}</td> |
---|
234 | ENTRY; |
---|
235 | } |
---|
236 | |
---|
237 | echo " |
---|
238 | </tr> |
---|
239 | "; |
---|
240 | } |
---|
241 | ?> |
---|
242 | |
---|
243 | </table> |
---|
244 | <?php |
---|
245 | } |
---|
246 | if (function_exists("ob_filter_path_nicer")) { |
---|
247 | ob_end_flush(); |
---|
248 | } |
---|
249 | } |
---|
250 | if ($moduleinfo) { |
---|
251 | $t_moduleinfo = _T("Module Info"); |
---|
252 | echo <<<HTML |
---|
253 | <h2>$t_moduleinfo</h2> |
---|
254 | <div class="moduleinfo">$moduleinfo</div> |
---|
255 | HTML; |
---|
256 | } |
---|
257 | ?> |
---|
258 | <div class="footnote"> |
---|
259 | <?php echo <<<EOS |
---|
260 | Powered By: XCache {$xcache_version}, {$xcache_modules} |
---|
261 | EOS; |
---|
262 | ?> |
---|
263 | </div> |
---|
264 | |
---|
265 | </body> |
---|
266 | </html> |
---|