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
a3152233
Commit
a3152233
authored
Feb 25, 2015
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Streamlined Rest-Endpoints and Restructured ngServices and -Resources
parent
340078ef
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
146 additions
and
233 deletions
+146
-233
app.js
spring-boot-admin-server-ui/app/js/app.js
+1
-1
classpathCtrl.js
...server-ui/app/js/controller/apps/details/classpathCtrl.js
+2
-2
envCtrl.js
...admin-server-ui/app/js/controller/apps/details/envCtrl.js
+3
-2
metricsCtrl.js
...n-server-ui/app/js/controller/apps/details/metricsCtrl.js
+2
-2
propsCtrl.js
...min-server-ui/app/js/controller/apps/details/propsCtrl.js
+3
-2
detailsCtrl.js
...oot-admin-server-ui/app/js/controller/apps/detailsCtrl.js
+4
-4
jmxCtrl.js
...ng-boot-admin-server-ui/app/js/controller/apps/jmxCtrl.js
+0
-0
loggingCtrl.js
...oot-admin-server-ui/app/js/controller/apps/loggingCtrl.js
+0
-0
threadsCtrl.js
...oot-admin-server-ui/app/js/controller/apps/threadsCtrl.js
+2
-2
traceCtrl.js
...-boot-admin-server-ui/app/js/controller/apps/traceCtrl.js
+2
-2
index.js
spring-boot-admin-server-ui/app/js/controller/index.js
+9
-9
overviewCtrl.js
...ng-boot-admin-server-ui/app/js/controller/overviewCtrl.js
+48
-15
humanBytes.js
spring-boot-admin-server-ui/app/js/filter/humanBytes.js
+1
-1
application.js
spring-boot-admin-server-ui/app/js/service/application.js
+44
-9
applicationDetails.js
...boot-admin-server-ui/app/js/service/applicationDetails.js
+0
-34
applicationOverview.js
...oot-admin-server-ui/app/js/service/applicationOverview.js
+0
-54
applicationThreads.js
...boot-admin-server-ui/app/js/service/applicationThreads.js
+0
-22
applicationTrace.js
...g-boot-admin-server-ui/app/js/service/applicationTrace.js
+0
-22
applications.js
spring-boot-admin-server-ui/app/js/service/applications.js
+0
-26
index.js
spring-boot-admin-server-ui/app/js/service/index.js
+0
-5
gulpfile.js
spring-boot-admin-server-ui/gulpfile.js
+4
-0
RegistryController.java
...codecentric/boot/admin/controller/RegistryController.java
+20
-17
AdminApplicationHazelcastTest.java
...codecentric/boot/admin/AdminApplicationHazelcastTest.java
+1
-2
No files found.
spring-boot-admin-server-ui/app/js/app.js
View file @
a3152233
...
...
@@ -61,7 +61,7 @@ springBootAdmin.config(function ($stateProvider, $urlRouterProvider) {
templateUrl
:
'views/apps.html'
,
resolve
:
{
application
:
function
(
$stateParams
,
Application
)
{
return
Application
.
query
({
return
Application
.
get
({
id
:
$stateParams
.
id
})
.
$promise
;
...
...
spring-boot-admin-server-ui/app/js/controller/
detailsC
lasspathCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/details/c
lasspathCtrl.js
View file @
a3152233
...
...
@@ -15,9 +15,9 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationDetails
)
{
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
application
=
application
;
ApplicationDetails
.
getEnv
(
application
)
application
.
getEnv
(
)
.
success
(
function
(
env
)
{
var
separator
=
env
.
systemProperties
[
'path.separator'
];
$scope
.
classpath
=
env
.
systemProperties
[
'java.class.path'
].
split
(
separator
);
...
...
spring-boot-admin-server-ui/app/js/controller/
detailsE
nvCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/details/e
nvCtrl.js
View file @
a3152233
...
...
@@ -15,9 +15,10 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationDetails
)
{
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
application
=
application
;
ApplicationDetails
.
getEnv
(
application
)
application
.
getEnv
(
application
)
.
success
(
function
(
env
)
{
$scope
.
env
=
env
;
})
...
...
spring-boot-admin-server-ui/app/js/controller/
detailsM
etricsCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/details/m
etricsCtrl.js
View file @
a3152233
...
...
@@ -15,14 +15,14 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
A
pplicationDetails
,
A
bbreviator
,
MetricsHelper
)
{
module
.
exports
=
function
(
$scope
,
application
,
Abbreviator
,
MetricsHelper
)
{
$scope
.
counters
=
[];
$scope
.
countersMax
=
0
;
$scope
.
gauges
=
[];
$scope
.
gaugesMax
=
0
;
$scope
.
showRichGauges
=
false
;
ApplicationDetails
.
getMetrics
(
application
)
application
.
getMetrics
(
)
.
success
(
function
(
metrics
)
{
function
merge
(
array
,
obj
)
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
...
...
spring-boot-admin-server-ui/app/js/controller/
detailsP
ropsCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/details/p
ropsCtrl.js
View file @
a3152233
...
...
@@ -15,9 +15,10 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationDetails
)
{
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
application
=
application
;
ApplicationDetails
.
getEnv
(
application
)
application
.
getEnv
()
.
success
(
function
(
env
)
{
$scope
.
props
=
[];
for
(
var
attr
in
env
)
{
...
...
spring-boot-admin-server-ui/app/js/controller/detailsCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/
detailsCtrl.js
View file @
a3152233
...
...
@@ -15,7 +15,7 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
$interval
,
application
,
ApplicationDetails
,
MetricsHelper
)
{
module
.
exports
=
function
(
$scope
,
$interval
,
application
,
MetricsHelper
)
{
$scope
.
application
=
application
;
var
start
=
Date
.
now
();
...
...
@@ -23,7 +23,7 @@ module.exports = function ($scope, $interval, application, ApplicationDetails, M
$scope
.
ticks
=
Date
.
now
()
-
start
;
},
1000
);
ApplicationDetails
.
getInfo
(
application
)
application
.
getInfo
(
)
.
success
(
function
(
info
)
{
$scope
.
info
=
info
;
})
...
...
@@ -31,7 +31,7 @@ module.exports = function ($scope, $interval, application, ApplicationDetails, M
$scope
.
error
=
error
;
});
ApplicationDetails
.
getHealth
(
application
)
application
.
getHealth
(
)
.
success
(
function
(
health
)
{
$scope
.
health
=
health
;
})
...
...
@@ -39,7 +39,7 @@ module.exports = function ($scope, $interval, application, ApplicationDetails, M
$scope
.
health
=
health
;
});
ApplicationDetails
.
getMetrics
(
application
)
application
.
getMetrics
(
)
.
success
(
function
(
metrics
)
{
$scope
.
metrics
=
metrics
;
$scope
.
metrics
[
'mem.used'
]
=
$scope
.
metrics
.
mem
-
$scope
.
metrics
[
'mem.free'
];
...
...
spring-boot-admin-server-ui/app/js/controller/jmxCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/
jmxCtrl.js
View file @
a3152233
File moved
spring-boot-admin-server-ui/app/js/controller/loggingCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/
loggingCtrl.js
View file @
a3152233
File moved
spring-boot-admin-server-ui/app/js/controller/threadsCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/
threadsCtrl.js
View file @
a3152233
...
...
@@ -15,9 +15,9 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationThreads
)
{
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
dumpThreads
=
function
()
{
ApplicationThreads
.
getDump
(
application
)
application
.
getThreadDump
(
)
.
success
(
function
(
dump
)
{
$scope
.
dump
=
dump
;
...
...
spring-boot-admin-server-ui/app/js/controller/traceCtrl.js
→
spring-boot-admin-server-ui/app/js/controller/
apps/
traceCtrl.js
View file @
a3152233
...
...
@@ -15,14 +15,14 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
application
,
ApplicationTrace
,
$interval
)
{
module
.
exports
=
function
(
$scope
,
application
,
$interval
)
{
$scope
.
lastTraceTime
=
0
;
$scope
.
traces
=
[];
$scope
.
refresher
=
null
;
$scope
.
refreshInterval
=
5
;
$scope
.
refresh
=
function
()
{
ApplicationTrace
.
getTraces
(
application
)
application
.
getTraces
(
)
.
success
(
function
(
traces
)
{
for
(
var
i
=
0
;
i
<
traces
.
length
;
i
++
)
{
if
(
traces
[
i
].
timestamp
>
$scope
.
lastTraceTime
)
{
...
...
spring-boot-admin-server-ui/app/js/controller/index.js
View file @
a3152233
...
...
@@ -5,12 +5,12 @@ var springBootAdmin = angular.module('springBootAdmin');
springBootAdmin
.
controller
(
'overviewCtrl'
,
require
(
'./overviewCtrl'
));
springBootAdmin
.
controller
(
'appsCtrl'
,
require
(
'./appsCtrl'
));
springBootAdmin
.
controller
(
'detailsCtrl'
,
require
(
'./detailsCtrl'
));
springBootAdmin
.
controller
(
'detailsMetricsCtrl'
,
require
(
'./
detailsM
etricsCtrl'
));
springBootAdmin
.
controller
(
'detailsEnvCtrl'
,
require
(
'./
detailsE
nvCtrl'
));
springBootAdmin
.
controller
(
'detailsPropsCtrl'
,
require
(
'./
detailsP
ropsCtrl'
));
springBootAdmin
.
controller
(
'detailsClasspathCtrl'
,
require
(
'./
detailsC
lasspathCtrl'
));
springBootAdmin
.
controller
(
'loggingCtrl'
,
require
(
'./loggingCtrl'
));
springBootAdmin
.
controller
(
'jmxCtrl'
,
require
(
'./jmxCtrl'
));
springBootAdmin
.
controller
(
'threadsCtrl'
,
require
(
'./threadsCtrl'
));
springBootAdmin
.
controller
(
'traceCtrl'
,
require
(
'./traceCtrl'
));
springBootAdmin
.
controller
(
'detailsCtrl'
,
require
(
'./
apps/
detailsCtrl'
));
springBootAdmin
.
controller
(
'detailsMetricsCtrl'
,
require
(
'./
apps/details/m
etricsCtrl'
));
springBootAdmin
.
controller
(
'detailsEnvCtrl'
,
require
(
'./
apps/details/e
nvCtrl'
));
springBootAdmin
.
controller
(
'detailsPropsCtrl'
,
require
(
'./
apps/details/p
ropsCtrl'
));
springBootAdmin
.
controller
(
'detailsClasspathCtrl'
,
require
(
'./
apps/details/c
lasspathCtrl'
));
springBootAdmin
.
controller
(
'loggingCtrl'
,
require
(
'./
apps/
loggingCtrl'
));
springBootAdmin
.
controller
(
'jmxCtrl'
,
require
(
'./
apps/
jmxCtrl'
));
springBootAdmin
.
controller
(
'threadsCtrl'
,
require
(
'./
apps/
threadsCtrl'
));
springBootAdmin
.
controller
(
'traceCtrl'
,
require
(
'./
apps/
traceCtrl'
));
spring-boot-admin-server-ui/app/js/controller/overviewCtrl.js
View file @
a3152233
...
...
@@ -15,10 +15,45 @@
*/
'use strict'
;
module
.
exports
=
function
(
$scope
,
$location
,
$interval
,
$q
,
Applications
,
ApplicationOverview
,
Application
)
{
module
.
exports
=
function
(
$scope
,
$location
,
$interval
,
$q
,
Application
)
{
var
getInfo
=
function
(
app
)
{
return
app
.
getInfo
()
.
success
(
function
(
response
)
{
app
.
version
=
response
.
version
;
delete
response
.
version
;
app
.
info
=
response
;
})
.
error
(
function
()
{
app
.
version
=
'---'
;
});
};
var
getHealth
=
function
(
app
)
{
return
app
.
getHealth
()
.
success
(
function
(
response
)
{
app
.
status
=
response
.
status
;
})
.
error
(
function
(
response
,
httpStatus
)
{
if
(
httpStatus
===
503
)
{
app
.
status
=
response
.
status
;
}
else
if
(
httpStatus
===
404
||
httpStatus
===
0
)
{
app
.
status
=
'OFFLINE'
;
}
else
{
app
.
status
=
'UNKNOWN'
;
}
});
};
var
getLogfile
=
function
(
app
)
{
return
app
.
hasLogfile
()
.
success
(
function
()
{
app
.
providesLogfile
=
true
;
})
.
error
(
function
()
{
app
.
providesLogfile
=
false
;
});
};
$scope
.
loadData
=
function
()
{
Application
s
.
query
(
function
(
applications
)
{
Application
.
query
(
function
(
applications
)
{
function
refresh
(
app
)
{
//find application in known applications and copy state --> less flickering
for
(
var
j
=
0
;
$scope
.
applications
!=
null
&&
j
<
$scope
.
applications
...
...
@@ -32,9 +67,7 @@ module.exports = function ($scope, $location, $interval, $q, Applications, Appli
}
}
app
.
refreshing
=
true
;
$q
.
all
(
ApplicationOverview
.
getInfo
(
app
),
ApplicationOverview
.
getHealth
(
app
),
ApplicationOverview
.
getLogfile
(
app
))
$q
.
all
(
getInfo
(
app
),
getHealth
(
app
),
getLogfile
(
app
))
.
finally
(
function
()
{
app
.
refreshing
=
false
;
});
...
...
@@ -46,12 +79,9 @@ module.exports = function ($scope, $location, $interval, $q, Applications, Appli
$scope
.
applications
=
applications
;
});
};
$scope
.
loadData
();
$scope
.
remove
=
function
(
application
)
{
Application
.
remove
({
id
:
application
.
id
},
function
()
{
application
.
$remove
(
function
()
{
var
index
=
$scope
.
applications
.
indexOf
(
application
);
if
(
index
>
-
1
)
{
$scope
.
applications
.
splice
(
index
,
1
);
...
...
@@ -59,11 +89,6 @@ module.exports = function ($scope, $location, $interval, $q, Applications, Appli
});
};
// reload site every 30 seconds
$interval
(
function
()
{
$scope
.
loadData
();
},
30000
);
$scope
.
order
=
{
column
:
'name'
,
descending
:
false
...
...
@@ -85,4 +110,12 @@ module.exports = function ($scope, $location, $interval, $q, Applications, Appli
return
''
;
}
};
//initial load
$scope
.
loadData
();
// reload site every 30 seconds
$interval
(
function
()
{
$scope
.
loadData
();
},
30000
);
};
spring-boot-admin-server-ui/app/js/filter/humanBytes.js
View file @
a3152233
...
...
@@ -15,7 +15,7 @@
*/
'use strict'
;
module
.
exports
=
function
()
{
module
.
exports
=
function
()
{
var
units
=
{
B
:
Math
.
pow
(
1024
,
0
)
,
K
:
Math
.
pow
(
1024
,
1
)
,
M
:
Math
.
pow
(
1024
,
2
)
...
...
spring-boot-admin-server-ui/app/js/service/application.js
View file @
a3152233
...
...
@@ -15,14 +15,49 @@
*/
'use strict'
;
module
.
exports
=
function
(
$resource
)
{
return
$resource
(
'api/application/:id'
,
{},
{
query
:
{
method
:
'GET'
},
remove
:
{
method
:
'DELETE'
}
module
.
exports
=
function
(
$resource
,
$http
,
$rootScope
)
{
var
Application
=
$resource
(
'api/applications/:id'
,
{
id
:
'@id'
},
{
query
:
{
method
:
'GET'
,
isArray
:
true
},
get
:
{
method
:
'GET'
},
remove
:
{
method
:
'DELETE'
}
});
var
AuthInterceptor
=
function
(
application
)
{
return
function
(
data
,
status
,
headers
)
{
if
(
status
===
401
)
{
$rootScope
.
$emit
(
'application-auth-required'
,
application
,
headers
(
'WWW-Authenticate'
).
split
(
' '
)[
0
]);
}
};
};
Application
.
prototype
.
getHealth
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/health'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
getInfo
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/info'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
getMetrics
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/metrics'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
getEnv
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/env'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
getThreadDump
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/dump'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
getTraces
=
function
()
{
return
$http
.
get
(
this
.
url
+
'/trace'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
hasLogfile
=
function
()
{
return
$http
.
head
(
this
.
url
+
'/logfile'
).
error
(
new
AuthInterceptor
(
this
));
};
return
Application
;
};
spring-boot-admin-server-ui/app/js/service/applicationDetails.js
deleted
100644 → 0
View file @
340078ef
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
;
module
.
exports
=
function
(
$http
)
{
this
.
getInfo
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/info'
);
};
this
.
getMetrics
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/metrics'
);
};
this
.
getEnv
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/env'
);
};
this
.
getHealth
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/health'
);
};
};
spring-boot-admin-server-ui/app/js/service/applicationOverview.js
deleted
100644 → 0
View file @
340078ef
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
;
module
.
exports
=
function
(
$http
)
{
this
.
getInfo
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/info'
)
.
success
(
function
(
response
)
{
app
.
version
=
response
.
version
;
delete
response
.
version
;
app
.
info
=
response
;
})
.
error
(
function
()
{
app
.
version
=
'---'
;
});
};
this
.
getHealth
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/health'
)
.
success
(
function
(
response
)
{
app
.
status
=
response
.
status
;
})
.
error
(
function
(
response
,
httpStatus
)
{
if
(
httpStatus
===
503
)
{
app
.
status
=
response
.
status
;
}
else
if
(
httpStatus
===
404
||
httpStatus
===
0
)
{
app
.
status
=
'OFFLINE'
;
}
else
{
app
.
status
=
'UNKNOWN'
;
}
});
};
this
.
getLogfile
=
function
(
app
)
{
return
$http
.
head
(
app
.
url
+
'/logfile'
)
.
success
(
function
()
{
app
.
providesLogfile
=
true
;
})
.
error
(
function
()
{
app
.
providesLogfile
=
false
;
});
};
};
spring-boot-admin-server-ui/app/js/service/applicationThreads.js
deleted
100644 → 0
View file @
340078ef
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
;
module
.
exports
=
function
(
$http
)
{
this
.
getDump
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/dump'
);
};
};
spring-boot-admin-server-ui/app/js/service/applicationTrace.js
deleted
100644 → 0
View file @
340078ef
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
;
module
.
exports
=
function
(
$http
)
{
this
.
getTraces
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/trace'
);
};
};
spring-boot-admin-server-ui/app/js/service/applications.js
deleted
100644 → 0
View file @
340078ef
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
;
module
.
exports
=
function
(
$resource
)
{
return
$resource
(
'api/applications'
,
{},
{
query
:
{
method
:
'GET'
,
isArray
:
true
}
});
};
spring-boot-admin-server-ui/app/js/service/index.js
View file @
a3152233
...
...
@@ -3,15 +3,10 @@
var
angular
=
require
(
'angular'
);
var
springBootAdmin
=
angular
.
module
(
'springBootAdmin'
);
springBootAdmin
.
factory
(
'Applications'
,
require
(
'./applications'
));
springBootAdmin
.
factory
(
'Application'
,
require
(
'./application'
));
springBootAdmin
.
service
(
'ApplicationOverview'
,
require
(
'./applicationOverview'
));
springBootAdmin
.
service
(
'ApplicationDetails'
,
require
(
'./applicationDetails'
));
springBootAdmin
.
service
(
'ApplicationLogging'
,
require
(
'./applicationLogging'
));
springBootAdmin
.
service
(
'ApplicationJMX'
,
require
(
'./applicationJmx'
));
springBootAdmin
.
service
(
'Abbreviator'
,
require
(
'./abbreviator'
));
springBootAdmin
.
service
(
'jolokia'
,
require
(
'./jolokia'
));
springBootAdmin
.
service
(
'MetricsHelper'
,
require
(
'./metricsHelper'
));
springBootAdmin
.
service
(
'ApplicationThreads'
,
require
(
'./applicationThreads'
));
springBootAdmin
.
service
(
'ApplicationTrace'
,
require
(
'./applicationTrace'
));
spring-boot-admin-server-ui/gulpfile.js
View file @
a3152233
...
...
@@ -161,7 +161,11 @@ gulp.task('backend-server', shell.task([
]));
gulp
.
task
(
'server'
,
[
'browserify'
,
'copy'
],
function
()
{
if
(
argv
.
nobackend
===
true
)
{
process
.
stdout
.
write
(
'Running UI only
\
n'
);
}
else
{
gulp
.
start
(
'backend-server'
);
}
connect
.
server
({
root
:
target
(
'/dist'
),
livereload
:
liveReload
,
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/controller/RegistryController.java
View file @
a3152233
...
...
@@ -36,6 +36,7 @@ import de.codecentric.boot.admin.registry.ApplicationRegistryConflictException;
* REST controller for controlling registration of managed applications.
*/
@RestController
@RequestMapping
(
value
=
"/api/applications"
)
public
class
RegistryController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
RegistryController
.
class
);
...
...
@@ -52,7 +53,7 @@ public class RegistryController {
* @param app The application infos.
* @return The registered application.
*/
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
Application
>
register
(
@RequestBody
Application
app
)
{
LOGGER
.
debug
(
"Register application {}"
,
app
.
toString
());
try
{
...
...
@@ -64,12 +65,28 @@ public class RegistryController {
}
/**
* List all registered applications with name
*
* @return List.
*/
@RequestMapping
(
method
=
RequestMethod
.
GET
)
public
Collection
<
Application
>
applications
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
LOGGER
.
debug
(
"Deliver registered applications with name= {}"
,
name
);
if
(
name
==
null
||
name
.
isEmpty
())
{
return
registry
.
getApplications
();
}
else
{
return
registry
.
getApplicationsByName
(
name
);
}
}
/**
* Get a single application out of the registry.
*
* @param id The application identifier.
* @return The registered application.
*/
@RequestMapping
(
value
=
"/
api/application/
{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
<
Application
>
get
(
@PathVariable
String
id
)
{
LOGGER
.
debug
(
"Deliver registered application with ID '{}'"
,
id
);
Application
application
=
registry
.
getApplication
(
id
);
...
...
@@ -85,7 +102,7 @@ public class RegistryController {
*
* @param id The application id.
*/
@RequestMapping
(
value
=
"/
api/application/
{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
public
ResponseEntity
<
Application
>
unregister
(
@PathVariable
String
id
)
{
LOGGER
.
debug
(
"Unregister application with ID '{}'"
,
id
);
Application
app
=
registry
.
unregister
(
id
);
...
...
@@ -96,18 +113,4 @@ public class RegistryController {
}
}
/**
* List all registered applications with name
*
* @return List.
*/
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
GET
)
public
Collection
<
Application
>
applications
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
LOGGER
.
debug
(
"Deliver registered applications with name= {}"
,
name
);
if
(
name
==
null
||
name
.
isEmpty
())
{
return
registry
.
getApplications
();
}
else
{
return
registry
.
getApplicationsByName
(
name
);
}
}
}
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/AdminApplicationHazelcastTest.java
View file @
a3152233
...
...
@@ -26,7 +26,6 @@ import java.util.Collections;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
@@ -110,7 +109,7 @@ public class AdminApplicationHazelcastTest {
private
ResponseEntity
<
Application
>
getApp
(
String
id
,
EmbeddedWebApplicationContext
context
)
{
int
port
=
context
.
getEmbeddedServletContainer
().
getPort
();
ResponseEntity
<
Application
>
getResponse
=
template
.
getForEntity
(
"http://localhost:"
+
port
+
"/api/application/"
+
id
,
Application
.
class
);
+
"/api/application
s
/"
+
id
,
Application
.
class
);
return
getResponse
;
}
...
...
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