1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix a tab in the daemon console

Summary:
The "Running Daemons" tab in `/daemon` links to
`/daemon/log?show=running/`, which doesn't work. No other side nav tries
to link to a URL with a query string, and I don't know if this ever
worked. This fixes that in a minimally invasive way.

NOTE: Daemons run when a good man goes to war.

Test Plan: View `/daemon` and click on tabs.

Reviewers: epriestley, nh

Reviewed By: nh

CC: aran, Korvin, nh

Differential Revision: https://secure.phabricator.com/D3301
This commit is contained in:
Alan Huang 2012-08-15 15:55:26 -07:00
parent 66b5acd275
commit 8ddd9c7a61
3 changed files with 11 additions and 5 deletions

View file

@ -45,7 +45,7 @@ final class PhabricatorApplicationDaemons extends PhabricatorApplication {
'task/(?P<id>\d+)/(?P<action>[^/]+)/'
=> 'PhabricatorWorkerTaskUpdateController',
'log/' => array(
'' => 'PhabricatorDaemonLogListController',
'(?P<running>running/)?' => 'PhabricatorDaemonLogListController',
'combined/' => 'PhabricatorDaemonCombinedLogController',
'(?P<id>\d+)/' => 'PhabricatorDaemonLogViewController',
),

View file

@ -24,7 +24,7 @@ abstract class PhabricatorDaemonController extends PhabricatorController {
$nav->addLabel('Daemons');
$nav->addFilter('', 'Console', $this->getApplicationURI());
$nav->addFilter('log?show=running', 'Running Daemons');
$nav->addFilter('log/running', 'Running Daemons');
$nav->addFilter('log', 'All Daemons');
$nav->addFilter('log/combined', 'Combined Log');

View file

@ -19,6 +19,12 @@
final class PhabricatorDaemonLogListController
extends PhabricatorDaemonController {
private $running;
public function willProcessRequest(array $data) {
$this->running = !empty($data['running']);
}
public function processRequest() {
$request = $this->getRequest();
@ -26,7 +32,7 @@ final class PhabricatorDaemonLogListController
$pager->setOffset($request->getInt('page'));
$clause = '1 = 1';
if ($request->getStr('show') == 'running') {
if ($this->running) {
$clause = "`status` != 'exit'";
}
@ -49,13 +55,13 @@ final class PhabricatorDaemonLogListController
$daemon_panel->appendChild($pager);
$nav = $this->buildSideNavView();
$nav->selectFilter('log');
$nav->selectFilter($this->running ? 'log/running' : 'log');
$nav->appendChild($daemon_panel);
return $this->buildApplicationPage(
$nav,
array(
'title' => 'All Daemons',
'title' => $this->running ? 'Running Daemons' : 'All Daemons',
));
}