You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/01/13 06:43:30 UTC
[atlas] branch master updated: ATLAS-3582: UI: Show comma formatted
numbers in System Details "memory panel" of Statistics popup
This is an automated email from the ASF dual-hosted git repository.
kbhatt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 7be35c3 ATLAS-3582: UI: Show comma formatted numbers in System Details "memory panel" of Statistics popup
7be35c3 is described below
commit 7be35c3fff13a6ed9996860c081d9760bfa07e4d
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Mon Jan 13 10:46:28 2020 +0530
ATLAS-3582: UI: Show comma formatted numbers in System Details "memory panel" of Statistics popup
---
dashboardv2/public/js/utils/CommonViewFunction.js | 12 +++++++++++-
dashboardv2/public/js/views/site/Statistics.js | 1 +
dashboardv3/public/js/utils/CommonViewFunction.js | 12 +++++++++++-
dashboardv3/public/js/views/site/Statistics.js | 1 +
4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index a151fa1..facaee7 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
formatIntVal = options.formatIntVal,
showListCount = options.showListCount || true,
highlightString = options.highlightString,
+ formatStringVal = options.formatStringVal,
numberFormat = options.numberFormat || _.numberFormatWithComa;
var table = "",
@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) {
return numberFormat(val);
} 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 {
return "N/A";
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index fcee124..0329e04 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -382,6 +382,7 @@ define(['require',
if (!_.isEmpty(systemMemoryData)) {
var memoryTable = CommonViewFunction.propertyTable({
scope: this,
+ formatStringVal: true,
valueObject: systemMemoryData
});
that.ui.memoryCard.html(
diff --git a/dashboardv3/public/js/utils/CommonViewFunction.js b/dashboardv3/public/js/utils/CommonViewFunction.js
index b2b96ab..c99bbf4 100644
--- a/dashboardv3/public/js/utils/CommonViewFunction.js
+++ b/dashboardv3/public/js/utils/CommonViewFunction.js
@@ -81,6 +81,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
formatIntVal = options.formatIntVal,
showListCount = options.showListCount || true,
highlightString = options.highlightString,
+ formatStringVal = options.formatStringVal,
numberFormat = options.numberFormat || _.numberFormatWithComa;
var table = "",
@@ -102,7 +103,16 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if ((_.isNumber(val) || !_.isNaN(parseInt(val))) && formatIntVal) {
return numberFormat(val);
} 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 {
return "N/A";
diff --git a/dashboardv3/public/js/views/site/Statistics.js b/dashboardv3/public/js/views/site/Statistics.js
index fcee124..0329e04 100644
--- a/dashboardv3/public/js/views/site/Statistics.js
+++ b/dashboardv3/public/js/views/site/Statistics.js
@@ -382,6 +382,7 @@ define(['require',
if (!_.isEmpty(systemMemoryData)) {
var memoryTable = CommonViewFunction.propertyTable({
scope: this,
+ formatStringVal: true,
valueObject: systemMemoryData
});
that.ui.memoryCard.html(