-
-
Notifications
You must be signed in to change notification settings - Fork 666
/
info.php
51 lines (36 loc) · 1.01 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once 'includes/common.inc.php';
global $redis, $config, $csrfToken, $server;
if (isset($_GET['reset'])) {
$redis->config('resetstat');
header('Location: info.php');
die;
}
// Fetch the info
$info = $redis->info();
$alt = false;
$page['css'][] = 'frame';
$page['js'][] = 'frame';
require 'includes/header.inc.php';
?>
<h2>Info</h2>
<p>
<a href="?reset=1&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a>
</p>
<table>
<tr><th><div>Key</div></th><th><div>Value</div></th></tr>
<?php
foreach ($info as $key => $value) {
if ($key == 'allocation_stats') { // This key is very long to split it into multiple lines
$value = str_replace(',', ",\n", $value);
}
?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo format_html($key)?></div></td><td><pre><?php echo format_html(is_array($value) ? print_r($value, true) : $value)?></pre></td></tr>
<?php
$alt = !$alt;
}
?>
</table>
<?php
require 'includes/footer.inc.php';
?>