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
0c1caf7c
Commit
0c1caf7c
authored
May 15, 2015
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added working error messages to logging and jmx view to prevent such confusion as in #72
parent
cbafd81c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
82 deletions
+106
-82
jmxCtrl.js
...ng-boot-admin-server-ui/app/js/controller/apps/jmxCtrl.js
+8
-15
loggingCtrl.js
...oot-admin-server-ui/app/js/controller/apps/loggingCtrl.js
+10
-15
application.js
spring-boot-admin-server-ui/app/js/service/application.js
+10
-8
applicationJmx.js
spring-boot-admin-server-ui/app/js/service/applicationJmx.js
+2
-2
jolokia.js
spring-boot-admin-server-ui/app/js/service/jolokia.js
+11
-0
apps.html
spring-boot-admin-server-ui/app/views/apps.html
+4
-4
jmx.html
spring-boot-admin-server-ui/app/views/apps/jmx.html
+9
-3
logging.html
spring-boot-admin-server-ui/app/views/apps/logging.html
+52
-35
No files found.
spring-boot-admin-server-ui/app/js/controller/apps/jmxCtrl.js
View file @
0c1caf7c
...
...
@@ -15,17 +15,16 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
$modal
,
$log
,
application
,
ApplicationJMX
)
{
module
.
exports
=
function
(
$scope
,
$modal
,
application
,
ApplicationJMX
)
{
$scope
.
error
=
null
;
$scope
.
domains
=
[];
ApplicationJMX
.
list
(
application
)
.
then
(
function
(
domains
)
{
$scope
.
domains
=
domains
;
})
.
catch
(
function
(
response
)
{
$scope
.
error
=
response
.
error
;
$log
.
error
(
response
.
stacktrace
);
},
function
(
response
)
{
$scope
.
error
=
response
;
$scope
.
errorWhileListing
=
true
;
});
$scope
.
readAllAttr
=
function
(
bean
)
{
...
...
@@ -39,10 +38,8 @@ module.exports = function ($scope, $modal, $log, application, ApplicationJMX) {
bean
.
attributes
[
name
].
jsonValue
=
JSON
.
stringify
(
response
.
value
[
name
],
null
,
' '
);
}
})
.
catch
(
function
(
response
)
{
},
function
(
response
)
{
bean
.
error
=
response
.
error
;
$log
.
error
(
response
.
stacktrace
);
});
};
...
...
@@ -52,7 +49,6 @@ module.exports = function ($scope, $modal, $log, application, ApplicationJMX) {
.
catch
(
function
(
response
)
{
attr
.
error
=
response
.
error
;
$log
.
error
(
response
.
stacktrace
);
});
};
...
...
@@ -65,8 +61,7 @@ module.exports = function ($scope, $modal, $log, application, ApplicationJMX) {
function
(
response
)
{
$scope
.
invocation
.
state
=
'success'
;
$scope
.
invocation
.
result
=
response
.
value
;
})
.
catch
(
function
(
response
)
{
},
function
(
response
)
{
$scope
.
invocation
.
state
=
'error'
;
$scope
.
invocation
.
error
=
response
.
error
;
$scope
.
invocation
.
stacktrace
=
response
.
stacktrace
;
...
...
@@ -97,8 +92,7 @@ module.exports = function ($scope, $modal, $log, application, ApplicationJMX) {
})
.
result
.
then
(
function
(
chosenOp
)
{
$scope
.
prepareInvoke
(
bean
,
name
,
chosenOp
);
})
.
catch
(
function
()
{
},
function
()
{
$scope
.
invocation
=
null
;
});
}
else
{
...
...
@@ -122,8 +116,7 @@ module.exports = function ($scope, $modal, $log, application, ApplicationJMX) {
})
.
result
.
then
(
function
()
{
$scope
.
invoke
();
})
.
catch
(
function
()
{
},
function
()
{
$scope
.
invocation
=
null
;
});
}
...
...
spring-boot-admin-server-ui/app/js/controller/apps/loggingCtrl.js
View file @
0c1caf7c
...
...
@@ -15,27 +15,25 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationLogging
,
$log
)
{
module
.
exports
=
function
(
$scope
,
application
,
ApplicationLogging
)
{
$scope
.
loggers
=
[];
$scope
.
filteredLoggers
=
[];
$scope
.
limit
=
10
;
function
findLogger
(
loggers
,
name
)
{
var
findLogger
=
function
(
loggers
,
name
)
{
for
(
var
i
in
loggers
)
{
if
(
loggers
[
i
].
name
===
name
)
{
return
loggers
[
i
];
}
}
}
}
;
$scope
.
setLogLevel
=
function
(
name
,
level
)
{
ApplicationLogging
.
setLoglevel
(
application
,
name
,
level
)
.
then
(
function
()
{
$scope
.
reload
(
name
);
})
.
catch
(
function
(
response
)
{
$scope
.
error
=
response
.
error
;
$log
.
error
(
response
.
stacktrace
);
},
function
(
response
)
{
$scope
.
error
=
response
;
$scope
.
reload
(
name
);
});
};
...
...
@@ -72,12 +70,10 @@ module.exports = function ($scope, application, ApplicationLogging, $log) {
findLogger
(
$scope
.
loggers
,
name
)
.
level
=
level
;
}
})
.
catch
(
function
(
responses
)
{
},
function
(
responses
)
{
for
(
var
j
in
responses
)
{
if
(
responses
[
j
].
error
!=
null
)
{
$scope
.
error
=
responses
[
j
].
error
;
$log
.
error
(
responses
[
j
].
stacktrace
);
$scope
.
error
=
responses
[
j
];
break
;
}
}
...
...
@@ -101,9 +97,8 @@ module.exports = function ($scope, application, ApplicationLogging, $log) {
$scope
.
$watch
(
'limit'
,
function
()
{
$scope
.
refreshLevels
();
});
})
.
catch
(
function
(
response
)
{
$scope
.
error
=
response
.
error
;
$log
.
error
(
response
.
stacktrace
);
},
function
(
response
)
{
$scope
.
error
=
response
;
$scope
.
errorWhileListing
=
true
;
});
};
spring-boot-admin-server-ui/app/js/service/application.js
View file @
0c1caf7c
...
...
@@ -28,14 +28,16 @@ module.exports = function ($resource, $http) {
var
getCapabilities
=
function
(
application
)
{
application
.
capabilities
=
{};
$http
.
get
(
'api/applications/'
+
application
.
id
+
'/configprops'
).
success
(
function
(
configprops
)
{
application
.
capabilities
.
logfile
=
isEndpointPresent
(
'logfileEndpoint'
,
configprops
);
application
.
capabilities
.
activiti
=
isEndpointPresent
(
'processEngineEndpoint'
,
configprops
);
application
.
capabilities
.
restart
=
isEndpointPresent
(
'restartEndpoint'
,
configprops
);
application
.
capabilities
.
refresh
=
isEndpointPresent
(
'refreshEndpoint'
,
configprops
);
application
.
capabilities
.
pause
=
isEndpointPresent
(
'pauseEndpoint'
,
configprops
);
application
.
capabilities
.
resume
=
isEndpointPresent
(
'resumeEndpoint'
,
configprops
);
});
if
(
application
.
managementUrl
)
{
$http
.
get
(
'api/applications/'
+
application
.
id
+
'/configprops'
).
success
(
function
(
configprops
)
{
application
.
capabilities
.
logfile
=
isEndpointPresent
(
'logfileEndpoint'
,
configprops
);
application
.
capabilities
.
activiti
=
isEndpointPresent
(
'processEngineEndpoint'
,
configprops
);
application
.
capabilities
.
restart
=
isEndpointPresent
(
'restartEndpoint'
,
configprops
);
application
.
capabilities
.
refresh
=
isEndpointPresent
(
'refreshEndpoint'
,
configprops
);
application
.
capabilities
.
pause
=
isEndpointPresent
(
'pauseEndpoint'
,
configprops
);
application
.
capabilities
.
resume
=
isEndpointPresent
(
'resumeEndpoint'
,
configprops
);
});
}
};
var
Application
=
$resource
(
...
...
spring-boot-admin-server-ui/app/js/service/applicationJmx.js
View file @
0c1caf7c
...
...
@@ -15,7 +15,7 @@
*/
'use strict'
;
module
.
exports
=
function
(
$rootScope
,
Abbreviator
,
jolokia
)
{
module
.
exports
=
function
(
$rootScope
,
Abbreviator
,
jolokia
,
$q
)
{
this
.
list
=
function
(
app
)
{
return
jolokia
.
list
(
'api/applications/'
+
app
.
id
+
'/jolokia/'
)
.
then
(
function
(
response
)
{
...
...
@@ -76,7 +76,7 @@ module.exports = function ($rootScope, Abbreviator, jolokia) {
return
domains
;
},
function
(
response
)
{
return
response
;
return
$q
.
reject
(
response
)
;
});
};
...
...
spring-boot-admin-server-ui/app/js/service/jolokia.js
View file @
0c1caf7c
...
...
@@ -15,6 +15,7 @@
*/
'use strict'
;
var
angular
=
require
(
'angular'
);
module
.
exports
=
function
(
$q
)
{
var
outer
=
this
;
var
j4p
=
new
Jolokia
();
...
...
@@ -45,6 +46,13 @@ module.exports = function ($q) {
if
(
responses
.
length
>=
requests
.
length
)
{
deferred
.
reject
(
responses
);
}
},
ajaxError
:
function
(
response
)
{
hasError
=
true
;
responses
.
push
(
angular
.
fromJson
(
response
.
responseText
));
if
(
responses
.
length
>=
requests
.
length
)
{
deferred
.
reject
(
responses
,
response
.
status
);
}
}
});
...
...
@@ -63,6 +71,9 @@ module.exports = function ($q) {
},
error
:
function
(
response
)
{
deferred
.
reject
(
response
);
},
ajaxError
:
function
(
response
)
{
deferred
.
reject
(
angular
.
fromJson
(
response
.
responseText
),
response
.
status
);
}
});
...
...
spring-boot-admin-server-ui/app/views/apps.html
View file @
0c1caf7c
...
...
@@ -17,10 +17,10 @@
<div
class=
"navbar header--application-urls"
>
<div
class=
"navbar-inner"
>
<div
class=
"container-fluid"
>
<ul
class=
"nav"
style=
"width: 100%;"
>
<li
style=
"width: 33%; text-align: center;"
><a
href=
"{{ application.serviceUrl }}"
title=
"Service URL"
><i
class=
"icon-home"
></i>
{{ application.service
Url }}
</a></li>
<li
style=
"width: 33%; text-align: center;"
><a
href=
"{{ application.healthUrl }}"
title=
"Health URL"
><i
class=
"icon-heart"
></i>
{{ application.health
Url }}
</a></li>
<li
style=
"width: 33%;
text-align: center;"
><a
href=
"{{ application.managementUrl }}"
title=
"Management URL"
><i
class=
"icon-wrench"
></i>
{{ application.managementUrl }}
</a></li>
<ul
class=
"nav"
>
<li
ng-if=
"application.healthUrl"
style=
" text-align: center;"
><a
href=
"{{ application.healthUrl }}"
title=
"Health URL"
><i
class=
"icon-heart"
></i>
{{ application.health
Url }}
</a></li>
<li
ng-if=
"application.serviceUrl"
style=
"text-align: center;"
><a
href=
"{{ application.serviceUrl }}"
title=
"Service URL"
><i
class=
"icon-home"
></i>
{{ application.service
Url }}
</a></li>
<li
ng-if=
"application.managementUrl"
style=
"
text-align: center;"
><a
href=
"{{ application.managementUrl }}"
title=
"Management URL"
><i
class=
"icon-wrench"
></i>
{{ application.managementUrl }}
</a></li>
</ul>
</div>
</div>
...
...
spring-boot-admin-server-ui/app/views/apps/jmx.html
View file @
0c1caf7c
<div
class=
"container content"
>
<div
class=
"alert alert-error"
ng-if=
"error"
>
<b>
Error:
</b>
{{ error }}
<div
ng-if=
"errorWhileListing"
>
<p>
To make the JMX section work you need to make the /jolokia-endpoint accessible.
<br/>
Include the jolokia-core.jar in your spring-boot-application:
<pre>
<
dependency
>
<
groupId>org.jolokia
<
/groupId
>
<
artifactId>jolokia-core
<
/artifactId
>
<
/dependency
>
</pre></p>
</div>
<accordion
close-others=
"true"
>
<pre
class=
"alert alert-error"
ng-if=
"error"
><b>
Error:
</b><br/>
{{ error | json }}
</pre>
<accordion
ng-if=
"domains"
close-others=
"true"
>
<accordion-group
ng-repeat=
"domain in domains track by domain.name"
>
<accordion-heading>
<small
class=
"muted"
>
Domain
</small>
{{domain.name}}
...
...
spring-boot-admin-server-ui/app/views/apps/logging.html
View file @
0c1caf7c
<div
class=
"container content"
>
<form
ng-init=
"showPackageLoggers = false"
>
<div
class=
"input-prepend input-append"
>
<button
class=
"btn"
title=
"Show package-level loggers"
ng-class=
"{'btn-inverse': showPackageLoggers}"
ng-model=
"showPackageLoggers"
btn-checkbox
><i
class=
"icon-folder-open"
ng-class=
"{'icon-white': showPackageLoggers}"
></i></button>
<input
placeholder=
"Filter by name ..."
class=
"span10"
type=
"search"
ng-model=
"filterLogger.name"
/>
<button
class=
"btn"
title=
"reload list"
ng-click=
"reload()"
><i
class=
"icon-refresh"
></i></button>
<span
title=
"filtered / total"
class=
"add-on"
>
{{ filteredLoggers.length }}/{{ loggers.length }}
</span>
</div>
</form>
<table
class=
"table table-hover"
>
<tbody>
<tr
ng-repeat=
"logger in (filteredLoggers = (loggers | classNameLoggerOnly:!showPackageLoggers | filter:filterLogger) ) | limitTo: limit track by logger.name"
>
<td>
{{ logger.name }}
<div
class=
"btn-group pull-right"
>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-danger': logger.level== 'TRACE'}"
ng-click=
"setLogLevel(logger.name, 'TRACE')"
>
TRACE
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-warning': logger.level=='DEBUG'}"
ng-click=
"setLogLevel(logger.name, 'DEBUG')"
>
DEBUG
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-info': logger.level=='INFO'}"
ng-click=
"setLogLevel(logger.name, 'INFO')"
>
INFO
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-success': logger.level == 'WARN'}"
ng-click=
"setLogLevel(logger.name, 'WARN')"
>
WARN
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-primary': logger.level == 'ERROR'}"
ng-click=
"setLogLevel(logger.name, 'ERROR')"
>
ERROR
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-inverse': logger.level == 'OFF'}"
ng-click=
"setLogLevel(logger.name, 'OFF')"
>
OFF
</label>
</div>
</td>
</tr>
<tr
ng-show=
"limit < loggers.length"
>
<td>
<button
class=
"btn btn-link btn-block"
ng-click=
"limit = limit + 10"
>
show more
</button>
</td>
</tr>
<tr
ng-show=
"limit < loggers.length"
>
<td>
<button
class=
"btn btn-link btn-block"
ng-click=
"limit = loggers.length"
>
show all
</button>
</td>
</tr>
</tbody>
</table>
<div
ng-if=
"errorWhileListing"
>
<p>
To make the logging section work you need to make the /jolokia-endpoint accessible.
<br/>
Include the jolokia-core.jar in your spring-boot-application:
<pre>
<
dependency
>
<
groupId>org.jolokia
<
/groupId
>
<
artifactId>jolokia-core
<
/artifactId
>
<
/dependency
>
</pre></p>
<p>
Please note that the logging section currently only works with Logback.
<br/>
To make the section work with Logback please activate the JMXConfigurator in your
<b>
logback.xml
</b>
:
<pre>
<
configuration
>
<
include resource="org/springframework/boot/logging/logback/base.xml"/
>
<
jmxConfigurator/
>
<
/configuration
>
</pre></p>
</div>
<pre
class=
"alert alert-error"
ng-if=
"error"
><b>
Error:
</b><br/>
{{ error | json }}
</pre>
<div
ng-show=
"loggers"
>
<form
ng-init=
"showPackageLoggers = false"
>
<div
class=
"input-prepend input-append"
>
<button
class=
"btn"
title=
"Show package-level loggers"
ng-class=
"{'btn-inverse': showPackageLoggers}"
ng-model=
"showPackageLoggers"
btn-checkbox
><i
class=
"icon-folder-open"
ng-class=
"{'icon-white': showPackageLoggers}"
></i></button>
<input
placeholder=
"Filter by name ..."
class=
"span10"
type=
"search"
ng-model=
"filterLogger.name"
/>
<button
class=
"btn"
title=
"reload list"
ng-click=
"reload()"
><i
class=
"icon-refresh"
></i></button>
<span
title=
"filtered / total"
class=
"add-on"
>
{{ filteredLoggers.length }}/{{ loggers.length }}
</span>
</div>
</form>
<table
class=
"table table-hover"
>
<tbody>
<tr
ng-repeat=
"logger in (filteredLoggers = (loggers | classNameLoggerOnly:!showPackageLoggers | filter:filterLogger) ) | limitTo: limit track by logger.name"
>
<td>
{{ logger.name }}
<div
class=
"btn-group pull-right"
>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-danger': logger.level== 'TRACE'}"
ng-click=
"setLogLevel(logger.name, 'TRACE')"
>
TRACE
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-warning': logger.level=='DEBUG'}"
ng-click=
"setLogLevel(logger.name, 'DEBUG')"
>
DEBUG
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-info': logger.level=='INFO'}"
ng-click=
"setLogLevel(logger.name, 'INFO')"
>
INFO
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-success': logger.level == 'WARN'}"
ng-click=
"setLogLevel(logger.name, 'WARN')"
>
WARN
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-primary': logger.level == 'ERROR'}"
ng-click=
"setLogLevel(logger.name, 'ERROR')"
>
ERROR
</label>
<label
class=
"btn btn-small"
ng-class=
"{'active btn-inverse': logger.level == 'OFF'}"
ng-click=
"setLogLevel(logger.name, 'OFF')"
>
OFF
</label>
</div>
</td>
</tr>
<tr
ng-show=
"limit < loggers.length"
>
<td>
<button
class=
"btn btn-link btn-block"
ng-click=
"limit = limit + 10"
>
show more
</button>
</td>
</tr>
<tr
ng-show=
"limit < loggers.length"
>
<td>
<button
class=
"btn btn-link btn-block"
ng-click=
"limit = loggers.length"
>
show all
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
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