HostsController: Don't allow to reschedule checks if no objects have active ones
refs #3665
This commit is contained in:
parent
3d4fa0bcae
commit
f45b4640b0
|
@ -85,7 +85,12 @@ class HostsController extends Controller
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$this->setAutorefreshInterval(15);
|
$this->setAutorefreshInterval(15);
|
||||||
if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
|
$activeChecksEnabled = $this->hostList->getFeatureStatus()['active_checks_enabled'] !== 0;
|
||||||
|
if ($this->Auth()->hasPermission('monitoring/command/schedule-check')
|
||||||
|
|| ($this->Auth()->hasPermission('monitoring/command/schedule-check/active-only')
|
||||||
|
&& $activeChecksEnabled
|
||||||
|
)
|
||||||
|
) {
|
||||||
$checkNowForm = new CheckNowCommandForm();
|
$checkNowForm = new CheckNowCommandForm();
|
||||||
$checkNowForm
|
$checkNowForm
|
||||||
->setObjects($this->hostList)
|
->setObjects($this->hostList)
|
||||||
|
@ -114,8 +119,10 @@ class HostsController extends Controller
|
||||||
|
|
||||||
$hostStates = $this->hostList->getStateSummary();
|
$hostStates = $this->hostList->getStateSummary();
|
||||||
|
|
||||||
$this->setAutorefreshInterval(15);
|
if ($activeChecksEnabled) {
|
||||||
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
|
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
|
||||||
|
}
|
||||||
|
|
||||||
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
|
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
|
||||||
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
|
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
|
||||||
$this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
|
$this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
|
||||||
|
|
|
@ -181,6 +181,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
<?php if (isset($rescheduleAllLink)): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<td>
|
<td>
|
||||||
|
@ -195,6 +196,7 @@
|
||||||
) ?>
|
) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php endif ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<h2><?= $this->translate('Feature Commands') ?></h2>
|
<h2><?= $this->translate('Feature Commands') ?></h2>
|
||||||
|
|
Loading…
Reference in New Issue