Newer
Older
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
$json = file_get_contents("http://".$_SERVER['SERVER_NAME']."/status/status-api.php");
$infos = json_decode($json);
$percentageRAMClear = substr($infos->memPercentageUsed, 0, strlen($infos->memPercentageUsed) -2);
$percentageRAMClear = number_format($percentageRAMClear, 2, '.', '');
$percentageDiskClear = substr($infos->spacePercentageUsed, 0, strlen($infos->spacePercentageUsed) -2);
$percentageDiskClear = number_format($percentageDiskClear, 2, '.', '');
?>
<!DOCTYPE html>
<html>
<head>
<title>Pi Status</title>
<link rel="stylesheet" type="text/css" href="status.css">
<link rel="stylesheet" href="font-awesome-4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="weather-icons-master/css/weather-icons.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="status.js"></script>
<style>
#progress1{
width: <?php echo $percentageRAMClear; ?>%;
}
#progress2{
width: <?php echo $percentageDiskClear; ?>%;
}
</style>
</head>
<body>
<div id="main">
<div id="header">
Raspberry Pi - Status
</div>
<table class="infos" id="table1">
<tr class="headline">
<td>
<div class="icon">
<i class="fa fa-wifi fa-1x"></i><span class="icon-text">Uptime</span>
</div>
</td>
<td colspan="2">
<div class="icon">
<i class="fa fa-tachometer fa-1x"></i><span class="icon-text">CPU-Load</span>
</div>
</td>
<td>
<div class="icon">
<i class="wi wi-thermometer"></i><span class="icon-text">Temperature</span>
</div>
</td>
</tr>
<tr class="value">
<td><?php echo $infos->uptime;?></td>
<td colspan="2"><?php echo $infos->cpuLoad;?></td>
<td><?php echo $infos->temperature;?></td>
</tr>
</table>
<table class="infos">
<tr class="headline">
<td colspan="2">
<div class="icon">
<i class="fa fa-hdd-o fa-1x"></i><span class="icon-text">RAM</span>
</div>
</td>
<td colspan="2">
<div class="icon">
<i class="fa fa-database fa-1x"></i><span class="icon-text">Disk</span>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<table class="details">
<tr class="value">
<td>Total:</td>
<td class="right"><?php echo $infos->memTotal;?></td>
</tr>
<tr>
<td>Free:</td>
<td class="right"><?php echo $infos->memFree;?></td>
</tr>
<tr>
<td colspan="2">
<div class="border">
<div class="bar">
<div class="percentage"><?php echo $infos->memPercentageUsed;?></div>
<div class="progress" id="progress1">
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
<td colspan="2">
<table class="details">
<tr class="value">
<td>Total:</td>
<td class="right"><?php echo $infos->totalSpace;?></td>
</tr>
<tr>
<td>Free:</td>
<td class="right"><?php echo $infos->freeSpace;?></td>
</tr>
<tr>
<td colspan="2">
<div class="border">
<div class="bar">
<div class="percentage"><?php echo $infos->spacePercentageUsed;?></div>
<div class="progress" id="progress2">
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="infos">
<tr class="headline">
<td class="align-right">
<a class="button save" id="button-reboot" href="javascript:void(null)">
<i class="fa fa-refresh"></i> <span class="button-text">Reboot</span>
</a>
</td>
<td class="align-left">
<a class="button save" id="button-shutdown" href="javascript:void(null)">
<i class="fa fa-power-off"></i> <span class="button-text">Shutdown</span>
</a>
</td>
</tr>
</table>
</div>
</body>
</html>