-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.php
171 lines (160 loc) · 8.68 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
include ('inc/config.php');
include ('inc/panel.header.php');
include ('inc/panel.menu.php');
?>
<div class="mainpanel">
<!--<div class="pageheader">
<h2><i class="fa fa-home"></i> Dashboard</h2>
</div>-->
<div class="contentpanel">
<div class="row">
<div class="col-md-8">
<!--BANDWIDTH CHART & DATA-->
<div class="panel panel-main panel-inverse">
<div class="panel-heading">
<h4 class="panel-title"><?php echo T('BANDWIDTH_DATA'); ?></h4>
</div>
<div class="panel-body text-center" style="padding:0 0 0 5px; overflow: hidden !important">
<div style="margin-right: -30px">
<div id="mainbw" style="width:100%;height:350px;"></div>
</div>
</div>
<div class="row panel-footer panel-statistics" style="padding:0">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-hover table-bordered nomargin">
<thead>
<tr>
<th style="width:33%;padding: 4px 4px 4px 12px"><?php echo T('NETWORK'); ?></th>
<th style="width:33%;padding: 4px 4px 4px 12px"><?php echo T('UPLOAD'); ?></th>
<th style="width:33%;padding: 4px 4px 4px 12px"><?php echo T('DOWNLOAD'); ?></th>
</tr>
</thead>
<tbody>
<?php if (false !== ($strs = @file("/proc/net/dev"))) : ?>
<?php for ($i = 2; $i < count($strs); $i++ ) : ?>
<?php preg_match_all( "/([^\s]+):[\s]{0,}(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/", $strs[$i], $info );?>
<tr>
<td style="font-size:14px;font-weight:bold;padding: 2px 2px 2px 12px"><?php echo $info[1][0]?></td>
<td style="font-size:11px;padding: 2px 2px 2px 12px"><span class="text-success"><span id="NetOutSpeed<?php echo $i?>">0B/s</span></span></td>
<td style="font-size:11px;padding: 2px 2px 2px 12px"><span class="text-primary"><span id="NetInputSpeed<?php echo $i?>">0B/s</span></span></td>
</tr>
<?php endfor; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-inverse">
<div class="panel-heading">
<h4 class="panel-title"><?php echo T('VIEW_ADDITIONAL_BANDWIDTH_DETAILS'); ?></h4>
</div>
<div class="panel-body" style="padding:0">
<div class="row" style="padding: 0; margin: 0"><div id="bw_tables" style="padding:0;margin:0;"></div></div>
</div>
</div>
<!--SERVICE CONTROL CENTER-->
<?php include ('widgets/service_control.php'); ?>
<!-- panel -->
<?php if (file_exists("/install/.foo.lock")) { ?>
<!--PACKAGE MANAGEMENT CENTER-->
<?php include ('widgets/pmc.php'); ?>
<!-- panel -->
<?php } ?>
</div>
<div class="col-md-4 dash-right">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-side panel-inverse-full panel-updates">
<div class="panel-heading">
<h4 class="panel-title text-success"><?php echo T('SERVER_LOAD'); ?></h4>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-9">
<h4><span id="cpuload"></span></h4>
<p><?php echo T('SL_TXT'); ?></p>
</div>
<div class="col-sm-3 text-right">
<i class="fa fa-heartbeat text-danger" style="font-size: 70px"></i>
</div>
<div class="row">
<div class="col-sm-12 mt20 text-center">
<strong><?php echo T('UPTIME'); ?>:</strong> <span id="uptime"></span>
</div>
</div>
</div>
</div>
</div><!-- panel -->
</div><!-- SERVER LOAD WIDGET -->
<div class="col-sm-12">
<div class="panel panel-side panel-inverse">
<div class="panel-heading">
<h4 class="panel-title"><?php echo T('YOUR_DISK_STATUS'); ?></h4>
</div>
<div class="panel-body">
<div id="disk_data"></div>
</div>
</div>
</div><!-- DISK WIDGET -->
<div class="col-sm-12">
<div class="panel panel-side panel-inverse">
<div class="panel-heading">
<h4 class="panel-title"><?php echo T('SYSTEM_RAM_STATUS'); ?></h4>
</div>
<div class="panel-body">
<div id="meterram"></div>
</div>
</div>
</div><!-- RAM WIDGET -->
<div class="col-sm-12">
<div class="panel panel-side panel-inverse">
<div class="panel-heading">
<h4 class="panel-title"><?php echo T('CPU_STATUS'); ?></h4>
</div>
<div class="panel-body" style="overflow:hidden">
<div style="padding:0;margin:-15px -30 -15px -15px">
<div id="flot-placeholder1" style="width:100%;height:200px;"></div>
<!--div id="metercpu"></div-->
</div>
<hr />
<span class="nomargin" style="font-size:14px">
<?php echo $sysInfo['cpu']['model'];?><br/>
[<span style="color:#999;font-weight:600">x<?php echo $sysInfo['cpu']['num']; ?></span> core]
</span>
</div>
</div>
</div><!-- CPU WIDGET -->
<?php if ($username == "$master" && file_exists("/install/.foo.lock")) { ?>
<div class="col-sm-12">
<div id="project-commits" class="panel panel-inverse">
<div class="panel-heading">
<h4 class="panel-title text-success"><?php echo T('RECENT_UPDATES'); ?>
<a href="https://github.com/QuickBox/QB/compare/<?php echo $version ?>...master" target="blank" title="<?php echo T('CURRENT_VERSIONS_CHANGELOG'); ?>" data-placement="top" class="label label-primary tooltips" style="font-size:10px; padding-top:0; padding-bottom:0px; top: -2px; position: relative;" target='_blank'>QuickBox :: <span style="color: #fff;text-shadow: 0px 0px 6px #fff;"><?php echo "$version"; ?></span></a>
</h4>
</div>
<div class="panel-body ps-container" style="max-height: 350px; padding: 0;">
<div class="alert alert-default" style="margin-bottom: 4px; text-align: center" role="alert">
<?php echo T('QUICKBOX_COMMIT'); ?> - <code><a href="https://github.com/QuickBox/QB/commit/<?php echo shell_exec('git -C /etc/QuickBox/.git/ show --oneline -s | head -n 5 | cut -d\ -f 1;'); ?>" target="_blank" title="<?php echo T('CURRENT_COMMIT'); ?>" data-placement="top" class="tooltips"><?php echo shell_exec('git -C /etc/QuickBox/.git/ show --oneline -s | head -n 5 | cut -d\ -f 1;'); ?></a> ... <a href="https://github.com/QuickBox/QB/compare/<?php echo shell_exec('git -C /etc/QuickBox/.git/ show --oneline -s | head -n 5 | cut -d\ -f 1;'); ?>...<?php if (file_exists('/install/.developer.lock')) { ?>development<?php } else { ?>master<?php } ?>" target="_blank" title="<?php echo T('COMPARE_COMMITS'); ?>" data-placement="top" class="tooltips"><?php echo T('LATEST_COMMIT'); ?></a></code></a><br>
<strong><?php echo T('RECENT_UPDATES_TXT'); ?></strong>
</div>
<div id="activityfeed"></div>
</div>
<div class="panel-footer">
<a href="?updateQuickBox=true" data-toggle="modal" data-target="#sysResponse"><button class="btn btn-success btn-quirk btn-block"><i class="fa fa-bell text-success"></i> <?php echo T('UPDATE'); ?> </button></a>
</div>
</div>
</div><!-- QUICKBOX UPDATE WIDGET -->
<?php } ?>
</div><!-- row -->
</div>
</div>
</div><!-- contentpanel -->
</div><!-- mainpanel -->
<?php
include ('inc/panel.scripts.php');
include ('inc/panel.end.php');
?>