Add option to add custom title in header (esm:custom_title)
Last login : add option to enable or not Disk : add filesystem Disk : values are centered
This commit is contained in:
parent
9970343fe5
commit
b330d193bb
|
@ -3,7 +3,8 @@
|
||||||
"version": "2.5",
|
"version": "2.5",
|
||||||
"website": "http://www.ezservermonitor.com",
|
"website": "http://www.ezservermonitor.com",
|
||||||
"check_updates": true,
|
"check_updates": true,
|
||||||
"auto_refresh": 0
|
"auto_refresh": 0,
|
||||||
|
"custom_title": ""
|
||||||
},
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"enable_temperature": true
|
"enable_temperature": true
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"last_login": {
|
"last_login": {
|
||||||
|
"enable": true,
|
||||||
"max": 5
|
"max": 5
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
|
|
20
index.php
20
index.php
|
@ -48,7 +48,12 @@ $update = $Config->checkUpdate();
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="hostname">
|
<div id="hostname">
|
||||||
<?php echo Misc::getHostname(); ?> - <?php echo Misc::getLanIP(); ?>
|
<?php
|
||||||
|
if ($Config->get('esm:custom_title') != '')
|
||||||
|
echo $Config->get('esm:custom_title');
|
||||||
|
else
|
||||||
|
echo Misc::getHostname().' - '.Misc::getLanIP();
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!is_null($update)): ?>
|
<?php if (!is_null($update)): ?>
|
||||||
|
@ -221,8 +226,9 @@ $update = $Config->checkUpdate();
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="w10p">Filesystem</th>
|
||||||
<th class="w20p">Mount</th>
|
<th class="w20p">Mount</th>
|
||||||
<th class="w35p">Use</th>
|
<th>Use</th>
|
||||||
<th class="w15p">Free</th>
|
<th class="w15p">Free</th>
|
||||||
<th class="w15p">Used</th>
|
<th class="w15p">Used</th>
|
||||||
<th class="w15p">Total</th>
|
<th class="w15p">Total</th>
|
||||||
|
@ -316,9 +322,13 @@ $update = $Config->checkUpdate();
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<table>
|
<?php if ($Config->get('last_login:enable') == true): ?>
|
||||||
<tbody></tbody>
|
<table>
|
||||||
</table>
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
<?php else: ?>
|
||||||
|
<p>Disabled</p>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -152,11 +152,12 @@ esm.getDisk = function() {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
|
html += '<td>'+data[line].filesystem+'</td>';
|
||||||
html += '<td>'+data[line].mount+'</td>';
|
html += '<td>'+data[line].mount+'</td>';
|
||||||
html += '<td><div class="progressbar-wrap"><div class="progressbar '+bar_class+'" style="width: '+data[line].percent_used+'%;">'+data[line].percent_used+'%</div></div></td>';
|
html += '<td><div class="progressbar-wrap"><div class="progressbar '+bar_class+'" style="width: '+data[line].percent_used+'%;">'+data[line].percent_used+'%</div></div></td>';
|
||||||
html += '<td class="t-right">'+data[line].free+'</td>';
|
html += '<td class="t-center">'+data[line].free+'</td>';
|
||||||
html += '<td class="t-right">'+data[line].used+'</td>';
|
html += '<td class="t-center">'+data[line].used+'</td>';
|
||||||
html += '<td class="t-right">'+data[line].total+'</td>';
|
html += '<td class="t-center">'+data[line].total+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
|
|
|
@ -4,7 +4,7 @@ $Config = new Config();
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $1}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6}\'', $df)))
|
if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df)))
|
||||||
{
|
{
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'total' => 'N.A',
|
'total' => 'N.A',
|
||||||
|
@ -12,6 +12,7 @@ if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{pri
|
||||||
'free' => 'N.A',
|
'free' => 'N.A',
|
||||||
'percent_used' => 0,
|
'percent_used' => 0,
|
||||||
'mount' => 'N.A',
|
'mount' => 'N.A',
|
||||||
|
'filesystem' => 'N.A',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -20,7 +21,7 @@ else
|
||||||
|
|
||||||
foreach ($df as $mounted)
|
foreach ($df as $mounted)
|
||||||
{
|
{
|
||||||
list($type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
||||||
|
|
||||||
if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false)
|
if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false)
|
||||||
continue;
|
continue;
|
||||||
|
@ -35,6 +36,7 @@ else
|
||||||
'free' => Misc::getSize($free * 1024),
|
'free' => Misc::getSize($free * 1024),
|
||||||
'percent_used' => trim($percent, '%'),
|
'percent_used' => trim($percent, '%'),
|
||||||
'mount' => $mount,
|
'mount' => $mount,
|
||||||
|
'filesystem' => $filesystem,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,26 +5,29 @@ $Config = new Config();
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk -F\' \' \'{ print $1";"$5, $4, $8, $6}\'', $users)))
|
if ($Config->get('last_login:enable'))
|
||||||
{
|
{
|
||||||
$datas[] = array(
|
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk -F\' \' \'{ print $1";"$5, $4, $8, $6}\'', $users)))
|
||||||
'user' => 'N.A',
|
|
||||||
'date' => 'N.A',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$max = $Config->get('last_login:max');
|
|
||||||
|
|
||||||
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
|
||||||
{
|
{
|
||||||
list($user, $date) = explode(';', $users[$i]);
|
|
||||||
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'user' => $user,
|
'user' => 'N.A',
|
||||||
'date' => $date,
|
'date' => 'N.A',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$max = $Config->get('last_login:max');
|
||||||
|
|
||||||
|
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
||||||
|
{
|
||||||
|
list($user, $date) = explode(';', $users[$i]);
|
||||||
|
|
||||||
|
$datas[] = array(
|
||||||
|
'user' => $user,
|
||||||
|
'date' => $date,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($datas);
|
echo json_encode($datas);
|
|
@ -35,9 +35,9 @@ img { border: 0; }
|
||||||
|
|
||||||
.debug { border: 1px solid red; }
|
.debug { border: 1px solid red; }
|
||||||
|
|
||||||
.text_left, .t-left { text-align: left; }
|
.text_left, .t-left { text-align: left !important; }
|
||||||
.text_right, .t-right { text-align: right !important; }
|
.text_right, .t-right { text-align: right !important; }
|
||||||
.text_center, .t-center { text-align: center; }
|
.text_center, .t-center { text-align: center !important; }
|
||||||
|
|
||||||
.pfixed { position: fixed !important; }
|
.pfixed { position: fixed !important; }
|
||||||
.f-left { float: left; }
|
.f-left { float: left; }
|
||||||
|
@ -66,6 +66,7 @@ img { border: 0; }
|
||||||
color: #666;
|
color: #666;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
.w10p { width: 10%; }
|
||||||
.w15p { width: 15%; }
|
.w15p { width: 15%; }
|
||||||
.w20p { width: 20%; }
|
.w20p { width: 20%; }
|
||||||
.w33p { width: 33%; }
|
.w33p { width: 33%; }
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue