ServicesController: Don't allow to reschedule checks if no objects have active ones
refs #3665
This commit is contained in:
parent
f45b4640b0
commit
164555760b
|
@ -92,7 +92,12 @@ class ServicesController extends Controller
|
|||
public function showAction()
|
||||
{
|
||||
$this->setAutorefreshInterval(15);
|
||||
if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
|
||||
$activeChecksEnabled = $this->serviceList->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
|
||||
->setObjects($this->serviceList)
|
||||
|
@ -119,8 +124,10 @@ class ServicesController extends Controller
|
|||
->handleRequest();
|
||||
$this->view->toggleFeaturesForm = $toggleFeaturesForm;
|
||||
|
||||
$this->setAutorefreshInterval(15);
|
||||
if ($activeChecksEnabled) {
|
||||
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
|
||||
}
|
||||
|
||||
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
|
||||
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath(
|
||||
'monitoring/services/process-check-result'
|
||||
|
|
|
@ -183,6 +183,7 @@
|
|||
</tr>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($rescheduleAllLink)): ?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
|
@ -197,6 +198,7 @@
|
|||
) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2><?= $this->translate('Feature Commands') ?></h2>
|
||||
|
|
Loading…
Reference in New Issue