mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-24 11:21:23 +00:00
renamed params
This commit is contained in:
@@ -4,11 +4,8 @@ PORTAL_RUNNER_PASSWORD=
|
||||
PORTAL_RUNNER_SUBSCRIPTION=
|
||||
PORTAL_RUNNER_RESOURCE_GROUP=
|
||||
PORTAL_RUNNER_DATABASE_ACCOUNT=
|
||||
PORTAL_RUNNER_KEY=
|
||||
PORTAL_RUNNER_CONNECTION_STRING=
|
||||
NOTEBOOKS_TEST_RUNNER_TENANT_ID=
|
||||
NOTEBOOKS_TEST_RUNNER_CLIENT_ID=
|
||||
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET=
|
||||
NOTEBOOKS_ACCOUNT_SUBSCRIPTION_ID=
|
||||
NOTEBOOKS_ACCOUNT_RESOURCE_GROUP=
|
||||
NOTEBOOKS_ACCOUNT_NAME=
|
||||
NOTEBOOKS_ACCOUNT_KEY=
|
||||
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET=
|
||||
@@ -10,18 +10,18 @@ export const getTestExplorerFrame = async (): Promise<Frame> => {
|
||||
return testExplorerFrame;
|
||||
}
|
||||
|
||||
const notebooksTestRunnerApplicationId = process.env.NOTEBOOKS_TEST_RUNNER_TENANT_ID;
|
||||
const notebooksTestRunnerTenantId = process.env.NOTEBOOKS_TEST_RUNNER_TENANT_ID;
|
||||
const notebooksTestRunnerClientId = process.env.NOTEBOOKS_TEST_RUNNER_CLIENT_ID;
|
||||
const notebooksTestRunnerClientSecret = process.env.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET;
|
||||
const notebooksAccountName = process.env.NOTEBOOKS_ACCOUNT_NAME;
|
||||
const notebooksAccountKey = process.env.NOTEBOOKS_ACCOUNT_KEY;
|
||||
const notebooksAccountSubscriptonId = process.env.NOTEBOOKS_ACCOUNT_SUBSCRIPTION_ID;
|
||||
const notebooksAccountResourceGroup = process.env.NOTEBOOKS_ACCOUNT_RESOURCE_GROUP;
|
||||
const portalRunnerDatabaseAccount = process.env.PORTAL_RUNNER_DATABASE_ACCOUNT;
|
||||
const portalRunnerKey = process.env.PORTAL_RUNNER_KEY;
|
||||
const portalRunnerSubscripton = process.env.PORTAL_RUNNER_SUBSCRIPTION;
|
||||
const portalRunnerResourceGroup = process.env.PORTAL_RUNNER_RESOURCE_GROUP;
|
||||
|
||||
const testExplorerUrl = new URL("testExplorer.html", "https://localhost:1234");
|
||||
testExplorerUrl.searchParams.append(
|
||||
TestExplorerParams.notebooksTestRunnerApplicationId,
|
||||
encodeURI(notebooksTestRunnerApplicationId)
|
||||
TestExplorerParams.notebooksTestRunnerTenantId,
|
||||
encodeURI(notebooksTestRunnerTenantId)
|
||||
);
|
||||
testExplorerUrl.searchParams.append(
|
||||
TestExplorerParams.notebooksTestRunnerClientId,
|
||||
@@ -31,15 +31,15 @@ export const getTestExplorerFrame = async (): Promise<Frame> => {
|
||||
TestExplorerParams.notebooksTestRunnerClientSecret,
|
||||
encodeURI(notebooksTestRunnerClientSecret)
|
||||
);
|
||||
testExplorerUrl.searchParams.append(TestExplorerParams.notebooksAccountName, encodeURI(notebooksAccountName));
|
||||
testExplorerUrl.searchParams.append(TestExplorerParams.notebooksAccountKey, encodeURI(notebooksAccountKey));
|
||||
testExplorerUrl.searchParams.append(
|
||||
TestExplorerParams.notebooksAccountSubscriptonId,
|
||||
encodeURI(notebooksAccountSubscriptonId)
|
||||
TestExplorerParams.portalRunnerDatabaseAccount,
|
||||
encodeURI(portalRunnerDatabaseAccount)
|
||||
);
|
||||
testExplorerUrl.searchParams.append(TestExplorerParams.portalRunnerKey, encodeURI(portalRunnerKey));
|
||||
testExplorerUrl.searchParams.append(TestExplorerParams.portalRunnerSubscripton, encodeURI(portalRunnerSubscripton));
|
||||
testExplorerUrl.searchParams.append(
|
||||
TestExplorerParams.notebooksAccountResourceGroup,
|
||||
encodeURI(notebooksAccountResourceGroup)
|
||||
TestExplorerParams.portalRunnerResourceGroup,
|
||||
encodeURI(portalRunnerResourceGroup)
|
||||
);
|
||||
|
||||
await page.goto(testExplorerUrl.toString());
|
||||
|
||||
@@ -68,8 +68,8 @@ const initTestExplorer = async (): Promise<void> => {
|
||||
window.addEventListener("message", handleMessage, false);
|
||||
|
||||
const urlSearchParams = new URLSearchParams(window.location.search);
|
||||
const notebooksTestRunnerApplicationId = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksTestRunnerApplicationId)
|
||||
const notebooksTestRunnerTenantId = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksTestRunnerTenantId)
|
||||
);
|
||||
const notebooksTestRunnerClientId = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksTestRunnerClientId)
|
||||
@@ -77,33 +77,33 @@ const initTestExplorer = async (): Promise<void> => {
|
||||
const notebooksTestRunnerClientSecret = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksTestRunnerClientSecret)
|
||||
);
|
||||
const notebooksAccountName = decodeURIComponent(urlSearchParams.get(TestExplorerParams.notebooksAccountName));
|
||||
const notebooksAccountKey = decodeURIComponent(urlSearchParams.get(TestExplorerParams.notebooksAccountKey));
|
||||
const notebooksAccountSubscriptonId = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksAccountSubscriptonId)
|
||||
const portalRunnerDatabaseAccount = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.portalRunnerDatabaseAccount)
|
||||
);
|
||||
const notebooksAccountResourceGroup = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.notebooksAccountResourceGroup)
|
||||
const portalRunnerKey = decodeURIComponent(urlSearchParams.get(TestExplorerParams.portalRunnerKey));
|
||||
const portalRunnerSubscripton = decodeURIComponent(urlSearchParams.get(TestExplorerParams.portalRunnerSubscripton));
|
||||
const portalRunnerResourceGroup = decodeURIComponent(
|
||||
urlSearchParams.get(TestExplorerParams.portalRunnerResourceGroup)
|
||||
);
|
||||
|
||||
const token = await AADLogin(
|
||||
notebooksTestRunnerApplicationId,
|
||||
notebooksTestRunnerTenantId,
|
||||
notebooksTestRunnerClientId,
|
||||
notebooksTestRunnerClientSecret
|
||||
);
|
||||
const databaseAccount = await getDatabaseAccount(
|
||||
token,
|
||||
notebooksAccountSubscriptonId,
|
||||
notebooksAccountResourceGroup,
|
||||
notebooksAccountName
|
||||
portalRunnerSubscripton,
|
||||
portalRunnerResourceGroup,
|
||||
portalRunnerDatabaseAccount
|
||||
);
|
||||
|
||||
const initTestExplorerContent = {
|
||||
type: MessageTypes.InitTestExplorer,
|
||||
inputs: {
|
||||
databaseAccount: databaseAccount,
|
||||
subscriptionId: notebooksAccountSubscriptonId,
|
||||
resourceGroup: notebooksAccountResourceGroup,
|
||||
subscriptionId: portalRunnerSubscripton,
|
||||
resourceGroup: portalRunnerResourceGroup,
|
||||
authorizationToken: `Bearer ${token}`,
|
||||
features: {},
|
||||
hasWriteAccess: true,
|
||||
@@ -115,7 +115,7 @@ const initTestExplorer = async (): Promise<void> => {
|
||||
quotaId: "Internal_2014-09-01",
|
||||
addCollectionDefaultFlight: "2",
|
||||
isTryCosmosDBSubscription: false,
|
||||
masterKey: notebooksAccountKey,
|
||||
masterKey: portalRunnerKey,
|
||||
loadDatabaseAccountTimestamp: 1604663109836,
|
||||
dataExplorerVersion: "1.0.1",
|
||||
sharedThroughputMinimum: 400,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export enum TestExplorerParams {
|
||||
notebooksTestRunnerApplicationId = "notebooksTestRunnerApplicationId",
|
||||
notebooksTestRunnerTenantId = "notebooksTestRunnerTenantId",
|
||||
notebooksTestRunnerClientId = "notebooksTestRunnerClientId",
|
||||
notebooksTestRunnerClientSecret = "notebooksTestRunnerClientSecret",
|
||||
notebooksAccountName = "notebooksAccountName",
|
||||
notebooksAccountKey = "notebooksAccountKey",
|
||||
notebooksAccountSubscriptonId = "notebooksAccountSubscriptonId",
|
||||
notebooksAccountResourceGroup = "notebooksAccountResourceGroup"
|
||||
portalRunnerDatabaseAccount = "notebooksAccountName",
|
||||
portalRunnerKey = "notebooksAccountKey",
|
||||
portalRunnerSubscripton = "notebooksAccountSubscriptonId",
|
||||
portalRunnerResourceGroup = "notebooksAccountResourceGroup"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user