mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +01:00
Update Daemons for handleRequest
Summary: Updates the Daemon application calls Test Plan: Click on various things in the Daemon app Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13835
This commit is contained in:
parent
7e7e38e9c0
commit
384cae4942
4 changed files with 16 additions and 35 deletions
|
@ -3,16 +3,10 @@
|
||||||
final class PhabricatorDaemonLogEventViewController
|
final class PhabricatorDaemonLogEventViewController
|
||||||
extends PhabricatorDaemonController {
|
extends PhabricatorDaemonController {
|
||||||
|
|
||||||
private $id;
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$id = $request->getURIData('id');
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
$event = id(new PhabricatorDaemonLogEvent())->load($id);
|
||||||
$this->id = $data['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
|
|
||||||
$event = id(new PhabricatorDaemonLogEvent())->load($this->id);
|
|
||||||
if (!$event) {
|
if (!$event) {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
final class PhabricatorDaemonLogListController
|
final class PhabricatorDaemonLogListController
|
||||||
extends PhabricatorDaemonController {
|
extends PhabricatorDaemonController {
|
||||||
|
|
||||||
public function processRequest() {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
$viewer = $request->getViewer();
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
$pager = new AphrontCursorPagerView();
|
$pager = new AphrontCursorPagerView();
|
||||||
$pager->readFromRequest($request);
|
$pager->readFromRequest($request);
|
||||||
|
|
|
@ -3,19 +3,13 @@
|
||||||
final class PhabricatorDaemonLogViewController
|
final class PhabricatorDaemonLogViewController
|
||||||
extends PhabricatorDaemonController {
|
extends PhabricatorDaemonController {
|
||||||
|
|
||||||
private $id;
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$viewer = $request->getViewer();
|
||||||
public function willProcessRequest(array $data) {
|
$id = $request->getURIData('id');
|
||||||
$this->id = $data['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$log = id(new PhabricatorDaemonLogQuery())
|
$log = id(new PhabricatorDaemonLogQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withIDs(array($this->id))
|
->withIDs(array($id))
|
||||||
->setAllowStatusWrites(true)
|
->setAllowStatusWrites(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$log) {
|
if (!$log) {
|
||||||
|
@ -76,7 +70,7 @@ final class PhabricatorDaemonLogViewController
|
||||||
$properties = $this->buildPropertyListView($log);
|
$properties = $this->buildPropertyListView($log);
|
||||||
|
|
||||||
$event_view = id(new PhabricatorDaemonLogEventsView())
|
$event_view = id(new PhabricatorDaemonLogEventsView())
|
||||||
->setUser($user)
|
->setUser($viewer)
|
||||||
->setEvents($events);
|
->setEvents($events);
|
||||||
|
|
||||||
$event_panel = new PHUIObjectBoxView();
|
$event_panel = new PHUIObjectBoxView();
|
||||||
|
|
|
@ -3,20 +3,14 @@
|
||||||
final class PhabricatorWorkerTaskDetailController
|
final class PhabricatorWorkerTaskDetailController
|
||||||
extends PhabricatorDaemonController {
|
extends PhabricatorDaemonController {
|
||||||
|
|
||||||
private $id;
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$viewer = $request->getViewer();
|
||||||
|
$id = $request->getURIData('id');
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
$task = id(new PhabricatorWorkerActiveTask())->load($id);
|
||||||
$this->id = $data['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$task = id(new PhabricatorWorkerActiveTask())->load($this->id);
|
|
||||||
if (!$task) {
|
if (!$task) {
|
||||||
$tasks = id(new PhabricatorWorkerArchiveTaskQuery())
|
$tasks = id(new PhabricatorWorkerArchiveTaskQuery())
|
||||||
->withIDs(array($this->id))
|
->withIDs(array($id))
|
||||||
->execute();
|
->execute();
|
||||||
$task = reset($tasks);
|
$task = reset($tasks);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue