Commit 9165a9c4 authored by Leigh Stoller's avatar Leigh Stoller

Show deprecated images warnings even when there is no cluster selector

(the Emulab Portal).
parent 98e660cc
......@@ -1988,7 +1988,7 @@ $(function ()
"<div class='col-sm-6 alert alert-danger' id='where-nowhere' style='display: none; margin-top: 5px; margin-bottom: 5px'>This profile <b>will not work on any clusters</b>. Please check your profile or parameters for errors. If you are sure they are correct, you can report the problem to support@cloudlab.us and make sure to link to the problematic profile.</div>" +
"<div class='col-sm-4 col-sm-offset-1' style='display: none; margin-top: 5px; margin-bottom: 5px;'><button class='btn btn-default' type='button' data-toggle='collapse' data-target='#nowhere-breakdown' aria-expanded='false' id='nowhere-breakdown-button'>Cluster Compatibility Report</button></div>" +
"<div class='col-sm-12 collapse' id='nowhere-breakdown'></div>"+
"<div class='col-sm-6 alert alert-warning' id='where-deprecated' style='display: none; margin-top: 5px; margin-bottom: 5px'></div>" +
"<div class='col-sm-6 alert alert-warning hidden' id='where-deprecated' style='margin-top: 5px; margin-bottom: 5px'></div>" +
"<div class='col-sm-2 site-wait'><img src='images/spinner.gif' /></div>" +
" </div>" +
"</div>";
......@@ -2027,7 +2027,7 @@ $(function ()
" </div>" +
"<div class='col-sm-4'></div>" +
"<div class='col-sm-6 alert alert-danger' id='where-nowhere' style='display: none; margin-top: 5px; margin-bottom: 5px'>This site <b>will not work on any clusters</b>. All clusters are unselectable.</div>" +
"<div class='col-sm-6 alert alert-warning' id='where-deprecated' style='display: none; margin-top: 5px; margin-bottom: 5px'></div>" +
"<div class='col-sm-6 alert alert-warning hidden' id='where-deprecated' style='margin-top: 5px; margin-bottom: 5px'></div>" +
"<div class='col-sm-2 site-wait'><img src='images/spinner.gif' /></div>" +
" </div>" +
"</div>";
......@@ -2147,6 +2147,9 @@ $(function ()
var mycopy = $.extend(true, {}, json.value);
//console.log('json', mycopy);
updateDeprecated(json.value[0].images)
if (!window.CLUSTERSELECT) {
showDeprecated($('#nocluster-selector'));
}
constraints = new JACKS_LOADER.Constraints(context);
constraints.addPossibles({ images: foundImages });
allowWithSites(json.value[0].images, json.value[0].constraints);
......@@ -2168,6 +2171,30 @@ $(function ()
return true;
}
// Show the deprecated warnings in the proper cluster selector div.
function showDeprecated(domNode)
{
//console.info("showDeprecated:", domNode, deprecatedList);
if (deprecatedList.length === 0) {
domNode.find('#where-deprecated').hide();
}
else {
var current = domNode.find('#where-deprecated');
current.html('');
_.each(deprecatedList, function (item) {
var errorMessage = '';
if (item.deprecated_iserror) {
errorMessage = ': Using this image will cause your ' +
'experiment to fail.';
}
current.append('<p>Image ' + sup.ImageDisplay(item.id) +
' is deprecated: ' + item.deprecated_message +
errorMessage + '</p>');
});
current.removeClass("hidden");
}
}
function updateDeprecated(images)
{
deprecatedList = [];
......@@ -2375,24 +2402,7 @@ $(function ()
domNode.find('#where-warning').hide();
domNode.find('#where-nowhere').hide();
}
if (deprecatedList.length === 0)
{
domNode.find('#where-deprecated').hide();
}
else
{
var current = domNode.find('#where-deprecated');
current.html('');
_.each(deprecatedList, function (item) {
var errorMessage = '';
if (item.deprecated_iserror)
{
errorMessage = ': Using this image will cause your experiment to fail.';
}
current.append('<p>Image ' + sup.ImageDisplay(item.id) + ' is deprecated:' + item.deprecated_message + errorMessage + '</p>');
});
current.show();
}
showDeprecated(domNode);
domNode.find('select').children().each(function () {
var value = $(this).attr('value');
// Skip the Please Select option
......
......@@ -452,8 +452,16 @@
<label id='reservation_text' class='alert-warning col-sm-10 col-sm-offset-1'>Project <span class="reservation_project"></span> has a reservation on this cluster beginning <span class='reservation_start'>start</span>.</label>
</div>
</div>
<% } else { %>
<div id="nocluster-selector">
<div class='col-sm-6 col-sm-offset-4
alert alert-warning hidden'
id='where-deprecated'
style='margin-top: 5px; margin-bottom: 5px'></div>
</div>
<% } %>
<% if (1) { %>
<div style="clear: both">
<h5>
<a href="#advanced_options_dropdown" data-toggle="collapse">
<span class="glyphicon glyphicon-plus-sign pull-left"
......@@ -461,6 +469,7 @@
<span style="font-weight: bold; margin-left: 12px">Advanced Options</span>
</a>
</h5>
</div>
<div id="advanced_options_dropdown"
class="panel-collapse collapse">
<% if (0) { %>
......
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