Differential D11957 Diff 28796 src/applications/conduit/controller/PhabricatorConduitLogController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitLogController.php
Show All 29 Lines | public function processRequest() { | ||||
$conns = array(); | $conns = array(); | ||||
if ($conn_ids) { | if ($conn_ids) { | ||||
$conns = $conn_table->loadAllWhere( | $conns = $conn_table->loadAllWhere( | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$conn_ids); | $conn_ids); | ||||
} | } | ||||
$table = $this->renderCallTable($calls, $conns); | $table = $this->renderCallTable($calls, $conns); | ||||
$box = id(new PHUIObjectBoxView()) | |||||
->setHeaderText(pht('Call Logs')) | |||||
->appendChild($table); | |||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
$crumbs->addTextCrumb(pht('Call Logs')); | $crumbs->addTextCrumb(pht('Call Logs')); | ||||
return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
array( | array( | ||||
$crumbs, | $crumbs, | ||||
$table, | $box, | ||||
$pager, | $pager, | ||||
), | ), | ||||
array( | array( | ||||
'title' => 'Conduit Logs', | 'title' => pht('Conduit Logs'), | ||||
)); | )); | ||||
} | } | ||||
private function renderCallTable(array $calls, array $conns) { | private function renderCallTable(array $calls, array $conns) { | ||||
assert_instances_of($calls, 'PhabricatorConduitMethodCallLog'); | assert_instances_of($calls, 'PhabricatorConduitMethodCallLog'); | ||||
assert_instances_of($conns, 'PhabricatorConduitConnectionLog'); | assert_instances_of($conns, 'PhabricatorConduitConnectionLog'); | ||||
$viewer = $this->getRequest()->getUser(); | $viewer = $this->getRequest()->getUser(); | ||||
Show All 37 Lines | foreach ($calls as $call) { | ||||
array($call->getMethod(), $client), | array($call->getMethod(), $client), | ||||
$status, | $status, | ||||
$call->getError(), | $call->getError(), | ||||
number_format($call->getDuration()).' us', | number_format($call->getDuration()).' us', | ||||
phabricator_datetime($call->getDateCreated(), $viewer), | phabricator_datetime($call->getDateCreated(), $viewer), | ||||
); | ); | ||||
} | } | ||||
$table = id(new AphrontTableView($rows)) | $table = id(new AphrontTableView($rows)); | ||||
->setDeviceReadyTable(true); | |||||
$table->setHeaders( | $table->setHeaders( | ||||
array( | array( | ||||
'Connection', | pht('Connection'), | ||||
'User', | pht('User'), | ||||
'Method', | pht('Method'), | ||||
'Status', | pht('Status'), | ||||
'Error', | pht('Error'), | ||||
'Duration', | pht('Duration'), | ||||
'Date', | pht('Date'), | ||||
)); | )); | ||||
$table->setColumnClasses( | $table->setColumnClasses( | ||||
array( | array( | ||||
'', | '', | ||||
'', | '', | ||||
'wide', | 'wide', | ||||
'', | '', | ||||
'', | '', | ||||
'n', | 'n', | ||||
'right', | 'right', | ||||
)); | )); | ||||
return $table; | return $table; | ||||
} | } | ||||
} | } |