adding status to view page;
changing size of sidebar to span2; changing location of graph legend; issue #7: changing default page to status; moving auto-refresh to status page (from server page); removing "type" field from server order by; removing last_check;
This commit is contained in:
parent
b1f6879ce0
commit
6487091691
|
@ -183,7 +183,7 @@ abstract class AbstractController implements ControllerInterface {
|
|||
// add sidebar to page?
|
||||
if($this->sidebar !== null) {
|
||||
$tpl_data['html_sidebar'] = $this->sidebar->createHTML();
|
||||
$tpl_data['content_span'] = '9';
|
||||
$tpl_data['content_span'] = '10';
|
||||
} else {
|
||||
$tpl_data['content_span'] = '12';
|
||||
}
|
||||
|
@ -227,10 +227,10 @@ abstract class AbstractController implements ControllerInterface {
|
|||
|
||||
switch($ulvl) {
|
||||
case PSM_USER_ADMIN:
|
||||
$items = array('server', 'server_status', 'server_log', 'user', 'config', 'server_update');
|
||||
$items = array('server_status', 'server', 'server_log', 'user', 'config', 'server_update');
|
||||
break;
|
||||
case PSM_USER_USER:
|
||||
$items = array('server', 'server_status', 'server_log', 'server_update');
|
||||
$items = array('server_status', 'server', 'server_log', 'server_update');
|
||||
break;
|
||||
default:
|
||||
$items = array();
|
||||
|
|
|
@ -71,7 +71,7 @@ abstract class AbstractServerController extends AbstractController {
|
|||
`s`.`warning_threshold_counter`
|
||||
FROM `".PSM_DB_PREFIX."servers` AS `s`
|
||||
{$sql_join}
|
||||
ORDER BY `active` ASC, `status` DESC, `type` ASC, `label` ASC";
|
||||
ORDER BY `active` ASC, `status` DESC, `label` ASC";
|
||||
$servers = $this->db->query($sql);
|
||||
|
||||
return $servers;
|
||||
|
|
|
@ -89,24 +89,15 @@ class ServerController extends AbstractServerController {
|
|||
// will also be replaced in the html_actions template itself
|
||||
$servers[$x] = $html_actions + $servers[$x];
|
||||
$servers[$x]['class'] = ($x & 1) ? 'odd' : 'even';
|
||||
$servers[$x] = $this->formatServer($servers[$x]);
|
||||
|
||||
if($servers[$x]['type'] == 'website') {
|
||||
// add link to label
|
||||
$servers[$x]['ip'] = '<a href="'.$servers[$x]['ip'].'" target="_blank">'.$servers[$x]['ip'].'</a>';
|
||||
}
|
||||
$servers[$x] = $this->formatServer($servers[$x]);
|
||||
}
|
||||
// add servers to template
|
||||
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers', $servers);
|
||||
|
||||
// check if we need to add the auto refresh
|
||||
$auto_refresh = psm_get_conf('auto_refresh_servers');
|
||||
if(intval($auto_refresh) > 0) {
|
||||
// add it
|
||||
$this->tpl->newTemplate('main_auto_refresh', 'main.tpl.html');
|
||||
$this->tpl->addTemplateData('main_auto_refresh', array('seconds' => $auto_refresh));
|
||||
$this->tpl->addTemplateData('main', array('auto_refresh' => $this->tpl->getTemplate('main_auto_refresh')));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -317,6 +308,7 @@ class ServerController extends AbstractServerController {
|
|||
array(
|
||||
'subtitle' => psm_get_lang('menu', 'server'),
|
||||
'label_label' => psm_get_lang('servers', 'label'),
|
||||
'label_status' => psm_get_lang('menu', 'server_status'),
|
||||
'label_domain' => psm_get_lang('servers', 'domain'),
|
||||
'label_port' => psm_get_lang('servers', 'port'),
|
||||
'label_type' => psm_get_lang('servers', 'type'),
|
||||
|
|
|
@ -90,10 +90,15 @@ class StatusController extends AbstractServerController {
|
|||
// add servers to template
|
||||
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_offline', $offline);
|
||||
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_online', $online);
|
||||
// add refresh (bit overkill perhaps to do it this way..?)
|
||||
$this->tpl->newTemplate('main_auto_refresh', 'main.tpl.html');
|
||||
$this->tpl->addTemplateData('main_auto_refresh', array('seconds' => 30));
|
||||
$this->tpl->addTemplateData('main', array('auto_refresh' => $this->tpl->getTemplate('main_auto_refresh')));
|
||||
|
||||
// check if we need to add the auto refresh
|
||||
$auto_refresh = psm_get_conf('auto_refresh_servers');
|
||||
if(intval($auto_refresh) > 0) {
|
||||
// add it
|
||||
$this->tpl->newTemplate('main_auto_refresh', 'main.tpl.html');
|
||||
$this->tpl->addTemplateData('main_auto_refresh', array('seconds' => $auto_refresh));
|
||||
$this->tpl->addTemplateData('main', array('auto_refresh' => $this->tpl->getTemplate('main_auto_refresh')));
|
||||
}
|
||||
}
|
||||
|
||||
protected function createHTMLLabels() {
|
||||
|
|
|
@ -46,7 +46,7 @@ class Router {
|
|||
* Default module (if none given or invalid one)
|
||||
* @var string $default_module
|
||||
*/
|
||||
public $default_module = 'server';
|
||||
public $default_module = 'server_status';
|
||||
|
||||
/**
|
||||
* Controller map
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!--%tpl_main_sidebar_container-->
|
||||
<div class="span3">
|
||||
<div class="span2">
|
||||
<div class="well sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">{subtitle}</li>
|
||||
|
|
|
@ -5,15 +5,18 @@
|
|||
</colgroup>
|
||||
<thead>
|
||||
<tr class="head">
|
||||
<th colspan="2">
|
||||
<span class="label label-status-{status}">
|
||||
<a href="#" title="{error}">{status}</a>
|
||||
</span>
|
||||
{label}
|
||||
</th>
|
||||
<th colspan="2">{label}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{label_status}:</td>
|
||||
<td>
|
||||
<span class="label label-status-{status}">
|
||||
<a href="#" title="{error}">{status}</a>
|
||||
</span> {error}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{label_type}:</td>
|
||||
<td>{type}</td>
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<th>{label_domain}</th>
|
||||
<th>{label_port}</th>
|
||||
<th>{label_type}</th>
|
||||
<th>{label_last_check}</th>
|
||||
<th>{label_rtime}</th>
|
||||
<th>{label_last_online}</th>
|
||||
<th>{label_monitoring}</th>
|
||||
|
@ -21,14 +20,13 @@
|
|||
<tr>
|
||||
<td>
|
||||
<span class="label label-status-{status}">
|
||||
<a href="#" title="{error}">{status}</a>
|
||||
<a href="{url_view}" title="{error}">{status}</a>
|
||||
</span>
|
||||
</td>
|
||||
<td><a href="{url_view}">{label}</a></td>
|
||||
<td>{ip}</td>
|
||||
<td>{port}</td>
|
||||
<td>{type}</td>
|
||||
<td>{last_check}</td>
|
||||
<td>{rtime} s</td>
|
||||
<td>{last_online}</td>
|
||||
<td>{active}</td>
|
||||
|
|
|
@ -103,7 +103,8 @@ function create_plot($this, mode)
|
|||
series: eval($this.attr('data-series')),
|
||||
legend: {
|
||||
show: true,
|
||||
placement: 'outsideGrid'
|
||||
placement: 'insideGrid',
|
||||
location: 'nw'
|
||||
},
|
||||
axes : {
|
||||
xaxis:{
|
||||
|
|
Loading…
Reference in New Issue