Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93474855
PhabricatorDaemonTasksTableView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 01:37
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 01:37 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22644402
Attached To
rPH Phabricator
PhabricatorDaemonTasksTableView.php
View Options
<?php
final
class
PhabricatorDaemonTasksTableView
extends
AphrontView
{
private
$tasks
;
private
$noDataString
;
public
function
setTasks
(
array
$tasks
)
{
$this
->
tasks
=
$tasks
;
return
$this
;
}
public
function
getTasks
()
{
return
$this
->
tasks
;
}
public
function
setNoDataString
(
$no_data_string
)
{
$this
->
noDataString
=
$no_data_string
;
return
$this
;
}
public
function
getNoDataString
()
{
return
$this
->
noDataString
;
}
public
function
render
()
{
$tasks
=
$this
->
getTasks
();
$rows
=
array
();
foreach
(
$tasks
as
$task
)
{
$rows
[]
=
array
(
$task
->
getID
(),
$task
->
getTaskClass
(),
$task
->
getLeaseOwner
(),
$task
->
getLeaseExpires
()
?
phutil_format_relative_time
(
$task
->
getLeaseExpires
()
-
time
())
:
'-'
,
$task
->
getPriority
(),
$task
->
getFailureCount
(),
phutil_tag
(
'a'
,
array
(
'href'
=>
'/daemon/task/'
.
$task
->
getID
().
'/'
,
'class'
=>
'button small button-grey'
,
),
pht
(
'View Task'
)),
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
pht
(
'ID'
),
pht
(
'Class'
),
pht
(
'Owner'
),
pht
(
'Expires'
),
pht
(
'Priority'
),
pht
(
'Failures'
),
''
,
));
$table
->
setColumnClasses
(
array
(
'n'
,
'wide'
,
''
,
''
,
'n'
,
'n'
,
'action'
,
));
if
(
strlen
(
$this
->
getNoDataString
()))
{
$table
->
setNoDataString
(
$this
->
getNoDataString
());
}
return
$table
;
}
}
Event Timeline
Log In to Comment