icingadb-web/library/Icingadb/Common/Links.php

144 lines
3.8 KiB
PHP
Raw Permalink Normal View History

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
{
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
}
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
}
public static function commentsDelete(): Url
2019-12-16 10:01:30 -05:00
{
return Url::fromPath('icingadb/comments/delete');
}
public static function commentsDetails(): Url
2019-12-16 04:35:50 -05:00
{
return Url::fromPath('icingadb/comments/details');
}
public static function downtime(Downtime $downtime): Url
2019-11-05 07:04:26 -05:00
{
return Url::fromPath('icingadb/downtime', ['name' => $downtime->name]);
}
public static function downtimes(): Url
2019-12-16 04:36:26 -05:00
{
return Url::fromPath('icingadb/downtimes');
}
public static function downtimesDelete(): Url
2019-12-16 08:37:29 -05:00
{
return Url::fromPath('icingadb/downtimes/delete');
}
public static function downtimesDetails(): Url
2019-12-16 04:36:58 -05:00
{
return Url::fromPath('icingadb/downtimes/details');
}
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
}
public static function hostSource(Host $host): Url
2021-05-05 04:29:26 -04:00
{
return Url::fromPath('icingadb/host/source', ['name' => $host->name]);
}
public static function hostsDetails(): Url
2019-12-16 04:37:14 -05:00
{
return Url::fromPath('icingadb/hosts/details');
}
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
}
public static function hosts(): Url
2019-11-22 03:54:29 -05:00
{
return Url::fromPath('icingadb/hosts');
}
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
}
public static function serviceSource(Service $service, Host $host): Url
{
return Url::fromPath('icingadb/service/source', ['name' => $service->name, 'host.name' => $host->name]);
}
public static function servicesDetails(): Url
2019-12-16 04:37:31 -05:00
{
return Url::fromPath('icingadb/services/details');
}
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
}
public static function services(): Url
2019-11-22 03:54:39 -05:00
{
return Url::fromPath('icingadb/services');
}
public static function toggleHostsFeatures(): Url
{
return Url::fromPath('icingadb/hosts/toggle-features');
}
public static function toggleServicesFeatures(): Url
{
return Url::fromPath('icingadb/services/toggle-features');
}
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
}
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
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
}
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
}
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
}