Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / almanac / controller / AlmanacConsoleController.php
blob73f9e4799e52dcd105b86e856bc67d47fdb648ca
1 <?php
3 final class AlmanacConsoleController extends AlmanacController {
5 public function shouldAllowPublic() {
6 return true;
9 public function handleRequest(AphrontRequest $request) {
10 $viewer = $request->getViewer();
12 $menu = id(new PHUIObjectItemListView())
13 ->setViewer($viewer)
14 ->setBig(true);
16 $menu->addItem(
17 id(new PHUIObjectItemView())
18 ->setHeader(pht('Devices'))
19 ->setHref($this->getApplicationURI('device/'))
20 ->setImageIcon('fa-server')
21 ->setClickable(true)
22 ->addAttribute(
23 pht(
24 'Create an inventory of physical and virtual hosts and '.
25 'devices.')));
27 $menu->addItem(
28 id(new PHUIObjectItemView())
29 ->setHeader(pht('Services'))
30 ->setHref($this->getApplicationURI('service/'))
31 ->setImageIcon('fa-plug')
32 ->setClickable(true)
33 ->addAttribute(
34 pht(
35 'Create and update services, and map them to interfaces on '.
36 'devices.')));
38 $menu->addItem(
39 id(new PHUIObjectItemView())
40 ->setHeader(pht('Networks'))
41 ->setHref($this->getApplicationURI('network/'))
42 ->setImageIcon('fa-globe')
43 ->setClickable(true)
44 ->addAttribute(
45 pht(
46 'Manage public and private networks.')));
48 $menu->addItem(
49 id(new PHUIObjectItemView())
50 ->setHeader(pht('Namespaces'))
51 ->setHref($this->getApplicationURI('namespace/'))
52 ->setImageIcon('fa-asterisk')
53 ->setClickable(true)
54 ->addAttribute(
55 pht('Control who can create new named services and devices.')));
57 $docs_uri = PhabricatorEnv::getDoclink(
58 'Almanac User Guide');
60 $menu->addItem(
61 id(new PHUIObjectItemView())
62 ->setHeader(pht('Documentation'))
63 ->setHref($docs_uri)
64 ->setImageIcon('fa-book')
65 ->setClickable(true)
66 ->addAttribute(pht('Browse documentation for Almanac.')));
68 $crumbs = $this->buildApplicationCrumbs();
69 $crumbs->addTextCrumb(pht('Console'));
70 $crumbs->setBorder(true);
72 $box = id(new PHUIObjectBoxView())
73 ->setHeaderText(pht('Almanac Console'))
74 ->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
75 ->setObjectList($menu);
77 $launcher_view = id(new PHUILauncherView())
78 ->appendChild($box);
80 $view = id(new PHUITwoColumnView())
81 ->setFooter($launcher_view);
83 return $this->newPage()
84 ->setTitle(pht('Almanac Console'))
85 ->setCrumbs($crumbs)
86 ->appendChild($view);