Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96343143
DrydockLogListView.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
Wed, Dec 25, 15:35
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 27, 15:35 (2 d)
Engine
blob
Format
Raw Data
Handle
23151216
Attached To
rPH Phabricator
DrydockLogListView.php
View Options
<?php
final
class
DrydockLogListView
extends
AphrontView
{
private
$logs
;
public
function
setLogs
(
array
$logs
)
{
assert_instances_of
(
$logs
,
'DrydockLog'
);
$this
->
logs
=
$logs
;
return
$this
;
}
public
function
render
()
{
$logs
=
$this
->
logs
;
$viewer
=
$this
->
getUser
();
$view
=
new
PHUIObjectItemListView
();
$rows
=
array
();
foreach
(
$logs
as
$log
)
{
$resource_uri
=
'/drydock/resource/'
.
$log
->
getResourceID
().
'/'
;
$lease_uri
=
'/drydock/lease/'
.
$log
->
getLeaseID
().
'/'
;
$resource_name
=
$log
->
getResourceID
();
if
(
$log
->
getResourceID
()
!==
null
)
{
$resource_name
=
$log
->
getResource
()->
getName
();
}
$rows
[]
=
array
(
phutil_tag
(
'a'
,
array
(
'href'
=>
$resource_uri
,
),
$resource_name
),
phutil_tag
(
'a'
,
array
(
'href'
=>
$lease_uri
,
),
$log
->
getLeaseID
()),
$log
->
getMessage
(),
phabricator_datetime
(
$log
->
getEpoch
(),
$viewer
),
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setDeviceReadyTable
(
true
);
$table
->
setHeaders
(
array
(
pht
(
'Resource'
),
pht
(
'Lease'
),
pht
(
'Message'
),
pht
(
'Date'
),
));
$table
->
setShortHeaders
(
array
(
pht
(
'R'
),
pht
(
'L'
),
pht
(
'Message'
),
''
,
));
$table
->
setColumnClasses
(
array
(
''
,
''
,
'wide'
,
''
,
));
return
$table
;
}
}
Event Timeline
Log In to Comment