Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
cca52ad0
Commit
cca52ad0
authored
Jun 08, 2017
by
Leigh B Stoller
Browse files
mysql 5.5 does not do ANY_VALUE, so change to GROUP_CONCAT and print
all slice log urls.
parent
f760f0d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/aptui/profile-activity.php
View file @
cca52ad0
...
...
@@ -58,7 +58,7 @@ $query1_result =
DBQueryFatal
(
"select 1 as active, "
.
" i.uuid,i.profile_version,i.created,'' as destroyed, "
.
" i.creator,p.uuid as profile_uuid,u.email,"
.
"
ANY_VALUE
(ia.public_url), "
.
"
GROUP_CONCAT
(ia.public_url)
as public_urls
, "
.
" i.slice_uuid "
.
" from apt_instances as i "
.
"left join apt_instance_aggregates as ia "
.
...
...
@@ -74,7 +74,7 @@ $query2_result =
DBQueryFatal
(
"select 0 as active, "
.
" h.uuid,h.profile_version,h.created,h.destroyed, "
.
" h.creator,p.uuid as profile_uuid,u.email, "
.
"
ANY_VALUE
(ia.public_url), "
.
"
GROUP_CONCAT
(ia.public_url)
as public_urls
, "
.
" h.slice_uuid "
.
" from apt_instance_history as h "
.
"left join apt_instance_aggregate_history as ia "
.
...
...
@@ -103,7 +103,7 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$destroyed
=
$row
[
"destroyed"
];
$creator
=
$row
[
"creator"
];
$email
=
$row
[
"email"
];
$public_url
=
$row
[
"public_url"
];
$public_url
s
=
$row
[
"public_url
s
"
];
$slice_uuid
=
$row
[
"slice_uuid"
];
# If a guest user, use email instead.
if
(
isset
(
$email
))
{
...
...
@@ -112,10 +112,15 @@ foreach (array($query1_result, $query2_result) as $query_result) {
#
# If the slice is gone, the public url needs to be replaced.
#
if
(
$destroyed
!=
""
&&
preg_match
(
"/publicid=\w*/"
,
$public_url
))
{
$public_url
=
"https://"
.
parse_url
(
$public_url
,
PHP_URL_HOST
)
.
"/showslicelogs.php?slice_uuid="
.
$slice_uuid
;
$tmp
=
array
();
foreach
(
preg_split
(
"/,/"
,
$public_urls
)
as
$url
)
{
if
(
$destroyed
!=
""
&&
preg_match
(
"/publicid=\w*/"
,
$url
))
{
$url
=
"https://"
.
parse_url
(
$url
,
PHP_URL_HOST
)
.
"/showslicelogs.php?slice_uuid="
.
$slice_uuid
;
}
$tmp
[]
=
$url
;
}
$public_urls
=
implode
(
","
,
$tmp
);
$instance
=
array
();
$instance
[
"active"
]
=
intval
(
$active
);
$instance
[
"uuid"
]
=
$uuid
;
...
...
@@ -125,7 +130,7 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$instance
[
"created"
]
=
$created
;
$instance
[
"destroyed"
]
=
$destroyed
;
if
(
ISADMIN
())
{
$instance
[
"public_url"
]
=
$public_url
;
$instance
[
"public_url
s
"
]
=
$public_url
s
;
}
$instances
[]
=
$instance
;
}
...
...
www/aptui/template/profile-activity.html
View file @
cca52ad0
...
...
@@ -31,11 +31,15 @@
<td><
%
-
instance.destroyed
%
></td>
<
%
}
%
>
<
%
if
(
window.ISADMIN
)
{
%
>
<td><a
href=
'<%- instance.public_url %>'
target=
"_blank"
>
<span
class=
"glyphicon glyphicon-link"
></span></a></td>
<td>
<
%
_.each
(
instance.public_urls.split
(","),
function
(
url
)
{
%
>
<a
href=
'<%- url %>'
target=
"_blank"
>
<span
class=
"glyphicon glyphicon-link"
></span></a>
<
%
});
%
>
</td>
<
%
}
%
>
</tr>
<
%
});
%
>
<
%
});
%
>
</tbody>
</table>
</div>
...
...
Write
Preview
Supports
Markdown
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