autorefreshIntervals and titles

This commit is contained in:
Thomas Gelf 2014-03-04 12:33:02 +00:00
parent f5d796255c
commit 0f0e4883d1
2 changed files with 9 additions and 3 deletions

View File

@ -77,7 +77,7 @@ class Monitoring_ListController extends MonitoringController
$this->view->grapher = Hook::get('grapher'); $this->view->grapher = Hook::get('grapher');
$this->createTabs(); $this->createTabs();
$this->view->activeRowHref = $this->getParam('detail'); $this->view->activeRowHref = $this->getParam('detail');
$this->view->compact = ($this->_request->getParam('view') === 'compact');
/* /*
$contextSwitch = $this->_helper->getHelper('DataFormatSwitch'); $contextSwitch = $this->_helper->getHelper('DataFormatSwitch');
$contextSwitch = $this->_helper->getHelper('ContextSwitch'); $contextSwitch = $this->_helper->getHelper('ContextSwitch');
@ -109,7 +109,7 @@ class Monitoring_ListController extends MonitoringController
'url' => Url::fromPath('monitoring/list/hosts') 'url' => Url::fromPath('monitoring/list/hosts')
))->activate('hosts'); ))->activate('hosts');
header('X-Icinga-Refresh: 30'); $this->setAutorefreshInterval(10);
$this->view->title = 'Host Status'; $this->view->title = 'Host Status';
$this->compactView = 'hosts-compact'; $this->compactView = 'hosts-compact';
$dataview = HostStatusView::fromRequest( $dataview = HostStatusView::fromRequest(
@ -167,7 +167,7 @@ class Monitoring_ListController extends MonitoringController
'url' => Url::fromPath('monitoring/list/services') 'url' => Url::fromPath('monitoring/list/services')
))->activate('services'); ))->activate('services');
$this->view->title = 'Service Status'; $this->view->title = 'Service Status';
header('X-Icinga-Refresh: 30'); $this->setAutorefreshInterval(10);
$this->compactView = 'services-compact'; $this->compactView = 'services-compact';
$query = $this->fetchServices(); $query = $this->fetchServices();
$this->applyRestrictions($query); $this->applyRestrictions($query);
@ -408,6 +408,7 @@ class Monitoring_ListController extends MonitoringController
public function eventhistoryAction() public function eventhistoryAction()
{ {
$this->addTitleTab('eventhistory');
$dataview = EventHistoryView::fromRequest( $dataview = EventHistoryView::fromRequest(
$this->getRequest(), $this->getRequest(),
array( array(

View File

@ -74,6 +74,9 @@ class Monitoring_ShowController extends Controller
*/ */
public function serviceAction() public function serviceAction()
{ {
$this->setAutorefreshInterval(10);
$this->view->title = $this->view->object->service_description
. ' on ' . $this->view->object->host_name;
$this->getTabs()->activate('service'); $this->getTabs()->activate('service');
$this->view->object->populate(); $this->view->object->populate();
} }
@ -83,7 +86,9 @@ class Monitoring_ShowController extends Controller
*/ */
public function hostAction() public function hostAction()
{ {
$this->setAutorefreshInterval(10);
$this->getTabs()->activate('host'); $this->getTabs()->activate('host');
$this->view->title = $this->view->object->host_name;
$this->view->object->populate(); $this->view->object->populate();
} }