diff --git a/library/Icingadb/Widget/HostSummaryDonut.php b/library/Icingadb/Widget/HostSummaryDonut.php index 5efcf74d0..db2177958 100644 --- a/library/Icingadb/Widget/HostSummaryDonut.php +++ b/library/Icingadb/Widget/HostSummaryDonut.php @@ -16,7 +16,7 @@ use ipl\Stdlib\BaseFilter; use ipl\Stdlib\Filter; use ipl\Web\Common\Card; -use ipl\Web\Filter\QueryString; +use ipl\Web\Widget\ActionLink; class HostSummaryDonut extends Card { @@ -66,12 +66,21 @@ protected function assembleFooter(BaseHtmlElement $footer) protected function assembleHeader(BaseHtmlElement $header) { + $filter = Filter::all(); + + if ($this->hasBaseFilter()) { + $filter->add($this->getBaseFilter()); + } + $header->addHtml( new HtmlElement('h2', null, Text::create(t('Hosts'))), new HtmlElement('span', Attributes::create(['class' => 'meta']), TemplateString::create( - t('{{#total}}Total{{/total}} %d'), - ['total' => new HtmlElement('span')], - (int) $this->summary->hosts_total + t('{{#total}}Total{{/total}} {{#link}}%d{{/link}}'), + [ + 'total' => new HtmlElement('span'), + 'link' => new ActionLink(null, Links::hosts()->setFilter($filter)) + ], + $this->summary->hosts_total )) ); } diff --git a/library/Icingadb/Widget/ServiceSummaryDonut.php b/library/Icingadb/Widget/ServiceSummaryDonut.php index e6b38a103..d6f6d211f 100644 --- a/library/Icingadb/Widget/ServiceSummaryDonut.php +++ b/library/Icingadb/Widget/ServiceSummaryDonut.php @@ -16,6 +16,7 @@ use ipl\Stdlib\BaseFilter; use ipl\Stdlib\Filter; use ipl\Web\Common\Card; +use ipl\Web\Widget\ActionLink; class ServiceSummaryDonut extends Card { @@ -69,12 +70,21 @@ protected function assembleFooter(BaseHtmlElement $footer) protected function assembleHeader(BaseHtmlElement $header) { + $filter = Filter::all(); + + if ($this->hasBaseFilter()) { + $filter->add($this->getBaseFilter()); + } + $header->addHtml( new HtmlElement('h2', null, Text::create(t('Services'))), new HtmlElement('span', Attributes::create(['class' => 'meta']), TemplateString::create( - t('{{#total}}Total{{/total}} %d'), - ['total' => new HtmlElement('span')], - (int) $this->summary->services_total + t('{{#total}}Total{{/total}} {{#link}}%d{{/link}}'), + [ + 'total' => new HtmlElement('span'), + 'link' => new ActionLink(null, Links::services()->setFilter($filter)) + ], + $this->summary->services_total )) ); } diff --git a/public/css/widget/donut-container.less b/public/css/widget/donut-container.less index 6fc44665e..f1424ec77 100644 --- a/public/css/widget/donut-container.less +++ b/public/css/widget/donut-container.less @@ -1,6 +1,17 @@ .donut-container { .card(); + .card-header > .meta { + > span { + color: @text-color-light; + } + + > .action-link { + font-weight: bold; + font-size: 1.1em; + } + } + h2 { margin: 0; }