Commit 7be35c3f by kevalbhatt

ATLAS-3582: UI: Show comma formatted numbers in System Details "memory panel" of Statistics popup

parent 6d94f39c
...@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
formatIntVal = options.formatIntVal, formatIntVal = options.formatIntVal,
showListCount = options.showListCount || true, showListCount = options.showListCount || true,
highlightString = options.highlightString, highlightString = options.highlightString,
formatStringVal = options.formatStringVal,
numberFormat = options.numberFormat || _.numberFormatWithComa; numberFormat = options.numberFormat || _.numberFormatWithComa;
var table = "", var table = "",
...@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) { if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) {
return numberFormat(val); return numberFormat(val);
} else { } else {
return getHighlightedString(val); var newVal = val;
if (formatStringVal) {
newVal = parseInt(val);
if (newVal === NaN) {
newVal = val;
} else {
newVal = numberFormat(newVal);
}
}
return getHighlightedString(newVal);
} }
} else { } else {
return "N/A"; return "N/A";
......
...@@ -382,6 +382,7 @@ define(['require', ...@@ -382,6 +382,7 @@ define(['require',
if (!_.isEmpty(systemMemoryData)) { if (!_.isEmpty(systemMemoryData)) {
var memoryTable = CommonViewFunction.propertyTable({ var memoryTable = CommonViewFunction.propertyTable({
scope: this, scope: this,
formatStringVal: true,
valueObject: systemMemoryData valueObject: systemMemoryData
}); });
that.ui.memoryCard.html( that.ui.memoryCard.html(
......
...@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
formatIntVal = options.formatIntVal, formatIntVal = options.formatIntVal,
showListCount = options.showListCount || true, showListCount = options.showListCount || true,
highlightString = options.highlightString, highlightString = options.highlightString,
formatStringVal = options.formatStringVal,
numberFormat = options.numberFormat || _.numberFormatWithComa; numberFormat = options.numberFormat || _.numberFormatWithComa;
var table = "", var table = "",
...@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) { if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) {
return numberFormat(val); return numberFormat(val);
} else { } else {
return getHighlightedString(val); var newVal = val;
if (formatStringVal) {
newVal = parseInt(val);
if (newVal === NaN) {
newVal = val;
} else {
newVal = numberFormat(newVal);
}
}
return getHighlightedString(newVal);
} }
} else { } else {
return "N/A"; return "N/A";
......
...@@ -382,6 +382,7 @@ define(['require', ...@@ -382,6 +382,7 @@ define(['require',
if (!_.isEmpty(systemMemoryData)) { if (!_.isEmpty(systemMemoryData)) {
var memoryTable = CommonViewFunction.propertyTable({ var memoryTable = CommonViewFunction.propertyTable({
scope: this, scope: this,
formatStringVal: true,
valueObject: systemMemoryData valueObject: systemMemoryData
}); });
that.ui.memoryCard.html( that.ui.memoryCard.html(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment