2019-11-03 09:13:08 -05:00
|
|
|
<?php
|
|
|
|
|
|
2020-03-13 03:38:01 -04:00
|
|
|
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */
|
|
|
|
|
|
2019-11-04 19:07:30 -05:00
|
|
|
namespace Icinga\Module\Icingadb\Common;
|
|
|
|
|
|
|
|
|
|
use Icinga\Module\Icingadb\Model\Comment;
|
2019-11-05 07:04:26 -05:00
|
|
|
use Icinga\Module\Icingadb\Model\Downtime;
|
2021-06-08 07:01:48 -04:00
|
|
|
use Icinga\Module\Icingadb\Model\History;
|
2019-11-04 19:07:30 -05:00
|
|
|
use Icinga\Module\Icingadb\Model\Host;
|
2021-06-08 07:01:48 -04:00
|
|
|
use Icinga\Module\Icingadb\Model\NotificationHistory;
|
2019-11-04 19:07:30 -05:00
|
|
|
use Icinga\Module\Icingadb\Model\Service;
|
|
|
|
|
use Icinga\Module\Icingadb\Model\User;
|
|
|
|
|
use Icinga\Module\Icingadb\Model\Usergroup;
|
2019-11-03 09:13:08 -05:00
|
|
|
use ipl\Web\Url;
|
|
|
|
|
|
|
|
|
|
abstract class Links
|
|
|
|
|
{
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function comment(Comment $comment): Url
|
2019-11-04 09:47:06 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/comment', ['name' => $comment->name]);
|
2019-11-04 09:47:06 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function comments(): Url
|
2019-11-04 09:47:27 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/comments');
|
2019-11-04 09:47:27 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function commentsDelete(): Url
|
2019-12-16 10:01:30 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/comments/delete');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function commentsDetails(): Url
|
2019-12-16 04:35:50 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/comments/details');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function downtime(Downtime $downtime): Url
|
2019-11-05 07:04:26 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/downtime', ['name' => $downtime->name]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function downtimes(): Url
|
2019-12-16 04:36:26 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/downtimes');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function downtimesDelete(): Url
|
2019-12-16 08:37:29 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/downtimes/delete');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function downtimesDetails(): Url
|
2019-12-16 04:36:58 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/downtimes/details');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function host(Host $host): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/host', ['name' => $host->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function hostSource(Host $host): Url
|
2021-05-05 04:29:26 -04:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/host/source', ['name' => $host->name]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function hostsDetails(): Url
|
2019-12-16 04:37:14 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/hosts/details');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function hostgroup($hostgroup): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/hostgroup', ['name' => $hostgroup->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function hosts(): Url
|
2019-11-22 03:54:29 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/hosts');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function service(Service $service, Host $host): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/service', ['name' => $service->name, 'host.name' => $host->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function serviceSource(Service $service, Host $host): Url
|
2021-05-05 04:29:58 -04:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/service/source', ['name' => $service->name, 'host.name' => $host->name]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function servicesDetails(): Url
|
2019-12-16 04:37:31 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/services/details');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function servicegroup($servicegroup): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2019-11-04 19:07:30 -05:00
|
|
|
return Url::fromPath('icingadb/servicegroup', ['name' => $servicegroup->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function services(): Url
|
2019-11-22 03:54:39 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/services');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function toggleHostsFeatures(): Url
|
2020-01-08 07:37:07 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/hosts/toggle-features');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function toggleServicesFeatures(): Url
|
2020-01-08 07:37:07 -05:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/services/toggle-features');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function user(User $user): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2025-04-04 09:42:23 -04:00
|
|
|
return Url::fromPath('icingadb/contact', ['name' => $user->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function usergroup(Usergroup $usergroup): Url
|
2019-11-03 09:13:08 -05:00
|
|
|
{
|
2025-04-04 10:05:56 -04:00
|
|
|
return Url::fromPath('icingadb/contactgroup', ['name' => $usergroup->name]);
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|
2021-06-08 07:01:48 -04:00
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function users(): Url
|
2021-06-08 07:01:48 -04:00
|
|
|
{
|
2025-04-04 09:09:32 -04:00
|
|
|
return Url::fromPath('icingadb/contacts');
|
2021-06-08 07:01:48 -04:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function usergroups(): Url
|
2021-08-06 07:15:14 -04:00
|
|
|
{
|
2025-04-04 09:53:41 -04:00
|
|
|
return Url::fromPath('icingadb/contactgroups');
|
2021-08-06 07:15:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-09-22 04:21:15 -04:00
|
|
|
public static function event(History $event): Url
|
2021-06-08 07:01:48 -04:00
|
|
|
{
|
|
|
|
|
return Url::fromPath('icingadb/event', ['id' => bin2hex($event->id)]);
|
|
|
|
|
}
|
2019-11-03 09:13:08 -05:00
|
|
|
}
|