diff --git a/application/controllers/ShowController.php b/application/controllers/ShowController.php index 3b85366..552e612 100644 --- a/application/controllers/ShowController.php +++ b/application/controllers/ShowController.php @@ -40,80 +40,6 @@ class ShowController extends Controller $this->params->shift('r'); } - public function overviewAction() - { - $this->handleDatasourceToggles(); - $this->handleGraphParams(); - // TODO: $max = $query->getMaxValue(); - - $this->view->tabs->add('overview', array( - 'label' => $this->translate('Graphite - Overview'), - 'url' => $this->getRequest()->getUrl() - ))->activate('overview'); - - $this->view->filterColumn = $this->params->get('filterColumn'); - $this->view->filterValue = $this->params->get('filterValue'); - - $optional = array(null => '- please choose -'); - $any = array('*' => 'Show any'); - - $this->view->templates = array_merge( - $optional, - $this->templateStore->enumTemplates() - ); - - if (! $template = $this->template) { - return; - } - - $varnames = GraphiteUtil::extractVariableNames($template->getFilterString()); - $varnames = array_combine($varnames, $varnames); - - $this->view->filterColumns = $optional + $varnames; - - if ($this->view->filterColumn) { - if (array_key_exists($this->view->filterColumn, $this->view->filterColumns)) { - - $this->view->filterValues = $optional + $any + $this->graphiteWeb->select() - ->from($template->getFilterString()) - ->listDistinct($this->view->filterColumn); - } - } - - if (! $this->view->filterColumn || ! $this->view->filterValue) { - return; - } - - $imgs = array(); - - $title = $template->getTitle(); - if (false === strpos($title, '$')) { - $template->setTitle('$hostname'); - } else { - if (false === strpos($title, '$hostname')) { - $template->setTitle('$hostname: ' . $template->getTitle()); - } - } - - $query = $this->graphiteWeb->select()->from( - $template->getFilterString() - )->where($this->view->filterColumn, $this->view->filterValue); - - $view = $this->view; - $imgParams = array( - 'template' => $view->templateName, - 'start' => $view->start, - 'width' => $view->width, - 'height' => $view->height - ); - - if ($this->view->disabledDatasources) { - $imgParams['disabled'] = $this->view->disabledDatasources; - } - - $view->images = $query->getWrappedImageLinks($template, $imgParams); - } - public function graphAction() { $template = $this->loadTemplate(); diff --git a/configuration.php b/configuration.php index 6d39c75..7cfc2ca 100644 --- a/configuration.php +++ b/configuration.php @@ -3,7 +3,7 @@ /** @var \Icinga\Application\Modules\Module $this */ /** @var \Icinga\Application\Modules\MenuItemContainer $section */ -$section = $this->menuSection(N_('Graphite'), ['icon' => 'chart-area'])->setUrl('graphite/show/overview'); +$section = $this->menuSection(N_('Graphite'), ['icon' => 'chart-area']); $section->add(N_('Hosts'), ['url' => 'graphite/list/hosts']); $section->add(N_('Services'), ['url' => 'graphite/list/services']);