-
Notifications
You must be signed in to change notification settings - Fork 134
/
shared-plan-price-spec.ts
70 lines (62 loc) · 2.57 KB
/
shared-plan-price-spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { Kinds, Links, ServerFarmSku } from '../../../shared/models/constants';
import { PortalResources } from './../../../shared/models/portal-resources';
import { AppKind } from './../../../shared/Utilities/app-kind';
import { PriceSpec, PriceSpecInput } from './price-spec';
export class SharedPlanPriceSpec extends PriceSpec {
sku = ServerFarmSku.shared;
skuCode = 'D1';
legacySkuName = 'shared';
topLevelFeatures = [
this._ts.instant(PortalResources.pricing_sharedInfrastructure),
this._ts.instant(PortalResources.pricing_memory).format(1),
this._ts.instant(PortalResources.pricing_computeLimit).format(240),
];
featureItems = [{
iconUrl: 'image/custom-domains.svg',
title: this._ts.instant(PortalResources.feature_customDomainsName),
description: this._ts.instant(PortalResources.feature_customDomainsInfo),
}];
hardwareItems = [{
iconUrl: 'image/app-service-plan.svg',
title: this._ts.instant(PortalResources.pricing_includedHardware_azureComputeUnits),
description: this._ts.instant(PortalResources.pricing_computeDedicatedAcu),
learnMoreUrl: Links.azureComputeUnitLearnMore,
},
{
iconUrl: 'image/website-power.svg',
title: this._ts.instant(PortalResources.memory),
description: this._ts.instant(PortalResources.pricing_sharedMemory),
},
{
iconUrl: 'image/storage.svg',
title: this._ts.instant(PortalResources.storage),
description: this._ts.instant(PortalResources.pricing_sharedDisk).format('1 GB'),
}];
meterFriendlyName = 'Shared App Service Hours';
specResourceSet = {
id: this.skuCode,
firstParty: [{
quantity: 744,
resourceId: null
}]
};
cssClass = 'spec premium-spec';
runInitialization(input: PriceSpecInput) {
// data should only be populated for new plans
if (input.specPickerInput.data) {
if (input.specPickerInput.data.hostingEnvironmentName
|| input.specPickerInput.data.isLinux
|| input.specPickerInput.data.isXenon
|| input.specPickerInput.data.isElastic) {
this.state = 'hidden';
}
} else if (input.plan) {
if (input.plan.properties.hostingEnvironmentProfile
|| input.plan.properties.isXenon
|| AppKind.hasAnyKind(input.plan, [Kinds.linux, Kinds.elastic])) {
this.state = 'hidden';
}
}
return this.checkIfDreamspark(input.subscriptionId);
}
}