Skip to content

Commit

Permalink
BZ-1100150 - Cannot open 'Process & Task Dashboard' under NAT environ…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
dgutierr committed Jul 28, 2014
1 parent bebdf03 commit 89cc325
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
41 changes: 23 additions & 18 deletions jbpm-console-ng-dashboard/jbpm-console-ng-dashboard-backend/pom.xml
Expand Up @@ -2,26 +2,31 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jbpm-console-ng-dashboard</artifactId>
<groupId>org.jbpm</groupId>
<version>6.0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>jbpm-console-ng-dashboard</artifactId>
<groupId>org.jbpm</groupId>
<version>6.0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>jbpm-console-ng-dashboard-backend</artifactId>
<artifactId>jbpm-console-ng-dashboard-backend</artifactId>

<name>jBPM Console NG - Dashboard Backend</name>
<name>jBPM Console NG - Dashboard Backend</name>

<dependencies>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-bus</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-bus</artifactId>
</dependency>

<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-console-ng-dashboard-api</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-console-ng-dashboard-api</artifactId>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
</dependencies>
</project>
@@ -1,5 +1,6 @@
package org.jbpm.dashboard.renderer.service.impl;

import org.apache.commons.lang.StringUtils;
import org.jboss.errai.bus.server.annotations.Service;
import org.jbpm.dashboard.renderer.service.DashboardRendererService;
import org.jbpm.dashboard.renderer.service.ConnectionStatus;
Expand Down Expand Up @@ -50,12 +51,17 @@ protected List<String> explodeUrl(String anUrl) {
// Add the target URL
results.add(anUrl);

// Add the "localhost" version
try {
// Get the dashbuilder address (defaults to localhost).
String bindAddress = System.getProperty("dashbuilder.bind.address");
if (StringUtils.isBlank(bindAddress)) {
bindAddress = InetAddress.getLocalHost().getHostAddress();
}

// Add the bind address
String host = new URL(anUrl).getHost();
String localHost = InetAddress.getLocalHost().getHostAddress();
if (!host.equals(localHost)) {
results.add(anUrl.replace(host, localHost));
if (!host.equals(bindAddress)) {
results.add(anUrl.replace(host, bindAddress));
}
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 89cc325

Please sign in to comment.