More cleanup

This commit is contained in:
Steve Faulkner 2020-11-11 15:45:32 -06:00
parent 415ebc505b
commit 627c346559
3 changed files with 1 additions and 45 deletions

View File

@ -55,16 +55,6 @@
<span>Learn more about minimum throughput </span> <span>Learn more about minimum throughput </span>
<a href="https://docs.microsoft.com/azure/cosmos-db/set-throughput" target="_blank">here.</a> <a href="https://docs.microsoft.com/azure/cosmos-db/set-throughput" target="_blank">here.</a>
</p> </p>
<p data-bind="visible: canRequestSupport">
<!-- TODO: Replace link with call to the Azure Support blade -->
<a href="https://aka.ms/cosmosdbfeedback?subject=Cosmos%20DB%20More%20Throughput%20Request"
>Contact support</a
>
for more than <span data-bind="text: maxRUsText"></span> RU/s
</p>
<p data-bind="visible: shouldDisplayPortalUsePrompt">
Use Data Explorer from Azure Portal to request more than <span data-bind="text: maxRUsText"></span> RU/s
</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -63,8 +63,6 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
public isTemplateReady: ko.Observable<boolean>; public isTemplateReady: ko.Observable<boolean>;
public minRUAnotationVisible: ko.Computed<boolean>; public minRUAnotationVisible: ko.Computed<boolean>;
public minRUs: ko.Computed<number>; public minRUs: ko.Computed<number>;
public maxRUs: ko.Computed<number>;
public maxRUsText: ko.PureComputed<string>;
public notificationStatusInfo: ko.Observable<string>; public notificationStatusInfo: ko.Observable<string>;
public pendingNotification: ko.Observable<DataModels.Notification>; public pendingNotification: ko.Observable<DataModels.Notification>;
public requestUnitsUsageCost: ko.PureComputed<string>; public requestUnitsUsageCost: ko.PureComputed<string>;
@ -207,26 +205,6 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
return PricingUtils.isLargerThanDefaultMinRU(this.minRUs()); return PricingUtils.isLargerThanDefaultMinRU(this.minRUs());
}); });
this.maxRUs = ko.computed<number>(() => {
const collectionThroughputInfo: DataModels.OfferThroughputInfo =
this.database &&
this.database.offer &&
this.database.offer() &&
this.database.offer().content &&
this.database.offer().content.collectionThroughputInfo;
const numPartitions = collectionThroughputInfo && collectionThroughputInfo.numPhysicalPartitions;
if (!!numPartitions) {
return SharedConstants.CollectionCreation.MaxRUPerPartition * numPartitions;
}
const throughputDefaults = this.container.collectionCreationDefaults.throughput;
return throughputDefaults.unlimitedmax;
});
this.maxRUsText = ko.pureComputed(() => {
return SharedConstants.CollectionCreation.DefaultCollectionRUs1Million.toLocaleString();
});
this.throughputTitle = ko.pureComputed<string>(() => { this.throughputTitle = ko.pureComputed<string>(() => {
if (this.isAutoPilotSelected()) { if (this.isAutoPilotSelected()) {
return AutoPilotUtils.getAutoPilotHeaderText(); return AutoPilotUtils.getAutoPilotHeaderText();
@ -268,17 +246,10 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
return throughputApplyShortDelayMessage(this.isAutoPilotSelected(), throughput, this.database.id()); return throughputApplyShortDelayMessage(this.isAutoPilotSelected(), throughput, this.database.id());
} }
if ( if (this.throughput() > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million) {
this.maxRUs() <= SharedConstants.CollectionCreation.DefaultCollectionRUs1Million &&
this.throughput() > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million
) {
return updateThroughputBeyondLimitWarningMessage; return updateThroughputBeyondLimitWarningMessage;
} }
if (this.throughput() > this.maxRUs()) {
return updateThroughputDelayedApplyWarningMessage;
}
if (this.pendingNotification()) { if (this.pendingNotification()) {
const matches: string[] = this.pendingNotification().description.match("Throughput update for (.*) RU/s"); const matches: string[] = this.pendingNotification().description.match("Throughput update for (.*) RU/s");
const throughput: number = matches.length > 1 && Number(matches[1]); const throughput: number = matches.length > 1 && Number(matches[1]);

View File

@ -170,7 +170,6 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
public indexingPolicyElementFocused: ko.Observable<boolean>; public indexingPolicyElementFocused: ko.Observable<boolean>;
public minRUs: ko.Computed<number>; public minRUs: ko.Computed<number>;
public minRUAnotationVisible: ko.Computed<boolean>; public minRUAnotationVisible: ko.Computed<boolean>;
public maxRUsText: ko.PureComputed<string>;
public notificationStatusInfo: ko.Observable<string>; public notificationStatusInfo: ko.Observable<string>;
public partitionKeyName: ko.Computed<string>; public partitionKeyName: ko.Computed<string>;
public partitionKeyVisible: ko.PureComputed<boolean>; public partitionKeyVisible: ko.PureComputed<boolean>;
@ -485,10 +484,6 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
return PricingUtils.isLargerThanDefaultMinRU(this.minRUs()); return PricingUtils.isLargerThanDefaultMinRU(this.minRUs());
}); });
this.maxRUsText = ko.pureComputed(() => {
return SharedConstants.CollectionCreation.DefaultCollectionRUs1Million.toLocaleString();
});
this.throughputTitle = ko.pureComputed<string>(() => { this.throughputTitle = ko.pureComputed<string>(() => {
if (this.isAutoPilotSelected()) { if (this.isAutoPilotSelected()) {
return AutoPilotUtils.getAutoPilotHeaderText(); return AutoPilotUtils.getAutoPilotHeaderText();