Skip to content

Commit

Permalink
tidy up badges so we properly update it when we change the requiremen…
Browse files Browse the repository at this point in the history
…ts and use green if we've enough instances to match requirements #576
  • Loading branch information
jstrachan committed Sep 30, 2013
1 parent 3d9ad67 commit 2058552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -9,8 +9,11 @@
</div>

<div class="active-profile-count" title="The actual number of instances of each profile that are currently running">Count</div>
<div class="active-profile-requirements" title="The required number of instances of each profile">
<a ng-click="editRequirementsDialog.open()">Require</a>
<div class="active-profile-requirements" title="Configure the required number of instances of each profile which are then either created by an auto-scaler or created manually">
<a ng-click="editRequirementsDialog.open()">
<i class="icon-resize-vertical"></i>
Scale
</a>
</div>
</div>
<div class="active-profile-list" ng-repeat="profile in activeProfiles" ng-show="profileMatchesFilter(profile)">
Expand Down
Expand Up @@ -117,7 +117,7 @@ module Fabric {
if (!profile || !profile.count) {
return "badge-important";
} else {
return "badge-warning";
return min <= profile.count ? "badge-success" : "badge-warning";
}
}
return "";
Expand Down Expand Up @@ -404,10 +404,13 @@ module Fabric {
$scope.updateRequirements = (requirements) => {
function onRequirementsSaved(response) {
notification("success", "Updated the requirements");
$scope.updateActiveContainers();
Core.$apply($scope);
};

if (requirements) {
$scope.editRequirementsDialog.close();

var json = JSON.stringify(requirements);
jolokia.execute(Fabric.managerMBean, "requirementsJson",
json, onSuccess(onRequirementsSaved));
Expand Down

0 comments on commit 2058552

Please sign in to comment.