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

View file

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

View file

@ -17,9 +17,9 @@ final class PhabricatorDaemonLogEventViewController
->setCombinedLog(true)
->setShowFullMessage(true);
$log_panel = new PHUIObjectBoxView();
$log_panel->setHeaderText(pht('Combined Log'));
$log_panel->appendChild($event_view);
$log_panel = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($event_view);
$daemon_id = $event->getLogID();
@ -27,17 +27,21 @@ final class PhabricatorDaemonLogEventViewController
->addTextCrumb(
pht('Daemon %s', $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($pager);
return $this->buildApplicationPage(
$nav,
array(
'title' => pht('All Daemons'),
));
return $this->newPage()
->setTitle(pht('All Daemons'))
->appendChild($nav);
}
}

View file

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

View file

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