Commit 942a6075 authored by Till Brehm's avatar Till Brehm
Browse files

Fixeed UI issues in Monitor module.

parent 7e0103f9
......@@ -53,6 +53,7 @@ case 'server_load':
$time = $app->tools_monitor->getDataTime('server_load');
$title = $app->lng("Server Load").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'disk_usage':
$template = 'templates/show_data.htm';
......@@ -95,6 +96,7 @@ case 'openvz_beancounter':
$time = $app->tools_monitor->getDataTime('openvz_beancounter');
$title = $app->lng("monitor_title_beancounter_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'system_update':
$template = 'templates/show_data.htm';
......@@ -102,6 +104,7 @@ case 'system_update':
$time = $app->tools_monitor->getDataTime('system_update');
$title = $app->lng("monitor_title_updatestate_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'mailq':
$template = 'templates/show_data.htm';
......@@ -109,6 +112,7 @@ case 'mailq':
$time = $app->tools_monitor->getDataTime('mailq');
$title = $app->lng("monitor_title_mailq_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'raid_state':
$template = 'templates/show_data.htm';
......@@ -116,6 +120,7 @@ case 'raid_state':
$time = $app->tools_monitor->getDataTime('raid_state');
$title = $app->lng("monitor_title_raidstate_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'rkhunter':
$template = 'templates/show_data.htm';
......@@ -123,6 +128,7 @@ case 'rkhunter':
$time = $app->tools_monitor->getDataTime('rkhunter');
$title = $app->lng("monitor_title_rkhunterlog_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'fail2ban':
$template = 'templates/show_data.htm';
......@@ -130,6 +136,7 @@ case 'fail2ban':
$time = $app->tools_monitor->getDataTime('log_fail2ban');
$title = $app->lng("monitor_title_fail2ban_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'mongodb':
$template = 'templates/show_data.htm';
......@@ -144,12 +151,17 @@ case 'iptables':
$time = $app->tools_monitor->getDataTime('iptables_rules');
$title = $app->lng("monitor_title_iptables_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
default:
$template = '';
break;
}
if($add_padding == true) {
$output = '<div style="padding:20px;">'.$output.'</div>';
}
// Loading the template
$app->uses('tpl');
......
......@@ -223,45 +223,76 @@ function _getServerState($serverId, $serverName) {
/*
* Info of a VE inside a OpenVz-Host
*/
$alert_class = 'alert-info';
if($serverState == 'ok') $alert_class = 'alert-success';
if($serverState == 'warning') $alert_class = 'alert-warning';
if($serverState == 'critical' || $serverState == 'error') $alert_class = 'alert-danger';
//$html_ve = '<div class="systemmonitor-ve state-' . $serverState . '-ve os-' . $osData['name'] . '">';
$html_ve = '<div class="systemmonitor state-' . $serverState . ' os-' . $osData['name'] . '">';
//$html_ve = '<div class="systemmonitor state-' . $serverState . ' os-' . $osData['name'] . '">';
$html_server = '<div class="alert '.$alert_class.'" role="alert">';
if ($osData != null) {
$html_ve .= '<div class="icoDevice"><p class="status"></p></div>';
}
else {
$html_ve .= '<div class="icoDevice"><p class="status"></p></div>';
}
$html_ve .= '<div class="statusDevice"><p>' . $serverName;
$html_ve .= '<div class="statusDevice"><h3>' . $serverName;
if ($osData != null) {
$html_ve .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
}
if ($ispcData != null) {
$html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
$html_ve .= $ispcData['name'] . ' ' . $ispcData['version'] . '</h3>';
}
else {
$html_ve .= '</p>';
$html_ve .= '</h3>';
}
$html_ve .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '</p>';
/*
* Info of a "normal" Server or a OpenVz-Host
*/
$html_server = '<div class="systemmonitor-server state-' . $serverState . ' os-' . $osData['name'] . '">';
//$html_server = '<div class="systemmonitor-server state-' . $serverState . ' os-' . $osData['name'] . '">';
/*
switch ($oldState) {
case 'no_state': $oldInt = 0;
break;
case 'ok': $oldInt = 1;
break;
case 'unknown': $oldInt = 2;
break;
case 'info': $oldInt = 3;
break;
case 'warning': $oldInt = 4;
break;
case 'critical': $oldInt = 5;
break;
case 'error': $oldInt = 6;
break;
*/
$alert_class = 'alert-info';
if($serverState == 'ok') $alert_class = 'alert-success';
if($serverState == 'warning') $alert_class = 'alert-warning';
if($serverState == 'critical' || $serverState == 'error') $alert_class = 'alert-danger';
$html_server = '<div class="alert '.$alert_class.'" role="alert">';
if ($osData != null) {
$html_server .= '<div class="icoDevice"><p class="status"></p></div>';
//$html_server .= '<div class="icoDevice"><p class="status"></p></div>';
}
else {
$html_server .= '<div class="icoDevice"><p class="status"></p></div>';
}
$html_server .= '<div class="statusDevice"><p>' . $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
$html_server .= '<div class="statusDevice"><h3>' . $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName;
if ($osData != null) {
$html_server .= ' (' . $osData['name'] . ' ' . $osData['version'] . ') ';
}
if ($ispcData != null) {
$html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '</p>';
$html_server .= $ispcData['name'] . ' ' . $ispcData['version'] . '</h3>';
}
else {
$html_server .= '</p>';
$html_server .= '</h3>';
}
$html_server .= '<p>' . $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' (';
......@@ -277,7 +308,7 @@ function _getServerState($serverId, $serverName) {
*/
$html_verbose = $html_server;
foreach($messages as $key => $state) {
$html_verbose .= $key . ':<br />';
$html_verbose .= '<strong>'.ucfirst($key) . '</strong><br />';
foreach ($state as $msg) {
$html_verbose .= $msg . '<br />';
}
......
......@@ -7,8 +7,7 @@
<legend><tmpl_var name="monTransRefreshsq"></legend>
<div class="form-group">
<label for="refreshinterval" class="col-sm-3 control-label">{tmpl_var name='refreshinterval_txt'}</label>
<div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_log.php?log={tmpl_var name="log_id"}')">
<div class="col-sm-12"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_log.php?log={tmpl_var name="log_id"}')">
{tmpl_var name='refresh'}
</select></div>
......
......@@ -7,8 +7,7 @@
<legend><tmpl_var name="monTransRefreshsq"></legend>
<div class="form-group">
<label for="refreshinterval" class="col-sm-3 control-label">&nbsp;</label>
<div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_sys_state.php?state={tmpl_var name="state_type"}')">
<div class="col-sm-12"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_sys_state.php?state={tmpl_var name="state_type"}')">
{tmpl_var name='refresh'}
</select></div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment