mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
ServiceController: Fetch service in method init()
This commit is contained in:
parent
5121c2b2f0
commit
b91f9d3bcf
1 changed files with 10 additions and 2 deletions
|
|
@ -10,7 +10,10 @@ use Icinga\Module\Eagle\Widget\ServiceListItem;
|
|||
|
||||
class ServiceController extends Controller
|
||||
{
|
||||
public function indexAction()
|
||||
/** @var Service The service object */
|
||||
protected $service;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$name = $this->params->shiftRequired('name');
|
||||
$hostName = $this->params->shiftRequired('host_name');
|
||||
|
|
@ -34,6 +37,11 @@ class ServiceController extends Controller
|
|||
$volatileState->add($service);
|
||||
$volatileState->fetch();
|
||||
|
||||
$this->addContent((new ServiceListItem($service))->setTag('div'));
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->addContent((new ServiceListItem($this->service))->setTag('div'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue