@cloud-ru/uikit-product-calculator 0.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1508 -0
- package/LICENSE +201 -0
- package/README.md +85 -0
- package/package.json +75 -0
- package/src/components/Calculator/Calculator.tsx +79 -0
- package/src/components/Calculator/index.ts +1 -0
- package/src/components/CalculatorContent/CalculatorContent.tsx +38 -0
- package/src/components/CalculatorContent/index.ts +1 -0
- package/src/components/CalculatorContent/styles.module.scss +79 -0
- package/src/components/Catalog/Catalog.tsx +225 -0
- package/src/components/Catalog/components/PrivateCardHeader.tsx +63 -0
- package/src/components/Catalog/components/index.ts +1 -0
- package/src/components/Catalog/components/styles.module.scss +35 -0
- package/src/components/Catalog/index.ts +1 -0
- package/src/components/Catalog/styles.module.scss +104 -0
- package/src/components/Controls/AlertControl/AlertControl.tsx +44 -0
- package/src/components/Controls/AlertControl/index.ts +1 -0
- package/src/components/Controls/ArrayControl/ArrayControl.tsx +105 -0
- package/src/components/Controls/ArrayControl/index.ts +1 -0
- package/src/components/Controls/ArrayControl/styles.module.scss +33 -0
- package/src/components/Controls/CarouselControl/CarouselControl.tsx +173 -0
- package/src/components/Controls/CarouselControl/index.ts +1 -0
- package/src/components/Controls/CarouselControl/styles.module.scss +32 -0
- package/src/components/Controls/Control/Control.tsx +205 -0
- package/src/components/Controls/Control/index.ts +1 -0
- package/src/components/Controls/ObjectControl/ObjectControl.tsx +150 -0
- package/src/components/Controls/ObjectControl/index.ts +1 -0
- package/src/components/Controls/ObjectControl/styles.module.scss +18 -0
- package/src/components/Controls/ObjectDecorator/ObjectDecorator.tsx +23 -0
- package/src/components/Controls/ObjectDecorator/index.ts +1 -0
- package/src/components/Controls/ObjectDecorator/styles.module.scss +15 -0
- package/src/components/Controls/SegmentedControl/SegmentedControl.tsx +79 -0
- package/src/components/Controls/SegmentedControl/SegmentedControlCard.tsx +38 -0
- package/src/components/Controls/SegmentedControl/index.ts +1 -0
- package/src/components/Controls/SegmentedControl/styles.module.scss +8 -0
- package/src/components/Controls/SelectControl/SelectControl.tsx +172 -0
- package/src/components/Controls/SelectControl/index.ts +1 -0
- package/src/components/Controls/SelectControl/styles.module.scss +5 -0
- package/src/components/Controls/SliderControl/SliderControl.tsx +92 -0
- package/src/components/Controls/SliderControl/index.ts +1 -0
- package/src/components/Controls/StepperControl/StepperControl.tsx +160 -0
- package/src/components/Controls/StepperControl/index.ts +1 -0
- package/src/components/Controls/StepperControl/styles.module.scss +16 -0
- package/src/components/Controls/TableControl/TableControl.tsx +162 -0
- package/src/components/Controls/TableControl/helperComponents/StepperWithAllowedValues.tsx +50 -0
- package/src/components/Controls/TableControl/helperComponents/index.ts +1 -0
- package/src/components/Controls/TableControl/helperComponents/styles.module.scss +53 -0
- package/src/components/Controls/TableControl/index.ts +1 -0
- package/src/components/Controls/TableControl/styles.module.scss +104 -0
- package/src/components/Controls/ToggleCard/ToggleCard.tsx +46 -0
- package/src/components/Controls/ToggleCard/index.ts +1 -0
- package/src/components/Controls/ToggleCard/styles.module.scss +11 -0
- package/src/components/Controls/ToggleCardsControl/ToggleCardsControl.tsx +93 -0
- package/src/components/Controls/ToggleCardsControl/index.ts +1 -0
- package/src/components/Controls/ToggleCardsControl/styles.module.scss +40 -0
- package/src/components/Controls/ToggleControl/ToggleControl.tsx +59 -0
- package/src/components/Controls/ToggleControl/components/SwitchRow.tsx +98 -0
- package/src/components/Controls/ToggleControl/components/index.ts +1 -0
- package/src/components/Controls/ToggleControl/components/styles.module.scss +110 -0
- package/src/components/Controls/ToggleControl/index.ts +1 -0
- package/src/components/Controls/ToggleObjectControl/ToggleObjectControl.tsx +111 -0
- package/src/components/Controls/ToggleObjectControl/index.ts +1 -0
- package/src/components/Controls/ToggleObjectControl/styles.module.scss +13 -0
- package/src/components/Controls/constants.ts +16 -0
- package/src/components/Controls/index.tsx +26 -0
- package/src/components/Controls/types.ts +181 -0
- package/src/components/Controls/utils.ts +49 -0
- package/src/components/Disclaimer/Disclaimer.tsx +33 -0
- package/src/components/Disclaimer/index.ts +1 -0
- package/src/components/Disclaimer/styles.module.scss +14 -0
- package/src/components/HeaderContainer/index.tsx +32 -0
- package/src/components/HeaderContainer/styles.module.scss +24 -0
- package/src/components/PriceSummary/PriceSummary.tsx +158 -0
- package/src/components/PriceSummary/components/PricePeriodSelect/PricePeriodSelect.tsx +81 -0
- package/src/components/PriceSummary/components/PricePeriodSelect/index.ts +1 -0
- package/src/components/PriceSummary/components/ProductCard/ProductCard.tsx +85 -0
- package/src/components/PriceSummary/components/ProductCard/index.ts +1 -0
- package/src/components/PriceSummary/components/ProductCard/styles.module.scss +7 -0
- package/src/components/PriceSummary/components/ProductListActions/ProductListActions.tsx +118 -0
- package/src/components/PriceSummary/components/ProductListActions/index.ts +1 -0
- package/src/components/PriceSummary/components/ProductListActions/styles.module.scss +38 -0
- package/src/components/PriceSummary/components/index.ts +3 -0
- package/src/components/PriceSummary/hooks.ts +36 -0
- package/src/components/PriceSummary/index.ts +1 -0
- package/src/components/PriceSummary/styles.module.scss +110 -0
- package/src/components/PriceSummary/utils/getTotalPrice.ts +19 -0
- package/src/components/PriceSummary/utils/index.ts +2 -0
- package/src/components/PriceSummary/utils/transformToProductCardData.ts +36 -0
- package/src/components/ProductHeadline/ProductPageHeadline.tsx +134 -0
- package/src/components/ProductHeadline/components/PriceCount.tsx +93 -0
- package/src/components/ProductHeadline/components/index.ts +1 -0
- package/src/components/ProductHeadline/components/styles.module.scss +52 -0
- package/src/components/ProductHeadline/index.ts +1 -0
- package/src/components/ProductHeadline/styles.module.scss +32 -0
- package/src/components/ProductPage/ProductPage.tsx +105 -0
- package/src/components/ProductPage/index.ts +1 -0
- package/src/components/ProductPage/styles.module.scss +13 -0
- package/src/components/Welcome/Welcome.tsx +138 -0
- package/src/components/Welcome/index.ts +1 -0
- package/src/components/Welcome/styles.module.scss +155 -0
- package/src/components/index.ts +3 -0
- package/src/config/config.tsx +27 -0
- package/src/config/index.ts +2 -0
- package/src/config/platforms/advanced/catalog.ts +82 -0
- package/src/config/platforms/advanced/constants.ts +23 -0
- package/src/config/platforms/advanced/index.ts +5 -0
- package/src/config/platforms/advanced/platform.tsx +13 -0
- package/src/config/platforms/advanced/product-config/AdvancedCloudBackup.ts +76 -0
- package/src/config/platforms/advanced/product-config/AdvancedCloudContainerEngine.tsx +260 -0
- package/src/config/platforms/advanced/product-config/AdvancedCloudServer.tsx +526 -0
- package/src/config/platforms/advanced/product-config/AdvancedDataAsYouUse.ts +159 -0
- package/src/config/platforms/advanced/product-config/AdvancedDataLakeInsight.ts +134 -0
- package/src/config/platforms/advanced/product-config/AdvancedDataWarehouseService.ts +94 -0
- package/src/config/platforms/advanced/product-config/AdvancedDcsMemcached.ts +69 -0
- package/src/config/platforms/advanced/product-config/AdvancedDcsRedis.ts +220 -0
- package/src/config/platforms/advanced/product-config/AdvancedDmsKafka.tsx +186 -0
- package/src/config/platforms/advanced/product-config/AdvancedDmsRabbitMq.ts +202 -0
- package/src/config/platforms/advanced/product-config/AdvancedDocumentDatabase.tsx +323 -0
- package/src/config/platforms/advanced/product-config/AdvancedElasticLoadBalance.tsx +252 -0
- package/src/config/platforms/advanced/product-config/AdvancedElasticSearch.ts +365 -0
- package/src/config/platforms/advanced/product-config/AdvancedFunctionGraph.tsx +65 -0
- package/src/config/platforms/advanced/product-config/AdvancedMapReduce.tsx +394 -0
- package/src/config/platforms/advanced/product-config/AdvancedMySqlDataBase.ts +417 -0
- package/src/config/platforms/advanced/product-config/AdvancedNetwork.ts +146 -0
- package/src/config/platforms/advanced/product-config/AdvancedObjectStorage.ts +232 -0
- package/src/config/platforms/advanced/product-config/AdvancedPostgreSqlDatabase.ts +402 -0
- package/src/config/platforms/advanced/product-config/AdvancedScalableFile.tsx +161 -0
- package/src/config/platforms/advanced/product-config/AdvancedSqlDatabase.ts +380 -0
- package/src/config/platforms/advanced/product-config/index.ts +21 -0
- package/src/config/platforms/advanced/products.ts +267 -0
- package/src/config/platforms/evolution/catalog.tsx +107 -0
- package/src/config/platforms/evolution/constants.ts +80 -0
- package/src/config/platforms/evolution/index.ts +5 -0
- package/src/config/platforms/evolution/platform.tsx +13 -0
- package/src/config/platforms/evolution/product-config/EvolutionArenadataDb.ts +151 -0
- package/src/config/platforms/evolution/product-config/EvolutionArtifactRegistry.ts +57 -0
- package/src/config/platforms/evolution/product-config/EvolutionBareMetal.tsx +172 -0
- package/src/config/platforms/evolution/product-config/EvolutionCloudServer.tsx +407 -0
- package/src/config/platforms/evolution/product-config/EvolutionCloudServerFreeTier.tsx +185 -0
- package/src/config/platforms/evolution/product-config/EvolutionCloudServerGpu.tsx +301 -0
- package/src/config/platforms/evolution/product-config/EvolutionContainerApps.ts +84 -0
- package/src/config/platforms/evolution/product-config/EvolutionContainerAppsFreeTier.ts +29 -0
- package/src/config/platforms/evolution/product-config/EvolutionKubernetes.ts +388 -0
- package/src/config/platforms/evolution/product-config/EvolutionManagedMetastore.ts +38 -0
- package/src/config/platforms/evolution/product-config/EvolutionManagedRedis.ts +161 -0
- package/src/config/platforms/evolution/product-config/EvolutionManagedSpark.ts +360 -0
- package/src/config/platforms/evolution/product-config/EvolutionManagedTrino.ts +53 -0
- package/src/config/platforms/evolution/product-config/EvolutionMlInference.tsx +703 -0
- package/src/config/platforms/evolution/product-config/EvolutionPostgreSql.ts +217 -0
- package/src/config/platforms/evolution/product-config/EvolutionPublicIp.ts +39 -0
- package/src/config/platforms/evolution/product-config/EvolutionSnatGateway.ts +22 -0
- package/src/config/platforms/evolution/product-config/EvolutionStorageS3.ts +223 -0
- package/src/config/platforms/evolution/product-config/EvolutionStorageS3FreeTier.ts +97 -0
- package/src/config/platforms/evolution/product-config/index.ts +17 -0
- package/src/config/platforms/evolution/products.ts +260 -0
- package/src/config/platforms/index.ts +3 -0
- package/src/config/platforms/vmware/catalog.ts +19 -0
- package/src/config/platforms/vmware/constants.ts +6 -0
- package/src/config/platforms/vmware/index.ts +5 -0
- package/src/config/platforms/vmware/platform.tsx +13 -0
- package/src/config/platforms/vmware/product-config/VmWareCloudBackup.ts +56 -0
- package/src/config/platforms/vmware/product-config/VmWareVirtualDataCenter.ts +309 -0
- package/src/config/platforms/vmware/product-config/VmWareVirtualMachinesBackup.ts +58 -0
- package/src/config/platforms/vmware/product-config/VmWareVirtualWorkspaces.tsx +210 -0
- package/src/config/platforms/vmware/product-config/index.ts +4 -0
- package/src/config/platforms/vmware/products.ts +63 -0
- package/src/config/styles.module.scss +9 -0
- package/src/config/utils/disk.ts +94 -0
- package/src/config/utils/diskPostgreSqlMySQL.ts +94 -0
- package/src/config/utils/eip.ts +104 -0
- package/src/config/utils/index.ts +52 -0
- package/src/config/utils/obs.ts +100 -0
- package/src/constants.ts +56 -0
- package/src/contexts/CalculatorContext.tsx +193 -0
- package/src/contexts/ProductContext.ts +25 -0
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useAdaptive.ts +20 -0
- package/src/hooks/useCatalogCardClick.ts +37 -0
- package/src/hooks/useProductClick.ts +14 -0
- package/src/hooks/useProductDelete.ts +46 -0
- package/src/index.ts +6 -0
- package/src/services/constants.ts +5 -0
- package/src/services/getFetcherFn.ts +57 -0
- package/src/services/getInitPrice.ts +64 -0
- package/src/services/getOnDownloadFileClick.ts +37 -0
- package/src/services/getOnShareClick.ts +56 -0
- package/src/services/index.ts +4 -0
- package/src/types/CalculatorType.ts +16 -0
- package/src/types/CatalogConfig.ts +13 -0
- package/src/types/Category.ts +14 -0
- package/src/types/FetcherFn.ts +26 -0
- package/src/types/FormValues.ts +4 -0
- package/src/types/Platform.ts +24 -0
- package/src/types/Price.ts +18 -0
- package/src/types/Product.ts +39 -0
- package/src/types/ProductState.ts +11 -0
- package/src/types/State.ts +7 -0
- package/src/types/index.ts +10 -0
- package/src/utils/filterNonEmptyArrays.ts +13 -0
- package/src/utils/formatNumber.ts +5 -0
- package/src/utils/getPrice.ts +38 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/parseKeyToDataTest.ts +14 -0
- package/src/utils/value.ts +11 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { Link } from '@snack-uikit/link';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AlertControl,
|
|
5
|
+
CarouselControl,
|
|
6
|
+
CONTROL,
|
|
7
|
+
FormConfig,
|
|
8
|
+
ObjectControl,
|
|
9
|
+
SegmentedControl,
|
|
10
|
+
StepperControl,
|
|
11
|
+
} from '../../../../components';
|
|
12
|
+
import { AnyType } from '../../../../types';
|
|
13
|
+
import { generateCpuItems, generateRamItems, getDisk } from '../../../utils';
|
|
14
|
+
|
|
15
|
+
const MrsSpecificationItem = {
|
|
16
|
+
GeneralPurpose: 'General-Purpose (ECS)',
|
|
17
|
+
DedicatedGeneralPurpose: 'Dedicated General-Purpose (ECS)',
|
|
18
|
+
MemoryOptimized: 'Memory-optimized (ECS)',
|
|
19
|
+
DiskIntensive: 'Disk-intensive (ECS)',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const mrsSpecificationItems = [
|
|
23
|
+
{
|
|
24
|
+
label: 'General-Purpose',
|
|
25
|
+
value: MrsSpecificationItem.GeneralPurpose,
|
|
26
|
+
description: (
|
|
27
|
+
<span>
|
|
28
|
+
Базовый сервер, который обеспечивает работу виртуального процессора (vCPU), памяти, сети. Подходит для базовых
|
|
29
|
+
вычислений, не требующих высокой нагрузки.{' '}
|
|
30
|
+
<Link
|
|
31
|
+
onClick={event => event.stopPropagation()}
|
|
32
|
+
href='https://cloud.ru/docs/ecs/ug/topics/glossary#term-2'
|
|
33
|
+
target='_blank'
|
|
34
|
+
textMode='accent'
|
|
35
|
+
insideText
|
|
36
|
+
size='m'
|
|
37
|
+
text='Коэффициент переподписки на ядра'
|
|
38
|
+
/>{' '}
|
|
39
|
+
1:3.
|
|
40
|
+
</span>
|
|
41
|
+
),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Dedicated General-Purpose',
|
|
45
|
+
value: MrsSpecificationItem.DedicatedGeneralPurpose,
|
|
46
|
+
description: (
|
|
47
|
+
<span>
|
|
48
|
+
Предоставляет выделенные процессоры и память. Подходит для сервисов и маломасштабных приложений баз данных с
|
|
49
|
+
высокими требованиями к производительности процессора и памяти. Не использует{' '}
|
|
50
|
+
<Link
|
|
51
|
+
onClick={event => event.stopPropagation()}
|
|
52
|
+
href='https://cloud.ru/docs/ecs/ug/topics/glossary#term-2'
|
|
53
|
+
target='_blank'
|
|
54
|
+
textMode='accent'
|
|
55
|
+
insideText
|
|
56
|
+
size='m'
|
|
57
|
+
text='переподписку на ядра'
|
|
58
|
+
/>
|
|
59
|
+
.
|
|
60
|
+
</span>
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Memory-optimized',
|
|
65
|
+
value: MrsSpecificationItem.MemoryOptimized,
|
|
66
|
+
description:
|
|
67
|
+
'Развернут на платформе виртуализации последнего поколения. Обеспечивает высокоэффективный доступ к памяти. Не использует переподписку на ядра.',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'Disk-intensive',
|
|
71
|
+
value: MrsSpecificationItem.DiskIntensive,
|
|
72
|
+
description:
|
|
73
|
+
'Disk-intensive Развернут на платформе виртуализации последнего поколения. Обеспечивает высокую пропускную способность хранилища. Не использует переподписку на ядра.',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const specificationToCpuMap = {
|
|
78
|
+
[MrsSpecificationItem.GeneralPurpose]: [16],
|
|
79
|
+
[MrsSpecificationItem.DedicatedGeneralPurpose]: [16, 32, 64],
|
|
80
|
+
[MrsSpecificationItem.MemoryOptimized]: [8, 16, 32, 64],
|
|
81
|
+
[MrsSpecificationItem.DiskIntensive]: [16, 24, 32, 48, 64, 72],
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const specificationCpuToRamMap: Record<string, Record<string, number[]>> = {
|
|
85
|
+
[MrsSpecificationItem.GeneralPurpose]: {
|
|
86
|
+
'16': [64],
|
|
87
|
+
},
|
|
88
|
+
[MrsSpecificationItem.DedicatedGeneralPurpose]: {
|
|
89
|
+
'16': [32, 64],
|
|
90
|
+
'32': [64, 128],
|
|
91
|
+
'64': [128, 256],
|
|
92
|
+
},
|
|
93
|
+
[MrsSpecificationItem.MemoryOptimized]: {
|
|
94
|
+
'8': [64],
|
|
95
|
+
'16': [128],
|
|
96
|
+
'32': [256],
|
|
97
|
+
'64': [512],
|
|
98
|
+
},
|
|
99
|
+
[MrsSpecificationItem.DiskIntensive]: {
|
|
100
|
+
'16': [64],
|
|
101
|
+
'24': [96],
|
|
102
|
+
'32': [128],
|
|
103
|
+
'48': [192],
|
|
104
|
+
'64': [256],
|
|
105
|
+
'72': [288],
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
function getNodeConfig(prefix: string): {
|
|
110
|
+
specification: CarouselControl;
|
|
111
|
+
cpu: SegmentedControl;
|
|
112
|
+
ram: SegmentedControl;
|
|
113
|
+
systemDisk: ObjectControl;
|
|
114
|
+
additionalDisk: ObjectControl;
|
|
115
|
+
additionalDiskCounter: StepperControl;
|
|
116
|
+
instanceCount: StepperControl;
|
|
117
|
+
} {
|
|
118
|
+
const accessorKey = {
|
|
119
|
+
cpu: `${prefix}.mrs.cpu`,
|
|
120
|
+
specification: `${prefix}.mrs.specification`,
|
|
121
|
+
ram: `${prefix}.mrs.ram`,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
specification: {
|
|
126
|
+
type: CONTROL.Carousel,
|
|
127
|
+
defaultValue: MrsSpecificationItem.GeneralPurpose,
|
|
128
|
+
accessorKey: accessorKey.specification,
|
|
129
|
+
items: mrsSpecificationItems,
|
|
130
|
+
decoratorProps: {
|
|
131
|
+
label: 'Тип сервера',
|
|
132
|
+
},
|
|
133
|
+
onChangeFn: (value, setValue) => {
|
|
134
|
+
const arr: [string, AnyType][] = [[accessorKey.specification, value]];
|
|
135
|
+
|
|
136
|
+
switch (value) {
|
|
137
|
+
case MrsSpecificationItem.DedicatedGeneralPurpose: {
|
|
138
|
+
arr.push([accessorKey.cpu, '16']);
|
|
139
|
+
arr.push([accessorKey.ram, '32']);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
case MrsSpecificationItem.MemoryOptimized: {
|
|
144
|
+
arr.push([accessorKey.cpu, '8']);
|
|
145
|
+
arr.push([accessorKey.ram, '64']);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case MrsSpecificationItem.DiskIntensive:
|
|
149
|
+
case MrsSpecificationItem.GeneralPurpose:
|
|
150
|
+
default: {
|
|
151
|
+
arr.push([accessorKey.cpu, '16']);
|
|
152
|
+
arr.push([accessorKey.ram, '64']);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
setValue(arr);
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
cpu: {
|
|
161
|
+
type: CONTROL.Segmented,
|
|
162
|
+
accessorKey: `${prefix}.mrs.cpu`,
|
|
163
|
+
defaultValue: '16',
|
|
164
|
+
items: generateCpuItems([16]),
|
|
165
|
+
decoratorProps: {
|
|
166
|
+
label: 'Количество vCPU',
|
|
167
|
+
},
|
|
168
|
+
watchedControls: { specification: `${prefix}.mrs.specification` },
|
|
169
|
+
relateFn: ({ specification }) => {
|
|
170
|
+
const items = specificationToCpuMap?.[specification];
|
|
171
|
+
|
|
172
|
+
if (items?.length > 0) {
|
|
173
|
+
return {
|
|
174
|
+
items: generateCpuItems(items),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
ram: {
|
|
180
|
+
type: CONTROL.Segmented,
|
|
181
|
+
accessorKey: `${prefix}.mrs.ram`,
|
|
182
|
+
defaultValue: '64',
|
|
183
|
+
items: generateRamItems([64]),
|
|
184
|
+
decoratorProps: {
|
|
185
|
+
label: 'Объём RAM',
|
|
186
|
+
},
|
|
187
|
+
watchedControls: { specification: `${prefix}.mrs.specification`, cpu: `${prefix}.mrs.cpu` },
|
|
188
|
+
relateFn: ({ specification, cpu }) => {
|
|
189
|
+
const items = specificationCpuToRamMap?.[specification]?.[cpu];
|
|
190
|
+
|
|
191
|
+
if (items?.length > 0) {
|
|
192
|
+
return {
|
|
193
|
+
items: generateRamItems(items),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
systemDisk: getDisk({
|
|
199
|
+
space: {
|
|
200
|
+
accessorKey: `${prefix}.evs.systemDisk.diskSpace`,
|
|
201
|
+
label: 'Объем системного диска',
|
|
202
|
+
defaultValue: 480,
|
|
203
|
+
uiProps: {
|
|
204
|
+
min: 480,
|
|
205
|
+
max: 1000,
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
specification: {
|
|
209
|
+
accessorKey: `${prefix}.evs.systemDisk.specification`,
|
|
210
|
+
},
|
|
211
|
+
}),
|
|
212
|
+
additionalDisk: getDisk({
|
|
213
|
+
space: {
|
|
214
|
+
accessorKey: `${prefix}.evs.additionalDisk.diskSpace`,
|
|
215
|
+
label: 'Объем дополнительного диска',
|
|
216
|
+
defaultValue: 600,
|
|
217
|
+
uiProps: {
|
|
218
|
+
min: 600,
|
|
219
|
+
max: 32_000,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
specification: {
|
|
223
|
+
accessorKey: `${prefix}.evs.additionalDisk.specification`,
|
|
224
|
+
},
|
|
225
|
+
}),
|
|
226
|
+
additionalDiskCounter: {
|
|
227
|
+
type: CONTROL.Stepper,
|
|
228
|
+
decoratorProps: {
|
|
229
|
+
label: 'Количество дополнительных дисков',
|
|
230
|
+
},
|
|
231
|
+
accessorKey: `${prefix}.evs.additionalDiskCounter`,
|
|
232
|
+
defaultValue: 1,
|
|
233
|
+
uiProps: {
|
|
234
|
+
min: 1,
|
|
235
|
+
max: 10,
|
|
236
|
+
postfix: 'Шт',
|
|
237
|
+
visible: false,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
instanceCount: {
|
|
241
|
+
type: CONTROL.Stepper,
|
|
242
|
+
decoratorProps: {
|
|
243
|
+
label: 'Количество Master Node',
|
|
244
|
+
},
|
|
245
|
+
accessorKey: `${prefix}.instanceCount`,
|
|
246
|
+
defaultValue: 2,
|
|
247
|
+
uiProps: {
|
|
248
|
+
min: 2,
|
|
249
|
+
max: 9,
|
|
250
|
+
postfix: 'Шт',
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function getAlert(prefix: string, label: string): AlertControl {
|
|
257
|
+
return {
|
|
258
|
+
type: CONTROL.Alert,
|
|
259
|
+
uiProps: {
|
|
260
|
+
description: `Для ${label} будет добавлена Виртуальная машина ECS с аналогичными параметрами по типу сервера, vCPU, RAM Виртуальная машина: ECS General-Purpose 16vCPU 64 GB`,
|
|
261
|
+
},
|
|
262
|
+
watchedControls: {
|
|
263
|
+
specification: `${prefix}.mrs.specification`,
|
|
264
|
+
cpu: `${prefix}.mrs.cpu`,
|
|
265
|
+
ram: `${prefix}.mrs.ram`,
|
|
266
|
+
},
|
|
267
|
+
relateFn: ({ specification, cpu, ram }) => ({
|
|
268
|
+
uiProps: {
|
|
269
|
+
description: (
|
|
270
|
+
<>
|
|
271
|
+
{`Для ${label} будет добавлена Виртуальная машина ECS с аналогичными параметрами по типу сервера, vCPU,
|
|
272
|
+
RAM`}
|
|
273
|
+
<br />
|
|
274
|
+
{`Виртуальная машина: ${specification} ${cpu}vCPU ${ram} GB`}
|
|
275
|
+
</>
|
|
276
|
+
),
|
|
277
|
+
},
|
|
278
|
+
}),
|
|
279
|
+
accessorKey: 'vm-add',
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const masterNode = getNodeConfig('masterNode');
|
|
284
|
+
const workerNode = getNodeConfig('workerNode');
|
|
285
|
+
|
|
286
|
+
export const MAP_REDUCE_FORM_CONFIG: FormConfig = {
|
|
287
|
+
ui: ['masterNode', 'workerNode'],
|
|
288
|
+
controls: {
|
|
289
|
+
masterNode: {
|
|
290
|
+
type: CONTROL.Object,
|
|
291
|
+
decoratorProps: {
|
|
292
|
+
label: 'Master Node',
|
|
293
|
+
labelTooltip:
|
|
294
|
+
'Мастер-нода (Master Node) предназначена для управления кластером и включает в себя виртуальную машину ECS, службу MRS для работы с большими данными на базе ClickHouse и диски EVS для выполнения вычислений',
|
|
295
|
+
},
|
|
296
|
+
ui: ['alert', 'specification', ['cpu', 'ram'], ['systemDisk', 'additionalDisk'], ['instanceCount']],
|
|
297
|
+
controls: {
|
|
298
|
+
alert: getAlert('masterNode', 'Master Node'),
|
|
299
|
+
specification: { ...masterNode.specification, items: masterNode.specification.items.slice(0, 3) },
|
|
300
|
+
cpu: masterNode.cpu,
|
|
301
|
+
ram: masterNode.ram,
|
|
302
|
+
systemDisk: masterNode.systemDisk,
|
|
303
|
+
additionalDisk: masterNode.additionalDisk,
|
|
304
|
+
instanceCount: masterNode.instanceCount,
|
|
305
|
+
// Hidden
|
|
306
|
+
additionalDiskCounter: masterNode.additionalDiskCounter,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
workerNode: {
|
|
311
|
+
type: CONTROL.Object,
|
|
312
|
+
decoratorProps: {
|
|
313
|
+
label: 'Worker Node',
|
|
314
|
+
labelTooltip:
|
|
315
|
+
'Воркер-нода (Worker Node) предназначена для обработки и хранения данных и включает в себя виртуальную машину ECS, службу MRS для работы с большими данными на базе ClickHouse и диски EVS для выполнения вычислений',
|
|
316
|
+
},
|
|
317
|
+
ui: [
|
|
318
|
+
'alert',
|
|
319
|
+
'specification',
|
|
320
|
+
['cpu', 'ram'],
|
|
321
|
+
['systemDisk', 'additionalDisk'],
|
|
322
|
+
['additionalDiskCounter', 'localDisk'],
|
|
323
|
+
['instanceCount'],
|
|
324
|
+
],
|
|
325
|
+
controls: {
|
|
326
|
+
alert: getAlert('workerNode', 'Worker Node'),
|
|
327
|
+
specification: workerNode.specification,
|
|
328
|
+
cpu: workerNode.cpu,
|
|
329
|
+
ram: workerNode.ram,
|
|
330
|
+
systemDisk: workerNode.systemDisk,
|
|
331
|
+
additionalDisk: workerNode.additionalDisk,
|
|
332
|
+
additionalDiskCounter: {
|
|
333
|
+
...workerNode.additionalDiskCounter,
|
|
334
|
+
uiProps: {
|
|
335
|
+
...workerNode.additionalDiskCounter.uiProps,
|
|
336
|
+
visible: true,
|
|
337
|
+
},
|
|
338
|
+
watchedControls: { workerNodeMrsSpecification: 'workerNode.mrs.specification' },
|
|
339
|
+
relateFn: ({ workerNodeMrsSpecification }) => {
|
|
340
|
+
if (workerNodeMrsSpecification === MrsSpecificationItem.DiskIntensive) {
|
|
341
|
+
return {
|
|
342
|
+
uiProps: {
|
|
343
|
+
visible: false,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
localDisk: {
|
|
351
|
+
type: CONTROL.Object,
|
|
352
|
+
ui: ['workerNodeEvsLocalDisk'],
|
|
353
|
+
controls: {
|
|
354
|
+
workerNodeEvsLocalDisk: getDisk({
|
|
355
|
+
space: {
|
|
356
|
+
accessorKey: 'workerNode.evs.localDisk.diskSpace',
|
|
357
|
+
label: 'Объем локального диска',
|
|
358
|
+
defaultValue: 29_800,
|
|
359
|
+
uiProps: {
|
|
360
|
+
min: 600,
|
|
361
|
+
max: 32_000,
|
|
362
|
+
showHint: false,
|
|
363
|
+
disabled: true,
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
specification: {
|
|
367
|
+
accessorKey: 'workerNode.evs.localDisk.specification',
|
|
368
|
+
uiProps: {
|
|
369
|
+
disabled: true,
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
}),
|
|
373
|
+
},
|
|
374
|
+
visible: false,
|
|
375
|
+
watchedControls: { workerNodeMrsSpecification: 'workerNode.mrs.specification' },
|
|
376
|
+
relateFn: ({ workerNodeMrsSpecification }) => {
|
|
377
|
+
if (workerNodeMrsSpecification === MrsSpecificationItem.DiskIntensive) {
|
|
378
|
+
return {
|
|
379
|
+
visible: true,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
instanceCount: {
|
|
386
|
+
...workerNode.instanceCount,
|
|
387
|
+
decoratorProps: {
|
|
388
|
+
label: 'Количество Worker Node',
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
};
|