3 final class DrydockRepositoryOperationViewController
4 extends DrydockRepositoryOperationController
{
6 public function shouldAllowPublic() {
10 public function handleRequest(AphrontRequest
$request) {
11 $viewer = $request->getViewer();
12 $id = $request->getURIData('id');
14 $operation = id(new DrydockRepositoryOperationQuery())
19 return new Aphront404Response();
22 $id = $operation->getID();
23 $title = pht('Repository Operation %d', $id);
25 $header = id(new PHUIHeaderView())
28 ->setPolicyObject($operation)
29 ->setHeaderIcon('fa-fighter-jet');
31 $state = $operation->getOperationState();
32 $icon = DrydockRepositoryOperation
::getOperationStateIcon($state);
33 $name = DrydockRepositoryOperation
::getOperationStateName($state);
34 $header->setStatus($icon, null, $name);
36 $curtain = $this->buildCurtain($operation);
37 $properties = $this->buildPropertyListView($operation);
39 $crumbs = $this->buildApplicationCrumbs();
40 $crumbs->addTextCrumb(
42 $this->getApplicationURI('operation/'));
43 $crumbs->addTextCrumb($title);
44 $crumbs->setBorder(true);
46 $status_view = id(new DrydockRepositoryOperationStatusView())
48 ->setOperation($operation);
50 $log_query = id(new DrydockLogQuery())
51 ->withOperationPHIDs(array($operation->getPHID()));
53 $log_table = $this->buildLogTable($log_query)
54 ->setHideOperations(true);
56 $logs = $this->buildLogBox(
58 $this->getApplicationURI("operation/{$id}/logs/query/all/"));
60 $view = id(new PHUITwoColumnView())
62 ->setCurtain($curtain)
63 ->addPropertySection(pht('Properties'), $properties)
70 return $this->newPage()
79 private function buildCurtain(DrydockRepositoryOperation
$operation) {
80 $viewer = $this->getViewer();
81 $id = $operation->getID();
83 $curtain = $this->newCurtainView($operation);
88 private function buildPropertyListView(
89 DrydockRepositoryOperation
$operation) {
91 $viewer = $this->getViewer();
93 $view = new PHUIPropertyListView();
96 $viewer->renderHandle($operation->getRepositoryPHID()));
100 $viewer->renderHandle($operation->getObjectPHID()));
102 $lease_phid = $operation->getWorkingCopyLeasePHID();
104 $lease_display = $viewer->renderHandle($lease_phid);
106 $lease_display = phutil_tag('em', array(), pht('None'));
109 $view->addProperty(pht('Working Copy'), $lease_display);