Skip to content

Commit 09e388a

Browse files
author
OpenShift Bot
authored
Merge pull request #1808 from spadgett/evicted-pods-mini-donut
Merged by openshift-bot
2 parents 8363ad1 + f64773c commit 09e388a

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

app/scripts/directives/podDonut.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ angular.module('openshiftConsole')
2828

2929
$scope.chartId = _.uniqueId('pods-donut-chart-');
3030

31-
function updateCenterText() {
31+
function updatePodCount() {
32+
// Don't show failed pods like evicted pods in the donut.
33+
var pods = _.reject($scope.pods, { status: { phase: 'Failed' } });
34+
var total = _.size(pods);
3235
if ($scope.mini) {
36+
$scope.total = total;
3337
return;
3438
}
39+
3540
var smallText;
36-
// Don't show failed pods like evicted pods in the donut.
37-
var pods = _.reject($scope.pods, { status: { phase: 'Failed' } });
38-
var total = _.size(pods);
3941
if (!angular.isNumber($scope.desired) || $scope.desired === total) {
4042
smallText = (total === 1) ? "pod" : "pods";
4143
} else {
@@ -68,7 +70,7 @@ angular.module('openshiftConsole')
6870
legend: {
6971
show: false
7072
},
71-
onrendered: updateCenterText,
73+
onrendered: updatePodCount,
7274
tooltip: {
7375
format: {
7476
value: function(value, ratio, id) {
@@ -196,7 +198,7 @@ angular.module('openshiftConsole')
196198

197199
var debounceUpdate = _.debounce(updateChart, 350, { maxWait: 500 });
198200
$scope.$watch(countPodPhases, debounceUpdate, true);
199-
$scope.$watchGroup(['desired','idled'], updateCenterText);
201+
$scope.$watchGroup(['desired','idled'], updatePodCount);
200202

201203
$scope.$on('destroy', function() {
202204
if (chart) {

app/views/directives/pod-donut.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<div ng-if="mini" class="donut-mini-text">
44
<span ng-if="!idled">
5-
{{pods | hashSize}}
6-
<span ng-if="(pods | hashSize) === 1">pod</span>
7-
<span ng-if="(pods | hashSize) !== 1">pods</span>
5+
{{total}}
6+
<span ng-if="total === 1">pod</span>
7+
<span ng-if="total !== 1">pods</span>
88
</span>
99
<span ng-if="idled">
1010
Idle

dist/scripts/scripts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11463,14 +11463,14 @@ mini:"=?"
1146311463
templateUrl:"views/directives/pod-donut.html",
1146411464
link:function(a, f) {
1146511465
function h() {
11466-
if (!a.mini) {
11467-
var b, c = _.reject(a.pods, {
11466+
var b = _.reject(a.pods, {
1146811467
status:{
1146911468
phase:"Failed"
1147011469
}
11471-
}), d = _.size(c);
11472-
b = angular.isNumber(a.desired) && a.desired !== d ? "scaling to " + a.desired + "..." :1 === d ? "pod" :"pods", a.idled ? g.updateDonutCenterText(f[0], "Idle") :g.updateDonutCenterText(f[0], d, b);
11473-
}
11470+
}), c = _.size(b);
11471+
if (a.mini) return void (a.total = c);
11472+
var d;
11473+
d = angular.isNumber(a.desired) && a.desired !== c ? "scaling to " + a.desired + "..." :1 === c ? "pod" :"pods", a.idled ? g.updateDonutCenterText(f[0], "Idle") :g.updateDonutCenterText(f[0], c, d);
1147411474
}
1147511475
function i(b) {
1147611476
var c = {

dist/scripts/templates.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8495,9 +8495,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
84958495
"<div ng-attr-id=\"{{chartId}}\" class=\"pod-donut\" ng-class=\"{ mini: mini }\"></div>\n" +
84968496
"<div ng-if=\"mini\" class=\"donut-mini-text\">\n" +
84978497
"<span ng-if=\"!idled\">\n" +
8498-
"{{pods | hashSize}}\n" +
8499-
"<span ng-if=\"(pods | hashSize) === 1\">pod</span>\n" +
8500-
"<span ng-if=\"(pods | hashSize) !== 1\">pods</span>\n" +
8498+
"{{total}}\n" +
8499+
"<span ng-if=\"total === 1\">pod</span>\n" +
8500+
"<span ng-if=\"total !== 1\">pods</span>\n" +
85018501
"</span>\n" +
85028502
"<span ng-if=\"idled\">\n" +
85038503
"Idle\n" +

0 commit comments

Comments
 (0)