Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
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
openSource
spring-boot-admin
Commits
4b0b99d1
Commit
4b0b99d1
authored
Apr 26, 2017
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve display for multiple MBeans with the same name
closes #439
parent
028054d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
applicationJmx.js
...er-ui/modules/applications-jmx/services/applicationJmx.js
+32
-27
No files found.
spring-boot-admin-server-ui/modules/applications-jmx/services/applicationJmx.js
View file @
4b0b99d1
...
...
@@ -18,11 +18,37 @@
module
.
exports
=
function
(
$rootScope
,
jolokia
,
$q
)
{
'ngInject'
;
function
getBeanName
(
nameProps
)
{
var
name
=
nameProps
.
name
||
nameProps
.
title
||
null
;
var
type
=
nameProps
.
type
||
nameProps
.
j2eetype
||
null
;
var
typeText
=
null
;
if
(
type
)
{
typeText
=
'['
+
type
+
']'
;
}
var
props
=
[];
for
(
var
prop
in
nameProps
)
{
if
(
nameProps
.
hasOwnProperty
(
prop
)
&&
prop
!==
'name'
&&
prop
!==
'title'
&&
prop
!==
'type'
&&
prop
!==
'j2eetype'
)
{
props
.
push
(
prop
+
': '
+
nameProps
[
prop
]);
}
}
var
propText
=
null
;
if
(
props
.
length
>
0
)
{
propText
=
'('
+
props
.
join
(
', '
)
+
')'
;
}
return
[
name
,
typeText
,
propText
].
filter
(
function
(
v
)
{
return
v
!==
null
;
}).
join
(
' '
);
}
this
.
list
=
function
(
app
)
{
return
jolokia
.
list
(
'api/applications/'
+
app
.
id
+
'/jolokia/'
).
then
(
function
(
response
)
{
var
domains
=
[];
for
(
var
rDomainName
in
response
.
value
)
{
if
(
!
response
.
value
.
hasOwnProperty
(
rDomainName
))
{
continue
;
}
var
rDomain
=
response
.
value
[
rDomainName
];
var
domain
=
{
name
:
rDomainName
,
...
...
@@ -30,6 +56,9 @@ module.exports = function ($rootScope, jolokia, $q) {
};
for
(
var
rBeanName
in
rDomain
)
{
if
(
!
rDomain
.
hasOwnProperty
(
rBeanName
))
{
continue
;
}
var
rBean
=
rDomain
[
rBeanName
];
var
bean
=
{
id
:
domain
.
name
+
':'
+
rBeanName
,
...
...
@@ -40,39 +69,15 @@ module.exports = function ($rootScope, jolokia, $q) {
operations
:
rBean
.
op
,
attributes
:
rBean
.
attr
};
var
name
=
''
;
var
type
=
''
;
var
parts
=
rBeanName
.
split
(
','
);
for
(
var
i
=
0
;
i
<
parts
.
length
;
i
++
)
{
var
tokens
=
parts
[
i
].
split
(
'='
);
if
(
tokens
[
0
].
toLowerCase
()
===
'name'
)
{
name
=
tokens
[
1
];
}
else
{
bean
.
nameProps
[
tokens
[
0
]]
=
tokens
[
1
];
if
((
tokens
[
0
].
toLowerCase
()
===
'type'
||
tokens
[
0
]
.
toLowerCase
()
===
'j2eetype'
)
&&
type
.
length
===
0
)
{
type
=
tokens
[
1
];
}
}
bean
.
nameProps
[
tokens
[
0
].
toLowerCase
()]
=
tokens
[
1
];
}
if
(
name
.
length
!==
0
)
{
bean
.
name
=
name
;
}
if
(
type
.
length
!==
0
)
{
if
(
bean
.
name
!==
0
)
{
bean
.
name
+=
' '
;
}
bean
.
name
+=
'['
+
type
+
']'
;
}
if
(
bean
.
name
.
length
===
0
)
{
bean
.
name
=
rBeanName
;
}
bean
.
name
=
getBeanName
(
bean
.
nameProps
);
domain
.
beans
.
push
(
bean
);
}
domains
.
push
(
domain
);
}
...
...
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