ServiceController: Use trait CommandActions

This commit is contained in:
Johannes Meyer 2019-10-10 13:41:52 +02:00 committed by Eric Lippmann
parent 623fd8b1ff
commit edbc2af7a6

View file

@ -3,6 +3,7 @@
namespace Icinga\Module\Eagle\Controllers;
use Icinga\Exception\NotFoundError;
use Icinga\Module\Eagle\Common\CommandActions;
use Icinga\Module\Eagle\Model\Service;
use Icinga\Module\Eagle\Redis\VolatileState;
use Icinga\Module\Eagle\Web\Controller;
@ -10,6 +11,8 @@ use Icinga\Module\Eagle\Widget\ServiceListItem;
class ServiceController extends Controller
{
use CommandActions;
/** @var Service The service object */
protected $service;
@ -40,6 +43,11 @@ class ServiceController extends Controller
$this->service = $service;
}
public function fetchCommandTargets()
{
return [$this->service];
}
public function indexAction()
{
$this->addContent((new ServiceListItem($this->service))->setTag('div'));