Improve web tools for viewing daemons

Summary:
- Provides an "all daemons" view to look at more than the first 15 daemons.
  - Provides a "combined log" view with a large page size, to quickly look at
the log across all the daemons, making it easier to find issues when you have a
bunch of the same daemon and only one is having issues.
  - When viewing the web console on the same host as a daemon, show whether it's
running or not.

Test Plan:
Clicked the various daemon log interfaces.

Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran
Differential Revision: 215
This commit is contained in:
epriestley
2011-05-02 17:05:22 -07:00
parent 8370f93048
commit 6229cdadd8
16 changed files with 428 additions and 77 deletions

View File

@@ -22,48 +22,26 @@ class PhabricatorDaemonConsoleController extends PhabricatorDaemonController {
$logs = id(new PhabricatorDaemonLog())->loadAllWhere(
'1 = 1 ORDER BY id DESC LIMIT 15');
$rows = array();
foreach ($logs as $log) {
$epoch = $log->getDateCreated();
$rows[] = array(
phutil_escape_html($log->getDaemon()),
phutil_escape_html($log->getHost()),
$log->getPID(),
date('M j, Y', $epoch),
date('g:i A', $epoch),
phutil_render_tag(
'a',
array(
'href' => '/daemon/log/'.$log->getID().'/',
'class' => 'button small grey',
),
'View Log'),
);
}
$daemon_table = new AphrontTableView($rows);
$daemon_table->setHeaders(
array(
'Daemon',
'Host',
'PID',
'Date',
'Time',
'View',
));
$daemon_table->setColumnClasses(
array(
'wide wrap',
'',
'',
'',
'right',
'action',
));
$daemon_table = new PhabricatorDaemonLogListView();
$daemon_table->setDaemonLogs($logs);
$daemon_panel = new AphrontPanelView();
$daemon_panel->setHeader('Recently Launched Daemons');
$daemon_panel->setHeader(
'Recently Launched Daemons'.
' · '.
phutil_render_tag(
'a',
array(
'href' => '/daemon/log/',
),
'View All Daemons').
' · '.
phutil_render_tag(
'a',
array(
'href' => '/daemon/log/combined/',
),
'View Combined Log'));
$daemon_panel->appendChild($daemon_table);
$tasks = id(new PhabricatorWorkerTask())->loadAllWhere(