Commit dc383c72 authored by Leigh Stoller's avatar Leigh Stoller

Merge branch 'master' into 'master'

Grey circles when cluster status is not found

Merge request for issue #167

See merge request !16
parents 4afd72d0 bbc5dea0
......@@ -394,6 +394,10 @@ left: -999em;
background-color: #c9302c;
}
.cluster_picker_status .resource_inactive .circle {
background-color: #ddd;
}
.cluster_picker_status .status_healthy .circle {
border-color: #398439;
}
......@@ -407,6 +411,10 @@ left: -999em;
background-color: #c9302c;
}
.cluster_picker_status .status_inactive .circle {
border-color: #999;
}
.cluster_picker_status .resource_healthy .tooltip.right .tooltip-inner, .cluster_picker_status .status_healthy .tooltip.left .tooltip-inner {
background-color: #398439;
}
......@@ -434,6 +442,24 @@ left: -999em;
border-left-color: #ac2925;
}
.cluster_picker_status .resource_down .tooltip.right .tooltip-inner, .cluster_picker_status .status_down .tooltip.left .tooltip-inner {
background-color: #ac2925;
}
.cluster_picker_status .resource_down .tooltip.right .tooltip-arrow, .cluster_picker_status .status_down .tooltip.left .tooltip-arrow {
border-right-color: #ac2925;
border-left-color: #ac2925;
}
.cluster_picker_status .resource_inactive .tooltip.right .tooltip-inner, .cluster_picker_status .status_inactive .tooltip.left .tooltip-inner {
background-color: #999;
}
.cluster_picker_status .resource_inactive .tooltip.right .tooltip-arrow, .cluster_picker_status .status_inactive .tooltip.left .tooltip-arrow {
border-right-color: #999;
border-left-color: #999;
}
.cluster_picker_status .selected {
background-color: #f5f5f5;
}
......
......@@ -938,18 +938,22 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
_.each(amlist, function(name, key) {
var data = monitor[key];
var rating, classes;
var target = $('#'+which+' .cluster_picker_status .dropdown-menu .enabled a:contains("'+name+'")');
if (data && !$.isEmptyObject(data)) {
// Calculate testbed rating and set up tooltips.
var rating = wt.CalculateRating(data, resourceTypes);
target.parent().attr('data-health', rating[0]).attr('data-rating', rating[1]);
rating = wt.CalculateRating(data, resourceTypes);
classes = wt.AssignStatusClass(rating[0], rating[1]);
}
else {
rating = wt.InactiveRating();
classes = wt.AssignInactiveClass();
}
target.parent().attr('data-health', rating[0]).attr('data-rating', rating[1]);
var classes = wt.AssignStatusClass(rating[0], rating[1]);
target.addClass(classes[0]).addClass(classes[1]);
target.addClass(classes[0]).addClass(classes[1]);
target.append(wt.StatsLineHTML(classes, rating[2]));
}
target.append(wt.StatsLineHTML(classes, rating[2]));
});
var sort = function (a, b) {
......
......@@ -123,6 +123,10 @@ function(_) {
return [health, rating, tooltip];
}
function InactiveRating() {
return [0, 0, ['','Testbed status unavailable']]
}
function AssignStatusClass(health, rating) {
var result = [];
if (health >= 50) {
......@@ -148,6 +152,10 @@ function(_) {
return result;
}
function AssignInactiveClass() {
return ['status_inactive', 'resource_inactive']
}
function StatsLineHTML(classes, title) {
var title1 = '';
if (title[1]) {
......@@ -166,7 +174,9 @@ function(_) {
ClusterStatusHTML: ClusterStatusHTML,
StatusClickEvent: StatusClickEvent,
CalculateRating: CalculateRating,
InactiveRating: InactiveRating,
AssignStatusClass: AssignStatusClass,
AssignInactiveClass: AssignInactiveClass,
StatsLineHTML: StatsLineHTML
};
}
......
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