mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 01:41:31 +00:00
Add a feature flag to override Juno endpoint (#700)
* Add a feature flag to override Juno endpoint * Fix build
This commit is contained in:
@@ -13,6 +13,7 @@ export type Features = {
|
||||
readonly enableTtl: boolean;
|
||||
readonly executeSproc: boolean;
|
||||
readonly hostedDataExplorer: boolean;
|
||||
readonly junoEndpoint?: string;
|
||||
readonly livyEndpoint?: string;
|
||||
readonly notebookBasePath?: string;
|
||||
readonly notebookServerToken?: string;
|
||||
@@ -27,7 +28,8 @@ export type Features = {
|
||||
export function extractFeatures(given = new URLSearchParams(window.location.search)): Features {
|
||||
const downcased = new URLSearchParams();
|
||||
const set = (value: string, key: string) => downcased.set(key.toLowerCase(), value);
|
||||
const get = (key: string, defaultValue?: string) => downcased.get("feature." + key) ?? defaultValue;
|
||||
const get = (key: string, defaultValue?: string) =>
|
||||
downcased.get("feature." + key) ?? downcased.get(key) ?? defaultValue;
|
||||
|
||||
try {
|
||||
new URLSearchParams(window.parent.location.search).forEach(set);
|
||||
@@ -52,6 +54,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
|
||||
enableTtl: "true" === get("enablettl"),
|
||||
executeSproc: "true" === get("dataexplorerexecutesproc"),
|
||||
hostedDataExplorer: "true" === get("hosteddataexplorerenabled"),
|
||||
junoEndpoint: get("junoendpoint"),
|
||||
livyEndpoint: get("livyendpoint"),
|
||||
notebookBasePath: get("notebookbasepath"),
|
||||
notebookServerToken: get("notebookservertoken"),
|
||||
|
||||
Reference in New Issue
Block a user