mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Add checks for serverless account (#244)
This commit is contained in:
parent
3112cf5573
commit
0f82ed3749
@ -516,6 +516,10 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.container.isServerlessEnabled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const numPartitions = this.collection.quotaInfo().numPartitions;
|
const numPartitions = this.collection.quotaInfo().numPartitions;
|
||||||
return !!this.collection.partitionKeyProperty || numPartitions > 1;
|
return !!this.collection.partitionKeyProperty || numPartitions > 1;
|
||||||
});
|
});
|
||||||
@ -525,7 +529,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.minRUs = ko.computed<number>(() => {
|
this.minRUs = ko.computed<number>(() => {
|
||||||
if (this.isTryCosmosDBSubscription()) {
|
if (this.isTryCosmosDBSubscription() || this.container.isServerlessEnabled()) {
|
||||||
return SharedConstants.CollectionCreation.DefaultCollectionRUs400;
|
return SharedConstants.CollectionCreation.DefaultCollectionRUs400;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +576,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
|||||||
|
|
||||||
this.maxRUs = ko.computed<number>(() => {
|
this.maxRUs = ko.computed<number>(() => {
|
||||||
const isTryCosmosDBSubscription = this.isTryCosmosDBSubscription();
|
const isTryCosmosDBSubscription = this.isTryCosmosDBSubscription();
|
||||||
if (isTryCosmosDBSubscription) {
|
if (isTryCosmosDBSubscription || this.container.isServerlessEnabled()) {
|
||||||
return Constants.TryCosmosExperience.maxRU;
|
return Constants.TryCosmosExperience.maxRU;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -748,7 +752,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
|||||||
if (
|
if (
|
||||||
this.rupm() === Constants.RUPMStates.on &&
|
this.rupm() === Constants.RUPMStates.on &&
|
||||||
this.throughput() >
|
this.throughput() >
|
||||||
SharedConstants.CollectionCreation.MaxRUPMPerPartition * this.collection.quotaInfo().numPartitions
|
SharedConstants.CollectionCreation.MaxRUPMPerPartition * this.collection.quotaInfo()?.numPartitions
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user