mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 06:56:38 +00:00
Merge branch 'add-dp-rbac' of https://github.com/Azure/cosmos-explorer
This commit is contained in:
commit
8849526fab
@ -185,6 +185,9 @@ export class CassandraProxyAPIs {
|
||||
export class Queries {
|
||||
public static CustomPageOption: string = "custom";
|
||||
public static UnlimitedPageOption: string = "unlimited";
|
||||
public static setAutomaticRBACOption: string = "Automatic";
|
||||
public static setTrueRBACOption: string = "True";
|
||||
public static setFalseRBACOption: string = "False";
|
||||
public static itemsPerPage: number = 100;
|
||||
public static unlimitedItemsPerPage: number = 100; // TODO: Figure out appropriate value so it works for accounts with a large number of partitions
|
||||
public static containersPerPage: number = 50;
|
||||
|
@ -710,3 +710,4 @@ async function errorHandling(response: Response, action: string, params: unknown
|
||||
export function getARMCreateCollectionEndpoint(params: DataModels.MongoParameters): string {
|
||||
return `subscriptions/${params.sid}/resourceGroups/${params.rg}/providers/Microsoft.DocumentDB/databaseAccounts/${userContext.databaseAccount.name}/mongodbDatabases/${params.db}/collections/${params.coll}`;
|
||||
}
|
||||
|
||||
|
@ -129,6 +129,12 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
|
||||
|
||||
LocalStorageUtility.setEntryNumber(StorageKey.CustomItemPerPage, customItemPerPage);
|
||||
|
||||
LocalStorageUtility.setEntryString(
|
||||
StorageKey.DataPlaneRbacEnabled,
|
||||
enableDataPlaneRBACOption
|
||||
);
|
||||
|
||||
|
||||
LocalStorageUtility.setEntryString(
|
||||
StorageKey.DataPlaneRbacEnabled,
|
||||
enableDataPlaneRBACOption
|
||||
@ -428,6 +434,27 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{(
|
||||
<div className="settingsSection">
|
||||
<div className="settingsSectionPart">
|
||||
<fieldset>
|
||||
<legend id="enableDataPlaneRBACOptions" className="settingsSectionLabel legendLabel">
|
||||
Enable DataPlane RBAC
|
||||
</legend>
|
||||
<InfoTooltip>
|
||||
Choose Automatic to enable DataPlane RBAC automatically. True/False to voluntarily enable/disable DataPlane RBAC
|
||||
</InfoTooltip>
|
||||
<ChoiceGroup
|
||||
ariaLabelledBy="enableDataPlaneRBACOptions"
|
||||
selectedKey={enableDataPlaneRBACOption}
|
||||
options={dataPlaneRBACOptionsList}
|
||||
styles={choiceButtonStyles}
|
||||
onChange={handleOnDataPlaneRBACOptionChange}
|
||||
/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{userContext.apiType === "SQL" && (
|
||||
<>
|
||||
<div className="settingsSection">
|
||||
|
@ -749,6 +749,10 @@ export class CassandraAPIDataClient extends TableDataClient {
|
||||
CassandraProxyEndpoints.Prod,
|
||||
];
|
||||
let canAccessCassandraProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled";
|
||||
if (
|
||||
configContext.CASSANDRA_PROXY_ENDPOINT !== CassandraProxyEndpoints.Development &&
|
||||
userContext.databaseAccount.properties.ipRules?.length > 0
|
||||
) {
|
||||
if (
|
||||
configContext.CASSANDRA_PROXY_ENDPOINT !== CassandraProxyEndpoints.Development &&
|
||||
userContext.databaseAccount.properties.ipRules?.length > 0
|
||||
@ -763,3 +767,4 @@ export class CassandraAPIDataClient extends TableDataClient {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,6 +419,7 @@ async function configurePortal(): Promise<Explorer> {
|
||||
authType: AuthType.AAD,
|
||||
});
|
||||
|
||||
|
||||
let explorer: Explorer;
|
||||
return new Promise(async (resolve) => {
|
||||
// In development mode, try to load the iframe message from session storage.
|
||||
@ -434,6 +435,7 @@ async function configurePortal(): Promise<Explorer> {
|
||||
updateContextsFromPortalMessage(message);
|
||||
explorer = new Explorer();
|
||||
|
||||
|
||||
// In development mode, save the iframe message from the portal in session storage.
|
||||
// This allows webpack hot reload to funciton properly
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
|
Loading…
Reference in New Issue
Block a user