Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
910aeab6
Commit
910aeab6
authored
Sep 14, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add portal/cluster columns.
parent
5b5cf64c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
7 deletions
+43
-7
www/aptui/activity.php
www/aptui/activity.php
+34
-5
www/aptui/js/activity.js
www/aptui/js/activity.js
+3
-0
www/aptui/template/activity.html
www/aptui/template/activity.html
+6
-2
No files found.
www/aptui/activity.php
View file @
910aeab6
...
...
@@ -33,6 +33,7 @@ $page_title = "My Profiles";
#
$optargs
=
OptionalPageArguments
(
"target_user"
,
PAGEARG_USER
,
"target_project"
,
PAGEARG_PROJECT
,
"portalonly"
,
PAGEARG_BOOLEAN
,
"min"
,
PAGEARG_INTEGER
,
"max"
,
PAGEARG_INTEGER
);
#
...
...
@@ -74,6 +75,15 @@ elseif (isset($target_project)) {
$target_idx
=
$target_project
->
pid_idx
();
$whereclause
=
"where h.pid_idx='
$target_idx
'"
;
}
if
(
isset
(
$portalonly
)
&&
$portalonly
)
{
if
(
$whereclause
!=
""
)
{
$whereclause
=
"
$whereclause
and "
;
}
else
{
$whereclause
=
"where "
;
}
$whereclause
.
=
"servername='
$APTHOST
' "
;
}
# Lets default to last three months if neither min or max provided
if
(
!
(
isset
(
$min
)
||
isset
(
$max
)))
{
$min
=
time
()
-
(
90
*
3600
*
24
);
...
...
@@ -95,23 +105,37 @@ if (isset($min) || isset($max)) {
$whereclause
.
=
"UNIX_TIMESTAMP(h.started) <
$max
"
;
}
}
$portals
=
array
();
if
(
$TBMAINSITE
)
{
$portals
[
"www.aptlab.net"
]
=
"APT"
;
$portals
[
"www.cloudlab.us"
]
=
"Cloud"
;
$portals
[
"www.emulab.net"
]
=
"Emulab"
;
$portals
[
"www.phantomnet.org"
]
=
"Phantom"
;
$portals
[
"www.powderwireless.net"
]
=
"Powder"
;
}
else
{
$portals
[
$APTHOST
]
=
"Emulab"
;
}
$query_result
=
DBQueryFatal
(
"select h.uuid,h.profile_version,h.created, "
.
" h.started,h.destroyed, "
.
" h.started,h.destroyed,
h.servername,
"
.
" h.creator,p.uuid as profile_uuid,h.pid,u.email, "
.
" h.physnode_count,h.virtnode_count,"
.
" h.name as instance_name,p.name as profile_name, "
.
" truncate(h.physnode_count * "
.
" ((UNIX_TIMESTAMP(h.destroyed) - "
.
" UNIX_TIMESTAMP(h.started)) / 3600.0),2) as phours "
.
" UNIX_TIMESTAMP(h.started)) / 3600.0),2) as phours, "
.
" GROUP_CONCAT(aa.abbreviation) as clusters "
.
" from apt_instance_history as h "
.
"left join apt_instance_aggregate_history as ia "
.
" on ia.uuid=h.uuid "
.
"left join apt_aggregates as aa on aa.urn=ia.aggregate_urn "
.
"left join apt_profile_versions as p on "
.
" p.profileid=h.profile_id and "
.
" p.version=h.profile_version "
.
"left join geni.geni_users as u on u.uuid=h.creator_uuid "
.
$whereclause
.
" "
.
"order by h.started desc"
);
"
group by h.uuid
order by h.started desc"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
$message
=
"<b>Oops, there is no activity to show you.</b><br>"
;
...
...
@@ -134,6 +158,8 @@ if (1) {
$pcount
=
$row
[
"physnode_count"
];
$vcount
=
$row
[
"virtnode_count"
];
$phours
=
$row
[
"phours"
];
$portal
=
$portals
[
$row
[
"servername"
]];
$clusters
=
$row
[
"clusters"
];
# Backwards compat.
if
(
!
isset
(
$pproj
))
{
$pproj
=
""
;
...
...
@@ -154,7 +180,7 @@ if (1) {
$instance
=
array
(
$pname
,
$pproj
,
$puuid
,
$pcount
,
$vcount
,
$creator
,
$started
,
$destroyed
,
$phours
,
$iname
,
$uuid
,
$created
);
$uuid
,
$created
,
$portal
,
$clusters
);
$instances
[]
=
$instance
;
}
...
...
@@ -186,6 +212,9 @@ elseif (isset($target_project)) {
else
{
echo
" window.ARG = null;
\n
"
;
}
if
(
isset
(
$portalonly
)
&&
$portalonly
)
{
echo
" window.PORTALONLY = true;
\n
"
;
}
echo
"</script>
\n
"
;
echo
"<script type='text/plain' id='instances-json'>
\n
"
;
echo
json_encode
(
$instances
);
...
...
www/aptui/js/activity.js
View file @
910aeab6
...
...
@@ -45,6 +45,9 @@ $(function () {
url
=
url
+
window
.
ARG
+
"
&
"
;
}
url
=
url
+
"
min=
"
+
min
+
"
&max=
"
+
max
;
if
(
window
.
PORTALONLY
)
{
url
+=
"
&portalonly=1
"
;
}
window
.
location
.
replace
(
url
);
});
...
...
www/aptui/template/activity.html
View file @
910aeab6
...
...
@@ -21,6 +21,8 @@
<th>
Profile
</th>
<th>
Pid
</th>
<th>
Creator
</th>
<th>
Portal
</th>
<th>
Clusters
</th>
<th>
PCs
</th>
<th>
PHours
</th>
<th>
VMs
</th>
...
...
@@ -30,7 +32,7 @@
</tr>
<tr>
<th
class=
'filter-false sorter-false'
>
Totals
</th>
<th
class=
'filter-false sorter-false'
colspan=
3
></th>
<th
class=
'filter-false sorter-false'
colspan=
5
></th>
<th
class=
'filter-false sorter-false'
data-math=
'col-sum'
>
0
</th>
<th
class=
'filter-false sorter-false'
data-math=
'col-sum'
data-math-mask=
'##0'
>
0
</th>
...
...
@@ -43,7 +45,7 @@
<tfoot>
<tr>
<th
class=
'filter-false sorter-false'
>
Totals
</th>
<th
class=
'filter-false sorter-false'
colspan=
3
></th>
<th
class=
'filter-false sorter-false'
colspan=
5
></th>
<th
class=
'filter-false sorter-false'
data-math=
'col-sum'
>
0
</th>
<th
class=
'filter-false sorter-false'
data-math=
'col-sum'
data-math-mask=
'##0'
>
0
</th>
...
...
@@ -69,6 +71,8 @@
<a
href=
'user-dashboard.php?user=<%- instance[5] %>'
>
<
%
-
instance
[5]
%
></a>
</td>
<td><
%
-
instance
[12]
%
></td>
<td><
%
-
instance
[13]
%
></td>
<td><
%
-
instance
[3]
%
></td>
<td><
%
-
instance
[8]
%
></td>
<td><
%
-
instance
[4]
%
></td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment