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
74c93941
Commit
74c93941
authored
Oct 13, 2020
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3991: UI: Handlebar helper number format issue
parent
3c0b2746
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
69 additions
and
57 deletions
+69
-57
Helpers.js
dashboardv2/public/js/modules/Helpers.js
+15
-9
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+1
-1
Helper.js
dashboardv2/public/js/utils/Helper.js
+2
-2
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+2
-2
Statistics.js
dashboardv2/public/js/views/site/Statistics.js
+9
-9
Helpers.js
dashboardv3/public/js/modules/Helpers.js
+15
-9
CommonViewFunction.js
dashboardv3/public/js/utils/CommonViewFunction.js
+1
-1
Helper.js
dashboardv3/public/js/utils/Helper.js
+2
-2
SearchLayoutView.js
dashboardv3/public/js/views/search/SearchLayoutView.js
+2
-2
ClassificationTreeLayoutView.js
...blic/js/views/search/tree/ClassificationTreeLayoutView.js
+2
-2
EntityTreeLayoutView.js
...ardv3/public/js/views/search/tree/EntityTreeLayoutView.js
+2
-2
Favorite.js
dashboardv3/public/js/views/site/Favorite.js
+7
-7
Statistics.js
dashboardv3/public/js/views/site/Statistics.js
+9
-9
No files found.
dashboardv2/public/js/modules/Helpers.js
View file @
74c93941
...
@@ -102,29 +102,35 @@ define(['require',
...
@@ -102,29 +102,35 @@ define(['require',
//return options.inverse(this);
//return options.inverse(this);
});
});
Handlebars
.
registerHelper
(
'arithmetic'
,
function
(
val1
,
operator
,
val2
,
options
)
{
Handlebars
.
registerHelper
(
'arithmetic'
,
function
(
val1
,
operator
,
val2
,
commaFormat
,
options
)
{
var
v1
=
parseInt
(
val1
)
||
0
,
var
v1
=
(
val1
&&
parseInt
(
val1
.
toString
().
replace
(
/
\,
/g
,
''
)))
||
0
,
v2
=
parseInt
(
val2
)
||
0
;
v2
=
(
val2
&&
parseInt
(
val2
.
toString
().
replace
(
/
\,
/g
,
''
)))
||
0
,
val
=
null
;
switch
(
operator
)
{
switch
(
operator
)
{
case
'+'
:
case
'+'
:
return
(
v1
+
v2
)
;
val
=
v1
+
v2
;
break
;
break
;
case
'-'
:
case
'-'
:
return
(
v1
-
v2
)
;
val
=
v1
-
v2
;
break
;
break
;
case
'/'
:
case
'/'
:
return
(
v1
/
v2
)
;
val
=
v1
/
v2
;
break
;
break
;
case
'*'
:
case
'*'
:
return
(
v1
*
v2
)
;
val
=
v1
*
v2
;
break
;
break
;
case
'%'
:
case
'%'
:
return
(
v1
%
v2
)
;
val
=
v1
%
v2
;
break
;
break
;
default
:
default
:
return
0
;
val
=
0
;
break
;
break
;
}
}
if
(
commaFormat
===
false
)
{
return
val
;
}
return
_
.
numberFormatWithComma
(
val
);;
});
});
Handlebars
.
registerHelper
(
'lookup'
,
function
(
obj
,
field
,
defaulValue
)
{
Handlebars
.
registerHelper
(
'lookup'
,
function
(
obj
,
field
,
defaulValue
)
{
...
...
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
74c93941
...
@@ -87,7 +87,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -87,7 +87,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
showListCount
=
options
.
showListCount
||
true
,
showListCount
=
options
.
showListCount
||
true
,
highlightString
=
options
.
highlightString
,
highlightString
=
options
.
highlightString
,
formatStringVal
=
options
.
formatStringVal
,
formatStringVal
=
options
.
formatStringVal
,
numberFormat
=
options
.
numberFormat
||
_
.
numberFormatWithComa
;
numberFormat
=
options
.
numberFormat
||
_
.
numberFormatWithCom
m
a
;
var
table
=
""
,
var
table
=
""
,
getHighlightedString
=
function
(
resultStr
)
{
getHighlightedString
=
function
(
resultStr
)
{
...
...
dashboardv2/public/js/utils/Helper.js
View file @
74c93941
...
@@ -23,7 +23,7 @@ define(['require',
...
@@ -23,7 +23,7 @@ define(['require',
],
function
(
require
,
Utils
,
d3
)
{
],
function
(
require
,
Utils
,
d3
)
{
'use strict'
;
'use strict'
;
_
.
mixin
({
_
.
mixin
({
numberFormatWithComa
:
function
(
number
)
{
numberFormatWithCom
m
a
:
function
(
number
)
{
return
d3
.
format
(
','
)(
number
);
return
d3
.
format
(
','
)(
number
);
},
},
numberFormatWithBytes
:
function
(
number
)
{
numberFormatWithBytes
:
function
(
number
)
{
...
@@ -33,7 +33,7 @@ define(['require',
...
@@ -33,7 +33,7 @@ define(['require',
}
}
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
if
(
i
>
8
)
{
if
(
i
>
8
)
{
return
_
.
numberFormatWithComa
(
number
);
return
_
.
numberFormatWithCom
m
a
(
number
);
}
}
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
}
else
{
}
else
{
...
...
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
74c93941
...
@@ -545,7 +545,7 @@ define(['require',
...
@@ -545,7 +545,7 @@ define(['require',
var
name
=
Utils
.
getName
(
model
.
toJSON
(),
'name'
);
var
name
=
Utils
.
getName
(
model
.
toJSON
(),
'name'
);
if
(
model
.
get
(
'category'
)
==
'ENTITY'
&&
(
serviceTypeToBefiltered
&&
serviceTypeToBefiltered
.
length
?
_
.
contains
(
serviceTypeToBefiltered
,
model
.
get
(
'serviceType'
))
:
true
))
{
if
(
model
.
get
(
'category'
)
==
'ENTITY'
&&
(
serviceTypeToBefiltered
&&
serviceTypeToBefiltered
.
length
?
_
.
contains
(
serviceTypeToBefiltered
,
model
.
get
(
'serviceType'
))
:
true
))
{
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
name
]
||
0
)
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
||
0
);
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
name
]
||
0
)
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
||
0
);
typeStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
entityCount
?
"("
+
_
.
numberFormatWithComa
(
entityCount
)
+
")"
:
''
)
+
'</option>'
;
typeStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
entityCount
?
"("
+
_
.
numberFormatWithCom
m
a
(
entityCount
)
+
")"
:
''
)
+
'</option>'
;
}
}
if
(
isTypeOnly
==
undefined
&&
model
.
get
(
'category'
)
==
'CLASSIFICATION'
)
{
if
(
isTypeOnly
==
undefined
&&
model
.
get
(
'category'
)
==
'CLASSIFICATION'
)
{
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
...
@@ -554,7 +554,7 @@ define(['require',
...
@@ -554,7 +554,7 @@ define(['require',
foundNewClassification
=
true
;
foundNewClassification
=
true
;
}
}
}
}
tagStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
tagEntityCount
?
"("
+
_
.
numberFormatWithComa
(
tagEntityCount
)
+
")"
:
''
)
+
'</option>'
;
tagStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
tagEntityCount
?
"("
+
_
.
numberFormatWithCom
m
a
(
tagEntityCount
)
+
")"
:
''
)
+
'</option>'
;
}
}
});
});
...
...
dashboardv2/public/js/views/site/Statistics.js
View file @
74c93941
...
@@ -277,7 +277,7 @@ define(['require',
...
@@ -277,7 +277,7 @@ define(['require',
"type"
:
"classification"
"type"
:
"classification"
})
})
);
);
this
.
ui
.
classification
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithComa
(
tagsCount
)
+
")"
);
this
.
ui
.
classification
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
tagsCount
)
+
")"
);
if
(
tagEntitiesKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
if
(
tagEntitiesKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
this
.
closePanel
({
this
.
closePanel
({
el
:
this
.
ui
.
classification
el
:
this
.
ui
.
classification
...
@@ -310,7 +310,7 @@ define(['require',
...
@@ -310,7 +310,7 @@ define(['require',
if
(
type
==
"shell"
)
{
if
(
type
==
"shell"
)
{
shellEntityCount
+=
intVal
shellEntityCount
+=
intVal
}
}
intVal
=
_
.
numberFormatWithComa
(
intVal
)
intVal
=
_
.
numberFormatWithCom
m
a
(
intVal
)
if
(
stats
[
key
])
{
if
(
stats
[
key
])
{
stats
[
key
][
type
]
=
intVal
;
stats
[
key
][
type
]
=
intVal
;
}
else
{
}
else
{
...
@@ -341,10 +341,10 @@ define(['require',
...
@@ -341,10 +341,10 @@ define(['require',
})),
})),
})
})
);
);
this
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
activeEntityCount
)
+
")"
);
this
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
activeEntityCount
)
+
")"
);
this
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
deletedEntityCount
)
+
")"
);
this
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
deletedEntityCount
)
+
")"
);
this
.
$
(
'[data-id="shellEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
shellEntityCount
)
+
")"
);
this
.
$
(
'[data-id="shellEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
shellEntityCount
)
+
")"
);
this
.
ui
.
entity
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithComa
(
data
.
general
.
entityCount
)
+
")"
);
this
.
ui
.
entity
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
data
.
general
.
entityCount
)
+
")"
);
if
(
statsKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
if
(
statsKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
this
.
closePanel
({
this
.
closePanel
({
el
:
this
.
ui
.
entity
el
:
this
.
ui
.
entity
...
@@ -412,7 +412,7 @@ define(['require',
...
@@ -412,7 +412,7 @@ define(['require',
pickValueFrom
=
argument
.
key
;
pickValueFrom
=
argument
.
key
;
}
}
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
return
returnVal
?
_
.
numberFormatWithComa
(
returnVal
)
:
0
;
return
returnVal
?
_
.
numberFormatWithCom
m
a
(
returnVal
)
:
0
;
}
}
})
})
);
);
...
@@ -493,9 +493,9 @@ define(['require',
...
@@ -493,9 +493,9 @@ define(['require',
}
else
if
(
type
==
'day'
)
{
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
}
else
if
(
type
==
'number'
)
{
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComa
(
value
);
return
_
.
numberFormatWithCom
m
a
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
}
else
if
(
type
==
'millisecond'
)
{
return
_
.
numberFormatWithComa
(
value
)
+
" millisecond/s"
;
return
_
.
numberFormatWithCom
m
a
(
value
)
+
" millisecond/s"
;
}
else
if
(
type
==
"status-html"
)
{
}
else
if
(
type
==
"status-html"
)
{
return
'<span class="connection-status '
+
value
+
'"></span>'
;
return
'<span class="connection-status '
+
value
+
'"></span>'
;
}
else
{
}
else
{
...
...
dashboardv3/public/js/modules/Helpers.js
View file @
74c93941
...
@@ -102,29 +102,35 @@ define(['require',
...
@@ -102,29 +102,35 @@ define(['require',
//return options.inverse(this);
//return options.inverse(this);
});
});
Handlebars
.
registerHelper
(
'arithmetic'
,
function
(
val1
,
operator
,
val2
,
options
)
{
Handlebars
.
registerHelper
(
'arithmetic'
,
function
(
val1
,
operator
,
val2
,
commaFormat
,
options
)
{
var
v1
=
parseInt
(
val1
)
||
0
,
var
v1
=
(
val1
&&
parseInt
(
val1
.
toString
().
replace
(
/
\,
/g
,
''
)))
||
0
,
v2
=
parseInt
(
val2
)
||
0
;
v2
=
(
val2
&&
parseInt
(
val2
.
toString
().
replace
(
/
\,
/g
,
''
)))
||
0
,
val
=
null
;
switch
(
operator
)
{
switch
(
operator
)
{
case
'+'
:
case
'+'
:
return
(
v1
+
v2
)
;
val
=
v1
+
v2
;
break
;
break
;
case
'-'
:
case
'-'
:
return
(
v1
-
v2
)
;
val
=
v1
-
v2
;
break
;
break
;
case
'/'
:
case
'/'
:
return
(
v1
/
v2
)
;
val
=
v1
/
v2
;
break
;
break
;
case
'*'
:
case
'*'
:
return
(
v1
*
v2
)
;
val
=
v1
*
v2
;
break
;
break
;
case
'%'
:
case
'%'
:
return
(
v1
%
v2
)
;
val
=
v1
%
v2
;
break
;
break
;
default
:
default
:
return
0
;
val
=
0
;
break
;
break
;
}
}
if
(
commaFormat
===
false
)
{
return
val
;
}
return
_
.
numberFormatWithComma
(
val
);;
});
});
Handlebars
.
registerHelper
(
'lookup'
,
function
(
obj
,
field
,
defaulValue
)
{
Handlebars
.
registerHelper
(
'lookup'
,
function
(
obj
,
field
,
defaulValue
)
{
...
...
dashboardv3/public/js/utils/CommonViewFunction.js
View file @
74c93941
...
@@ -87,7 +87,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -87,7 +87,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
showListCount
=
options
.
showListCount
||
true
,
showListCount
=
options
.
showListCount
||
true
,
highlightString
=
options
.
highlightString
,
highlightString
=
options
.
highlightString
,
formatStringVal
=
options
.
formatStringVal
,
formatStringVal
=
options
.
formatStringVal
,
numberFormat
=
options
.
numberFormat
||
_
.
numberFormatWithComa
;
numberFormat
=
options
.
numberFormat
||
_
.
numberFormatWithCom
m
a
;
var
table
=
""
,
var
table
=
""
,
getHighlightedString
=
function
(
resultStr
)
{
getHighlightedString
=
function
(
resultStr
)
{
...
...
dashboardv3/public/js/utils/Helper.js
View file @
74c93941
...
@@ -24,7 +24,7 @@ define(['require',
...
@@ -24,7 +24,7 @@ define(['require',
],
function
(
require
,
Utils
,
d3
)
{
],
function
(
require
,
Utils
,
d3
)
{
'use strict'
;
'use strict'
;
_
.
mixin
({
_
.
mixin
({
numberFormatWithComa
:
function
(
number
)
{
numberFormatWithCom
m
a
:
function
(
number
)
{
return
d3
.
format
(
','
)(
number
);
return
d3
.
format
(
','
)(
number
);
},
},
numberFormatWithBytes
:
function
(
number
)
{
numberFormatWithBytes
:
function
(
number
)
{
...
@@ -34,7 +34,7 @@ define(['require',
...
@@ -34,7 +34,7 @@ define(['require',
}
}
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
var
i
=
number
==
0
?
0
:
Math
.
floor
(
Math
.
log
(
number
)
/
Math
.
log
(
1024
));
if
(
i
>
8
)
{
if
(
i
>
8
)
{
return
_
.
numberFormatWithComa
(
number
);
return
_
.
numberFormatWithCom
m
a
(
number
);
}
}
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
return
Number
((
number
/
Math
.
pow
(
1024
,
i
)).
toFixed
(
2
))
+
" "
+
[
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
][
i
];
}
else
{
}
else
{
...
...
dashboardv3/public/js/views/search/SearchLayoutView.js
View file @
74c93941
...
@@ -464,11 +464,11 @@ define(['require',
...
@@ -464,11 +464,11 @@ define(['require',
var
name
=
Utils
.
getName
(
model
.
toJSON
(),
'name'
);
var
name
=
Utils
.
getName
(
model
.
toJSON
(),
'name'
);
if
(
model
.
get
(
'category'
)
==
'ENTITY'
&&
(
serviceTypeToBefiltered
&&
serviceTypeToBefiltered
.
length
?
_
.
contains
(
serviceTypeToBefiltered
,
model
.
get
(
'serviceType'
))
:
true
))
{
if
(
model
.
get
(
'category'
)
==
'ENTITY'
&&
(
serviceTypeToBefiltered
&&
serviceTypeToBefiltered
.
length
?
_
.
contains
(
serviceTypeToBefiltered
,
model
.
get
(
'serviceType'
))
:
true
))
{
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
name
]
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
?
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
:
0
));
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
name
]
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
?
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
:
0
));
typeStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
entityCount
?
"("
+
_
.
numberFormatWithComa
(
entityCount
)
+
")"
:
''
)
+
'</option>'
;
typeStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
entityCount
?
"("
+
_
.
numberFormatWithCom
m
a
(
entityCount
)
+
")"
:
''
)
+
'</option>'
;
}
}
if
(
isTypeOnly
==
undefined
&&
model
.
get
(
'category'
)
==
'CLASSIFICATION'
)
{
if
(
isTypeOnly
==
undefined
&&
model
.
get
(
'category'
)
==
'CLASSIFICATION'
)
{
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
tagStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
tagEntityCount
?
"("
+
_
.
numberFormatWithComa
(
tagEntityCount
)
+
")"
:
''
)
+
'</option>'
;
tagStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
tagEntityCount
?
"("
+
_
.
numberFormatWithCom
m
a
(
tagEntityCount
)
+
")"
:
''
)
+
'</option>'
;
}
}
});
});
if
(
_
.
isUndefined
(
isTypeOnly
))
{
if
(
_
.
isUndefined
(
isTypeOnly
))
{
...
...
dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
View file @
74c93941
...
@@ -443,7 +443,7 @@ define([
...
@@ -443,7 +443,7 @@ define([
name
:
name
name
:
name
});
});
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagname
=
tagEntityCount
?
name
+
" ("
+
_
.
numberFormatWithComa
(
tagEntityCount
)
+
")"
:
name
;
var
tagname
=
tagEntityCount
?
name
+
" ("
+
_
.
numberFormatWithCom
m
a
(
tagEntityCount
)
+
")"
:
name
;
if
(
that
.
options
.
value
)
{
if
(
that
.
options
.
value
)
{
isSelectedChild
=
that
.
options
.
value
.
tag
?
that
.
options
.
value
.
tag
==
name
:
false
;
isSelectedChild
=
that
.
options
.
value
.
tag
?
that
.
options
.
value
.
tag
==
name
:
false
;
...
@@ -486,7 +486,7 @@ define([
...
@@ -486,7 +486,7 @@ define([
var
modelJSON
=
model
.
toJSON
();
var
modelJSON
=
model
.
toJSON
();
var
name
=
modelJSON
.
name
;
var
name
=
modelJSON
.
name
;
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
var
tagname
=
tagEntityCount
?
name
+
" ("
+
_
.
numberFormatWithComa
(
tagEntityCount
)
+
")"
:
name
,
var
tagname
=
tagEntityCount
?
name
+
" ("
+
_
.
numberFormatWithCom
m
a
(
tagEntityCount
)
+
")"
:
name
,
isSelected
=
false
;
isSelected
=
false
;
if
(
that
.
options
.
value
)
{
if
(
that
.
options
.
value
)
{
...
...
dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
View file @
74c93941
...
@@ -320,7 +320,7 @@ define([
...
@@ -320,7 +320,7 @@ define([
var
entityCount
=
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
model
.
get
(
"name"
)]
||
0
)
+
(
that
.
entityCountObj
.
entity
.
entityActive
[
model
.
get
(
"name"
)]
||
0
)
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
model
.
get
(
"name"
)]
||
0
),
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
model
.
get
(
"name"
)]
||
0
),
modelname
=
entityCount
?
model
.
get
(
"name"
)
+
" ("
+
_
.
numberFormatWithComa
(
entityCount
)
+
")"
:
model
.
get
(
"name"
);
modelname
=
entityCount
?
model
.
get
(
"name"
)
+
" ("
+
_
.
numberFormatWithCom
m
a
(
entityCount
)
+
")"
:
model
.
get
(
"name"
);
if
(
that
.
options
.
value
)
{
if
(
that
.
options
.
value
)
{
isSelected
=
that
.
options
.
value
.
type
?
that
.
options
.
value
.
type
==
model
.
get
(
"name"
)
:
false
;
isSelected
=
that
.
options
.
value
.
type
?
that
.
options
.
value
.
type
==
model
.
get
(
"name"
)
:
false
;
if
(
!
that
.
typeId
)
{
if
(
!
that
.
typeId
)
{
...
@@ -416,7 +416,7 @@ define([
...
@@ -416,7 +416,7 @@ define([
var
checkEmptyServiceType
=
false
,
var
checkEmptyServiceType
=
false
,
getParrent
=
data
[
parents
[
i
]],
getParrent
=
data
[
parents
[
i
]],
totalCounter
=
getParrent
.
totalCounter
,
totalCounter
=
getParrent
.
totalCounter
,
textName
=
getParrent
.
totalCounter
?
parents
[
i
]
+
" ("
+
_
.
numberFormatWithComa
(
totalCounter
)
+
")"
:
parents
[
i
],
textName
=
getParrent
.
totalCounter
?
parents
[
i
]
+
" ("
+
_
.
numberFormatWithCom
m
a
(
totalCounter
)
+
")"
:
parents
[
i
],
parent
=
{
parent
=
{
icon
:
"fa fa-folder-o"
,
icon
:
"fa fa-folder-o"
,
type
:
type
,
type
:
type
,
...
...
dashboardv3/public/js/views/site/Favorite.js
View file @
74c93941
...
@@ -126,7 +126,7 @@ define(['require',
...
@@ -126,7 +126,7 @@ define(['require',
}
else
{
}
else
{
deletedEntityCount
+=
intVal
;
deletedEntityCount
+=
intVal
;
}
}
intVal
=
_
.
numberFormatWithComa
(
intVal
)
intVal
=
_
.
numberFormatWithCom
m
a
(
intVal
)
if
(
stats
[
key
])
{
if
(
stats
[
key
])
{
stats
[
key
][
type
]
=
intVal
;
stats
[
key
][
type
]
=
intVal
;
}
else
{
}
else
{
...
@@ -149,9 +149,9 @@ define(['require',
...
@@ -149,9 +149,9 @@ define(['require',
"data"
:
_
.
pick
(
stats
,
(
_
.
keys
(
stats
).
sort
())),
"data"
:
_
.
pick
(
stats
,
(
_
.
keys
(
stats
).
sort
())),
})
})
);
);
that
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
activeEntityCount
)
+
")"
);
that
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
activeEntityCount
)
+
")"
);
that
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
deletedEntityCount
)
+
")"
);
that
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
deletedEntityCount
)
+
")"
);
that
.
ui
.
entityHeader
.
html
(
" ("
+
_
.
numberFormatWithComa
(
data
.
general
.
entityCount
)
+
")"
);
that
.
ui
.
entityHeader
.
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
data
.
general
.
entityCount
)
+
")"
);
}
}
},
},
renderStats
:
function
(
options
)
{
renderStats
:
function
(
options
)
{
...
@@ -214,7 +214,7 @@ define(['require',
...
@@ -214,7 +214,7 @@ define(['require',
pickValueFrom
=
argument
.
key
;
pickValueFrom
=
argument
.
key
;
}
}
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
return
returnVal
?
_
.
numberFormatWithComa
(
returnVal
)
:
0
;
return
returnVal
?
_
.
numberFormatWithCom
m
a
(
returnVal
)
:
0
;
}
}
})
})
);
);
...
@@ -246,9 +246,9 @@ define(['require',
...
@@ -246,9 +246,9 @@ define(['require',
}
else
if
(
type
==
'day'
)
{
}
else
if
(
type
==
'day'
)
{
return
moment
.
tz
(
value
,
moment
.
tz
.
guess
()).
format
(
"MM/DD/YYYY h:mm A z"
);
return
moment
.
tz
(
value
,
moment
.
tz
.
guess
()).
format
(
"MM/DD/YYYY h:mm A z"
);
}
else
if
(
type
==
'number'
)
{
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComa
(
value
);
return
_
.
numberFormatWithCom
m
a
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
}
else
if
(
type
==
'millisecond'
)
{
return
_
.
numberFormatWithComa
(
value
)
+
" millisecond/s"
;
return
_
.
numberFormatWithCom
m
a
(
value
)
+
" millisecond/s"
;
}
else
if
(
type
==
"status-html"
)
{
}
else
if
(
type
==
"status-html"
)
{
return
'<span class="connection-status '
+
value
+
'"></span>'
;
return
'<span class="connection-status '
+
value
+
'"></span>'
;
}
else
{
}
else
{
...
...
dashboardv3/public/js/views/site/Statistics.js
View file @
74c93941
...
@@ -185,7 +185,7 @@ define(['require',
...
@@ -185,7 +185,7 @@ define(['require',
"type"
:
"classification"
"type"
:
"classification"
})
})
);
);
this
.
ui
.
classification
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithComa
(
tagsCount
)
+
")"
);
this
.
ui
.
classification
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
tagsCount
)
+
")"
);
if
(
tagEntitiesKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
if
(
tagEntitiesKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
this
.
closePanel
({
this
.
closePanel
({
el
:
this
.
ui
.
classification
el
:
this
.
ui
.
classification
...
@@ -218,7 +218,7 @@ define(['require',
...
@@ -218,7 +218,7 @@ define(['require',
if
(
type
==
"shell"
)
{
if
(
type
==
"shell"
)
{
shellEntityCount
+=
intVal
shellEntityCount
+=
intVal
}
}
intVal
=
_
.
numberFormatWithComa
(
intVal
)
intVal
=
_
.
numberFormatWithCom
m
a
(
intVal
)
if
(
stats
[
key
])
{
if
(
stats
[
key
])
{
stats
[
key
][
type
]
=
intVal
;
stats
[
key
][
type
]
=
intVal
;
}
else
{
}
else
{
...
@@ -249,10 +249,10 @@ define(['require',
...
@@ -249,10 +249,10 @@ define(['require',
})),
})),
})
})
);
);
this
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
activeEntityCount
)
+
")"
);
this
.
$
(
'[data-id="activeEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
activeEntityCount
)
+
")"
);
this
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
deletedEntityCount
)
+
")"
);
this
.
$
(
'[data-id="deletedEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
deletedEntityCount
)
+
")"
);
this
.
$
(
'[data-id="shellEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithComa
(
shellEntityCount
)
+
")"
);
this
.
$
(
'[data-id="shellEntity"]'
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
shellEntityCount
)
+
")"
);
this
.
ui
.
entity
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithComa
(
data
.
general
.
entityCount
)
+
")"
);
this
.
ui
.
entity
.
find
(
".count"
).
html
(
" ("
+
_
.
numberFormatWithCom
m
a
(
data
.
general
.
entityCount
)
+
")"
);
if
(
statsKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
if
(
statsKeys
.
length
>
this
.
DATA_MAX_LENGTH
)
{
this
.
closePanel
({
this
.
closePanel
({
el
:
this
.
ui
.
entity
el
:
this
.
ui
.
entity
...
@@ -320,7 +320,7 @@ define(['require',
...
@@ -320,7 +320,7 @@ define(['require',
pickValueFrom
=
argument
.
key
;
pickValueFrom
=
argument
.
key
;
}
}
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
var
returnVal
=
data
.
Notification
[
pickValueFrom
];
return
returnVal
?
_
.
numberFormatWithComa
(
returnVal
)
:
0
;
return
returnVal
?
_
.
numberFormatWithCom
m
a
(
returnVal
)
:
0
;
}
}
})
})
);
);
...
@@ -400,9 +400,9 @@ define(['require',
...
@@ -400,9 +400,9 @@ define(['require',
}
else
if
(
type
==
'day'
)
{
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
}
else
if
(
type
==
'number'
)
{
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComa
(
value
);
return
_
.
numberFormatWithCom
m
a
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
}
else
if
(
type
==
'millisecond'
)
{
return
_
.
numberFormatWithComa
(
value
)
+
" millisecond/s"
;
return
_
.
numberFormatWithCom
m
a
(
value
)
+
" millisecond/s"
;
}
else
if
(
type
==
"status-html"
)
{
}
else
if
(
type
==
"status-html"
)
{
return
'<span class="connection-status '
+
value
+
'"></span>'
;
return
'<span class="connection-status '
+
value
+
'"></span>'
;
}
else
{
}
else
{
...
...
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