-
Notifications
You must be signed in to change notification settings - Fork 134
/
premium-plan-price-spec.ts
138 lines (122 loc) · 4.7 KB
/
premium-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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import { Injector } from '@angular/core';
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 abstract class PremiumPlanPriceSpec extends PriceSpec {
sku = ServerFarmSku.premium;
featureItems = [{
iconUrl: 'image/ssl.svg',
title: this._ts.instant(PortalResources.pricing_customDomainsSsl),
description: this._ts.instant(PortalResources.pricing_customDomainsIpSslDesc),
},
{
iconUrl: 'image/scale-up.svg',
title: this._ts.instant(PortalResources.pricing_autoScale),
description: this._ts.instant(PortalResources.pricing_scaleDesc).format(20),
},
{
iconUrl: 'image/slots.svg',
title: this._ts.instant(PortalResources.pricing_stagingSlots),
description: this._ts.instant(PortalResources.pricing_slotsDesc).format(20),
},
{
iconUrl: 'image/backups.svg',
title: this._ts.instant(PortalResources.pricing_dailyBackups),
description: this._ts.instant(PortalResources.pricing_dailyBackupDesc).format(50),
},
{
iconUrl: 'image/globe.svg',
title: this._ts.instant(PortalResources.pricing_trafficManager),
description: this._ts.instant(PortalResources.pricing_trafficManagerDesc),
}];
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_dedicatedMemory),
},
{
iconUrl: 'image/storage.svg',
title: this._ts.instant(PortalResources.storage),
description: this._ts.instant(PortalResources.pricing_sharedDisk).format('250 GB'),
}];
cssClass = 'spec premium-spec';
constructor(injector: Injector) {
super(injector);
}
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);
}
}
export class PremiumSmallPlanPriceSpec extends PremiumPlanPriceSpec {
skuCode = 'P1';
legacySkuName = 'small_premium';
topLevelFeatures = [
this._ts.instant(PortalResources.pricing_ACU).format('100'),
this._ts.instant(PortalResources.pricing_memory).format('1.75'),
this._ts.instant(PortalResources.pricing_aSeriesComputeEquivalent),
];
meterFriendlyName = 'Premium Small App Service Hours';
specResourceSet = {
id: 'p1',
firstParty: [{
quantity: 744,
resourceId: null
}]
};
}
export class PremiumMediumPlanPriceSpec extends PremiumPlanPriceSpec {
skuCode = 'P2';
legacySkuName = 'medium_premium';
topLevelFeatures = [
this._ts.instant(PortalResources.pricing_ACU).format('200'),
this._ts.instant(PortalResources.pricing_memory).format('3.5'),
this._ts.instant(PortalResources.pricing_aSeriesComputeEquivalent),
];
meterFriendlyName = 'Premium Medium App Service Hours';
specResourceSet = {
id: 'p2',
firstParty: [{
quantity: 744,
resourceId: null
}]
};
}
export class PremiumLargePlanPriceSpec extends PremiumPlanPriceSpec {
skuCode = 'P3';
legacySkuName = 'large_premium';
topLevelFeatures = [
this._ts.instant(PortalResources.pricing_ACU).format('400'),
this._ts.instant(PortalResources.pricing_memory).format('7'),
this._ts.instant(PortalResources.pricing_aSeriesComputeEquivalent),
];
meterFriendlyName = 'Premium Large App Service Hours';
specResourceSet = {
id: 'p3',
firstParty: [{
quantity: 744,
resourceId: null
}]
};
}