Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[console] Fixes bug for docker port mapping case #1213

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,14 @@ private void getInferenceAddress(ChannelHandlerContext ctx, HttpMethod method) {
ConfigManager configManager = ConfigManager.getInstance();
String inferenceAddress =
configManager.getProperty("inference_address", "http://127.0.0.1:8080");
String managementAddress =
configManager.getProperty("management_address", "http://127.0.0.1:8080");
String origin = configManager.getProperty("cors_allowed_origin", "");
String methods = configManager.getProperty("cors_allowed_methods", "");
String headers = configManager.getProperty("cors_allowed_headers", "");
Map<String, String> map = new ConcurrentHashMap<>(2);
map.put("inferenceAddress", inferenceAddress);
map.put("managementAddress", managementAddress);
map.put("corsAllowed", "0");
if (!StringUtil.isNullOrEmpty(origin)
&& !StringUtil.isNullOrEmpty(headers)
Expand Down
3 changes: 2 additions & 1 deletion plugins/management-console/webapp/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ var store = new Vuex.Store({
let res = await logAPI.inferenceAddress()
let corsAllowed = res.corsAllowed
let port = getPort(res.inferenceAddress)
if(port == window.location.port){
let mgmtPort = getPort(res.inferenceAddress)
if(port == window.location.port || port == mgmtPort){
predictionUrl = env.baseUrl
}else{
if(corsAllowed !="1"){
Expand Down
Loading