1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00

Update Deamons with new UI

Summary: Modernize and use newer UI

Test Plan: Bounce around various views.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15574
This commit is contained in:
Chad Little 2016-04-02 10:18:52 -07:00
parent 83a3ea5705
commit 27e13ea03f
6 changed files with 99 additions and 79 deletions

View file

@ -23,13 +23,14 @@ final class PhabricatorDaemonBulkJobViewController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Bulk Jobs'), '/daemon/bulk/'); $crumbs->addTextCrumb(pht('Bulk Jobs'), '/daemon/bulk/');
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
$properties = $this->renderProperties($job); $properties = $this->renderProperties($job);
$actions = $this->renderActions($job); $curtain = $this->buildCurtainView($job);
$properties->setActionList($actions);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('DETAILS'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties); ->addPropertyList($properties);
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
@ -37,15 +38,22 @@ final class PhabricatorDaemonBulkJobViewController
new PhabricatorWorkerBulkJobTransactionQuery()); new PhabricatorWorkerBulkJobTransactionQuery());
$timeline->setShouldTerminate(true); $timeline->setShouldTerminate(true);
return $this->buildApplicationPage( $header = id(new PHUIHeaderView())
array( ->setHeader($title)
$crumbs, ->setHeaderIcon('fa-hourglass');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(array(
$box, $box,
$timeline, $timeline,
),
array(
'title' => $title,
)); ));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
private function renderProperties(PhabricatorWorkerBulkJob $job) { private function renderProperties(PhabricatorWorkerBulkJob $job) {
@ -64,12 +72,9 @@ final class PhabricatorDaemonBulkJobViewController
return $view; return $view;
} }
private function renderActions(PhabricatorWorkerBulkJob $job) { private function buildCurtainView(PhabricatorWorkerBulkJob $job) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$curtain = $this->newCurtainView($job);
$actions = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($job);
if ($job->isConfirming()) { if ($job->isConfirming()) {
$continue_uri = $job->getMonitorURI(); $continue_uri = $job->getMonitorURI();
@ -77,13 +82,13 @@ final class PhabricatorDaemonBulkJobViewController
$continue_uri = $job->getDoneURI(); $continue_uri = $job->getDoneURI();
} }
$actions->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setHref($continue_uri) ->setHref($continue_uri)
->setIcon('fa-arrow-circle-o-right') ->setIcon('fa-arrow-circle-o-right')
->setName(pht('Continue'))); ->setName(pht('Continue')));
return $actions; return $curtain;
} }
} }

View file

@ -117,16 +117,15 @@ final class PhabricatorDaemonConsoleController
'n', 'n',
)); ));
$completed_panel = new PHUIObjectBoxView(); $completed_panel = id(new PHUIObjectBoxView())
$completed_panel->setHeaderText( ->setHeaderText(pht('Recently Completed Tasks (Last 15m)'))
pht('Recently Completed Tasks (Last 15m)')); ->setTable($completed_table);
$completed_panel->setTable($completed_table);
$daemon_table = new PhabricatorDaemonLogListView(); $daemon_table = new PhabricatorDaemonLogListView();
$daemon_table->setUser($viewer); $daemon_table->setUser($viewer);
$daemon_table->setDaemonLogs($logs); $daemon_table->setDaemonLogs($logs);
$daemon_panel = new PHUIObjectBoxView(); $daemon_panel = id(new PHUIObjectBoxView());
$daemon_panel->setHeaderText(pht('Active Daemons')); $daemon_panel->setHeaderText(pht('Active Daemons'));
$daemon_panel->setObjectList($daemon_table); $daemon_panel->setObjectList($daemon_table);
@ -218,11 +217,10 @@ final class PhabricatorDaemonConsoleController
$triggers_panel, $triggers_panel,
)); ));
return $this->buildApplicationPage( return $this->newPage()
$nav, ->setTitle(pht('Console'))
array( ->appendChild($nav);
'title' => pht('Console'),
));
} }
private function buildTriggersTable(array $triggers) { private function buildTriggersTable(array $triggers) {

View file

@ -17,9 +17,9 @@ final class PhabricatorDaemonLogEventViewController
->setCombinedLog(true) ->setCombinedLog(true)
->setShowFullMessage(true); ->setShowFullMessage(true);
$log_panel = new PHUIObjectBoxView(); $log_panel = id(new PHUIObjectBoxView())
$log_panel->setHeaderText(pht('Combined Log')); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
$log_panel->appendChild($event_view); ->appendChild($event_view);
$daemon_id = $event->getLogID(); $daemon_id = $event->getLogID();
@ -27,17 +27,21 @@ final class PhabricatorDaemonLogEventViewController
->addTextCrumb( ->addTextCrumb(
pht('Daemon %s', $daemon_id), pht('Daemon %s', $daemon_id),
$this->getApplicationURI("log/{$daemon_id}/")) $this->getApplicationURI("log/{$daemon_id}/"))
->addTextCrumb(pht('Event %s', $event->getID())); ->addTextCrumb(pht('Event %s', $event->getID()))
->setBorder(true);
$header = id(new PHUIHeaderView())
->setHeader(pht('Combined Log'))
->setHeaderIcon('fa-file-text');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($log_panel);
return $this->newPage()
->setTitle(pht('Combined Daemon Log'))
->appendChild($view);
return $this->buildApplicationPage(
array(
$crumbs,
$log_panel,
),
array(
'title' => pht('Combined Daemon Log'),
));
} }
} }

View file

@ -31,11 +31,10 @@ final class PhabricatorDaemonLogListController
$nav->appendChild($box); $nav->appendChild($box);
$nav->appendChild($pager); $nav->appendChild($pager);
return $this->buildApplicationPage( return $this->newPage()
$nav, ->setTitle(pht('All Daemons'))
array( ->appendChild($nav);
'title' => pht('All Daemons'),
));
} }
} }

View file

@ -22,9 +22,11 @@ final class PhabricatorDaemonLogViewController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Daemon %s', $log->getID())); $crumbs->addTextCrumb(pht('Daemon %s', $log->getID()));
$crumbs->setBorder(true);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($log->getDaemon()); ->setHeader($log->getDaemon())
->setHeaderIcon('fa-pied-piper-alt');
$tag = id(new PHUITagView()) $tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE); ->setType(PHUITagView::TYPE_STATE);
@ -32,32 +34,38 @@ final class PhabricatorDaemonLogViewController
$status = $log->getStatus(); $status = $log->getStatus();
switch ($status) { switch ($status) {
case PhabricatorDaemonLog::STATUS_UNKNOWN: case PhabricatorDaemonLog::STATUS_UNKNOWN:
$tag->setBackgroundColor(PHUITagView::COLOR_ORANGE); $color = 'orange';
$tag->setName(pht('Unknown')); $name = pht('Unknown');
$icon = 'fa-warning';
break; break;
case PhabricatorDaemonLog::STATUS_RUNNING: case PhabricatorDaemonLog::STATUS_RUNNING:
$tag->setBackgroundColor(PHUITagView::COLOR_GREEN); $color = 'green';
$tag->setName(pht('Running')); $name = pht('Running');
$icon = 'fa-rocket';
break; break;
case PhabricatorDaemonLog::STATUS_DEAD: case PhabricatorDaemonLog::STATUS_DEAD:
$tag->setBackgroundColor(PHUITagView::COLOR_RED); $color = 'red';
$tag->setName(pht('Dead')); $name = pht('Dead');
$icon = 'fa-times';
break; break;
case PhabricatorDaemonLog::STATUS_WAIT: case PhabricatorDaemonLog::STATUS_WAIT:
$tag->setBackgroundColor(PHUITagView::COLOR_BLUE); $color = 'blue';
$tag->setName(pht('Waiting')); $name = pht('Waiting');
$icon = 'fa-clock-o';
break; break;
case PhabricatorDaemonLog::STATUS_EXITING: case PhabricatorDaemonLog::STATUS_EXITING:
$tag->setBackgroundColor(PHUITagView::COLOR_YELLOW); $color = 'yellow';
$tag->setName(pht('Exiting')); $name = pht('Exiting');
$icon = 'fa-check';
break; break;
case PhabricatorDaemonLog::STATUS_EXITED: case PhabricatorDaemonLog::STATUS_EXITED:
$tag->setBackgroundColor(PHUITagView::COLOR_GREY); $color = 'bluegrey';
$tag->setName(pht('Exited')); $name = pht('Exited');
$icon = 'fa-check';
break; break;
} }
$header->addTag($tag); $header->setStatus($icon, $color, $name);
$properties = $this->buildPropertyListView($log); $properties = $this->buildPropertyListView($log);
@ -65,23 +73,26 @@ final class PhabricatorDaemonLogViewController
->setUser($viewer) ->setUser($viewer)
->setEvents($events); ->setEvents($events);
$event_panel = new PHUIObjectBoxView(); $event_panel = id(new PHUIObjectBoxView())
$event_panel->setHeaderText(pht('Events')); ->setHeaderText(pht('Events'))
$event_panel->appendChild($event_view); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($event_view);
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties); ->addPropertyList($properties);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter(array(
$object_box, $object_box,
$event_panel, $event_panel,
),
array(
'title' => pht('Daemon Log'),
)); ));
return $this->newPage()
->setTitle(pht('Daemon Log'))
->setCrumbs($crumbs)
->appendChild($view);
} }
private function buildPropertyListView(PhabricatorDaemonLog $daemon) { private function buildPropertyListView(PhabricatorDaemonLog $daemon) {

View file

@ -31,17 +31,18 @@ final class PhabricatorWorkerTaskDetailController
$title = pht('Task %d', $task->getID()); $title = pht('Task %d', $task->getID());
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Task %d (%s)', ->setHeader(pht('Task %d: %s',
$task->getID(), $task->getID(),
$task->getTaskClass())); $task->getTaskClass()))
->setHeaderIcon('fa-sort');
$properties = $this->buildPropertyListView($task); $properties = $this->buildPropertyListView($task);
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeaderText($title)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties); ->addPropertyList($properties);
$retry_head = id(new PHUIHeaderView()) $retry_head = id(new PHUIHeaderView())
->setHeader(pht('Retries')); ->setHeader(pht('Retries'));
@ -49,6 +50,7 @@ final class PhabricatorWorkerTaskDetailController
$retry_box = id(new PHUIObjectBoxView()) $retry_box = id(new PHUIObjectBoxView())
->setHeader($retry_head) ->setHeader($retry_head)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($retry_info); ->addPropertyList($retry_info);
$content = array( $content = array(
@ -59,15 +61,16 @@ final class PhabricatorWorkerTaskDetailController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter($content);
$content,
), return $this->newPage()
array( ->setTitle($title)
'title' => $title, ->setCrumbs($crumbs)
)); ->appendChild($view);
} }
private function buildPropertyListView( private function buildPropertyListView(