-
Notifications
You must be signed in to change notification settings - Fork 104
/
main.php
77 lines (54 loc) · 2.01 KB
/
main.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
77
<?php session_start();
if($_SESSION['username'] == ""){
require('index.php');
die;
}
?>
<?php
require('app/classes/_ram.php');
require('app/classes/_hdd.php');
require('app/classes/_cpu.php');
require('app/classes/_uptime.php');
require('app/includes/_header.php');
?>
<div id="firstBlockContainer">
<div class="firstBlockWrapper">
<?php $uptime = new systemUptime; $getSystemUptime = $uptime->getSystemUptime();?>
<div class="clear"></div>
<br/><br/>
<?php $load = new cpuLoad; $getLoad = $load->getCpuLoad();?>
<div class="clear"></div>
<br/><br/>
<?php $ram = new ramPercentage; $percentage = $ram->freeMemory(); $percentage = $ram->freeSwap();?>
<div class="clear"></div>
<br/><br/>
<?php $hdd = new hddPercentage; $storagepercentage = $hdd->freeStorage();?>
<div class="clear"></div>
<br/><br/>
<center>
Mission Control:<br/><br/>
<button onclick="rebootWarn()" class="minimal">Reboot Rasberry Pi</button> <a href="app/commands/_updatesources.php"><button class="minimal">Update Sources</button></a>
<?php
if (file_exists("/usr/bin/rpi-update")) {
echo "<a href=\"app/commands/_updatefirmware.php\"><button class=\"minimal\">Update Firmware</button></a>";
}
?>
</center>
</div>
<br/><br/>
</div>
<?php require('app/includes/_footer.php'); ?>
<script type="text/javascript">
<!--
function rebootWarn() {
var answer = confirm("WARNING: This will make your Raspberry Pi temporarily unavailable, it may also connect back to the network with a different IP.")
if (answer){
alert("Rebooting...!")
window.location = "app/commands/_reboot.php";
}
else{
alert("Reboot Aborted")
}
}
//-->
</script>