@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,260 @@
|
|
|
1
|
+
import { CONTROL, FormConfig } from '../../../../components';
|
|
2
|
+
import styles from '../../../styles.module.scss';
|
|
3
|
+
import { generateCpuItems, generateRamItems, getDisk } from '../../../utils';
|
|
4
|
+
import {
|
|
5
|
+
cascadeLakeServerGenItem,
|
|
6
|
+
ecsSpecificationGenCpuToRamMap,
|
|
7
|
+
ecsSpecificationGenToCpuMap,
|
|
8
|
+
EcsSpecificationItem,
|
|
9
|
+
ecsSpecificationItems,
|
|
10
|
+
ecsSpecificationToGenMap,
|
|
11
|
+
EcsSpecificationType,
|
|
12
|
+
iceLakeServerGenItem,
|
|
13
|
+
OsItem,
|
|
14
|
+
osItems,
|
|
15
|
+
ServerGenType,
|
|
16
|
+
} from './AdvancedCloudServer';
|
|
17
|
+
|
|
18
|
+
const DeploymentZonesNumberItem = {
|
|
19
|
+
'1AZ': '1AZ',
|
|
20
|
+
'3AZ': '3AZ',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const deploymentZonesNumberItems = [
|
|
24
|
+
{
|
|
25
|
+
value: DeploymentZonesNumberItem['1AZ'],
|
|
26
|
+
label: '1AZ',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: DeploymentZonesNumberItem['3AZ'],
|
|
30
|
+
label: '3AZ',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const CLOUD_CONTAINER_ENGINE_FORM_CONFIG: FormConfig = {
|
|
35
|
+
ui: [['deploymentZonesNumber', 'masterNodeNumber'], 'masterNodeNumberAlert', 'ecs'],
|
|
36
|
+
controls: {
|
|
37
|
+
deploymentZonesNumber: {
|
|
38
|
+
type: CONTROL.Segmented,
|
|
39
|
+
accessorKey: 'cce.deploymentZonesNumber',
|
|
40
|
+
defaultValue: DeploymentZonesNumberItem['1AZ'],
|
|
41
|
+
items: deploymentZonesNumberItems,
|
|
42
|
+
decoratorProps: {
|
|
43
|
+
label: 'Количество зон развертывания мастер-нод',
|
|
44
|
+
labelTooltip:
|
|
45
|
+
'При использовании режима 3AZ будут созданы три мастер-узла, а при отказе одного мастер-узла будет создаваться кластер.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
masterNodeNumber: {
|
|
49
|
+
type: CONTROL.Segmented,
|
|
50
|
+
accessorKey: 'cce.masterNodeNumber',
|
|
51
|
+
defaultValue: '50',
|
|
52
|
+
items: generateCpuItems([50, 200, 1000]),
|
|
53
|
+
decoratorProps: {
|
|
54
|
+
label: 'Максимальное количество узлов',
|
|
55
|
+
labelTooltip: ' Количество серверов (виртуальных машин), на которых разворачивают и запускают контейнеры',
|
|
56
|
+
},
|
|
57
|
+
watchedControls: { deploymentZonesNumber: 'cce.deploymentZonesNumber' },
|
|
58
|
+
relateFn: ({ deploymentZonesNumber }) => {
|
|
59
|
+
if (deploymentZonesNumber === DeploymentZonesNumberItem['3AZ']) {
|
|
60
|
+
return {
|
|
61
|
+
items: generateCpuItems([50, 200, 1000, 2000]),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
masterNodeNumberAlert: {
|
|
67
|
+
type: CONTROL.Alert,
|
|
68
|
+
uiProps: {
|
|
69
|
+
description: 'При выборе 1 000 узлов и более активируется Kubernetes Turbo.',
|
|
70
|
+
link: {
|
|
71
|
+
target: '_blank',
|
|
72
|
+
href: 'https://cloud.ru/docs/cce/ug/topics/overview__comparison',
|
|
73
|
+
text: 'Сравнение Kubernetes и Kubernetes Turbo',
|
|
74
|
+
},
|
|
75
|
+
visible: false,
|
|
76
|
+
},
|
|
77
|
+
accessorKey: 'turbo',
|
|
78
|
+
watchedControls: { masterNodeNumber: 'cce.masterNodeNumber' },
|
|
79
|
+
relateFn: ({ masterNodeNumber }) => {
|
|
80
|
+
if (Number(masterNodeNumber) >= 1000) {
|
|
81
|
+
return {
|
|
82
|
+
uiProps: {
|
|
83
|
+
visible: true,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
ecs: {
|
|
91
|
+
type: CONTROL.ToggleObject,
|
|
92
|
+
switchKey: 'cce.vmServerNeeded',
|
|
93
|
+
decoratorProps: {
|
|
94
|
+
label: 'Узлы для запуска контейнера',
|
|
95
|
+
},
|
|
96
|
+
control: {
|
|
97
|
+
type: CONTROL.Object,
|
|
98
|
+
ui: [
|
|
99
|
+
['ecsSpecification', 'ecsGen'],
|
|
100
|
+
['ecsCpu', 'ecsRam'],
|
|
101
|
+
['counter'],
|
|
102
|
+
['evsSystemDisk'],
|
|
103
|
+
['evsAdditionalDisks'],
|
|
104
|
+
],
|
|
105
|
+
controls: {
|
|
106
|
+
ecsSpecification: {
|
|
107
|
+
type: CONTROL.SelectSingle,
|
|
108
|
+
accessorKey: 'ecs.specification',
|
|
109
|
+
defaultValue: EcsSpecificationItem.GeneralPurpose,
|
|
110
|
+
items: ecsSpecificationItems,
|
|
111
|
+
decoratorProps: {
|
|
112
|
+
label: 'Спецификация узлов',
|
|
113
|
+
labelTooltip: (
|
|
114
|
+
<ul className={styles.tip}>
|
|
115
|
+
<li>General-Purpose для веб-серверов и приложений с небольшой рабочей нагрузкой;</li>
|
|
116
|
+
<li>Dedicated General-Purpose для баз данных и приложений средней и высокой нагрузки;</li>
|
|
117
|
+
<li>Memory-Optimized для приложений, обрабатывающих большие объемы данных;</li>
|
|
118
|
+
<li>Disk-intensive для Big Data и распределённых вычислений;</li>
|
|
119
|
+
<li>Ultra-high I/O для ElasticSearch и высокопроизводительных реляционных баз данных.</li>
|
|
120
|
+
</ul>
|
|
121
|
+
),
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
ecsOs: {
|
|
126
|
+
type: CONTROL.Segmented,
|
|
127
|
+
accessorKey: 'ecs.os',
|
|
128
|
+
defaultValue: OsItem.Linux,
|
|
129
|
+
items: osItems,
|
|
130
|
+
decoratorProps: {
|
|
131
|
+
label: 'Операционная система',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
counter: {
|
|
136
|
+
type: CONTROL.Stepper,
|
|
137
|
+
accessorKey: 'counter',
|
|
138
|
+
defaultValue: 1,
|
|
139
|
+
decoratorProps: {
|
|
140
|
+
label: 'Количество узлов',
|
|
141
|
+
},
|
|
142
|
+
uiProps: {
|
|
143
|
+
min: 1,
|
|
144
|
+
max: 99,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
ecsCpu: {
|
|
149
|
+
type: CONTROL.SelectSingle,
|
|
150
|
+
accessorKey: 'ecs.cpu',
|
|
151
|
+
defaultValue: '1',
|
|
152
|
+
items: generateCpuItems([1, 2, 4, 8]),
|
|
153
|
+
decoratorProps: {
|
|
154
|
+
label: 'Количество vCPU',
|
|
155
|
+
labelTooltip: 'Виртуальный процессор',
|
|
156
|
+
},
|
|
157
|
+
watchedControls: { ecsSpecification: 'ecs.specification', serverGen: 'ecs.gen' },
|
|
158
|
+
relateFn: ({
|
|
159
|
+
ecsSpecification,
|
|
160
|
+
serverGen,
|
|
161
|
+
}: {
|
|
162
|
+
ecsSpecification: EcsSpecificationType;
|
|
163
|
+
serverGen: ServerGenType;
|
|
164
|
+
}) => {
|
|
165
|
+
const items = ecsSpecificationGenToCpuMap?.[ecsSpecification]?.[serverGen] || [];
|
|
166
|
+
|
|
167
|
+
if (items?.length > 0) {
|
|
168
|
+
return {
|
|
169
|
+
items: generateCpuItems(items),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
ecsRam: {
|
|
176
|
+
type: CONTROL.Segmented,
|
|
177
|
+
accessorKey: 'ecs.ram',
|
|
178
|
+
defaultValue: '1',
|
|
179
|
+
items: generateRamItems([1, 2, 4]),
|
|
180
|
+
decoratorProps: {
|
|
181
|
+
label: 'Объём RAM',
|
|
182
|
+
labelTooltip: 'Оперативная память',
|
|
183
|
+
},
|
|
184
|
+
watchedControls: { ecsSpecification: 'ecs.specification', serverGen: 'ecs.gen', cpu: 'ecs.cpu' },
|
|
185
|
+
relateFn: ({
|
|
186
|
+
ecsSpecification,
|
|
187
|
+
serverGen,
|
|
188
|
+
cpu,
|
|
189
|
+
}: {
|
|
190
|
+
ecsSpecification: EcsSpecificationType;
|
|
191
|
+
serverGen: ServerGenType;
|
|
192
|
+
cpu: string;
|
|
193
|
+
}) => {
|
|
194
|
+
const items = ecsSpecificationGenCpuToRamMap?.[ecsSpecification]?.[serverGen]?.[cpu];
|
|
195
|
+
|
|
196
|
+
if (items?.length > 0) {
|
|
197
|
+
return {
|
|
198
|
+
items: generateRamItems(items),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
ecsGen: {
|
|
205
|
+
type: CONTROL.Segmented,
|
|
206
|
+
accessorKey: 'ecs.gen',
|
|
207
|
+
defaultValue: cascadeLakeServerGenItem.value,
|
|
208
|
+
items: [cascadeLakeServerGenItem, iceLakeServerGenItem],
|
|
209
|
+
decoratorProps: {
|
|
210
|
+
label: 'Поколение',
|
|
211
|
+
labelTooltip: 'Поколение сервера',
|
|
212
|
+
},
|
|
213
|
+
watchedControls: { ecsSpecification: 'ecs.specification' },
|
|
214
|
+
relateFn: ({ ecsSpecification }: { ecsSpecification: EcsSpecificationType }) => ({
|
|
215
|
+
items: ecsSpecificationToGenMap[ecsSpecification] || [],
|
|
216
|
+
}),
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
evsSystemDisk: getDisk({
|
|
220
|
+
space: {
|
|
221
|
+
accessorKey: 'evs.systemDisk.diskSpace',
|
|
222
|
+
defaultValue: 50,
|
|
223
|
+
uiProps: {
|
|
224
|
+
min: 50,
|
|
225
|
+
max: 1_530,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
specification: {
|
|
229
|
+
accessorKey: 'evs.systemDisk.specification',
|
|
230
|
+
},
|
|
231
|
+
}),
|
|
232
|
+
|
|
233
|
+
evsAdditionalDisks: {
|
|
234
|
+
type: CONTROL.Array,
|
|
235
|
+
max: 23,
|
|
236
|
+
accessorKey: 'evs.additionalDisks',
|
|
237
|
+
defaultValue: [],
|
|
238
|
+
addText: 'Добавить диск',
|
|
239
|
+
ui: ['disk'],
|
|
240
|
+
controls: {
|
|
241
|
+
disk: getDisk({
|
|
242
|
+
space: {
|
|
243
|
+
accessorKey: 'diskSpace',
|
|
244
|
+
defaultValue: 100,
|
|
245
|
+
uiProps: {
|
|
246
|
+
min: 100,
|
|
247
|
+
max: 32_760,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
specification: {
|
|
251
|
+
accessorKey: 'specification',
|
|
252
|
+
},
|
|
253
|
+
}),
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|