diff --git a/lib/monitoring/addon/components/nodes-reservation/component.js b/lib/monitoring/addon/components/nodes-reservation/component.js index 372f56cff..38aaf9a5a 100644 --- a/lib/monitoring/addon/components/nodes-reservation/component.js +++ b/lib/monitoring/addon/components/nodes-reservation/component.js @@ -25,8 +25,8 @@ export default Component.extend({ podUsage: computed('nodes.@each.{allocatable,requested}', 'intl.locale', function() { return this.getGauge('pods', - (u, t) => formatSi(u, 1000, '', '', 0, exponentNeeded(t), 1).replace(/\s.*$/, ''), - (t) => formatSi(t, 1000, '', '', 0, exponentNeeded(t), 1), 'used', + (u, t) => formatSi(u, 1000, '', '', 0, exponentNeeded(Math.max(u, t)), 1).replace(/\s.*$/, ''), + (t, u) => formatSi(t, 1000, '', '', 0, exponentNeeded(Math.max(u, t)), 1), 'used', ); }), @@ -124,7 +124,7 @@ export default Component.extend({ return this.get('intl').t(`clusterDashboard.subtitle.${ keyword }`, { used: usedCb ? (usedCb(used, total) || '').trim() : used, - total: totalCb ? (totalCb(total) || '').trim() : total, + total: totalCb ? (totalCb(total, used) || '').trim() : total, }); }, }); diff --git a/lib/shared/addon/utils/percent-gauge.js b/lib/shared/addon/utils/percent-gauge.js index 8596097bb..788a2b8b7 100644 --- a/lib/shared/addon/utils/percent-gauge.js +++ b/lib/shared/addon/utils/percent-gauge.js @@ -74,7 +74,7 @@ function repaintTicks(svg, tooltip, width, height, margin, ticks, value, thickne function repaintArc(width, margin, value, thickness, valuePath, maxPath) { const r = calcR(width, margin); - valuePath.attr('d', createArc(-135, value, r, thickness)) + valuePath.attr('d', createArc(-135, Math.min(value, 100), r, thickness)) .attr('transform', `translate(${ margin + r },${ margin + r }), scale(1, 1)`); maxPath.attr('d', createArc(-135, 100, r, thickness))