Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
6dedc0b0
Commit
6dedc0b0
authored
May 22, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #101 from mattweber/issue100
Stringify object within multi-valued fields
parents
030cb2cd
07ccb638
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
common/lib/shared.js
+11
-1
No files found.
common/lib/shared.js
View file @
6dedc0b0
...
@@ -271,7 +271,17 @@ function flatten_json(object,root,array) {
...
@@ -271,7 +271,17 @@ function flatten_json(object,root,array) {
var
rootname
=
root
.
length
==
0
?
index
:
root
+
'.'
+
index
;
var
rootname
=
root
.
length
==
0
?
index
:
root
+
'.'
+
index
;
if
(
typeof
obj
==
'object'
)
{
if
(
typeof
obj
==
'object'
)
{
if
(
_
.
isArray
(
obj
))
{
if
(
_
.
isArray
(
obj
))
{
if
(
obj
.
length
===
1
&&
_
.
isNumber
(
obj
[
0
]))
{
if
(
obj
.
length
>
0
&&
typeof
obj
[
0
]
===
'object'
)
{
var
strval
=
''
;
for
(
var
objidx
=
0
,
objlen
=
obj
.
length
;
objidx
<
objlen
;
objidx
++
)
{
if
(
objidx
>
0
)
{
strval
=
strval
+
', '
;
}
strval
=
strval
+
JSON
.
stringify
(
obj
[
objidx
]);
}
array
[
rootname
]
=
strval
;
}
else
if
(
obj
.
length
===
1
&&
_
.
isNumber
(
obj
[
0
]))
{
array
[
rootname
]
=
parseFloat
(
obj
[
0
]);
array
[
rootname
]
=
parseFloat
(
obj
[
0
]);
}
else
{
}
else
{
array
[
rootname
]
=
typeof
obj
===
'undefined'
?
null
:
obj
.
join
(
','
);
array
[
rootname
]
=
typeof
obj
===
'undefined'
?
null
:
obj
.
join
(
','
);
...
...
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