mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
QuickActions: Add action to reschedule checks
This commit is contained in:
parent
d577153eed
commit
bc351a5122
3 changed files with 27 additions and 0 deletions
|
|
@ -22,6 +22,11 @@ abstract class HostLinks
|
|||
return Url::fromPath('icingadb/host/check-now', ['name' => $host->name]);
|
||||
}
|
||||
|
||||
public static function scheduleCheck(Host $host)
|
||||
{
|
||||
return Url::fromPath('icingadb/host/schedule-check', ['name' => $host->name]);
|
||||
}
|
||||
|
||||
public static function cancelDowntime(Host $host)
|
||||
{
|
||||
return Url::fromPath('icingadb/host/delete-downtime', ['name' => $host->name]);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,13 @@ abstract class ServiceLinks
|
|||
);
|
||||
}
|
||||
|
||||
public static function scheduleCheck(Service $service, Host $host)
|
||||
{
|
||||
return Url::fromPath(
|
||||
'icingadb/service/schedule-check', ['name' => $service->name, 'host.name' => $host->name]
|
||||
);
|
||||
}
|
||||
|
||||
public static function cancelDowntime(Service $service, Host $host)
|
||||
{
|
||||
return Url::fromPath(
|
||||
|
|
|
|||
|
|
@ -90,6 +90,21 @@ class QuickActions extends BaseHtmlElement
|
|||
'Schedule a downtime to suppress all problem notifications within a specific period of time'
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
$this->getAuth()->hasPermission('monitoring/command/schedule-check')
|
||||
|| (
|
||||
$this->object->active_checks_enabled
|
||||
&& $this->getAuth()->hasPermission('monitoring/command/schedule-check/active-only')
|
||||
)
|
||||
) {
|
||||
$this->assembleAction(
|
||||
'scheduleCheck',
|
||||
'Reschedule',
|
||||
'icon-calendar-empty',
|
||||
'Schedule the next active check at a different time than the current one'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function assembleAction($action, $label, $icon, $title)
|
||||
|
|
|
|||
Loading…
Reference in a new issue