CEC-2970: Multiple Superset Dashboards (#229)
Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
committed by
GitHub
parent
843fddd0b7
commit
2d298368c5
@@ -21,15 +21,32 @@ const supersetAPI = {
|
||||
let q = r["token"]
|
||||
return q
|
||||
},
|
||||
getEmbeddedDashboards: async(token) => {
|
||||
const u = addQueryParams(`${API_ENDPOINT}/dashboard/embedded-dashboards`);
|
||||
let res = await fetch(u, {
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
})
|
||||
if(res.status !== 200){
|
||||
return [{title: "dashboard", embedded_id: GetSupersetDashboardID()}]
|
||||
}
|
||||
let r = await res.json()
|
||||
return r
|
||||
},
|
||||
SupersetDashboardURL: () => {
|
||||
const SUPERSET_BASE_URL = process.env.REACT_APP_SUPERSET_URL;
|
||||
return SUPERSET_BASE_URL
|
||||
},
|
||||
SupersetDashboardID: () => {
|
||||
const SUPERSET_BASE_ID = process.env.REACT_APP_SUPERSET_KEYS_LIST;
|
||||
return SUPERSET_BASE_ID
|
||||
return GetSupersetDashboardID()
|
||||
}
|
||||
}
|
||||
|
||||
const GetSupersetDashboardID = () => {
|
||||
const SUPERSET_BASE_ID = process.env.REACT_APP_SUPERSET_KEYS_LIST;
|
||||
return SUPERSET_BASE_ID
|
||||
}
|
||||
|
||||
export default supersetAPI;
|
||||
Reference in New Issue
Block a user