Commit e9be5a3a authored by Leigh Stoller's avatar Leigh Stoller

The set of node type pruned from the list is now specific to the

Portal and MAINSITE and if its the local cluster. Basically, try
not to skip node types for some cases that they are wanted.
parent f39adf6b
......@@ -808,9 +808,14 @@ class Instance
#
# Return a list of types not to show user.
#
function NodeTypePruneList() {
function NodeTypePruneList($aggregate = null) {
global $ISEMULAB, $ISCLOUD, $ISAPT, $ISPNET, $ISPOWDER, $TBMAINSITE;
global $DEFAULT_AGGREGATE_URN;
$aggregate_urn = ($aggregate ? $aggregate->urn() : "");
#
# We never want to show these.
#
$skiptypes = array("dboxvm" => true,
"d430k" => true,
"d530" => true,
......@@ -819,8 +824,15 @@ class Instance
"pc2400hp" => true,
"d2100" => true,
"pc2400w" => true);
if (($ISEMULAB || $ISCLOUD || $ISAPT) && $TBMAINSITE) {
#
# If showing nodes from another cluster, then we show them
# all (not sure how long this rule will last). Otherwise,
# only the Powder/Phantom portals get to see all these types.
#
if ($TBMAINSITE &&
!($ISPOWDER || $ISPNET) &&
$aggregate_urn == $DEFAULT_AGGREGATE_URN) {
$skiptypes["sdr"] = true;
$skiptypes["nuc5300"] = true;
$skiptypes["enodeb"] = true;
......
......@@ -378,10 +378,6 @@ function SPITFORM($formfields, $newuser, $errors)
}
SpitAggregateStatus(true);
echo "<script type='text/plain' id='skiptypes-json'>\n";
echo htmlentities(json_encode(Instance::NodeTypePruneList()));
echo "</script>\n";
SpitOopsModal("oops");
echo "<script type='text/javascript'>\n";
echo " window.PROFILE = '" . $formfields["profile"] . "';\n";
......
......@@ -14,7 +14,6 @@ $(function ()
var fields = null;
var projlist = null;
var amlist = null;
var skiptypes = null;
var isadmin = false;
var editing = false;
var buttonstate = "check";
......@@ -30,7 +29,6 @@ $(function ()
fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
projlist = JSON.parse(_.unescape($('#projects-json')[0].textContent));
amlist = JSON.parse(_.unescape($('#amlist-json')[0].textContent));
skiptypes= JSON.parse(_.unescape($('#skiptypes-json')[0].textContent));
GeneratePageBody(fields);
......@@ -392,7 +390,7 @@ $(function ()
ShowResGraph({"forecast" : json.value.forecast,
"selector" : id,
"skiptypes" : skiptypes,
"skiptypes" : json.value.prunelist,
"click_callback" : function(when, type) {
if (!editing) {
SetCluster(details.nickname, urn);
......
......@@ -12,7 +12,6 @@ $(function ()
var totalsTemplate = _.template(templates["resinfo-totals"]);
var amlist = null;
var isadmin = false;
var skiptypes = null;
function initialize()
{
......@@ -20,7 +19,6 @@ $(function ()
isadmin = window.ISADMIN;
amlist = JSON.parse(_.unescape($('#amlist-json')[0].textContent));
skiptypes= JSON.parse(_.unescape($('#skiptypes-json')[0].textContent));
GeneratePageBody();
......@@ -114,6 +112,7 @@ $(function ()
.removeClass("hidden");
return;
}
var skiptypes = json.value.prunelist;
// Just POWDER
var radiotypes = {"nuc5300" : true,
"nuc6260" : true,
......
......@@ -803,6 +803,10 @@ function Do_ReservationInfo()
# If requesting for a single cluster, return just that.
if (isset($aggregate)) {
$blob = $blob[$aggregate->urn()];
$blob["prunelist"] = Instance::NodeTypePruneList($aggregate);
}
else {
$blob["prunelist"] = Instance::NodeTypePruneList();
}
$webtask->Delete();
SPITAJAX_RESPONSE($blob);
......
......@@ -127,10 +127,6 @@ echo "<script type='text/plain' id='amlist-json'>\n";
echo htmlentities(json_encode($amlist));
echo "</script>\n";
echo "<script type='text/plain' id='skiptypes-json'>\n";
echo htmlentities(json_encode(Instance::NodeTypePruneList()));
echo "</script>\n";
$defaults = array();
$defaults["pid"] = '';
# Default project.
......
<?php
#
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -94,10 +94,6 @@ echo "<script type='text/javascript'>\n";
echo " window.ISADMIN = $isadmin;\n";
echo "</script>\n";
echo "<script type='text/plain' id='skiptypes-json'>\n";
echo htmlentities(json_encode(Instance::NodeTypePruneList()));
echo "</script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
......
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