Remove "/prometheus" from default serverUrl.

This commit is contained in:
Dzmitry Lazerka 2024-04-03 16:53:05 +02:00
parent 93c3be2530
commit 04dd7bd8fb
No known key found for this signature in database
GPG key ID: F710E0DC6F0204A3

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);