From c5c204b223e907528b40ea75eeae2ff04e627c8d Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 30 Nov 2023 17:40:16 -0500 Subject: [PATCH] init --- .../web_app/client/src/api/api-dashboards.js | 12 ++++++------ .../client/src/api/api-default-event-topics.js | 6 +++--- .../web_app/client/src/api/api-events.js | 14 +++++++------- .../web_app/client/src/api/api-locations.js | 6 +++--- .../web_app/client/src/api/api-org.js | 16 ++++++++-------- .../web_app/client/src/api/api-states.js | 4 ++-- .../web_app/client/src/api/api-testing-types.js | 4 ++-- .../web_app/client/src/api/api-topics.js | 6 +++--- .../web_app/client/src/api/api-units.js | 6 +++--- .../web_app/client/src/api/api-user.js | 16 ++++++++-------- .../web_app/client/src/api/user_topic_request.js | 8 ++++---- .../telematic_apps/web_app/client/src/env.js | 5 +---- .../web_app/client/src/pages/Grafana.js | 6 +++--- 13 files changed, 53 insertions(+), 56 deletions(-) diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-dashboards.js b/telematic_system/telematic_apps/web_app/client/src/api/api-dashboards.js index 1ec3d6ff..5139b192 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-dashboards.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-dashboards.js @@ -1,10 +1,10 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env } from "../env" /** *@brief List all dashboards urls belong to the current user organization */ const searchDashboards = async (org_id, search_text) => { - const URL = `${URL_Web_Server_Prefix}/api/dashboards/org/search` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/dashboards/org/search` try { @@ -23,7 +23,7 @@ const searchDashboards = async (org_id, search_text) => { *@brief List all dashboards urls belong to the current user organization */ const getDashboardsByOrg = async (org_id) => { - const URL = `${URL_Web_Server_Prefix}/api/dashboards/org/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/dashboards/org/all` try { @@ -42,7 +42,7 @@ const getDashboardsByOrg = async (org_id) => { *@brief List all dashboards urls belong to the selected event */ const listEventDashboards = async (event_id) => { - const URL = `${URL_Web_Server_Prefix}/api/dashboards/event/list` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/dashboards/event/list` try { @@ -62,7 +62,7 @@ const listEventDashboards = async (event_id) => { *@brief Update all dashboards urls belong to the selected event */ const updateEventDashboards = async (event_id, dashboard_id) => { - const URL = `${URL_Web_Server_Prefix}/api/dashboards/event/update` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/dashboards/event/update` try { @@ -82,7 +82,7 @@ const updateEventDashboards = async (event_id, dashboard_id) => { *@brief Remove dashboards urls belong to the selected event */ const deleteEventDashboards = async (event_id, dashboard_id) => { - const URL = `${URL_Web_Server_Prefix}/api/dashboards/event/delete` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/dashboards/event/delete` try { diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-default-event-topics.js b/telematic_system/telematic_apps/web_app/client/src/api/api-default-event-topics.js index bc0de71e..694f7c79 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-default-event-topics.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-default-event-topics.js @@ -1,13 +1,13 @@ import axios, { CanceledError } from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Save the default topics setting for the given list of event and unit combinations * @Param The list of events and units combinations * @Return Response status and save a bulk of topics for each event and unit combination */ const createDefaultTopicsByEventUnits = async (seletedUnitsTopics, user_id) => { - const URL = `${URL_Web_Server_Prefix}/api/default_event_topics/create` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/default_event_topics/create` let event_id = 0; let unit_identifiers = []; seletedUnitsTopics.forEach(element => { @@ -35,7 +35,7 @@ const createDefaultTopicsByEventUnits = async (seletedUnitsTopics, user_id) => { * @Return Response status and load a bulk of topics for each event and list of units for the event */ const findAllDefaultTopicsByEventUnits = async (event_id, selectedUnitIdentifiers, user_id) => { - const URL = `${URL_Web_Server_Prefix}/api/default_event_topics/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/default_event_topics/all` if (selectedUnitIdentifiers.length === 0 || event_id === 0 || event_id === undefined) { return { errCode: CanceledError.ERR_BAD_REQUEST, errMsg: "Event id or units cannot be empty" }; } diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-events.js b/telematic_system/telematic_apps/web_app/client/src/api/api-events.js index e368bffe..904b2189 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-events.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-events.js @@ -1,5 +1,5 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Create an event in database (DB) @@ -8,7 +8,7 @@ import {URL_Web_Server_Prefix } from "../env" */ const createEvent = async (event) => { try { - const URL = `${URL_Web_Server_Prefix}/api/events/create` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/events/create` const { data } = await axios.post(URL, event, { withCredentials: true }); return data; } catch (err) { @@ -24,7 +24,7 @@ const createEvent = async (event) => { */ const findAllEvents = async (criteria) => { try { - let URL = `${URL_Web_Server_Prefix}/api/events/all`; + let URL = `${env.REACT_APP_WEB_SERVER_URI}/api/events/all`; if (criteria !== undefined && Object.keys(criteria).length > 0) { URL += "?"; let key_values = ""; @@ -50,7 +50,7 @@ const findAllEvents = async (criteria) => { */ const editEvent = async (event) => { try { - const URL = `${URL_Web_Server_Prefix}/api/events/update/${event.id}`; + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/events/update/${event.id}`; const { data } = await axios.put(URL, event, { withCredentials: true }); return data; } catch (err) { @@ -66,7 +66,7 @@ const editEvent = async (event) => { */ const assignUnit2Event = async (assign_event_unit) => { try { - const URL = `${URL_Web_Server_Prefix}/api/event_units/create` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/event_units/create` const { data } = await axios.post(URL, assign_event_unit, { withCredentials: true }); return data; } catch (err) { @@ -82,7 +82,7 @@ const assignUnit2Event = async (assign_event_unit) => { */ const unAssignUnit2Event = async (event_unit) => { try { - const URL = `${URL_Web_Server_Prefix}/api/event_units/delete?event_id=${event_unit.event_id}&unit_id=${event_unit.unit.id}`; + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/event_units/delete?event_id=${event_unit.event_id}&unit_id=${event_unit.unit.id}`; const { data } = await axios.delete(URL, { withCredentials: true }); return data; } catch (err) { @@ -98,7 +98,7 @@ const unAssignUnit2Event = async (event_unit) => { */ const deleteEvent = async (id) => { try { - const URL = `${URL_Web_Server_Prefix}/api/events/delete/${id}` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/events/delete/${id}` const { data } = await axios.delete(URL, { withCredentials: true }); return data; } catch (err) { diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-locations.js b/telematic_system/telematic_apps/web_app/client/src/api/api-locations.js index 77eeecae..0f76a079 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-locations.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-locations.js @@ -1,6 +1,6 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Create a location @@ -8,7 +8,7 @@ import {URL_Web_Server_Prefix } from "../env" * @Return Response status and message */ const createLocation = async (location) => { - const URL = `${URL_Web_Server_Prefix}/api/locations/create` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/locations/create` try { const { data } = await axios.post(URL, location, { withCredentials: true }); return data; @@ -23,7 +23,7 @@ const createLocation = async (location) => { * @Return Response status and a list of locations */ const findAllLocations = async () => { - const URL = `${URL_Web_Server_Prefix}/api/locations/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/locations/all` try { const { data } = await axios.get(URL, { withCredentials: true }); return data; diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-org.js b/telematic_system/telematic_apps/web_app/client/src/api/api-org.js index 93aaa643..35817ba7 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-org.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-org.js @@ -1,7 +1,7 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" const listOrgs = async () => { - const URL = `${URL_Web_Server_Prefix}/api/org/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/all` try { const { data } = await axios.get(URL, { withCredentials: true }); return data; @@ -12,7 +12,7 @@ const listOrgs = async () => { } const listOrgUsers = async () => { - const URL = `${URL_Web_Server_Prefix}/api/org/all/users` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/all/users` try { const { data } = await axios.get(URL, { withCredentials: true }); return data; @@ -23,7 +23,7 @@ const listOrgUsers = async () => { } const addOrgUser = async (reqData) => { - const URL = `${URL_Web_Server_Prefix}/api/org/user/add` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/user/add` try { const { data } = await axios.post(URL, { @@ -37,7 +37,7 @@ const addOrgUser = async (reqData) => { } const getUserRole = async (reqData) => { - const URL = `${URL_Web_Server_Prefix}/api/org/role/get` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/role/get` try { const { data } = await axios.post(URL, { data: reqData @@ -51,7 +51,7 @@ const getUserRole = async (reqData) => { const getOrgsByUser = async (userId) => { - const URL = `${URL_Web_Server_Prefix}/api/org/user/find` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/user/find` try { const { data } = await axios.post(URL, { @@ -65,7 +65,7 @@ const getOrgsByUser = async (userId) => { } const updateOrgUser = async (reqData) => { - const URL = `${URL_Web_Server_Prefix}/api/org/user/update` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/user/update` try { const { data } = await axios.post(URL, { @@ -80,7 +80,7 @@ const updateOrgUser = async (reqData) => { const deleteOrgUser = async (req) => { - const URL = `${URL_Web_Server_Prefix}/api/org/user/delete` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/org/user/delete` if (req === undefined || req.user_id === undefined || req.org_id === undefined) { console.error("Cannot delete org user because request data is empty") } diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-states.js b/telematic_system/telematic_apps/web_app/client/src/api/api-states.js index a0be4ed4..79da25de 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-states.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-states.js @@ -1,12 +1,12 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Find all states in the US * @Return Response status and a list of states */ const findAllStates = async () => { - const URL = `${URL_Web_Server_Prefix}/api/states/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/states/all` try { const { data } = await axios.get(URL, { withCredentials: true }); return data; diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-testing-types.js b/telematic_system/telematic_apps/web_app/client/src/api/api-testing-types.js index 6324410c..375d0de0 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-testing-types.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-testing-types.js @@ -1,5 +1,5 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Find all testing types @@ -7,7 +7,7 @@ import {URL_Web_Server_Prefix } from "../env" */ const findAllTestingTypes= async (criteria) => { try { - let URL = `${URL_Web_Server_Prefix}/api/testing_types/all`; + let URL = `${env.REACT_APP_WEB_SERVER_URI}/api/testing_types/all`; const { data } = await axios.get(URL, { withCredentials: true }); return data; } catch (err) { diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-topics.js b/telematic_system/telematic_apps/web_app/client/src/api/api-topics.js index 0449545f..24901826 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-topics.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-topics.js @@ -1,5 +1,5 @@ import axios from 'axios'; -import {env, URL_Web_Messaging_Server_Prefix } from "../env" +import {env } from "../env" /** *@brief Send request to telematic_cloud_messaging web service to get available topics for the given unit identifiers @@ -9,7 +9,7 @@ import {env, URL_Web_Messaging_Server_Prefix } from "../env" const getAvailableLiveTopicsByEventUnits = async (selectedUnitIdentifiers) => { let sentStatus = []; await Promise.all(selectedUnitIdentifiers.map(async selectedUnitIdentifier => { - const URL = `${URL_Web_Messaging_Server_Prefix}/requestAvailableTopics/${selectedUnitIdentifier}` + const URL = `${env.REACT_APP_MESSAGING_SERVER_URI}/requestAvailableTopics/${selectedUnitIdentifier}` try { const { data } = await axios.get(URL); sentStatus.push(data); @@ -30,7 +30,7 @@ const getAvailableLiveTopicsByEventUnits = async (selectedUnitIdentifiers) => { * @Return Response status and message from telematic_cloud_messaging server. */ const requestSelectedLiveUnitsTopics = async (seletedUnitTopicListToConfirm) => { - const URL = `${URL_Web_Messaging_Server_Prefix}/requestSelectedTopics`; + const URL = `${env.REACT_APP_MESSAGING_SERVER_URI}/requestSelectedTopics`; let sentStatus = []; return await Promise.all(seletedUnitTopicListToConfirm.map(async selectdUnitTopics => { let body = { diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-units.js b/telematic_system/telematic_apps/web_app/client/src/api/api-units.js index d7243144..0dd78ebe 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-units.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-units.js @@ -1,13 +1,13 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Create a unit * @Return Response status and message */ const createUnit = async (unit) => { try { - const URL = `${URL_Web_Server_Prefix}/api/units/create` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/units/create` const { data } = await axios.post(URL, unit, { withCredentials: true }); return data; } catch (err) { @@ -22,7 +22,7 @@ const createUnit = async (unit) => { */ const findAllUnits = async () => { try { - const URL = `${URL_Web_Server_Prefix}/api/units/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/units/all` const { data } = await axios.get(URL, { withCredentials: true }); return data; } catch (err) { diff --git a/telematic_system/telematic_apps/web_app/client/src/api/api-user.js b/telematic_system/telematic_apps/web_app/client/src/api/api-user.js index 3f398a40..886c376a 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/api-user.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/api-user.js @@ -1,8 +1,8 @@ import axios from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" const registerNewUser = async (username, email, password, org_id) => { - const URL = `${URL_Web_Server_Prefix}/api/users/register` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/register` try { const { data } = await axios.post(URL, { @@ -19,7 +19,7 @@ const registerNewUser = async (username, email, password, org_id) => { } const updatePassword = async (username, email, new_password) => { - const URL = `${URL_Web_Server_Prefix}/api/users/forget/password` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/forget/password` try { const { data } = await axios.post(URL, { username: username, @@ -34,7 +34,7 @@ const updatePassword = async (username, email, new_password) => { } const loginUser = async (username, password) => { - const URL = `${URL_Web_Server_Prefix}/api/users/login` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/login` try { const { data } = await axios.post(URL, { username: username, @@ -49,7 +49,7 @@ const loginUser = async (username, password) => { const deleteUser = async (username) => { - const URL = `${URL_Web_Server_Prefix}/api/users/delete` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/delete` try { const { data } = await axios.delete(URL + "?username=" + username, { withCredentials: true }); @@ -62,7 +62,7 @@ const deleteUser = async (username) => { const listUsers = async () => { - const URL = `${URL_Web_Server_Prefix}/api/users/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/all` try { const { data } = await axios.get(URL, { withCredentials: true }); @@ -73,7 +73,7 @@ const listUsers = async () => { } } const updateUserServerAdmin = async (req) => { - const URL = `${URL_Web_Server_Prefix}/api/users/update/server/admin` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/update/server/admin` try { const { data } = await axios.post(URL, req, { withCredentials: true }); return data; @@ -83,7 +83,7 @@ const updateUserServerAdmin = async (req) => { } } const checkServerSession = async () => { - const URL = `${URL_Web_Server_Prefix}/api/users/ping` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/users/ping` try { const { data } = await axios.get(URL, { withCredentials: true }); return data; diff --git a/telematic_system/telematic_apps/web_app/client/src/api/user_topic_request.js b/telematic_system/telematic_apps/web_app/client/src/api/user_topic_request.js index 3c3618c1..53a2f114 100644 --- a/telematic_system/telematic_apps/web_app/client/src/api/user_topic_request.js +++ b/telematic_system/telematic_apps/web_app/client/src/api/user_topic_request.js @@ -1,13 +1,13 @@ import axios, { CanceledError } from 'axios'; -import {URL_Web_Server_Prefix } from "../env" +import {env} from "../env" /** *@brief Save the user topic request for the given list of event and unit combinations * @Param The list of events and units combinations * @Return Response status and save a bulk of topics for each event and unit combination */ const upsertUserTopicRequestForEventUnits = async (seletedUnitsTopics, user_id) => { - const URL = `${URL_Web_Server_Prefix}/api/user_topic_request/upsert` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/user_topic_request/upsert` let event_id = 0; let unit_identifiers = []; seletedUnitsTopics.forEach(element => { @@ -36,7 +36,7 @@ const upsertUserTopicRequestForEventUnits = async (seletedUnitsTopics, user_id) * @Return Response status and load a bulk of topics for each event and list of units for the event */ const findUsersTopicRequestByEventUnits = async (event_id, selectedUnitIdentifiers, exclude_user_id) => { - const URL = `${URL_Web_Server_Prefix}/api/user_topic_request/all` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/user_topic_request/all` if (selectedUnitIdentifiers.length === 0 || event_id === 0 || event_id === undefined) { return { errCode: CanceledError.ERR_BAD_REQUEST, errMsg: "Event id or units cannot be empty" }; } @@ -65,7 +65,7 @@ const findUsersTopicRequestByEventUnits = async (event_id, selectedUnitIdentifie * @Return Response status and load a bulk of topics for each event and list of units for the event */ const findUserTopicRequestByUserEventUnits = async (event_id, selectedUnitIdentifiers, user_id) => { - const URL = `${URL_Web_Server_Prefix}/api/user_topic_request/user/list` + const URL = `${env.REACT_APP_WEB_SERVER_URI}/api/user_topic_request/user/list` if (selectedUnitIdentifiers.length === 0 || event_id === 0 || event_id === undefined) { return { errCode: CanceledError.ERR_BAD_REQUEST, errMsg: "Event id or units cannot be empty" }; } diff --git a/telematic_system/telematic_apps/web_app/client/src/env.js b/telematic_system/telematic_apps/web_app/client/src/env.js index e5a7e857..1c494f92 100644 --- a/telematic_system/telematic_apps/web_app/client/src/env.js +++ b/telematic_system/telematic_apps/web_app/client/src/env.js @@ -1,4 +1 @@ -export const env = {...process.env, ...window['env']} -export const URL_Web_Server_Prefix = process.env.NODE_ENV === "production" ? env.REACT_APP_WEB_SERVER_URI: process.env.REACT_APP_WEB_SERVER_URI; -export const URL_Web_Messaging_Server_Prefix = process.env.NODE_ENV === "production" ? env.REACT_APP_MESSAGING_SERVER_URI: process.env.REACT_APP_MESSAGING_SERVER_URI; -export const URL_GRAFANA_Prefix = process.env.NODE_ENV === "production" ? env.REACT_APP_GRAFANA_URI: process.env.REACT_APP_GRAFANA_URI; \ No newline at end of file +export const env = {...process.env, ...window['env']} \ No newline at end of file diff --git a/telematic_system/telematic_apps/web_app/client/src/pages/Grafana.js b/telematic_system/telematic_apps/web_app/client/src/pages/Grafana.js index 176b0153..5858ef1d 100644 --- a/telematic_system/telematic_apps/web_app/client/src/pages/Grafana.js +++ b/telematic_system/telematic_apps/web_app/client/src/pages/Grafana.js @@ -19,9 +19,9 @@ import React, { useContext, useEffect, useState } from 'react'; import Iframe from 'react-iframe'; import { useSearchParams } from 'react-router-dom'; import AuthContext from '../context/auth-context'; -import {URL_GRAFANA_Prefix} from '../env' +import {env} from '../env' const Grafana = () => { - const [embedURL, setEmbedURL] = useState(URL_GRAFANA_Prefix + "/dashboards?theme=light") + const [embedURL, setEmbedURL] = useState(env.REACT_APP_GRAFANA_URI + "/dashboards?theme=light") const [loading, setLoading] = useState(true); const authContext = useContext(AuthContext); const loadedHanlder = () => { @@ -31,7 +31,7 @@ const Grafana = () => { const [searchParams, setSearchParams] = useSearchParams(); useEffect(() => { if (searchParams.get("uid") !== null && searchParams.get("slug") !== null) { - setEmbedURL(URL_GRAFANA_Prefix + '/d/' + searchParams.get("uid") + '/' + searchParams.get("slug") + "?=orgId=" + authContext.org_id + "&theme=light") + setEmbedURL(env.REACT_APP_GRAFANA_URI + '/d/' + searchParams.get("uid") + '/' + searchParams.get("slug") + "?=orgId=" + authContext.org_id + "&theme=light") } }, []) return (