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:
		
							
								
								
									
										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() { | ||||
|     $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(); | ||||
|     $user = $request->getUser(); | ||||
| @@ -31,22 +31,7 @@ final class PhabricatorDaemonConsoleController | ||||
|     $daemon_table->setDaemonLogs($logs); | ||||
|  | ||||
|     $daemon_panel = new AphrontPanelView(); | ||||
|     $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->setHeader('Recently Launched Daemons'); | ||||
|     $daemon_panel->appendChild($daemon_table); | ||||
|  | ||||
|     $tasks = id(new PhabricatorWorkerTask())->loadAllWhere( | ||||
|   | ||||
| @@ -24,6 +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', 'All Daemons'); | ||||
|     $nav->addFilter('log/combined', 'Combined Log'); | ||||
|  | ||||
|   | ||||
| @@ -25,8 +25,14 @@ final class PhabricatorDaemonLogListController | ||||
|     $pager = new AphrontPagerView(); | ||||
|     $pager->setOffset($request->getInt('page')); | ||||
|  | ||||
|     $clause = '1 = 1'; | ||||
|     if ($request->getStr('show') == 'running') { | ||||
|       $clause = "`status` != 'exit'"; | ||||
|     } | ||||
|  | ||||
|     $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->getPageSize() + 1); | ||||
|  | ||||
|   | ||||
| @@ -964,6 +964,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { | ||||
|         'type'    => 'sql', | ||||
|         'name'    => $this->getPatchPath('policy-project.sql'), | ||||
|       ), | ||||
|       'daemonstatuskey.sql' => array( | ||||
|         'type'    => 'sql', | ||||
|         'name'    => $this->getPatchPath('daemonstatuskey.sql'), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nick Harper
					Nick Harper