mirror of https://github.com/rancher/ui.git
Fix gauge greater 100 and unit
https://github.com/rancher/rancher/issues/19413
This commit is contained in:
parent
2c0e103f34
commit
750e5fc482
|
|
@ -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,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue