2013-12-26 21:30:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DrydockConsoleController extends DrydockController {
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildSideNavView() {
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
// These are only used on mobile.
|
|
|
|
|
|
|
|
$nav->addFilter('blueprint', pht('Blueprints'));
|
|
|
|
$nav->addFilter('resource', pht('Resources'));
|
|
|
|
$nav->addFilter('lease', pht('Leases'));
|
|
|
|
$nav->addFilter('log', pht('Logs'));
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
2015-07-27 16:56:52 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $request->getViewer();
|
2013-12-26 21:30:36 +01:00
|
|
|
|
|
|
|
$menu = id(new PHUIObjectItemListView())
|
|
|
|
->setUser($viewer);
|
|
|
|
|
|
|
|
$menu->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader(pht('Blueprints'))
|
|
|
|
->setHref($this->getApplicationURI('blueprint/'))
|
|
|
|
->addAttribute(
|
|
|
|
pht(
|
|
|
|
'Configure blueprints so Drydock can build resources, like '.
|
|
|
|
'hosts and working copies.')));
|
|
|
|
|
|
|
|
$menu->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader(pht('Resources'))
|
|
|
|
->setHref($this->getApplicationURI('resource/'))
|
|
|
|
->addAttribute(
|
2015-05-22 09:27:56 +02:00
|
|
|
pht('View and manage resources Drydock has built, like hosts.')));
|
2013-12-26 21:30:36 +01:00
|
|
|
|
|
|
|
$menu->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader(pht('Leases'))
|
|
|
|
->setHref($this->getApplicationURI('lease/'))
|
2015-05-22 09:27:56 +02:00
|
|
|
->addAttribute(pht('Manage leases on resources.')));
|
2013-12-26 21:30:36 +01:00
|
|
|
|
|
|
|
$menu->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader(pht('Logs'))
|
|
|
|
->setHref($this->getApplicationURI('log/'))
|
2015-05-22 09:27:56 +02:00
|
|
|
->addAttribute(pht('View logs.')));
|
2013-12-26 21:30:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
|
|
$crumbs->addTextCrumb(pht('Console'));
|
|
|
|
|
2015-05-28 20:12:49 +02:00
|
|
|
$box = id(new PHUIObjectBoxView())
|
|
|
|
->setHeaderText(pht('Drydock Console'))
|
|
|
|
->setObjectList($menu);
|
|
|
|
|
2013-12-26 21:30:36 +01:00
|
|
|
return $this->buildApplicationPage(
|
|
|
|
array(
|
|
|
|
$crumbs,
|
2015-05-28 20:12:49 +02:00
|
|
|
$box,
|
2013-12-26 21:30:36 +01:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => pht('Drydock Console'),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|