summary = $summary; } protected function createDonut(): ValidHtml { $donut = (new Donut()) ->addSlice($this->summary->services_ok, ['class' => 'slice-state-ok']) ->addSlice($this->summary->services_warning_handled, ['class' => 'slice-state-warning-handled']) ->addSlice($this->summary->services_warning_unhandled, ['class' => 'slice-state-warning']) ->addSlice($this->summary->services_critical_handled, ['class' => 'slice-state-critical-handled']) ->addSlice($this->summary->services_critical_unhandled, ['class' => 'slice-state-critical']) ->addSlice($this->summary->services_unknown_handled, ['class' => 'slice-state-unknown-handled']) ->addSlice($this->summary->services_unknown_unhandled, ['class' => 'slice-state-unknown']) ->addSlice($this->summary->services_pending, ['class' => 'slice-state-pending']); return HtmlString::create($donut->render()); } protected function createTotal(): ValidHtml { $url = Links::services(); if ($this->hasBaseFilter()) { $url->setFilter($this->getBaseFilter()); } return new Link( (new VerticalKeyValue( tp('Service', 'Services', $this->summary->services_total), $this->shortenAmount($this->summary->services_total) ))->setAttribute('title', $this->summary->services_total), $url ); } protected function createBadges(): ValidHtml { $badges = new ServiceStateBadges($this->summary); if ($this->hasBaseFilter()) { $badges->setBaseFilter($this->getBaseFilter()); } return $badges; } }