Commit c5428c53 by Thomas Bosch

application details

parent b3c41a9c
......@@ -10,6 +10,7 @@
<bootstrap.version>2.3.2</bootstrap.version>
<jquery.version>1.11.0</jquery.version>
<angularjs.version>1.2.12</angularjs.version>
<angular-ui-router.version>0.2.10-1</angular-ui-router.version>
</properties>
<dependencies>
<dependency>
......@@ -47,6 +48,11 @@
<artifactId>angularjs</artifactId>
<version>${angularjs.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angular-ui-router</artifactId>
<version>${angular-ui-router.version}</version>
</dependency>
<!-- Test -->
<dependency>
......
......@@ -26,8 +26,8 @@
<a class="spring-logo" href="/"><span></span></a>
</div>
<ul class="nav pull-right" ng-controller='navCtrl'>
<li class="navbar-link" ng-class="navClass('main')"><a href="/#/main">Applications</a></li>
<li class="navbar-link" ng-class="navClass('about')"><a href="/#/about">About</a></li>
<li class="navbar-link" ng-class="{active: $state.includes('apps')}"><a ui-sref="apps.overview">Applications</a></li>
<li class="navbar-link" ng-class="{active: $state.includes('about')}"><a ui-sref="about">About</a></li>
<li class="navbar-link" ng-if="authenticationEnabled" class="dropdown"><a data-target="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span><b class="caret"></b></a>
<ul class="dropdown-menu">
......@@ -40,15 +40,7 @@
</header>
<div class="body--container container-fluid ">
<div class="main-body--wrapper">
<div class="row-fluid docs--header">
<div class="span12">
<h1 class="index-page--title">Spring-Boot applications</h1>
<p class="index-page--subtitle">
Here you'll find all Spring-Boot applications that registered itself at this admin application.
</p>
</div>
</div>
<div ng-view></div>
<div ui-view></div>
</div>
<div id="footer-push-down"></div>
</div>
......@@ -64,6 +56,7 @@
<script src="/webjars/bootstrap/${bootstrap.version}/js/bootstrap.min.js"></script>
<script src="/webjars/angularjs/${angularjs.version}/angular-resource.min.js"></script>
<script src="/webjars/angularjs/${angularjs.version}/angular-route.min.js"></script>
<script src="/webjars/angular-ui-router/0.2.10/angular-ui-router.min.js"></script>
<script src="/scripts/app.js"></script>
<script src="/scripts/controllers/controllers.js"></script>
<script src="/scripts/services/services.js"></script>
......
......@@ -3,21 +3,42 @@
angular.module('springBootAdmin', [
'ngResource',
'ngRoute',
'ui.router',
'springBootAdmin.services'
])
.config(function ($routeProvider) {
$routeProvider
.when('/main', {
templateUrl: 'views/main.html',
controller: 'mainCtrl'
})
.when('/about', {
templateUrl: 'views/about.html'
})
.when('/', {
redirectTo: '/main'
})
.otherwise({
redirectTo: '/'
});
});
\ No newline at end of file
.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider
.when('/', '/apps/overview')
.otherwise('/')
$stateProvider
.state('apps', {
url: '/apps',
templateUrl: 'views/apps.html',
})
.state('about', {
url: '/about',
templateUrl: 'views/about.html'
})
.state('apps.overview', {
url: '/overview',
templateUrl: 'views/apps/overview.html',
controller: 'overviewCtrl'
})
.state('apps.details', {
url: '/details',
templateUrl: 'views/apps/details.html'
})
.state('apps.details.infos', {
url: '/infos',
templateUrl: 'views/apps/details/infos.html'
})
.state('apps.details.metrics', {
url: '/metrics',
templateUrl: 'views/apps/details/metrics.html'
});
})
.run(function ($rootScope, $state, $stateParams, $log) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
$rootScope.springBootAdminServerUrl = window.location.protocol + '//' + window.location.host;
});
'use strict';
angular.module('springBootAdmin')
.controller('mainCtrl', function ($scope, Application, ApplicationInfo, $location, $http) {
.controller('overviewCtrl', function ($scope, Application, ApplicationInfo, $location, $http) {
// Gets the service from /api/services
$scope.applications = Application.query({}, function(applications) {
......@@ -15,8 +15,11 @@ angular.module('springBootAdmin')
})
.controller('navCtrl', function ($scope, $location) {
$scope.navClass = function(page) {
var currentRoute = $location.path().substring(1) || 'main';
return page == currentRoute ? 'active' : '';
};
$scope.navClass = function(page) {
var currentRoute = $location.path().substring(1) || 'main';
return page == currentRoute ? 'active' : '';
};
})
.controller('metricsCtrl', function ($scope, $location) {
});
\ No newline at end of file
......@@ -5,3 +5,27 @@
@import "base.css";
@import "application.css";
@import "highlight.css";
.table > thead > tr > th {
background-color: #34302D; /* lighten 3% */
color: #f1f1f1;
}
.table-filter {
background-color: #34302D;
padding: 9px 12px;
}
.nav > li > a {
color: #838789;
}
.nav {
margin-bottom: 0;
}
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
background-color: #34302D;
border-color: #34302D;
color: #f1f1f1;
}
\ No newline at end of file
<div class="row-fluid">
<div class="span12">
<h1 class="index-page--title">{{ application.id }}</h1>
<p class="index-page--subtitle">Show information provided by the Spring-Boot Actuators.</p>
</div>
</div>
<div class="container">
<div class="main-template">
<div id="xd-jobs" class="tab-pane active col-md-12">
<ul class="nav nav-tabs">
<li ng-class="{ active: $state.includes('apps.details.infos') }"><a ui-sref="apps.details.infos">Infos</a></li>
<li ng-class="{ active: $state.includes('apps.details.metrics') }"><a ui-sref="apps.details.metrics">Metrics</a></li>
</ul>
<div class="tab-content">
<div ui-view></div>
</div>
</div>
</div>
</div>
<!-- /.container -->
\ No newline at end of file
<div class="container">
<div class="main-template">
<table class="table table-striped">
<thead>
<tr>
<th>Application</th>
<th>Version</th>
<th>Status</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="application in applications">
<td>{{ application.id }}</td>
<td>{{ application.version }}</td>
<td>{{ application.status }}</td>
<td></td>
<td><!-- <button type="button" ng-click="editService(service.id)" class="btn btn-success">Edit</button> --></td>
</tr>
</tbody>
</table>
</div>
</div><!-- /.container -->
\ No newline at end of file
<table class="table table-striped">
<thead>
<tr>
<th>Application</th>
<th>Version</th>
<th>Status</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="application in applications">
<td>{{ application.id }}</td>
<td>{{ application.version }}</td>
<td>{{ application.status }}</td>
<td></td>
<td>
<!-- <button type="button" ng-click="editService(service.id)" class="btn btn-success">Edit</button> -->
</td>
</tr>
</tbody>
</table>
Info-Endpoint
<table class="table table-striped">
<thead>
<tr>
<th>Application</th>
<th>Version</th>
<th>Status</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="application in applications">
<td>{{ application.id }}</td>
<td>{{ application.version }}</td>
<td>{{ application.status }}</td>
<td></td>
<td>
<!-- <button type="button" ng-click="editService(service.id)" class="btn btn-success">Edit</button> -->
</td>
</tr>
</tbody>
</table>
Metrics-Endpoint
\ No newline at end of file
<div class="row-fluid">
<div class="span12">
<h1 class="index-page--title">Spring-Boot applications</h1>
<p class="index-page--subtitle">Here you'll find all Spring-Boot applications that registered itself at this admin
application.</p>
</div>
</div>
<div class="container">
<div class="main-template">
<table class="table table-striped">
<thead>
<tr>
<th>Application</th>
<th>Version</th>
<th>Status</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="application in applications">
<td>{{ application.id }}</td>
<td>{{ application.version }}</td>
<td>{{ application.status }}</td>
<td></td>
<td></td>
<td>
<!-- <button type="button" ng-click="editService(service.id)" class="btn btn-success">Edit</button> -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- /.container -->
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment