mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Merge 6b6e15e761 into 07df145091
This commit is contained in:
commit
3e79a9b2f7
3 changed files with 37 additions and 7 deletions
|
|
@ -17,7 +17,7 @@ use ipl\Html\Text;
|
|||
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
|
||||
{
|
||||
|
|
@ -67,12 +67,21 @@ class HostSummaryDonut extends Card
|
|||
|
||||
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
|
||||
))
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use ipl\Html\Text;
|
|||
use ipl\Stdlib\BaseFilter;
|
||||
use ipl\Stdlib\Filter;
|
||||
use ipl\Web\Common\Card;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
|
||||
class ServiceSummaryDonut extends Card
|
||||
{
|
||||
|
|
@ -70,12 +71,21 @@ class ServiceSummaryDonut extends Card
|
|||
|
||||
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
|
||||
))
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,17 @@
|
|||
.donut-container {
|
||||
.card();
|
||||
|
||||
.card-header > .meta {
|
||||
> span {
|
||||
color: @text-color-light;
|
||||
}
|
||||
|
||||
> .action-link {
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue