Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
2dd41162
Commit
2dd41162
authored
5 years ago
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3795:- UI: statistics Memory Section should have suffix like Bytes /KB /MB
parent
2228d752
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
+32
-2
Helper.js
dashboardv2/public/js/utils/Helper.js
+14
-0
Statistics.js
dashboardv2/public/js/views/site/Statistics.js
+2
-1
Helper.js
dashboardv3/public/js/utils/Helper.js
+14
-0
Statistics.js
dashboardv3/public/js/views/site/Statistics.js
+2
-1
No files found.
dashboardv2/public/js/utils/Helper.js
View file @
2dd41162
...
...
@@ -26,6 +26,20 @@ define(['require',
numberFormatWithComa
:
function
(
number
)
{
return
d3
.
format
(
','
)(
number
);
},
numberFormatWithBytes
:
function
(
number
)
{
if
(
number
>
-
1
)
{
if
(
number
===
0
)
{
return
"0 Bytes"
;
}
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
if
(
i
>
8
)
{
return
_
.
numberFormatWithComa
(
number
);
}
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
}
else
{
return
number
;
}
},
isEmptyArray
:
function
(
val
)
{
if
(
val
&&
_
.
isArray
(
val
))
{
return
_
.
isEmpty
(
val
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/site/Statistics.js
View file @
2dd41162
...
...
@@ -477,7 +477,8 @@ define(['require',
var
memoryTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
formatStringVal
:
true
,
valueObject
:
systemMemoryData
valueObject
:
systemMemoryData
,
numberFormat
:
_
.
numberFormatWithBytes
});
that
.
ui
.
memoryCard
.
html
(
memoryTable
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/Helper.js
View file @
2dd41162
...
...
@@ -27,6 +27,20 @@ define(['require',
numberFormatWithComa
:
function
(
number
)
{
return
d3
.
format
(
','
)(
number
);
},
numberFormatWithBytes
:
function
(
number
)
{
if
(
number
>
-
1
)
{
if
(
number
===
0
)
{
return
"0 Bytes"
;
}
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
if
(
i
>
8
)
{
return
_
.
numberFormatWithComa
(
number
);
}
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
}
else
{
return
number
;
}
},
isEmptyArray
:
function
(
val
)
{
if
(
val
&&
_
.
isArray
(
val
))
{
return
_
.
isEmpty
(
val
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/site/Statistics.js
View file @
2dd41162
...
...
@@ -384,7 +384,8 @@ define(['require',
var
memoryTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
formatStringVal
:
true
,
valueObject
:
systemMemoryData
valueObject
:
systemMemoryData
,
numberFormat
:
_
.
numberFormatWithBytes
});
that
.
ui
.
memoryCard
.
html
(
memoryTable
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment