mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 09:48:39 +01:00
Show list of non-exited daemons
Summary: This is arguably a more useful view than listing all daemons. Test Plan: Looked at list, only saw daemons that haven't exited Reviewers: vrana, epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3286
This commit is contained in:
parent
dc2fd46027
commit
3908f7db2e
5 changed files with 16 additions and 18 deletions
2
resources/sql/patches/daemonstatuskey.sql
Normal file
2
resources/sql/patches/daemonstatuskey.sql
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE {$NAMESPACE}_daemon.daemon_log
|
||||||
|
ADD KEY `status` (`status`);
|
|
@ -21,7 +21,7 @@ final class PhabricatorDaemonConsoleController
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$logs = id(new PhabricatorDaemonLog())->loadAllWhere(
|
$logs = id(new PhabricatorDaemonLog())->loadAllWhere(
|
||||||
'1 = 1 ORDER BY id DESC LIMIT 15');
|
'`status` != %s ORDER BY id DESC LIMIT 15', 'exit');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
@ -31,22 +31,7 @@ final class PhabricatorDaemonConsoleController
|
||||||
$daemon_table->setDaemonLogs($logs);
|
$daemon_table->setDaemonLogs($logs);
|
||||||
|
|
||||||
$daemon_panel = new AphrontPanelView();
|
$daemon_panel = new AphrontPanelView();
|
||||||
$daemon_panel->setHeader(
|
$daemon_panel->setHeader('Recently Launched Daemons');
|
||||||
'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);
|
$daemon_panel->appendChild($daemon_table);
|
||||||
|
|
||||||
$tasks = id(new PhabricatorWorkerTask())->loadAllWhere(
|
$tasks = id(new PhabricatorWorkerTask())->loadAllWhere(
|
||||||
|
|
|
@ -24,6 +24,7 @@ abstract class PhabricatorDaemonController extends PhabricatorController {
|
||||||
|
|
||||||
$nav->addLabel('Daemons');
|
$nav->addLabel('Daemons');
|
||||||
$nav->addFilter('', 'Console', $this->getApplicationURI());
|
$nav->addFilter('', 'Console', $this->getApplicationURI());
|
||||||
|
$nav->addFilter('log?show=running', 'Running Daemons');
|
||||||
$nav->addFilter('log', 'All Daemons');
|
$nav->addFilter('log', 'All Daemons');
|
||||||
$nav->addFilter('log/combined', 'Combined Log');
|
$nav->addFilter('log/combined', 'Combined Log');
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,14 @@ final class PhabricatorDaemonLogListController
|
||||||
$pager = new AphrontPagerView();
|
$pager = new AphrontPagerView();
|
||||||
$pager->setOffset($request->getInt('page'));
|
$pager->setOffset($request->getInt('page'));
|
||||||
|
|
||||||
|
$clause = '1 = 1';
|
||||||
|
if ($request->getStr('show') == 'running') {
|
||||||
|
$clause = "`status` != 'exit'";
|
||||||
|
}
|
||||||
|
|
||||||
$logs = id(new PhabricatorDaemonLog())->loadAllWhere(
|
$logs = id(new PhabricatorDaemonLog())->loadAllWhere(
|
||||||
'1 = 1 ORDER BY id DESC LIMIT %d, %d',
|
'%Q ORDER BY id DESC LIMIT %d, %d',
|
||||||
|
$clause,
|
||||||
$pager->getOffset(),
|
$pager->getOffset(),
|
||||||
$pager->getPageSize() + 1);
|
$pager->getPageSize() + 1);
|
||||||
|
|
||||||
|
|
|
@ -964,6 +964,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
||||||
'type' => 'sql',
|
'type' => 'sql',
|
||||||
'name' => $this->getPatchPath('policy-project.sql'),
|
'name' => $this->getPatchPath('policy-project.sql'),
|
||||||
),
|
),
|
||||||
|
'daemonstatuskey.sql' => array(
|
||||||
|
'type' => 'sql',
|
||||||
|
'name' => $this->getPatchPath('daemonstatuskey.sql'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue