Skip to content

Commit e94b736

Browse files
committed
Add header link for service donut chart
Add link on the header that opens the list that the service donut chart in the tactical overview represents considering the active filters.
1 parent 69d4bac commit e94b736

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

library/Icingadb/Widget/ServiceSummaryDonut.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,24 @@ protected function assembleFooter(BaseHtmlElement $footer)
6969

7070
protected function assembleHeader(BaseHtmlElement $header)
7171
{
72+
$filter = Filter::all();
73+
74+
if ($this->hasBaseFilter()) {
75+
$filter->add($this->getBaseFilter());
76+
}
77+
78+
$attributes = Attributes::create(['href' => Links::services()->setFilter($filter)]);
79+
7280
$header->addHtml(
73-
new HtmlElement('h2', null, Text::create(t('Services'))),
74-
new HtmlElement('span', Attributes::create(['class' => 'meta']), TemplateString::create(
75-
t('{{#total}}Total{{/total}} %d'),
76-
['total' => new HtmlElement('span')],
77-
(int) $this->summary->services_total
81+
new HtmlElement('a', $attributes, new HtmlElement('h2', null, Text::create(t('Services')))),
82+
new HtmlElement('a', $attributes, new HtmlElement(
83+
'span',
84+
Attributes::create(['class' => 'meta']),
85+
TemplateString::create(
86+
t('{{#total}}Total{{/total}} %d'),
87+
['total' => new HtmlElement('span')],
88+
(int) $this->summary->services_total
89+
)
7890
))
7991
);
8092
}

0 commit comments

Comments
 (0)