monitoring: Set a proper title for all controller actions

refs #3851
This commit is contained in:
Johannes Meyer 2019-07-12 10:23:06 +02:00
parent fb48731978
commit 7ba998c6b1
13 changed files with 28 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class CommentController extends Controller
public function showAction()
{
$this->view->comment = $this->comment;
$this->view->title = $this->translate('Comments');
if ($this->hasPermission('monitoring/command/comment/delete')) {
$listUrl = Url::fromPath('monitoring/list/comments')

View File

@ -56,6 +56,7 @@ class CommentsController extends Controller
$this->comments = $query;
$this->view->title = $this->translate('Comments');
$this->getTabs()->add(
'comments',
array(

View File

@ -27,6 +27,8 @@ class ConfigController extends Controller
public function init()
{
$this->assertPermission('config/modules');
$this->view->title = $this->translate('Backends');
$this->view->defaultTitle = 'monitoring :: ' . $this->view->defaultTitle;
parent::init();
}
@ -290,6 +292,7 @@ class ConfigController extends Controller
$form->handleRequest();
$this->view->form = $form;
$this->view->title = $this->translate('Security');
$this->view->tabs = $this->Module()->getConfigTabs()->activate('security');
}
}

View File

@ -86,6 +86,7 @@ class DowntimeController extends Controller
$this->view->stateName = $isService ? Service::getStateText($this->downtime->service_state)
: Host::getStateText($this->downtime->host_state);
$this->view->title = $this->translate('Downtimes');
if ($this->hasPermission('monitoring/command/downtime/delete')) {
$form = new DeleteDowntimeCommandForm();
$form

View File

@ -63,6 +63,7 @@ class DowntimesController extends Controller
$this->downtimes = $query;
$this->view->title = $this->translate('Downtimes');
$this->getTabs()->add(
'downtimes',
array(

View File

@ -70,6 +70,7 @@ class EventController extends Controller
$this->getDetails($type, $event)
);
$this->view->title = $this->translate('Event Overview');
$this->getTabs()
->add('event', array(
'title' => $label,

View File

@ -113,6 +113,7 @@ class HealthController extends Controller
*/
public function statsAction()
{
$this->view->title = $this->translate('Stats');
$this->getTabs()->activate('stats');
$servicestats = $this->backend->select()->from('servicestatussummary', array(

View File

@ -35,6 +35,8 @@ class HostController extends MonitoredObjectController
$this->object = $host;
$this->createTabs();
$this->getTabs()->activate('host');
$this->view->title = $host->host_display_name;
$this->view->defaultTitle = $this->translate('Hosts') . ' :: ' . $this->view->defaultTitle;
}
/**

View File

@ -68,6 +68,7 @@ class HostsController extends Controller
)
)->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
$this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/hosts');
$this->view->title = $this->translate('Hosts');
}
protected function handleCommandForm(ObjectsCommandForm $form)

View File

@ -40,6 +40,12 @@ class ServiceController extends MonitoredObjectController
$this->object = $service;
$this->createTabs();
$this->getTabs()->activate('service');
$this->view->title = $service->service_display_name;
$this->view->defaultTitle = join(' :: ', [
$service->host_display_name,
$this->translate('Services'),
$this->view->defaultTitle
]);
}
/**

View File

@ -74,6 +74,7 @@ class ServicesController extends Controller
'url' => Url::fromRequest()
)
)->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
$this->view->title = $this->translate('Services');
}
protected function handleCommandForm(ObjectsCommandForm $form)

View File

@ -19,6 +19,13 @@ class ShowController extends Controller
*/
protected $backend;
public function init()
{
$this->view->defaultTitle = $this->translate('Contacts') . ' :: ' . $this->view->defaultTitle;
parent::init();
}
public function contactAction()
{
$contactName = $this->params->getRequired('contact_name');
@ -71,6 +78,7 @@ class ShowController extends Controller
$this->view->notifications = $notifications;
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
$this->view->title = $contact->contact_name;
}
$this->view->contact = $contact;

View File

@ -15,6 +15,7 @@ class TacticalController extends Controller
{
$this->setAutorefreshInterval(15);
$this->view->title = $this->translate('Tactical Overview');
$this->getTabs()->add(
'tactical_overview',
array(