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
6ff2b45c
Commit
6ff2b45c
authored
Nov 05, 2014
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function to remove offline apps
parent
87ee9bbd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
4 deletions
+40
-4
RegistryController.java
...codecentric/boot/admin/controller/RegistryController.java
+14
-0
ApplicationRegistry.java
...e/codecentric/boot/admin/service/ApplicationRegistry.java
+8
-0
controllers.js
...src/main/webapp/public/scripts/controllers/controllers.js
+12
-2
services.js
...erver/src/main/webapp/public/scripts/services/services.js
+2
-1
overview.html
...t-admin-server/src/main/webapp/public/views/overview.html
+4
-1
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/controller/RegistryController.java
View file @
6ff2b45c
...
...
@@ -20,10 +20,12 @@ import java.util.List;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
import
org.springframework.web.bind.annotation.RestController
;
import
de.codecentric.boot.admin.model.Application
;
...
...
@@ -67,6 +69,18 @@ public class RegistryController {
}
/**
* Deregister an application within this admin application.
*
* @param id The application id.
*/
@ResponseStatus
(
value
=
HttpStatus
.
OK
)
@RequestMapping
(
value
=
"/api/application/{id}"
,
method
=
RequestMethod
.
DELETE
)
public
void
unregister
(
@PathVariable
String
id
)
{
LOGGER
.
info
(
"Deregister application with ID '{}'"
,
id
);
registry
.
unregister
(
id
);
}
/**
* List all registered applications.
*
* @return List.
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/service/ApplicationRegistry.java
View file @
6ff2b45c
...
...
@@ -100,4 +100,12 @@ public class ApplicationRegistry {
return
registry
.
get
(
id
);
}
/**
* Remove a specific application from registry
* @param id
*/
public
void
unregister
(
String
id
)
{
registry
.
remove
(
id
);
}
}
spring-boot-admin-server/src/main/webapp/public/scripts/controllers/controllers.js
View file @
6ff2b45c
...
...
@@ -16,8 +16,8 @@
'use strict'
;
angular
.
module
(
'springBootAdmin'
)
.
controller
(
'overviewCtrl'
,
[
'$scope'
,
'$location'
,
'$interval'
,
'Applications'
,
'ApplicationOverview'
,
function
(
$scope
,
$location
,
$interval
,
Applications
,
ApplicationOverview
)
{
.
controller
(
'overviewCtrl'
,
[
'$scope'
,
'$location'
,
'$interval'
,
'Applications'
,
'ApplicationOverview'
,
'Application'
,
function
(
$scope
,
$location
,
$interval
,
Applications
,
ApplicationOverview
,
Application
)
{
$scope
.
loadData
=
function
()
{
Applications
.
query
(
function
(
applications
)
{
...
...
@@ -36,6 +36,16 @@ angular.module('springBootAdmin')
ApplicationOverview
.
refresh
(
application
);
};
$scope
.
remove
=
function
(
application
)
{
Application
.
remove
({
id
:
application
.
id
},
function
()
{
var
index
=
$scope
.
applications
.
indexOf
(
application
);
if
(
index
>
-
1
)
{
$scope
.
applications
.
splice
(
index
,
1
);
}
});
}
// reload site every 30 seconds
var
task
=
$interval
(
function
()
{
$scope
.
loadData
();
...
...
spring-boot-admin-server/src/main/webapp/public/scripts/services/services.js
View file @
6ff2b45c
...
...
@@ -26,7 +26,8 @@ angular.module('springBootAdmin.services', ['ngResource'])
.
factory
(
'Application'
,
[
'$resource'
,
function
(
$resource
)
{
return
$resource
(
'/api/application/:id'
,
{},
{
query
:
{
method
:
'GET'
}
query
:
{
method
:
'GET'
},
remove
:
{
method
:
'DELETE'
}
});
}
])
...
...
spring-boot-admin-server/src/main/webapp/public/views/overview.html
View file @
6ff2b45c
...
...
@@ -17,7 +17,7 @@
</thead>
<tbody>
<tr
ng-repeat=
"application in applications track by application.id"
>
<td>
{{ application.id }}
</td>
<td>
<span
title=
"{{application.url}}"
>
{{ application.id }}
</span>
</td>
<td>
{{ application.version }}
</td>
<td><span
class=
"status-{{application.status}}"
>
{{ application.status }}
</span></td>
<td>
...
...
@@ -27,6 +27,9 @@
<a
ui-sref=
"apps.logging({id: application.id})"
class=
"btn btn-success"
>
Logging
</a>
<a
ui-sref=
"apps.jmx({id: application.id})"
class=
"btn btn-success"
>
JMX
</a>
</span>
<span
class=
"pull-right"
ng-show=
"application.status == null || application.status != 'UP'"
>
<a
class=
"btn btn-danger"
ng-click=
"remove(application)"
><i
class=
"icon-remove icon-white"
></i>
Remove
</a>
</span>
</td>
</tr>
</tbody>
...
...
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