mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
e45723c4db
commit
dee6f4d797
@ -15,6 +15,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandFo
|
|||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostCheckCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostCheckCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\SendCustomNotificationCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\SendCustomNotificationCommandForm;
|
||||||
|
use Icinga\Module\Monitoring\Forms\Command\Object\ToggleObjectFeaturesCommandForm;
|
||||||
use Icinga\Module\Monitoring\Object\HostList;
|
use Icinga\Module\Monitoring\Object\HostList;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
@ -33,6 +34,22 @@ class HostsController extends Controller
|
|||||||
$this->applyRestriction('monitoring/filter/objects', $hostList);
|
$this->applyRestriction('monitoring/filter/objects', $hostList);
|
||||||
$hostList->addFilter(Filter::fromQueryString((string) $this->params));
|
$hostList->addFilter(Filter::fromQueryString((string) $this->params));
|
||||||
$this->hostList = $hostList;
|
$this->hostList = $hostList;
|
||||||
|
$this->hostList->setColumns(array(
|
||||||
|
'host_acknowledged',
|
||||||
|
'host_active_checks_enabled',
|
||||||
|
'host_display_name',
|
||||||
|
'host_event_handler_enabled',
|
||||||
|
'host_flap_detection_enabled',
|
||||||
|
'host_handled',
|
||||||
|
'host_in_downtime',
|
||||||
|
'host_is_flapping',
|
||||||
|
'host_last_state_change',
|
||||||
|
'host_name',
|
||||||
|
'host_notifications_enabled',
|
||||||
|
'host_passive_checks_enabled',
|
||||||
|
'host_problem',
|
||||||
|
'host_state'
|
||||||
|
));
|
||||||
$this->view->baseFilter = $this->hostList->getFilter();
|
$this->view->baseFilter = $this->hostList->getFilter();
|
||||||
$this->getTabs()->add(
|
$this->getTabs()->add(
|
||||||
'show',
|
'show',
|
||||||
@ -50,21 +67,6 @@ class HostsController extends Controller
|
|||||||
|
|
||||||
protected function handleCommandForm(ObjectsCommandForm $form)
|
protected function handleCommandForm(ObjectsCommandForm $form)
|
||||||
{
|
{
|
||||||
$this->hostList->setColumns(array(
|
|
||||||
'host_acknowledged',
|
|
||||||
'host_active_checks_enabled',
|
|
||||||
'host_display_name',
|
|
||||||
'host_handled',
|
|
||||||
'host_in_downtime',
|
|
||||||
'host_is_flapping',
|
|
||||||
'host_last_state_change',
|
|
||||||
'host_name',
|
|
||||||
'host_notifications_enabled',
|
|
||||||
'host_passive_checks_enabled',
|
|
||||||
'host_problem',
|
|
||||||
'host_state'
|
|
||||||
));
|
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->setObjects($this->hostList)
|
->setObjects($this->hostList)
|
||||||
->setRedirectUrl(Url::fromPath('monitoring/hosts/show')->setParams($this->params))
|
->setRedirectUrl(Url::fromPath('monitoring/hosts/show')->setParams($this->params))
|
||||||
@ -85,20 +87,6 @@ class HostsController extends Controller
|
|||||||
->setObjects($this->hostList)
|
->setObjects($this->hostList)
|
||||||
->handleRequest();
|
->handleRequest();
|
||||||
$this->view->checkNowForm = $checkNowForm;
|
$this->view->checkNowForm = $checkNowForm;
|
||||||
$this->hostList->setColumns(array(
|
|
||||||
'host_acknowledged',
|
|
||||||
'host_active_checks_enabled',
|
|
||||||
'host_display_name',
|
|
||||||
'host_handled',
|
|
||||||
'host_in_downtime',
|
|
||||||
'host_is_flapping',
|
|
||||||
'host_last_state_change',
|
|
||||||
'host_name',
|
|
||||||
'host_notifications_enabled',
|
|
||||||
'host_passive_checks_enabled',
|
|
||||||
'host_problem',
|
|
||||||
'host_state'
|
|
||||||
));
|
|
||||||
|
|
||||||
$acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
|
$acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
|
||||||
if (! empty($acknowledgedObjects)) {
|
if (! empty($acknowledgedObjects)) {
|
||||||
@ -109,6 +97,16 @@ class HostsController extends Controller
|
|||||||
$this->view->removeAckForm = $removeAckForm;
|
$this->view->removeAckForm = $removeAckForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$featureStatus = $this->hostList->getFeatureStatus();
|
||||||
|
$toggleFeaturesForm = new ToggleObjectFeaturesCommandForm(array(
|
||||||
|
'backend' => $this->backend,
|
||||||
|
'objects' => $this->hostList
|
||||||
|
));
|
||||||
|
$toggleFeaturesForm
|
||||||
|
->load((object) $featureStatus)
|
||||||
|
->handleRequest();
|
||||||
|
$this->view->toggleFeaturesForm = $toggleFeaturesForm;
|
||||||
|
|
||||||
$hostStates = $this->hostList->getStateSummary();
|
$hostStates = $this->hostList->getStateSummary();
|
||||||
|
|
||||||
$this->setAutorefreshInterval(15);
|
$this->setAutorefreshInterval(15);
|
||||||
|
@ -195,6 +195,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<h2><?= $this->translate('Feature Commands') ?></h2>
|
||||||
|
<?= $toggleFeaturesForm ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user