Compare commits

...

1 Commits

Author SHA1 Message Date
Dzmitry Lazerka
04dd7bd8fb Remove "/prometheus" from default serverUrl. 2024-04-03 16:53:05 +02:00

View File

@@ -8,7 +8,7 @@ export const getDefaultServer = (tenantId?: string): string => {
const { serverURL } = getAppModeParams();
const storageURL = getFromStorage("SERVER_URL") as string;
const logsURL = window.location.href.replace(/\/(select\/)?(vmui)\/.*/, "");
const defaultURL = window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/, "/prometheus");
const defaultURL = window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/, "/");
const url = serverURL || storageURL || defaultURL;
if (REACT_APP_TYPE === AppType.logs) return logsURL;
if (tenantId) return replaceTenantId(url, tenantId);