-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
76 lines (57 loc) · 2.1 KB
/
index.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once "config.php";
require_once "graphics.php";
require_once "generatestatdata.php";
require_once "importstatfiledata.php";
require_once "buildjsonstructure.php";
session_start();
if (!isset($_SESSION['login']) || !($_SESSION['login'] === true)) {
header("Location: login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Stats for <?php echo $hostname; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="sysstatgraph.js"></script>
<script type="text/javascript" src="rendergraph.js"></script>
<script src="sere.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="template.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Stats for <span class="hostname"><?php echo $hostname; ?></span></h1>
<h2><a class="buttons" href=".">LIVE</a> • <a class="buttons" href="?p=report">REPORT</a></h2>
<div id="debug"></div>
<?php
if (isset($_GET["p"]) && $_GET["p"] == "report") {
$generatestatdata = new generatestatdata();
$generatestatdata->execute();
?>
<div id="content"></div>
<p style="text-align: center;"><span class="smallnote">Generated by <a href="http://magnetikonline.com/sysstatgraph/">SysStat Graph Version 0.4</a></span></p>
<script type="text/javascript">
sysstatgraph.statdata = <?php echo((is_file(JSONSTRUCTUREFILENAME)) ? file_get_contents(JSONSTRUCTUREFILENAME) : '{}'); ?>;
sysstatgraph.init();
</script>
<?php
}
else {
?>
<div class="container">
<?php
$g = new graphics($graphs,$iface);
$g->draw();
?>
</div>
<p style="text-align: center;"><span class="smallnote">Generated by <a href="https://github.com/linuxitux/sere">sere v0.1.2</a></span></p>
<script>
updateGraphics(null);
var loop = window.setInterval(updateMetrics,1000*<?php echo $update_interval; ?>);
</script>
<?php
}
?>
</body>
</html>