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
44b6acec
Commit
44b6acec
authored
Jun 30, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CSS
parent
e0e201d2
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
44 deletions
+47
-44
pom.xml
pom.xml
+1
-8
SpringBootAdmin.java
src/main/java/de/codecentric/boot/admin/SpringBootAdmin.java
+4
-2
WebappConfig.java
...n/java/de/codecentric/boot/admin/config/WebappConfig.java
+11
-7
controllers.js
src/main/webapp/public/scripts/controllers/controllers.js
+7
-1
services.js
src/main/webapp/public/scripts/services/services.js
+9
-4
main.css
src/main/webapp/public/styles/main.css
+10
-0
overview.html
src/main/webapp/public/views/apps/overview.html
+5
-5
RegisterExampleApp.java
...st/java/de/codecentric/boot/admin/RegisterExampleApp.java
+0
-17
No files found.
pom.xml
View file @
44b6acec
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
<artifactId>
spring-boot-admin
</artifactId>
<artifactId>
spring-boot-admin
</artifactId>
<version>
1.0.0-RC1
</version>
<version>
1.0.0-RC1
</version>
<properties>
<properties>
<spring-boot.version>
1.0.2.RELEASE
</spring-boot.version>
<spring-boot.version>
1.1.0.RELEASE
</spring-boot.version>
<spring.version>
4.0.3.RELEASE
</spring.version>
<bootstrap.version>
2.3.2
</bootstrap.version>
<bootstrap.version>
2.3.2
</bootstrap.version>
<jquery.version>
1.11.0
</jquery.version>
<jquery.version>
1.11.0
</jquery.version>
<angularjs.version>
1.2.12
</angularjs.version>
<angularjs.version>
1.2.12
</angularjs.version>
...
@@ -61,12 +60,6 @@
...
@@ -61,12 +60,6 @@
<version>
4.10
</version>
<version>
4.10
</version>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<version>
${spring.version}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
<repositories>
<repositories>
<repository>
<repository>
...
...
src/main/java/de/codecentric/boot/admin/SpringBootAdmin.java
View file @
44b6acec
...
@@ -2,12 +2,14 @@ package de.codecentric.boot.admin;
...
@@ -2,12 +2,14 @@ package de.codecentric.boot.admin;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
de.codecentric.boot.admin.config.WebappConfig
;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
@
ComponentScan
@
Import
(
WebappConfig
.
class
)
public
class
SpringBootAdmin
{
public
class
SpringBootAdmin
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/de/codecentric/boot/admin/config/WebappConfig.java
View file @
44b6acec
...
@@ -2,13 +2,15 @@ package de.codecentric.boot.admin.config;
...
@@ -2,13 +2,15 @@ package de.codecentric.boot.admin.config;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
de.codecentric.boot.admin.controller.RegistryController
;
import
de.codecentric.boot.admin.service.ApplicationRegistry
;
@Configuration
@Configuration
public
class
WebappConfig
extends
WebMvcConfigurerAdapter
{
public
class
WebappConfig
extends
WebMvcConfigurerAdapter
{
...
@@ -17,12 +19,14 @@ public class WebappConfig extends WebMvcConfigurerAdapter {
...
@@ -17,12 +19,14 @@ public class WebappConfig extends WebMvcConfigurerAdapter {
converters
.
add
(
new
MappingJackson2HttpMessageConverter
());
converters
.
add
(
new
MappingJackson2HttpMessageConverter
());
}
}
@Controller
@Bean
static
class
Routes
{
public
RegistryController
registryController
()
{
@RequestMapping
({
"/applications"
,
"/applications/{id:\\w+}"
})
return
new
RegistryController
();
public
String
index
()
{
return
"/index.html"
;
}
}
@Bean
public
ApplicationRegistry
applicationRegistry
()
{
return
new
ApplicationRegistry
();
}
}
}
}
src/main/webapp/public/scripts/controllers/controllers.js
View file @
44b6acec
'use strict'
;
'use strict'
;
angular
.
module
(
'springBootAdmin'
)
angular
.
module
(
'springBootAdmin'
)
.
controller
(
'overviewCtrl'
,
function
(
$scope
,
Applications
,
ApplicationOverview
,
$location
)
{
.
controller
(
'overviewCtrl'
,
function
(
$scope
,
Applications
,
Application
,
Application
Overview
,
$location
)
{
$scope
.
applications
=
Applications
.
query
({},
function
(
applications
)
{
$scope
.
applications
=
Applications
.
query
({},
function
(
applications
)
{
for
(
var
i
=
0
;
i
<
applications
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
applications
.
length
;
i
++
)
{
var
app
=
applications
[
i
];
var
app
=
applications
[
i
];
...
@@ -13,6 +13,12 @@ angular.module('springBootAdmin')
...
@@ -13,6 +13,12 @@ angular.module('springBootAdmin')
$scope
.
showDetails
=
function
(
id
)
{
$scope
.
showDetails
=
function
(
id
)
{
$location
.
path
(
'/apps/details/'
+
id
+
'/infos'
);
$location
.
path
(
'/apps/details/'
+
id
+
'/infos'
);
};
};
// callback for ng-click 'refresh':
$scope
.
refresh
=
function
(
id
)
{
$scope
.
application
=
Application
.
query
({
id
:
id
},
function
(
application
)
{
ApplicationOverview
.
refresh
(
application
);
});
};
})
})
.
controller
(
'navCtrl'
,
function
(
$scope
,
$location
)
{
.
controller
(
'navCtrl'
,
function
(
$scope
,
$location
)
{
$scope
.
navClass
=
function
(
page
)
{
$scope
.
navClass
=
function
(
page
)
{
...
...
src/main/webapp/public/scripts/services/services.js
View file @
44b6acec
...
@@ -25,15 +25,20 @@ angular.module('springBootAdmin.services', ['ngResource'])
...
@@ -25,15 +25,20 @@ angular.module('springBootAdmin.services', ['ngResource'])
}
}
this
.
getHealth
=
function
(
app
)
{
this
.
getHealth
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/health'
).
success
(
function
(
response
)
{
return
$http
.
get
(
app
.
url
+
'/health'
).
success
(
function
(
response
)
{
if
(
response
.
indexOf
(
'ok'
)
!=
-
1
||
response
.
status
.
indexOf
(
'ok'
)
!=
-
1
)
{
if
(
typeof
(
response
)
===
'string'
&&
response
.
indexOf
(
'ok'
)
!=
-
1
app
.
status
=
'online'
;
||
typeof
(
response
.
status
)
===
'string'
&&
(
response
.
status
.
indexOf
(
'ok'
)
!=
-
1
||
response
.
status
.
indexOf
(
'UP'
)
!=
-
1
))
{
app
.
online
=
true
;
}
else
{
}
else
{
app
.
status
=
'offline'
;
app
.
online
=
false
;
}
}
}).
error
(
function
()
{
}).
error
(
function
()
{
app
.
status
=
'offline'
;
app
.
online
=
false
;
});
});
}
}
this
.
refresh
=
function
(
app
)
{
return
$http
.
post
(
app
.
url
+
'/refresh'
);
};
}])
}])
.
service
(
'ApplicationDetails'
,
[
'$http'
,
function
(
$http
)
{
.
service
(
'ApplicationDetails'
,
[
'$http'
,
function
(
$http
)
{
this
.
getInfo
=
function
(
app
)
{
this
.
getInfo
=
function
(
app
)
{
...
...
src/main/webapp/public/styles/main.css
View file @
44b6acec
...
@@ -48,3 +48,12 @@ a.spring-boot-logo span {
...
@@ -48,3 +48,12 @@ a.spring-boot-logo span {
a
:hover
.spring-boot-logo
span
{
a
:hover
.spring-boot-logo
span
{
opacity
:
1
;
opacity
:
1
;
}
}
span
.online
{
color
:
#00AA00
;
}
span
.offline
{
color
:
#DD0000
;
font-weight
:
bold
;
}
\ No newline at end of file
src/main/webapp/public/views/apps/overview.html
View file @
44b6acec
...
@@ -14,19 +14,19 @@
...
@@ -14,19 +14,19 @@
<th>
Version
</th>
<th>
Version
</th>
<th>
Status
</th>
<th>
Status
</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"application in applications"
>
<tr
ng-repeat=
"application in applications"
>
<td>
{{ application.id }}
</td>
<td>
{{ application.id }}
</td>
<td>
{{ application.version }}
</td>
<td>
{{ application.version }}
</td>
<td>
{{ application.status }}
</td>
<td></td>
<td></td>
<td>
<td>
<span
ng-show=
"application.online"
class=
"online"
>
online
</span>
<span
ng-show=
"!application.online"
class=
"offline"
>
offline
</span>
</td>
<td
align=
"right"
>
<button
type=
"button"
ng-click=
"showDetails(application.id)"
class=
"btn btn-success"
>
Details
</button>
<button
type=
"button"
ng-click=
"showDetails(application.id)"
class=
"btn btn-success"
>
Details
</button>
<!-- <button type="button" ng-click="refresh(application.id)" class="btn btn-success">Refresh</button> -->
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
...
src/test/java/de/codecentric/boot/admin/RegisterExampleApp.java
deleted
100644 → 0
View file @
e0e201d2
package
de
.
codecentric
.
boot
.
admin
;
import
org.springframework.web.client.RestTemplate
;
import
de.codecentric.boot.admin.model.Application
;
public
class
RegisterExampleApp
{
public
static
void
main
(
String
[]
args
)
{
RestTemplate
template
=
new
RestTemplate
();
Application
app
=
new
Application
();
app
.
setId
(
"app"
);
app
.
setUrl
(
"http://localhost:8081"
);
template
.
postForObject
(
"http://localhost:8080/api/applications"
,
app
,
String
.
class
);
}
}
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