Commit d6227c77 authored by Leigh Stoller's avatar Leigh Stoller

Resurrect the original images listing page.

1. We want to use this Emulab portal so users can see what images are
   available. Its not quite right for the Cloudlab portal yet, not
   showing it there yet.

2. Default node now is to show just project/system images. The My Disk
   Images link is a separate page that deals with the connection between
   profiles and images. Needs to think about how to combine these, along
   with the Classic images list. Messy.

3. Add to the Storage menu.
parent 6fe708ea
......@@ -130,22 +130,38 @@ while ($row = mysql_fetch_array($query_result)) {
# the user has access to the image. Creator, project, public.
#
$filters = array();
if ($row["creator_idx"] == $target_user->uid_idx()) {
if ($all && $row["creator_idx"] == $target_user->uid_idx()) {
$filters[] = "creator";
}
if (array_key_exists($pid, $projlist)) {
$filters[] = "project";
}
if ($pid == "emulab-ops") {
$filters[] = "system";
if ($all) {
if ($pid == "emulab-ops") {
$filters[] = "system";
}
if ($row["global"] != "0") {
$filters[] = "public";
}
}
if ($row["global"] != "0") {
$filters[] = "public";
else {
if ($pid == "emulab-ops" && $row["global"] != "0") {
$filters[] = "system";
}
# If not in any filters and global, skip.
if (!count($filters) && $row["global"] != "0") {
continue;
}
}
# If none of the filters match, then mark as admin so we can show
# those under a separate checkbox.
if (!count($filters)) {
$filters[] = "admin";
if ($all) {
$filters[] = "admin";
}
else {
continue;
}
}
$blob["imageid"] = $imageid;
......
......@@ -339,7 +339,7 @@ function SPITHEADER($thinheader = 0,
function SPITNAV($hiddenxs, $navbar_status, $navbar_right, $login_uid)
{
global $PORTAL_MANUAL, $APTLOGO, $login_status, $login_user, $TBMAINSITE, $THISHOMEBASE;
global $PORTAL_MANUAL, $APTLOGO, $login_status, $login_user, $TBMAINSITE, $THISHOMEBASE, $ISEMULAB, $ISPNET;
$hiddenxs = "";
echo "
......@@ -400,8 +400,11 @@ echo " <li class='divider'></li>
<li><a href='create-dataset.php'>Create Dataset</a></li>
<li><a href='user-dashboard.php#datasets'>
My Datasets</a></li>
<li><a href='list-images.php'>My Disk Images</a></li>
</ul>
<li><a href='list-images.php'>My Disk Images</a></li>";
if ($ISEMULAB || $ISPNET) {
echo "<li><a href='images.php'>Other Disk Images</a></li>";
}
echo "</ul>
</li>
";
}
......
......@@ -13,15 +13,17 @@
<div class='panel panel-default'>
<div class='panel-body' id="images-div">
<div>
<label class="checkbox-inline">
<input type="checkbox" id="my-images" checked>
<span data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Images you have created'>
My Images
</span>
</label>
<% if (all) { %>
<label class="checkbox-inline">
<input type="checkbox" id="my-images" checked>
<span data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Images you have created'>
My Images
</span>
</label>
<% } %>
<label class="checkbox-inline">
<input type="checkbox" id="project-images" checked>
<span data-toggle='tooltip'
......@@ -40,16 +42,16 @@
System Images
</span>
</label>
<label class="checkbox-inline">
<input type="checkbox" id="public-images" checked>
<span data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Public images created by anyone'>
Public Images
</span>
</label>
<% if (all) { %>
<label class="checkbox-inline">
<input type="checkbox" id="public-images">
<span data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Public images created by anyone'>
Public Images
</span>
</label>
<label class="checkbox-inline">
<input type="checkbox" id="admin-images">
<span data-toggle='tooltip'
......@@ -141,11 +143,19 @@
<div class='modal-body'>
<p>
The images shown on this page are the ones you can use in
your profiles. These include images created by you, system
images created by adminstrators, images created other users
in projects you belong to, and lastly, images that have been
created by users in other projects, that have been marked
public and available for anyone to use.
your profiles.
<% if (all) { %>
These include images created by you, system
images created by adminstrators, images created other users
in projects you belong to, and lastly, images that have been
created by users in other projects, that have been marked
public and available for anyone to use.
<% } else { %>
These include system images created by adminstrators, and
images created other users in projects you belong to. You can
list images created by <b>you</b>, by clicking on the <b>Storage</b>
menu above and selecting <b>My Disk Images</b>.
<% } %>
</p>
<p>
To use an image listed on this page, click on the link icon in the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment