Commit 02e9653b authored by Leigh Stoller's avatar Leigh Stoller

Powder changes; Kill previous commit, move split graphs to resinfo.

parent 3f9799b9
......@@ -46,7 +46,6 @@ $(function ()
var types = null;
var hardware = null;
var resinfo = null;
var graphsdrawn = false;
var currentStep = 0;
var deprecatedList = [];
var mainTemplate = _.template(instantiateString);
......@@ -572,9 +571,6 @@ $(function ()
if (currentIndex == 2) {
SwitchJacks('small');
}
if (currentIndex == 2 && newIndex != 2) {
HideClusterGraphs();
}
if (currentIndex == 0 && selected_uuid == null) {
return false;
}
......@@ -645,9 +641,6 @@ $(function ()
$('#inline_jacks').css('height',
$('#finalize_container').outerHeight() - 15);
}
if (currentIndex == 2) {
ShowClusterGraphs();
}
if (currentIndex < priorIndex) {
// Disable going forward by clicking on the labels
for (var i = cIndex+1; i < $('.steps > ul > li').length; i++) {
......@@ -2185,8 +2178,6 @@ $(function ()
function LoadReservationInfo()
{
InitClusterGraphs();
var callback = function(json) {
if (json.code) {
console.info("Could not get reservation info: " + json.value);
......@@ -2196,7 +2187,6 @@ $(function ()
resinfo = json.value;
ShowClusterReservations();
ShowClusterGraphs();
};
var $xmlthing =
sup.CallServerMethod(null, "reserve", "ReservationInfo", null);
......@@ -2229,108 +2219,6 @@ $(function ()
ga('send', 'event', 'picker', action, id, value);
}
function InitClusterGraphs()
{
// Only the Powder portal for now.
if (!window.ISPOWDER) {
return;
}
// Per clusters rows filled in with templates.
// For POWDER there are two graphs, one for
_.each(amlist, function(details, urn) {
var graphid = "resgraph-" + details.nickname;
$('#' + details.nickname + " .resgraph-panel-radios")
.html(graphTemplate({"details" : details,
"graphid" : graphid + "-radios",
"title" : "Radio",
"urn" : urn,
"showhelp" : true,
"showfullscreen" : false}));
$('#' + details.nickname + " .resgraph-panel-servers")
.html(graphTemplate({"details" : details,
"graphid" : graphid + "-servers",
"title" : "Server",
"urn" : urn,
"showhelp" : true,
"showfullscreen" : false}));
// Handler for the Reservation Graph Help button
$('.resgraph-help-button').click(function (event) {
event.preventDefault();
sup.ShowModal('#resgraph-help-modal');
});
});
}
function ShowClusterGraphs()
{
// Only the Powder portal for now.
if (!window.ISPOWDER) {
return;
}
if (currentStep != 2) {
return;
}
// Make visible, in case we hid it.
// Must be visible to draw graphs.
$('#resgraph-div').removeClass("hidden");
if (graphsdrawn || !resinfo) {
return;
}
var skiptypes = decodejson('#skiptypes-json');
// Per clusters rows filled in with templates.
_.each(amlist, function(details, urn) {
var graphid = 'resgraph-' + details.nickname;
if (! (_.has(resinfo, urn) && resinfo[urn])) {
$('#' + graphid).addClass("hidden");
return;
}
// Kill the spinners
$('#' + details.nickname + ' .resgraph-spinner')
.addClass("hidden");
ShowResGraph({"forecast" : resinfo[urn].forecast,
"selector" : graphid + "-radios",
"foralloc" : true,
"maxdays" : 7,
"showbrush" : false,
"skiptypes" : skiptypes,
"showtypes" : {"nuc5300" : true,
"nuc6260" : true,
"enodeb" : true,
"sdr" : true},
"click_callback" : null});
ShowResGraph({"forecast" : resinfo[urn].forecast,
"selector" : graphid + "-servers",
"foralloc" : true,
"maxdays" : 7,
"showbrush" : false,
"skiptypes" : skiptypes,
"showtypes" : {"d430" : true,
"d710" : true,
"pc3000" : true,
"d820" : true},
"click_callback" : null});
});
graphsdrawn = true;
}
function HideClusterGraphs()
{
// Only the Powder portal for now.
if (!window.ISPOWDER) {
return;
}
// Hide when switching to a different step.
$('#resgraph-div').addClass("hidden");
}
function ClusterSelected(selected, pickered)
{
console.info("ClusterSelected: ", selected);
......
......@@ -51,11 +51,23 @@ $(function ()
$('#' + details.nickname + " .counts-panel")
.html(totalsTemplate({"details" : details,
"urn" : urn}));
$('#' + details.nickname + " .resgraph-panel")
if (window.ISPOWDER) {
$('#' + details.nickname + " .resgraph-panel-radios")
.html(graphTemplate({"details" : details,
"graphid" : graphid + "-radios",
"title" :
details.nickname + " Radio",
"urn" : urn,
"showhelp" : true,
"showfullscreen" : false}));
}
$('#' + details.nickname + " .resgraph-panel-servers")
.html(graphTemplate({"details" : details,
"graphid" : graphid,
"title" : details.nickname,
"graphid" : graphid + "-servers",
"title" :
(!window.ISPOWDER ? details.nickname :
details.nickname + " Server"),
"urn" : urn,
"showhelp" : true,
"showfullscreen" : false}));
......@@ -98,11 +110,36 @@ $(function ()
details.name + ": " + json.value);
return;
}
// Just POWDER
var radiotypes = {"nuc5300" : true,
"nuc6260" : true,
"enodeb" : true,
"sdr" : true};
if (window.ISPOWDER) {
ShowResGraph({"forecast" : json.value.forecast,
"selector" : graphid + "-radios",
"foralloc" : true,
"maxdays" : 14,
"skiptypes" : skiptypes,
"showtypes" : radiotypes,
"click_callback" : null});
}
if (window.ISPOWDER) {
// For the servers panel, do not show the radios.
skiptypes = Object.assign(skiptypes, radiotypes);
}
ShowResGraph({"forecast" : json.value.forecast,
"selector" : graphid,
"selector" : graphid + "-servers",
"foralloc" : true,
"skiptypes" : skiptypes,
"click_callback" : null});
if (window.ISPOWDER) {
// But for the counts panel, we want to show the radios.
for (var type in radiotypes) {
delete skiptypes[type];
}
}
/*
* Fill in the counts panel. The first tuple in the forecast
......
......@@ -398,7 +398,7 @@ echo "
<li><a href='instantiate.php'>Start Experiment</a></li>
<li><a href='manage_profile.php'>Create Experiment Profile</a></li>
<li><a href='reserve.php'>Reserve Nodes</a></li>
<li><a href='resinfo.php'>Cluster Status</a></li>
<li><a href='resinfo.php'>Resource Availability</a></li>
";
echo " <li class='divider'></li>
<li><a href='user-dashboard.php#experiments'>
......
......@@ -447,7 +447,7 @@
</div>
<div id="cluster_status_link"><center>
<a target="_blank" href="resinfo.php">
Check Cluster Status</a></center>
Check Resource Availability</a></center>
</div>
</div>
</div>
......@@ -477,27 +477,6 @@
</form>
</div>
</div>
<% if (amlist) { %>
<div class='col-lg-10 col-lg-offset-1
col-md-10 col-md-offset-1
col-sm-10 col-sm-offset-1
col-xs-12 col-xs-offset-0 hidden'
style="margin-top: 10px;"
id='resgraph-div'>
<% _.each(amlist, function(details, urn) { %>
<div class='row' id='<%- details.nickname %>'>
<div class='col-sm-6 resgraph-panel-radios'
style="padding: 0px;">
<!-- Template goes here -->
</div>
<div class='col-sm-6 resgraph-panel-servers'
style="padding: 0px;">
<!-- Template goes here -->
</div>
</div>
<% }) %>
</div>
<% } %>
</div>
<!-- This is the user verify modal -->
<div id='verify_modal' class='modal fade'
......
......@@ -13,7 +13,7 @@
</center>
</div>
<div class='panel-body panel-body-dashboard'>
<svg style="height: 80%; padding: 0px;"></svg>
<svg style="height: 75%; padding: 0px;"></svg>
</div>
</div>
</div>
......
......@@ -17,12 +17,23 @@
<div>
<% _.each(amlist, function(details, urn) { %>
<div class='row' id='<%- details.nickname %>'>
<div class='col-sm-3 counts-panel'>
<!-- Template goes here -->
</div>
<div class='col-sm-9 resgraph-panel'>
<div class='col-sm-2 counts-panel'>
<!-- Template goes here -->
</div>
<% if (window.ISPOWDER) { %>
<div class='col-sm-5 resgraph-panel-radios'
style="padding: 0px;">
<!-- Template goes here -->
</div>
<div class='col-sm-5 resgraph-panel-servers'
style="padding: 0px;">
<!-- Template goes here -->
</div>
<% } else { %>
<div class='col-sm-10 resgraph-panel-servers'>
<!-- Template goes here -->
</div>
<% } %>
</div>
<% }) %>
<div id='waitwait_div'></div>
......
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