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