Path: blob/master/src/applications/almanac/application/PhabricatorAlmanacApplication.php
12256 views
<?php12final class PhabricatorAlmanacApplication extends PhabricatorApplication {34public function getBaseURI() {5return '/almanac/';6}78public function getName() {9return pht('Almanac');10}1112public function getShortDescription() {13return pht('Service Directory');14}1516public function getIcon() {17return 'fa-server';18}1920public function getTitleGlyph() {21return "\xE2\x98\x82";22}2324public function getApplicationGroup() {25return self::GROUP_UTILITIES;26}2728public function getHelpDocumentationArticles(PhabricatorUser $viewer) {29return array(30array(31'name' => pht('Almanac User Guide'),32'href' => PhabricatorEnv::getDoclink('Almanac User Guide'),33),34);35}3637public function getRoutes() {38return array(39'/almanac/' => array(40'' => 'AlmanacConsoleController',41'(?P<objectType>service)/' => array(42$this->getQueryRoutePattern() => 'AlmanacServiceListController',43$this->getEditRoutePattern('edit/') => 'AlmanacServiceEditController',44'view/(?P<name>[^/]+)/' => 'AlmanacServiceViewController',45),46'(?P<objectType>device)/' => array(47$this->getQueryRoutePattern() => 'AlmanacDeviceListController',48$this->getEditRoutePattern('edit/') => 'AlmanacDeviceEditController',49'view/(?P<name>[^/]+)/' => 'AlmanacDeviceViewController',50),51'interface/' => array(52'edit/(?:(?P<id>\d+)/)?' => 'AlmanacInterfaceEditController',53'delete/(?:(?P<id>\d+)/)?' => 'AlmanacInterfaceDeleteController',54),55'binding/' => array(56'edit/(?:(?P<id>\d+)/)?' => 'AlmanacBindingEditController',57'disable/(?:(?P<id>\d+)/)?' => 'AlmanacBindingDisableController',58'(?P<id>\d+)/' => 'AlmanacBindingViewController',59),60'network/' => array(61$this->getQueryRoutePattern() => 'AlmanacNetworkListController',62'edit/(?:(?P<id>\d+)/)?' => 'AlmanacNetworkEditController',63'(?P<id>\d+)/' => 'AlmanacNetworkViewController',64),65'namespace/' => array(66$this->getQueryRoutePattern() => 'AlmanacNamespaceListController',67$this->getEditRoutePattern('edit/')68=> 'AlmanacNamespaceEditController',69'(?P<id>\d+)/' => 'AlmanacNamespaceViewController',70),71'property/' => array(72'delete/' => 'AlmanacPropertyDeleteController',73'update/' => 'AlmanacPropertyEditController',74),75),76);77}7879protected function getCustomCapabilities() {80$cluster_caption = pht(81'This permission is very dangerous. %s',82phutil_tag(83'a',84array(85'href' => PhabricatorEnv::getDoclink('Clustering Introduction'),86'target' => '_blank',87),88pht('Learn More')));8990return array(91AlmanacCreateServicesCapability::CAPABILITY => array(92'default' => PhabricatorPolicies::POLICY_ADMIN,93),94AlmanacCreateDevicesCapability::CAPABILITY => array(95'default' => PhabricatorPolicies::POLICY_ADMIN,96),97AlmanacCreateNetworksCapability::CAPABILITY => array(98'default' => PhabricatorPolicies::POLICY_ADMIN,99),100AlmanacCreateNamespacesCapability::CAPABILITY => array(101'default' => PhabricatorPolicies::POLICY_ADMIN,102),103AlmanacManageClusterServicesCapability::CAPABILITY => array(104'default' => PhabricatorPolicies::POLICY_NOONE,105'caption' => $cluster_caption,106),107);108}109110}111112113