QuickActions: Add action to submit passive check results

This commit is contained in:
Johannes Meyer 2019-12-10 14:49:34 +01:00
parent bc351a5122
commit 2c8719723b
3 changed files with 21 additions and 0 deletions

View file

@ -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]);

View file

@ -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]
);
}
}

View file

@ -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)