Merge dbcc8789d0
into da67d4c20d
commit
ad50a2091b
18
device.php
18
device.php
|
@ -33,7 +33,7 @@ if (($str = @file("/proc/cpuinfo")) !== false){
|
|||
@preg_match_all("/BogoMIPS\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips);
|
||||
@preg_match_all("/Model\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $pimodel);
|
||||
|
||||
if (false !== is_array($model[1])){
|
||||
if (is_array($model[1]) && !empty($model[1])){
|
||||
$D['cpu']['count'] = sizeof($model[1]);
|
||||
$bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0];
|
||||
if($D['cpu']['count'] == 1){
|
||||
|
@ -42,6 +42,20 @@ if (($str = @file("/proc/cpuinfo")) !== false){
|
|||
else{
|
||||
$D['cpu']['model'] = $model[1][0].$bogomips[1][0].' ×'.$D['cpu']['count'];
|
||||
}
|
||||
} else {
|
||||
$str = shell_exec("lscpu");
|
||||
@preg_match_all("/Model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model);
|
||||
@preg_match_all("/CPU\(s\)\s{0,}\:+\s{0,}(\d+)([\r\n]+)/s", $str, $cpucnt);
|
||||
if (false !== is_array($model[1])) {
|
||||
$D['cpu']['count'] = $cpucnt[1][0];
|
||||
$bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0];
|
||||
if($D['cpu']['count'] == 1){
|
||||
$D['cpu']['model'] = $model[1][0].$bogomips[1][0];
|
||||
}
|
||||
else{
|
||||
$D['cpu']['model'] = $model[1][0].$bogomips[1][0].' ×'.$D['cpu']['count'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (false !== is_array($pimodel[1])){
|
||||
|
@ -180,4 +194,4 @@ function get_info(){
|
|||
$D['net']['count'] = 0;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -214,7 +214,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'device.php');
|
|||
</div>
|
||||
<div class="col-md-2 col-sm-2 col-xs-2" style="padding: 0;">
|
||||
<div style="height: 80px; margin-top: 10px;">
|
||||
<div class="text-center" style="padding: 2px 0 2px 0; background-color: #CCCCCC;"><strong><span id="net-interface-<?php echo($i+1) ?>-name"><?php echo($D['net']['interfaces'][$i]['name']) ?></span></strong></div>
|
||||
<div class="text-center" style="padding: 2px 0 2px 0; background-color: #CCCCCC; word-wrap: break-word;"><strong><span id="net-interface-<?php echo($i+1) ?>-name"><?php echo($D['net']['interfaces'][$i]['name']) ?></span></strong></div>
|
||||
<div class="text-center" style="padding: 10px 0 10px 0; background-color: #9BCEFD;"><span id="net-interface-<?php echo($i+1) ?>-total-in"><?php echo($D['net']['interfaces'][$i]['total_in']) ?></span><br /><small class="label">IN</small></div>
|
||||
<div class="text-center" style="padding: 10px 0 10px 0; background-color: #CDFD9F;"><span id="net-interface-<?php echo($i+1) ?>-total-out"><?php echo($D['net']['interfaces'][$i]['total_out']) ?></span><br /><small class="label">OUT</small></div>
|
||||
</div>
|
||||
|
@ -245,4 +245,4 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'device.php');
|
|||
</div>
|
||||
<script src="assets/dashboard.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue