Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions library/Icingadb/Widget/HostSummaryDonut.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
))
);
}
Expand Down
16 changes: 13 additions & 3 deletions library/Icingadb/Widget/ServiceSummaryDonut.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
))
);
}
Expand Down
11 changes: 11 additions & 0 deletions public/css/widget/donut-container.less
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
Loading