From 4e648a7b08612c4f4f889c9baaed10ac34330231 Mon Sep 17 00:00:00 2001 From: ozangunalp Date: Thu, 22 Dec 2022 11:13:36 +0000 Subject: [PATCH] Calculate Kafka dev ui RPC path from current window, for custom http root path Fixes #30029 --- .../deployment/src/main/resources/dev-static/js/config.js | 5 ++++- .../deployment/src/main/resources/dev-static/js/web/web.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/kafka-client/deployment/src/main/resources/dev-static/js/config.js b/extensions/kafka-client/deployment/src/main/resources/dev-static/js/config.js index 130b130828fbed..913a6d4f8fc733 100644 --- a/extensions/kafka-client/deployment/src/main/resources/dev-static/js/config.js +++ b/extensions/kafka-client/deployment/src/main/resources/dev-static/js/config.js @@ -1,2 +1,5 @@ -export const api = '/q/dev/io.quarkus.quarkus-kafka-client/kafka-admin'; +export const api = () => { + let path = window.location.pathname + return path.replace('/kafka-dev-ui', '/kafka-admin') +} export const ui = 'kafka-ui'; \ No newline at end of file diff --git a/extensions/kafka-client/deployment/src/main/resources/dev-static/js/web/web.js b/extensions/kafka-client/deployment/src/main/resources/dev-static/js/web/web.js index 6ba79b5c19720e..c981bf9e24a86e 100644 --- a/extensions/kafka-client/deployment/src/main/resources/dev-static/js/web/web.js +++ b/extensions/kafka-client/deployment/src/main/resources/dev-static/js/web/web.js @@ -2,7 +2,7 @@ import {api} from "../config.js" export function doPost(data, successCallback, errorCallback) { $.ajax({ - url: api, + url: api(), type: 'POST', data: JSON.stringify(data), contentType: "application/json; charset=utf-8",