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'));
|
2015-10-17 03:47:05 +02:00
|
|
|
$nav->addFilter('operation', pht('Repository Operations'));
|
2013-12-26 21:30:36 +01:00
|
|
|
|
|
|
|
$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'))
|
2016-01-28 17:40:22 +01:00
|
|
|
->setIcon('fa-map-o')
|
2013-12-26 21:30:36 +01:00
|
|
|
->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'))
|
2016-01-28 17:40:22 +01:00
|
|
|
->setIcon('fa-map')
|
2013-12-26 21:30:36 +01:00
|
|
|
->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'))
|
2016-01-28 17:40:22 +01:00
|
|
|
->setIcon('fa-link')
|
2013-12-26 21:30:36 +01:00
|
|
|
->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
|
|
|
|
2015-10-17 03:47:05 +02:00
|
|
|
$menu->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader(pht('Repository Operations'))
|
2016-01-28 17:40:22 +01:00
|
|
|
->setIcon('fa-fighter-jet')
|
2015-10-17 03:47:05 +02:00
|
|
|
->setHref($this->getApplicationURI('operation/'))
|
|
|
|
->addAttribute(pht('Review the repository operation queue.')));
|
|
|
|
|
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'),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|