@@ -11720,48 +11720,48 @@ restrict:"E",
11720
11720
scope:{
11721
11721
pods:"=",
11722
11722
containers:"=",
11723
- compact:"= "
11723
+ profile:"@ "
11724
11724
},
11725
11725
templateUrl:function(a, b) {
11726
- return b.compact ? "views/directives/metrics-compact.html" :"views/directives/deployment-metrics.html";
11726
+ return "compact" === b.profile ? "views/directives/metrics-compact.html" :"views/directives/deployment-metrics.html";
11727
11727
},
11728
11728
link:function(b) {
11729
11729
function d(a) {
11730
11730
return null === a.value || void 0 === a.value;
11731
11731
}
11732
11732
function f(a) {
11733
- var c ;
11734
- c = b.compact ? a.compactDatasetLabel || a.label :"Average Usage";
11735
- var e = {}, f = [ "Date" ], g = [ c ], h = [ f, g ], i = function(a) {
11733
+ var b ;
11734
+ b = w ? a.compactDatasetLabel || a.label :"Average Usage";
11735
+ var c = {}, e = [ "Date" ], f = [ b ], g = [ e, f ], h = function(a) {
11736
11736
var b = "" + a.start;
11737
- return e [b] || (e [b] = {
11737
+ return c [b] || (c [b] = {
11738
11738
total:0,
11739
11739
count:0
11740
- }), e [b];
11740
+ }), c [b];
11741
11741
};
11742
- return _.each(z [a.descriptor], function(a) {
11742
+ return _.each(A [a.descriptor], function(a) {
11743
11743
_.each(a, function(a) {
11744
- var b = i (a);
11745
- (!x || x < a.end) && (x = a.end), d(a) || (b.total += a.value, b.count = b.count + 1);
11744
+ var b = h (a);
11745
+ (!y || y < a.end) && (y = a.end), d(a) || (b.total += a.value, b.count = b.count + 1);
11746
11746
});
11747
- }), _.each(e , function(b, c) {
11747
+ }), _.each(c , function(b, c) {
11748
11748
var d;
11749
- d = b.count ? b.total / b.count :null, f .push(Number(c)), g .push(a.convert ? a.convert(d) :d);
11750
- }), g .length > 1 && (a.lastValue = _.last(g ) || 0), h ;
11749
+ d = b.count ? b.total / b.count :null, e .push(Number(c)), f .push(a.convert ? a.convert(d) :d);
11750
+ }), f .length > 1 && (a.lastValue = _.last(f ) || 0), g ;
11751
11751
}
11752
11752
function i(a, c) {
11753
11753
var e = [], g = {
11754
11754
type:"spline"
11755
11755
};
11756
11756
return b.showAverage ? (_.each(a[c.descriptor], function(a, b) {
11757
11757
p(c.descriptor, b, a);
11758
- }), g.type = "area-spline", b.compact && c.compactType && (g.type = c.compactType), g.x = "Date", g.columns = f(c), g) :(_.each(a[c.descriptor], function(a, b) {
11758
+ }), g.type = "area-spline", w && c.compactType && (g.type = c.compactType), g.x = "Date", g.columns = f(c), g) :(_.each(a[c.descriptor], function(a, b) {
11759
11759
p(c.descriptor, b, a);
11760
11760
var f = b + "-dates";
11761
11761
_.set(g, [ "xs", b ], f);
11762
11762
var h = [ f ], i = [ b ];
11763
- e.push(h), e.push(i), _.each(z [c.descriptor][b], function(a) {
11764
- if (h.push(a.start), (!x || x < a.end) && (x = a.end), d(a)) i.push(a.value); else {
11763
+ e.push(h), e.push(i), _.each(A [c.descriptor][b], function(a) {
11764
+ if (h.push(a.start), (!y || y < a.end) && (y = a.end), d(a)) i.push(a.value); else {
11765
11765
var b = c.convert ? c.convert(a.value) :a.value;
11766
11766
i.push(b);
11767
11767
}
@@ -11771,19 +11771,19 @@ return a[0];
11771
11771
}), g);
11772
11772
}
11773
11773
function j(a) {
11774
- w || (b.loaded = !0, b.showAverage = _.size(b.pods) > 5 || b.compact , _.each(b.metrics, function(c) {
11774
+ x || (b.loaded = !0, b.showAverage = _.size(b.pods) > 5 || w , _.each(b.metrics, function(c) {
11775
11775
var d, e = i(a, c), f = c.descriptor;
11776
- b.compact && c.compactCombineWith && (f = c.compactCombineWith, c.lastValue && (B [f].lastValue = (B [f].lastValue || 0) + c.lastValue)), t[f] ? (t[f].load(e), b.showAverage ? t[f].legend.hide() :t[f].legend.show()) :(d = C (c), d.data = e, t[f] = c3.generate(d));
11776
+ w && c.compactCombineWith && (f = c.compactCombineWith, c.lastValue && (C [f].lastValue = (C [f].lastValue || 0) + c.lastValue)), t[f] ? (t[f].load(e), b.showAverage ? t[f].legend.hide() :t[f].legend.show()) :(d = D (c), d.data = e, t[f] = c3.generate(d));
11777
11777
}));
11778
11778
}
11779
11779
function k() {
11780
- return b.compact ? "-15mn" :"-" + b.options.timeRange.value + "mn";
11780
+ return w ? "-15mn" :"-" + b.options.timeRange.value + "mn";
11781
11781
}
11782
11782
function l() {
11783
11783
return 60 * b.options.timeRange.value * 1e3;
11784
11784
}
11785
11785
function m() {
11786
- return b.compact ? "1mn" :Math.floor(l() / v) + "ms";
11786
+ return w ? "1mn" :Math.floor(l() / v) + "ms";
11787
11787
}
11788
11788
function n() {
11789
11789
var a = _.find(b.pods, "metadata.namespace");
@@ -11794,7 +11794,7 @@ containerName:b.options.selectedContainer.name,
11794
11794
namespace:a.metadata.namespace,
11795
11795
bucketDuration:m()
11796
11796
};
11797
- return x ? c.start = x :c.start = k(), c;
11797
+ return y ? c.start = y :c.start = k(), c;
11798
11798
}
11799
11799
}
11800
11800
function o() {
@@ -11803,10 +11803,10 @@ return a ? (b.loaded = !0, !1) :!b.metricsError;
11803
11803
}
11804
11804
function p(a, c, d) {
11805
11805
b.noData = !1;
11806
- var e = _.initial(d), f = _.get(z , [ a, c ]);
11807
- if (!f) return void _.set(z , [ a, c ], e);
11806
+ var e = _.initial(d), f = _.get(A , [ a, c ]);
11807
+ if (!f) return void _.set(A , [ a, c ], e);
11808
11808
var g = _.takeRight(f.concat(e), v);
11809
- _.set(z , [ a, c ], g);
11809
+ _.set(A , [ a, c ], g);
11810
11810
}
11811
11811
function q(a) {
11812
11812
b.loaded = !0, b.metricsError = {
@@ -11815,15 +11815,15 @@ details:_.get(a, "data.errorMsg") || _.get(a, "statusText") || "Status code " +
11815
11815
};
11816
11816
}
11817
11817
function r() {
11818
- if (!A && o()) {
11819
- y = Date.now();
11818
+ if (!B && o()) {
11819
+ z = Date.now();
11820
11820
var a = n();
11821
11821
h.getPodMetrics(a).then(j, q);
11822
11822
}
11823
11823
}
11824
- var s, t = {}, u = 6e4, v = 30, w = !1;
11824
+ var s, t = {}, u = 6e4, v = 30, w = "compact" === b.profile, x = !1;
11825
11825
b.uniqueID = _.uniqueId("metrics-");
11826
- var x, y, z = {}, A = b.compact ;
11826
+ var y, z, A = {}, B = w ;
11827
11827
b.metrics = [ {
11828
11828
label:"Memory",
11829
11829
units:"MiB",
@@ -11858,7 +11858,7 @@ compactDatasetLabel:"Received",
11858
11858
compactType:"spline",
11859
11859
chartID:"network-rx-" + b.uniqueID
11860
11860
} ];
11861
- var B = _.indexBy(b.metrics, "descriptor");
11861
+ var C = _.indexBy(b.metrics, "descriptor");
11862
11862
b.loaded = !1, b.noData = !0, h.getMetricsURL().then(function(a) {
11863
11863
b.metricsURL = a;
11864
11864
}), b.options = {
@@ -11879,12 +11879,12 @@ label:"Last week",
11879
11879
value:10080
11880
11880
} ]
11881
11881
}, b.options.timeRange = _.head(b.options.rangeOptions), b.options.selectedContainer = _.head(b.containers);
11882
- var C = function(a) {
11882
+ var D = function(a) {
11883
11883
return {
11884
11884
bindto:"#" + a.chartID,
11885
11885
axis:{
11886
11886
x:{
11887
- show:!b.compact ,
11887
+ show:!w ,
11888
11888
type:"timeseries",
11889
11889
padding:{
11890
11890
left:0,
@@ -11896,7 +11896,7 @@ format:"%a %H:%M"
11896
11896
}
11897
11897
},
11898
11898
y:{
11899
- show:!b.compact ,
11899
+ show:!w ,
11900
11900
label:a.units,
11901
11901
min:0,
11902
11902
padding:{
@@ -11912,13 +11912,13 @@ return d3.round(a, 3);
11912
11912
}
11913
11913
},
11914
11914
legend:{
11915
- show:!b.compact && !b.showAverage
11915
+ show:!w && !b.showAverage
11916
11916
},
11917
11917
point:{
11918
11918
show:!1
11919
11919
},
11920
11920
size:{
11921
- height:b.compact ? 35 :175
11921
+ height:w ? 35 :175
11922
11922
},
11923
11923
tooltip:{
11924
11924
format:{
@@ -11932,9 +11932,9 @@ return d3.round(b, 2) + " " + a.units;
11932
11932
b.formatUsage = function(a) {
11933
11933
return a < .01 ? "0" :a < 1 ? d3.format(".1r")(a) :d3.format(".2r")(a);
11934
11934
}, b.$watch("options", function() {
11935
- z = {}, x = null, delete b.metricsError, r();
11935
+ A = {}, y = null, delete b.metricsError, r();
11936
11936
}, !0), s = a(r, u, !1), b.updateInView = function(a) {
11937
- A = !a, a && (!y || Date.now() > y + u) && r();
11937
+ B = !a, a && (!z || Date.now() > z + u) && r();
11938
11938
}, e.$on("metrics.charts.resize", function() {
11939
11939
c(function() {
11940
11940
_.each(t, function(a) {
@@ -11944,7 +11944,7 @@ a.flush();
11944
11944
}), b.$on("$destroy", function() {
11945
11945
s && (a.cancel(s), s = null), angular.forEach(t, function(a) {
11946
11946
a.destroy();
11947
- }), t = null, w = !0;
11947
+ }), t = null, x = !0;
11948
11948
});
11949
11949
}
11950
11950
};
@@ -24421,7 +24421,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
24421
24421
"<div column class=\"overview-tile-details\" ng-if=\"activeReplicationController && !inProgressDeployment\">\n" +
24422
24422
"\n" +
24423
24423
"\n" +
24424
- "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[activeReplicationController.metadata.uid]\" containers=\"activeReplicationController.spec.template.spec.containers\" compact class=\"overview-metrics\">\n" +
24424
+ "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[activeReplicationController.metadata.uid]\" containers=\"activeReplicationController.spec.template.spec.containers\" profile=\" compact\" class=\"overview-metrics\">\n" +
24425
24425
"</deployment-metrics>\n" +
24426
24426
"<pod-template ng-if=\"!showMetrics\" pod-template=\"activeReplicationController.spec.template\"></pod-template>\n" +
24427
24427
"\n" +
@@ -24483,7 +24483,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
24483
24483
"<div column class=\"overview-tile-details\" ng-if=\"latestReplicaSet && !inProgressDeployment\">\n" +
24484
24484
"\n" +
24485
24485
"\n" +
24486
- "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[latestReplicaSet.metadata.uid]\" containers=\"latestReplicaSet.spec.template.spec.containers\" compact class=\"overview-metrics\">\n" +
24486
+ "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[latestReplicaSet.metadata.uid]\" containers=\"latestReplicaSet.spec.template.spec.containers\" profile=\" compact\" class=\"overview-metrics\">\n" +
24487
24487
"</deployment-metrics>\n" +
24488
24488
"<pod-template ng-if=\"!showMetrics\" pod-template=\"latestReplicaSet.spec.template\"></pod-template>\n" +
24489
24489
"\n" +
@@ -24529,7 +24529,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
24529
24529
"</a>\n" +
24530
24530
"</div>\n" +
24531
24531
"<div column class=\"overview-tile-details\">\n" +
24532
- "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"[pod]\" containers=\"pod.spec.containers\" compact class=\"overview-metrics\">\n" +
24532
+ "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"[pod]\" containers=\"pod.spec.containers\" profile=\" compact\" class=\"overview-metrics\">\n" +
24533
24533
"</deployment-metrics>\n" +
24534
24534
"<pod-template ng-if=\"!showMetrics\" pod-template=\"pod\"></pod-template>\n" +
24535
24535
"</div>\n" +
@@ -24720,7 +24720,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
24720
24720
"\n" +
24721
24721
"\n" +
24722
24722
"<div column class=\"overview-tile-details\">\n" +
24723
- "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[set.metadata.uid]\" containers=\"set.spec.template.spec.containers\" compact class=\"overview-metrics\">\n" +
24723
+ "<deployment-metrics ng-if=\"showMetrics && !collapse\" pods=\"podsByOwnerUID[set.metadata.uid]\" containers=\"set.spec.template.spec.containers\" profile=\" compact\" class=\"overview-metrics\">\n" +
24724
24724
"</deployment-metrics>\n" +
24725
24725
"<pod-template ng-if=\"!showMetrics\" pod-template=\"set.spec.template\"></pod-template>\n" +
24726
24726
"</div>\n" +
0 commit comments