Add proper title to the alert summary's tab

refs #8458
This commit is contained in:
Johannes Meyer 2015-02-23 16:57:06 +01:00
parent f6cbc17ff7
commit ebf8d183a7
1 changed files with 14 additions and 31 deletions

View File

@ -10,11 +10,6 @@ use Icinga\Web\Url;
class Monitoring_AlertsummaryController extends Controller class Monitoring_AlertsummaryController extends Controller
{ {
/**
* @var string
*/
protected $url;
/** /**
* @var array * @var array
*/ */
@ -30,40 +25,28 @@ class Monitoring_AlertsummaryController extends Controller
*/ */
public function init() public function init()
{ {
$tabs = $this->getTabs();
if (in_array($this->_request->getActionName(), array('alertsummary'))) {
$tabs->extend(new OutputFormat())->extend(new DashboardAction());
}
$this->url = Url::fromRequest();
$this->notificationData = $this->createNotificationData(); $this->notificationData = $this->createNotificationData();
$this->problemData = $this->createProblemData(); $this->problemData = $this->createProblemData();
} }
/** /**
* @param string $action * Create full report
* @param bool $title
*/
protected function addTitleTab($action, $title = false)
{
$title = $title ?: ucfirst($action);
$this->getTabs()->add(
$action,
array(
'title' => $title,
'url' => $this->url
)
)->activate($action);
$this->view->title = $title;
}
/**
* Creat full report
*/ */
public function indexAction() public function indexAction()
{ {
$this->addTitleTab('alertsummary', $this->translate('Alert Summary')); $this->getTabs()->add(
'alertsummary',
array(
'title' => $this->translate(
'Show recent alerts and visualize notifications and problems'
. ' based on their amount and chronological distribution'
),
'label' => $this->translate('Alert Summary'),
'url' => Url::fromRequest()
)
)->activate('alertsummary');
$this->view->title = $this->translate('Alert Summary');
$this->view->intervalBox = $this->createIntervalBox(); $this->view->intervalBox = $this->createIntervalBox();
$this->view->recentAlerts = $this->createRecentAlerts(); $this->view->recentAlerts = $this->createRecentAlerts();
$this->view->interval = $this->getInterval(); $this->view->interval = $this->getInterval();