Commit fd1b66aa by Johannes Edmeier

Merge branch '1.4.x'

parents fcf2a967 dca3e290
...@@ -71,7 +71,7 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG ...@@ -71,7 +71,7 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG
var applicationGroups = new ApplicationGroups(); var applicationGroups = new ApplicationGroups();
$rootScope.applicationGroups = applicationGroups; $rootScope.applicationGroups = applicationGroups;
var refresh = function (application) { var refresh = function (group, application) {
application.info = {}; application.info = {};
application.refreshing = true; application.refreshing = true;
application.getInfo().then(function (response) { application.getInfo().then(function (response) {
...@@ -81,6 +81,12 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG ...@@ -81,6 +81,12 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG
if (info.build && info.build.version) { if (info.build && info.build.version) {
application.version = info.build.version; application.version = info.build.version;
} }
if (application.version) {
group.versionsCounter[application.version] = (group.versionsCounter[application.version] || 0) + 1;
var versions = Object.keys(group.versionsCounter);
versions.sort;
group.version = versions[0] + (versions.length > 1 ? ', ...' : '');
}
application.info = info; application.info = info;
}).finally(function () { }).finally(function () {
application.refreshing = false; application.refreshing = false;
...@@ -89,8 +95,8 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG ...@@ -89,8 +95,8 @@ module.run(function ($rootScope, $state, Notification, Application, ApplicationG
Application.query(function (applications) { Application.query(function (applications) {
for (var i = 0; i < applications.length; i++) { for (var i = 0; i < applications.length; i++) {
refresh(applications[i]); var group = applicationGroups.addApplication(applications[i]);
applicationGroups.addApplication(applications[i]); refresh(group, applications[i]);
} }
}); });
......
...@@ -59,8 +59,8 @@ module.exports = function () { ...@@ -59,8 +59,8 @@ module.exports = function () {
}; };
this.addApplication = function (application, overwrite) { this.addApplication = function (application, overwrite) {
var groupIdx = findGroup(this.groups,application.name); var groupIdx = findGroup(this.groups, application.name);
var group = groupIdx > -1 ? this.groups[groupIdx] : { applications: [], statusCounter: {}, name: application.name, status: 'UNKNOWN' }; var group = groupIdx > -1 ? this.groups[groupIdx] : { applications: [], statusCounter: {}, versionsCounter: [], name: application.name, status: 'UNKNOWN' };
if (groupIdx === -1) { if (groupIdx === -1) {
this.groups.push(group); this.groups.push(group);
} }
...@@ -71,10 +71,11 @@ module.exports = function () { ...@@ -71,10 +71,11 @@ module.exports = function () {
group.applications[index] = application; group.applications[index] = application;
} }
updateStatus(group); updateStatus(group);
return group;
}; };
this.removeApplication = function (application) { this.removeApplication = function (application) {
var groupIdx = findGroup(this.groups,application.name); var groupIdx = findGroup(this.groups, application.name);
if (groupIdx > -1) { if (groupIdx > -1) {
var group = this.groups[groupIdx]; var group = this.groups[groupIdx];
var index = findApplication(group.applications, application); var index = findApplication(group.applications, application);
......
...@@ -26,12 +26,13 @@ ...@@ -26,12 +26,13 @@
<tr ng-repeat-start="group in applicationGroups.groups|orderBy:order.column:order.descending|orderBy:'status':false|filter:searchFilter track by group.name" <tr ng-repeat-start="group in applicationGroups.groups|orderBy:order.column:order.descending|orderBy:'status':false|filter:searchFilter track by group.name"
ng-init="group.collapsed = group.applications.length > 1 && !expandAll" ng-show="group.collapsed"> ng-init="group.collapsed = group.applications.length > 1 && !expandAll" ng-show="group.collapsed">
<td class="group-column" ng-click="group.collapsed = false"><i class="fa fa-plus"></i></td> <td class="group-column" ng-click="group.collapsed = false"><i class="fa fa-plus"></i></td>
<td colspan="3" ng-bind="group.name"></td> <td ng-bind="group.name"></td>
<td> <td><span ng-bind="group.version"></span></td>
<td></td>
<td colspan="2">
<span ng-repeat-start="(status, count) in group.statusCounter track by status" class="status-{{status}}" ng-bind="count + ' ' + status"></span> <span ng-repeat-start="(status, count) in group.statusCounter track by status" class="status-{{status}}" ng-bind="count + ' ' + status"></span>
<span ng-repeat-end ng-hide="$last"> / </span> <span ng-repeat-end ng-hide="$last"> / </span>
</td> </td>
<th colspan="2"></th>
</tr> </tr>
<tr ng-hide="group.collapsed" ng-repeat="application in filteredApps = (group.applications|orderBy:order.column:order.descending|orderBy:'statusInfo.status':false|filter:searchFilter) track by application.id" <tr ng-hide="group.collapsed" ng-repeat="application in filteredApps = (group.applications|orderBy:order.column:order.descending|orderBy:'statusInfo.status':false|filter:searchFilter) track by application.id"
ng-init="views = viewsForApplication(application)" ng-repeat-end> ng-init="views = viewsForApplication(application)" ng-repeat-end>
......
...@@ -59,8 +59,11 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration { ...@@ -59,8 +59,11 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration {
@Autowired @Autowired
private AdminServerProperties adminServer; private AdminServerProperties adminServer;
@Autowired @Bean
private ZuulHandlerMapping zuulHandlerMapping; @Primary
public CompositeRouteLocator compositeRouteLocator(List<RouteLocator> locators) {
return new CompositeRouteLocator(locators);
}
@Bean @Bean
@Order(0) @Order(0)
...@@ -72,15 +75,11 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration { ...@@ -72,15 +75,11 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration {
return routeLocator; return routeLocator;
} }
@Bean
@Primary
public CompositeRouteLocator routeLocator(List<RouteLocator> locators) {
return new CompositeRouteLocator(locators);
}
@Override @Override
@Bean
@Order(-100)
public RouteLocator routeLocator() { public RouteLocator routeLocator() {
return null; return super.routeLocator();
} }
@Bean @Bean
...@@ -102,8 +101,8 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration { ...@@ -102,8 +101,8 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration {
// pre filters // pre filters
@Bean @Bean
public PreDecorationFilter preDecorationFilter() { public PreDecorationFilter preDecorationFilter(RouteLocator routeLocator) {
return new PreDecorationFilter(routeLocator(), this.server.getServletPrefix(), return new PreDecorationFilter(routeLocator, this.server.getServletPrefix(),
zuulProperties, proxyRequestHelper()); zuulProperties, proxyRequestHelper());
} }
...@@ -120,7 +119,7 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration { ...@@ -120,7 +119,7 @@ public class RevereseZuulProxyConfiguration extends ZuulConfiguration {
@Bean @Bean
@Override @Override
public ApplicationListener<ApplicationEvent> zuulRefreshRoutesListener() { public ApplicationListener<ApplicationEvent> zuulRefreshRoutesListener() {
return new ZuulRefreshListener(zuulHandlerMapping); return new ZuulRefreshListener(zuulHandlerMapping(null));
} }
@Configuration @Configuration
......
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