Skip to content

Commit

Permalink
Merge branch 'master' into fix-5826
Browse files Browse the repository at this point in the history
  • Loading branch information
yu199195 authored Dec 4, 2024
2 parents bc09c8d + bcb7952 commit d4e8545
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shenyu.admin.mode.ShenyuRunningModeService;
import org.apache.shenyu.admin.utils.ShenyuDomain;
import org.apache.shenyu.common.constant.Constants;
import org.apache.shenyu.common.utils.IpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.context.WebServerInitializedEvent;
Expand All @@ -44,7 +45,10 @@ public class ApplicationStartListener implements ApplicationListener<WebServerIn
public void onApplicationEvent(final WebServerInitializedEvent event) {
int port = event.getWebServer().getPort();
final String host = IpUtils.getHost();
final String domain = System.getProperty("shenyu.httpPath");
String domain = System.getProperty(Constants.HTTP_PATH);
if (StringUtils.isBlank(domain)) {
domain = System.getenv(Constants.HTTP_PATH);
}
if (StringUtils.isBlank(domain)) {
ShenyuDomain.getInstance().setHttpPath("http://" + String.join(":", host, String.valueOf(port)) + contextPath);
} else {
Expand Down

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion shenyu-admin/src/main/resources/static/index.8fa6763d.js

This file was deleted.

1 change: 0 additions & 1 deletion shenyu-admin/src/main/resources/static/index.999a4920.js

This file was deleted.

1 change: 0 additions & 1 deletion shenyu-admin/src/main/resources/static/index.bb51b115.js

This file was deleted.

1 change: 1 addition & 0 deletions shenyu-admin/src/main/resources/static/index.e0676fc9.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions shenyu-admin/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Apache ShenYu Gateway</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link href="index.2a428c0d.css" rel="stylesheet"></head>
<link href="index.2f2f389d.css" rel="stylesheet"></head>

<body>
<div id="httpPath" style="display: none" th:text="${domain}"></div>
<div id="root"></div>
<script type="text/javascript" src="index.bb51b115.js"></script></body>
<script type="text/javascript" src="index.e0676fc9.js"></script></body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,11 @@ public interface Constants {
*/
String EVENT_NAME_DATA = "data";

/**
* The constant EVENT_NAME_REGISTER.
*/
String HTTP_PATH = "shenyu.httpPath";

/**
* String q.
*/
Expand Down

0 comments on commit d4e8545

Please sign in to comment.