Path: blob/master/src/applications/daemon/view/PhabricatorDaemonTasksTableView.php
12256 views
<?php12final class PhabricatorDaemonTasksTableView extends AphrontView {34private $tasks;5private $noDataString;67public function setTasks(array $tasks) {8$this->tasks = $tasks;9return $this;10}1112public function getTasks() {13return $this->tasks;14}1516public function setNoDataString($no_data_string) {17$this->noDataString = $no_data_string;18return $this;19}2021public function getNoDataString() {22return $this->noDataString;23}2425public function render() {26$tasks = $this->getTasks();2728$rows = array();29foreach ($tasks as $task) {30$rows[] = array(31$task->getID(),32$task->getTaskClass(),33$task->getLeaseOwner(),34$task->getLeaseExpires()35? phutil_format_relative_time($task->getLeaseExpires() - time())36: '-',37$task->getPriority(),38$task->getFailureCount(),39phutil_tag(40'a',41array(42'href' => '/daemon/task/'.$task->getID().'/',43'class' => 'button small button-grey',44),45pht('View Task')),46);47}4849$table = new AphrontTableView($rows);50$table->setHeaders(51array(52pht('ID'),53pht('Class'),54pht('Owner'),55pht('Expires'),56pht('Priority'),57pht('Failures'),58'',59));60$table->setColumnClasses(61array(62'n',63'wide',64'',65'',66'n',67'n',68'action',69));7071if (strlen($this->getNoDataString())) {72$table->setNoDataString($this->getNoDataString());73}7475return $table;76}7778}798081