mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
QuickActions: Add action to submit passive check results
This commit is contained in:
parent
bc351a5122
commit
2c8719723b
3 changed files with 21 additions and 0 deletions
|
|
@ -67,6 +67,11 @@ abstract class HostLinks
|
|||
return Url::fromPath('icingadb/host/send-custom-notification', ['name' => $host->name]);
|
||||
}
|
||||
|
||||
public static function processCheckresult(Host $host)
|
||||
{
|
||||
return Url::fromPath('icingadb/host/process-checkresult', ['name' => $host->name]);
|
||||
}
|
||||
|
||||
public static function services(Host $host)
|
||||
{
|
||||
return Url::fromPath('icingadb/host/services', ['name' => $host->name]);
|
||||
|
|
|
|||
|
|
@ -91,4 +91,11 @@ abstract class ServiceLinks
|
|||
'icingadb/service/send-custom-notification', ['name' => $service->name, 'host.name' => $host->name]
|
||||
);
|
||||
}
|
||||
|
||||
public static function processCheckresult(Service $service, Host $host)
|
||||
{
|
||||
return Url::fromPath(
|
||||
'icingadb/service/process-checkresult', ['name' => $service->name, 'host.name' => $host->name]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,15 @@ class QuickActions extends BaseHtmlElement
|
|||
'Schedule the next active check at a different time than the current one'
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->getAuth()->hasPermission('monitoring/command/process-check-result')) {
|
||||
$this->assembleAction(
|
||||
'processCheckresult',
|
||||
'Process check result',
|
||||
'icon-edit',
|
||||
sprintf('Submit a one time or so called passive result for the %s check', $this->object->checkcommand)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function assembleAction($action, $label, $icon, $title)
|
||||
|
|
|
|||
Loading…
Reference in a new issue