mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-26 07:26:58 +00:00
Sqlx approx cost bug fixes (#975)
* function naming changed * bug fix: replacing multiple occurences of space correctly now
This commit is contained in:
parent
65882ea831
commit
05f46dd635
@ -138,9 +138,9 @@ const getGeneralPath = (subscriptionId: string, resourceGroup: string, name: str
|
|||||||
return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`;
|
return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getReadRegions = async (): Promise<Array<string>> => {
|
export const getRegions = async (): Promise<Array<string>> => {
|
||||||
try {
|
try {
|
||||||
const readRegions = new Array<string>();
|
const regions = new Array<string>();
|
||||||
|
|
||||||
const response = await armRequestWithoutPolling<RegionsResponse>({
|
const response = await armRequestWithoutPolling<RegionsResponse>({
|
||||||
host: configContext.ARM_ENDPOINT,
|
host: configContext.ARM_ENDPOINT,
|
||||||
@ -150,13 +150,13 @@ export const getReadRegions = async (): Promise<Array<string>> => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.result.location !== undefined) {
|
if (response.result.location !== undefined) {
|
||||||
readRegions.push(response.result.location.replace(" ", "").toLowerCase());
|
regions.push(response.result.location.split(" ").join("").toLowerCase());
|
||||||
} else {
|
} else {
|
||||||
for (const location of response.result.locations) {
|
for (const location of response.result.locations) {
|
||||||
readRegions.push(location.locationName.replace(" ", "").toLowerCase());
|
regions.push(location.locationName.split(" ").join("").toLowerCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return readRegions;
|
return regions;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return new Array<string>();
|
return new Array<string>();
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ import {
|
|||||||
deleteDedicatedGatewayResource,
|
deleteDedicatedGatewayResource,
|
||||||
getCurrentProvisioningState,
|
getCurrentProvisioningState,
|
||||||
getPriceMap,
|
getPriceMap,
|
||||||
getReadRegions,
|
getRegions,
|
||||||
refreshDedicatedGatewayProvisioning,
|
refreshDedicatedGatewayProvisioning,
|
||||||
updateDedicatedGatewayResource,
|
updateDedicatedGatewayResource,
|
||||||
} from "./SqlX.rp";
|
} from "./SqlX.rp";
|
||||||
@ -324,7 +324,7 @@ export default class SqlX extends SelfServeBaseClass {
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
regions = await getReadRegions();
|
regions = await getRegions();
|
||||||
priceMap = await getPriceMap(regions);
|
priceMap = await getPriceMap(regions);
|
||||||
|
|
||||||
const response = await getCurrentProvisioningState();
|
const response = await getCurrentProvisioningState();
|
||||||
|
Loading…
Reference in New Issue
Block a user