@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,172 @@
|
|
|
1
|
+
import { CONTROL, FormConfig } from '../../../../components';
|
|
2
|
+
import { generateBaseItems } from '../../../utils';
|
|
3
|
+
|
|
4
|
+
const OsNameItem = {
|
|
5
|
+
Ubuntu: 'Ubuntu',
|
|
6
|
+
OracleLinux: 'Oracle Linux',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const osNameItems = [
|
|
10
|
+
{
|
|
11
|
+
value: OsNameItem.Ubuntu,
|
|
12
|
+
label: 'Ubuntu',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: OsNameItem.OracleLinux,
|
|
16
|
+
label: 'Oracle Linux',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const osNameToOsVersionMap = {
|
|
21
|
+
[OsNameItem.OracleLinux]: ['9.3'],
|
|
22
|
+
[OsNameItem.Ubuntu]: ['20.04', '22.04', '24.04'],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const NameFlavourItem = {
|
|
26
|
+
IntelBroadwellSSD: '2 x Intel Broadwell EP Xeon E5-2699 v4 22 ядра 2.2ГГц; RAM: 64ГБ; SSD: 800ГБ SATA',
|
|
27
|
+
IntelBroadwellHDD: '2 x Intel Broadwell EP Xeon E5-2699 v4 22 ядра 2.2ГГц; RAM: 64ГБ; HDD: 2 x 900ГБ SAS',
|
|
28
|
+
IntelHaswellRam64: '2 x Intel Haswell EP Xeon E5-2690 v3 12 ядер 2.6ГГц; RAM: 64ГБ; HDD: 4 x 2ТБ SATA',
|
|
29
|
+
IntelHaswellRam128: '2 x Intel Haswell EP Xeon E5-2690 v3 12 ядер 2.6ГГц; RAM: 128ГБ; HDD: 4 x 2ТБ SATA',
|
|
30
|
+
IntelSkylake: '2 x Intel Skylake-SP Xeon Gold 6161 22 ядра 2.2ГГц; RAM: 64ГБ; SSD: 4 x 800ГБ SAS',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const nameFlavourItems = [
|
|
34
|
+
{
|
|
35
|
+
value: NameFlavourItem.IntelBroadwellSSD,
|
|
36
|
+
label: '2 x Intel Broadwell EP Xeon E5-2699 v4',
|
|
37
|
+
description: (
|
|
38
|
+
<>
|
|
39
|
+
22 ядра 2.2 ГГц <br />
|
|
40
|
+
RAM 64 ГБ <br />
|
|
41
|
+
800 ГБ SSD SATA
|
|
42
|
+
</>
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: NameFlavourItem.IntelBroadwellHDD,
|
|
47
|
+
label: '2 x Intel Broadwell EP Xeon E5-2699 v4',
|
|
48
|
+
description: (
|
|
49
|
+
<>
|
|
50
|
+
22 ядра 2.2 ГГц <br />
|
|
51
|
+
RAM 64 ГБ <br /> 2 x 900 ГБ HDD SAS
|
|
52
|
+
</>
|
|
53
|
+
),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: NameFlavourItem.IntelHaswellRam64,
|
|
57
|
+
label: '2 x Intel Haswell EP Xeon E5-2690 v3',
|
|
58
|
+
description: (
|
|
59
|
+
<>
|
|
60
|
+
12 ядер 2.6 ГГц <br />
|
|
61
|
+
RAM 64 ГБ <br />4 x 2 ТБ HDD SATA
|
|
62
|
+
</>
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: NameFlavourItem.IntelHaswellRam128,
|
|
67
|
+
label: '2 x Intel Haswell EP Xeon E5-2690 v3',
|
|
68
|
+
description: (
|
|
69
|
+
<>
|
|
70
|
+
12 ядер 2.6 ГГц <br />
|
|
71
|
+
RAM 128 ГБ <br />4 x 2 ТБ HDD SATA
|
|
72
|
+
</>
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: NameFlavourItem.IntelSkylake,
|
|
77
|
+
label: '2 x Intel Skylake-SP Xeon Gold 6161',
|
|
78
|
+
description: (
|
|
79
|
+
<>
|
|
80
|
+
22 ядра 2.2 ГГц <br />
|
|
81
|
+
RAM 64 ГБ <br />4 x 800 ГБ SSD SAS
|
|
82
|
+
</>
|
|
83
|
+
),
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
export const EVOLUTION_BARE_METAL_FORM_CONFIG: FormConfig = {
|
|
88
|
+
ui: [['osName', 'osVersion'], 'nameFlavour', ['networkDisk'], 'eipAlert', 'eip'],
|
|
89
|
+
controls: {
|
|
90
|
+
osName: {
|
|
91
|
+
type: CONTROL.SelectSingle,
|
|
92
|
+
accessorKey: 'osName',
|
|
93
|
+
defaultValue: OsNameItem.Ubuntu,
|
|
94
|
+
items: osNameItems,
|
|
95
|
+
decoratorProps: {
|
|
96
|
+
label: 'Операционная система',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
osVersion: {
|
|
101
|
+
type: CONTROL.SelectSingle,
|
|
102
|
+
accessorKey: 'osVersion',
|
|
103
|
+
defaultValue: '20.04',
|
|
104
|
+
items: generateBaseItems(osNameToOsVersionMap[OsNameItem.Ubuntu]),
|
|
105
|
+
decoratorProps: {
|
|
106
|
+
label: 'Версия операционной системы',
|
|
107
|
+
},
|
|
108
|
+
watchedControls: { osName: 'osName' },
|
|
109
|
+
relateFn: ({ osName }) => {
|
|
110
|
+
const items = osNameToOsVersionMap[osName];
|
|
111
|
+
|
|
112
|
+
if (items?.length > 0) {
|
|
113
|
+
return {
|
|
114
|
+
items: generateBaseItems(items),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
nameFlavour: {
|
|
120
|
+
type: CONTROL.ToggleCards,
|
|
121
|
+
accessorKey: 'nameFlavour',
|
|
122
|
+
defaultValue: NameFlavourItem.IntelBroadwellSSD,
|
|
123
|
+
items: nameFlavourItems,
|
|
124
|
+
decoratorProps: {
|
|
125
|
+
label: 'Конфигурация',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
networkDisk: {
|
|
129
|
+
type: CONTROL.Array,
|
|
130
|
+
max: 1,
|
|
131
|
+
accessorKey: 'networkDisk',
|
|
132
|
+
defaultValue: [],
|
|
133
|
+
addText: 'Добавить диск',
|
|
134
|
+
ui: ['disk'],
|
|
135
|
+
controls: {
|
|
136
|
+
disk: {
|
|
137
|
+
type: CONTROL.Stepper,
|
|
138
|
+
decoratorProps: {
|
|
139
|
+
label: 'Сетевой диск',
|
|
140
|
+
labelTooltip: 'Дополнительное хранилище, которое можно подключить к серверу',
|
|
141
|
+
labelTooltipPlacement: 'right',
|
|
142
|
+
},
|
|
143
|
+
accessorKey: 'diskSpace',
|
|
144
|
+
defaultValue: 1,
|
|
145
|
+
uiProps: {
|
|
146
|
+
min: 1,
|
|
147
|
+
max: 4_096,
|
|
148
|
+
postfix: 'ГБ',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
eipAlert: {
|
|
154
|
+
type: CONTROL.Alert,
|
|
155
|
+
uiProps: {
|
|
156
|
+
description: 'При подключении сервиса публичный IP-адрес назначается по умолчанию',
|
|
157
|
+
},
|
|
158
|
+
accessorKey: 'public-ip',
|
|
159
|
+
},
|
|
160
|
+
eip: {
|
|
161
|
+
type: CONTROL.Toggle,
|
|
162
|
+
accessorKey: 'bindingPublickIpAddress',
|
|
163
|
+
defaultValue: true,
|
|
164
|
+
decoratorProps: {
|
|
165
|
+
label: 'Аренда публичного IP',
|
|
166
|
+
},
|
|
167
|
+
uiProps: {
|
|
168
|
+
disabled: true,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { CONTROL, FormConfig } from '../../../../components';
|
|
2
|
+
import { generateBaseItems, generateRamItems, getDisk } from '../../../utils';
|
|
3
|
+
import { guaranteedPartToVCpuMap, guaranteedPartVCpuToRamMap } from '../constants';
|
|
4
|
+
|
|
5
|
+
const GuaranteedPartItem = {
|
|
6
|
+
'10': '10',
|
|
7
|
+
'30': '30',
|
|
8
|
+
'100': '100',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const NVIDIA_A100_40GB = {
|
|
12
|
+
value: 'NVIDIA A100 40GB',
|
|
13
|
+
label: 'NVIDIA A100 40GB',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const NVIDIA_A100_80GB = {
|
|
17
|
+
value: 'NVIDIA A100 80GB',
|
|
18
|
+
label: 'NVIDIA A100 80GB',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const NVIDIA_H100_NVLINK_ITEM = {
|
|
22
|
+
value: 'NVIDIA H100 NVLink',
|
|
23
|
+
label: 'NVIDIA H100 NVLink',
|
|
24
|
+
};
|
|
25
|
+
const NVIDIA_H100_NVLINK_ITEM_PCIe = {
|
|
26
|
+
value: 'NVIDIA H100 PCIe',
|
|
27
|
+
label: 'NVIDIA H100 PCIe',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const NVIDIA_V100 = {
|
|
31
|
+
value: 'NVIDIA V100',
|
|
32
|
+
label: 'NVIDIA V100',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const MODEL_ITEMS = [
|
|
36
|
+
NVIDIA_A100_40GB,
|
|
37
|
+
NVIDIA_A100_80GB,
|
|
38
|
+
NVIDIA_H100_NVLINK_ITEM,
|
|
39
|
+
NVIDIA_H100_NVLINK_ITEM_PCIe,
|
|
40
|
+
NVIDIA_V100,
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const guaranteedPartCards = [
|
|
44
|
+
{
|
|
45
|
+
value: GuaranteedPartItem[10],
|
|
46
|
+
label: '10% доля',
|
|
47
|
+
description: 'Для тестирования и несложных приложений',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: GuaranteedPartItem[30],
|
|
51
|
+
label: '30% доля',
|
|
52
|
+
description: 'Для стандартной рабочей нагрузки',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: GuaranteedPartItem[100],
|
|
56
|
+
label: '100% доля',
|
|
57
|
+
description: 'Для высоконагруженных сервисов',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const osItems = ['CentOS 9', 'Debian 11', 'Debian 12', 'Ubuntu 20.04', 'Ubuntu 22.04', 'Ubuntu 24.04'];
|
|
62
|
+
|
|
63
|
+
const GPU_BY_MODEL: { [model: string]: number[] } = {
|
|
64
|
+
[NVIDIA_A100_40GB.value]: [1, 2, 4],
|
|
65
|
+
[NVIDIA_A100_80GB.value]: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
66
|
+
[NVIDIA_H100_NVLINK_ITEM.value]: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
67
|
+
[NVIDIA_H100_NVLINK_ITEM_PCIe.value]: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
68
|
+
[NVIDIA_V100.value]: [1, 2, 4, 8, 16],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const CPU_BY_MODEL_AND_GPU: { [model: string]: { [gpu: string]: number[] } } = {
|
|
72
|
+
[NVIDIA_A100_40GB.value]: {
|
|
73
|
+
'1': [24],
|
|
74
|
+
'2': [48],
|
|
75
|
+
'4': [96],
|
|
76
|
+
},
|
|
77
|
+
[NVIDIA_A100_80GB.value]: {
|
|
78
|
+
'1': [20],
|
|
79
|
+
'2': [40],
|
|
80
|
+
'3': [60],
|
|
81
|
+
'4': [80],
|
|
82
|
+
'5': [100],
|
|
83
|
+
'6': [120],
|
|
84
|
+
'7': [140],
|
|
85
|
+
'8': [160],
|
|
86
|
+
},
|
|
87
|
+
[NVIDIA_H100_NVLINK_ITEM.value]: {
|
|
88
|
+
'1': [20],
|
|
89
|
+
'2': [40],
|
|
90
|
+
'3': [60],
|
|
91
|
+
'4': [80],
|
|
92
|
+
'5': [100],
|
|
93
|
+
'6': [120],
|
|
94
|
+
'7': [140],
|
|
95
|
+
'8': [160],
|
|
96
|
+
},
|
|
97
|
+
[NVIDIA_H100_NVLINK_ITEM_PCIe.value]: {
|
|
98
|
+
'1': [20],
|
|
99
|
+
'2': [40],
|
|
100
|
+
'3': [60],
|
|
101
|
+
'4': [80],
|
|
102
|
+
'5': [100],
|
|
103
|
+
'6': [120],
|
|
104
|
+
'7': [140],
|
|
105
|
+
'8': [160],
|
|
106
|
+
},
|
|
107
|
+
[NVIDIA_V100.value]: {
|
|
108
|
+
'1': [4],
|
|
109
|
+
'2': [8],
|
|
110
|
+
'4': [16],
|
|
111
|
+
'8': [32],
|
|
112
|
+
'16': [64],
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const RAN_BY_MODEL_AND_GPU: { [model: string]: { [gpu: string]: number[] } } = {
|
|
117
|
+
[NVIDIA_A100_40GB.value]: {
|
|
118
|
+
'1': [240],
|
|
119
|
+
'2': [480],
|
|
120
|
+
'4': [960],
|
|
121
|
+
},
|
|
122
|
+
[NVIDIA_A100_80GB.value]: {
|
|
123
|
+
'1': [125],
|
|
124
|
+
'2': [250],
|
|
125
|
+
'3': [375],
|
|
126
|
+
'4': [500],
|
|
127
|
+
'5': [625],
|
|
128
|
+
'6': [750],
|
|
129
|
+
'7': [875],
|
|
130
|
+
'8': [900],
|
|
131
|
+
},
|
|
132
|
+
[NVIDIA_H100_NVLINK_ITEM.value]: {
|
|
133
|
+
'1': [186],
|
|
134
|
+
'2': [372],
|
|
135
|
+
'3': [558],
|
|
136
|
+
'4': [744],
|
|
137
|
+
'5': [930],
|
|
138
|
+
'6': [1116],
|
|
139
|
+
'7': [1302],
|
|
140
|
+
'8': [1488],
|
|
141
|
+
},
|
|
142
|
+
[NVIDIA_H100_NVLINK_ITEM_PCIe.value]: {
|
|
143
|
+
'1': [110],
|
|
144
|
+
'2': [220],
|
|
145
|
+
'3': [330],
|
|
146
|
+
'4': [440],
|
|
147
|
+
'5': [550],
|
|
148
|
+
'6': [660],
|
|
149
|
+
'7': [770],
|
|
150
|
+
'8': [880],
|
|
151
|
+
},
|
|
152
|
+
[NVIDIA_V100.value]: {
|
|
153
|
+
'1': [64],
|
|
154
|
+
'2': [128],
|
|
155
|
+
'4': [256],
|
|
156
|
+
'8': [512],
|
|
157
|
+
'16': [1024],
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const EVOLUTION_CLOUD_SERVER_FORM_CONFIG: FormConfig = {
|
|
162
|
+
ui: [
|
|
163
|
+
'alertStart',
|
|
164
|
+
'hasGpu',
|
|
165
|
+
['gpuModel'],
|
|
166
|
+
'gpuCount',
|
|
167
|
+
'guaranteedPart',
|
|
168
|
+
['os'],
|
|
169
|
+
['vCpuCoreCount', 'ramAmount'],
|
|
170
|
+
['systemDisk'],
|
|
171
|
+
'alertAdditional',
|
|
172
|
+
['additionalDisks'],
|
|
173
|
+
'networkIsNeeded',
|
|
174
|
+
],
|
|
175
|
+
controls: {
|
|
176
|
+
alertStart: {
|
|
177
|
+
type: CONTROL.Alert,
|
|
178
|
+
uiProps: {
|
|
179
|
+
appearance: 'info',
|
|
180
|
+
outline: true,
|
|
181
|
+
description: (
|
|
182
|
+
<>
|
|
183
|
+
Начните работать с сервисами бесплатно с бонусной программой Cloud.ru
|
|
184
|
+
<br />
|
|
185
|
+
Получить 4000 бонусов для оплаты сервисов можно за первую привязку карты.
|
|
186
|
+
</>
|
|
187
|
+
),
|
|
188
|
+
},
|
|
189
|
+
accessorKey: 'start',
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
hasGpu: {
|
|
193
|
+
type: CONTROL.Toggle,
|
|
194
|
+
accessorKey: 'hasGpu',
|
|
195
|
+
defaultValue: false,
|
|
196
|
+
decoratorProps: {
|
|
197
|
+
label: 'Графический процессор (GPU)',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
gpuModel: {
|
|
201
|
+
type: CONTROL.SelectSingle,
|
|
202
|
+
accessorKey: 'gpuModel',
|
|
203
|
+
defaultValue: MODEL_ITEMS[0].value,
|
|
204
|
+
items: MODEL_ITEMS,
|
|
205
|
+
uiProps: {
|
|
206
|
+
visible: false,
|
|
207
|
+
},
|
|
208
|
+
decoratorProps: {
|
|
209
|
+
label: 'Модель GPU',
|
|
210
|
+
},
|
|
211
|
+
watchedControls: {
|
|
212
|
+
hasGpu: 'hasGpu',
|
|
213
|
+
},
|
|
214
|
+
relateFn: ({ hasGpu }) => ({
|
|
215
|
+
uiProps: {
|
|
216
|
+
visible: hasGpu,
|
|
217
|
+
},
|
|
218
|
+
}),
|
|
219
|
+
},
|
|
220
|
+
gpuCount: {
|
|
221
|
+
type: CONTROL.Slider,
|
|
222
|
+
accessorKey: 'gpuCount',
|
|
223
|
+
defaultValue: '1',
|
|
224
|
+
items: GPU_BY_MODEL[0],
|
|
225
|
+
decoratorProps: {
|
|
226
|
+
label: 'Количество GPU',
|
|
227
|
+
},
|
|
228
|
+
uiProps: {
|
|
229
|
+
visible: false,
|
|
230
|
+
step: 1,
|
|
231
|
+
},
|
|
232
|
+
watchedControls: {
|
|
233
|
+
hasGpu: 'hasGpu',
|
|
234
|
+
gpuModel: 'gpuModel',
|
|
235
|
+
},
|
|
236
|
+
relateFn: ({ hasGpu, gpuModel }) => ({
|
|
237
|
+
uiProps: {
|
|
238
|
+
visible: hasGpu,
|
|
239
|
+
},
|
|
240
|
+
items: GPU_BY_MODEL[gpuModel],
|
|
241
|
+
}),
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
guaranteedPart: {
|
|
245
|
+
decoratorProps: {
|
|
246
|
+
label: 'Гарантированная доля vCPU',
|
|
247
|
+
labelTooltip:
|
|
248
|
+
'Гарантированная доля vCPU определяет долю использования процессора, выделенную для виртуальной машины. Этот параметр известен также как переподписка vCPU (vCPU Overcommitment). При 100% гарантируется использование полной мощности виртуальных ядер процессора хоста виртуализации, выделенных виртуальной машине.',
|
|
249
|
+
},
|
|
250
|
+
type: CONTROL.Carousel,
|
|
251
|
+
accessorKey: 'guaranteedPart',
|
|
252
|
+
defaultValue: GuaranteedPartItem[10],
|
|
253
|
+
items: guaranteedPartCards,
|
|
254
|
+
watchedControls: {
|
|
255
|
+
hasGpu: 'hasGpu',
|
|
256
|
+
},
|
|
257
|
+
relateFn: ({ hasGpu }) => ({
|
|
258
|
+
items: hasGpu ? [guaranteedPartCards[guaranteedPartCards.length - 1]] : guaranteedPartCards,
|
|
259
|
+
}),
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
os: {
|
|
263
|
+
type: CONTROL.SelectSingle,
|
|
264
|
+
decoratorProps: {
|
|
265
|
+
label: 'Операционная система',
|
|
266
|
+
},
|
|
267
|
+
accessorKey: 'os',
|
|
268
|
+
defaultValue: 'Ubuntu 22.04',
|
|
269
|
+
items: generateBaseItems(osItems),
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
vCpuCoreCount: {
|
|
273
|
+
type: CONTROL.Slider,
|
|
274
|
+
accessorKey: 'vCpuCoreCount',
|
|
275
|
+
defaultValue: '1',
|
|
276
|
+
items: [1, 2, 4, 8],
|
|
277
|
+
decoratorProps: {
|
|
278
|
+
label: 'Количество ядер vCPU',
|
|
279
|
+
labelTooltip: 'Количество ядер vCPU',
|
|
280
|
+
},
|
|
281
|
+
watchedControls: {
|
|
282
|
+
guaranteedPart: 'guaranteedPart',
|
|
283
|
+
hasGpu: 'hasGpu',
|
|
284
|
+
gpuModel: 'gpuModel',
|
|
285
|
+
gpuCount: 'gpuCount',
|
|
286
|
+
},
|
|
287
|
+
relateFn: ({ guaranteedPart, hasGpu, gpuModel, gpuCount }) => {
|
|
288
|
+
const items = hasGpu
|
|
289
|
+
? CPU_BY_MODEL_AND_GPU[gpuModel][String(gpuCount)]
|
|
290
|
+
: guaranteedPartToVCpuMap?.[guaranteedPart];
|
|
291
|
+
|
|
292
|
+
if (items?.length > 0) {
|
|
293
|
+
return {
|
|
294
|
+
items: items,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
ramAmount: {
|
|
300
|
+
type: CONTROL.Segmented,
|
|
301
|
+
decoratorProps: {
|
|
302
|
+
label: 'Количество оперативной памяти (RAM)',
|
|
303
|
+
},
|
|
304
|
+
defaultValue: '1',
|
|
305
|
+
items: generateRamItems([1, 2]),
|
|
306
|
+
accessorKey: 'ramAmount',
|
|
307
|
+
watchedControls: {
|
|
308
|
+
guaranteedPart: 'guaranteedPart',
|
|
309
|
+
gpuModel: 'gpuModel',
|
|
310
|
+
hasGpu: 'hasGpu',
|
|
311
|
+
gpuCount: 'gpuCount',
|
|
312
|
+
vCpuCoreCount: 'vCpuCoreCount',
|
|
313
|
+
},
|
|
314
|
+
relateFn: ({ guaranteedPart, vCpuCoreCount, gpuModel, hasGpu, gpuCount }) => {
|
|
315
|
+
const items = hasGpu
|
|
316
|
+
? RAN_BY_MODEL_AND_GPU[gpuModel][String(gpuCount)]
|
|
317
|
+
: guaranteedPartVCpuToRamMap?.[guaranteedPart]?.[vCpuCoreCount];
|
|
318
|
+
|
|
319
|
+
if (items?.length > 0) {
|
|
320
|
+
return {
|
|
321
|
+
items: generateRamItems(items),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
systemDisk: getDisk({
|
|
328
|
+
space: {
|
|
329
|
+
label: 'Загрузочный диск',
|
|
330
|
+
accessorKey: 'evs.systemDisk.diskSpace',
|
|
331
|
+
defaultValue: 10,
|
|
332
|
+
uiProps: {
|
|
333
|
+
min: 10,
|
|
334
|
+
max: 4_096,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
specification: {
|
|
338
|
+
accessorKey: 'evs.systemDisk.specification',
|
|
339
|
+
defaultValue: 'SSD',
|
|
340
|
+
uiProps: {
|
|
341
|
+
disabled: true,
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
}),
|
|
345
|
+
|
|
346
|
+
alertAdditional: {
|
|
347
|
+
type: 'alert',
|
|
348
|
+
uiProps: {
|
|
349
|
+
appearance: 'info',
|
|
350
|
+
outline: true,
|
|
351
|
+
description: 'Можно добавить до 7 дополнительных дисков',
|
|
352
|
+
},
|
|
353
|
+
accessorKey: 'risks',
|
|
354
|
+
},
|
|
355
|
+
additionalDisks: {
|
|
356
|
+
type: CONTROL.Array,
|
|
357
|
+
max: 7,
|
|
358
|
+
accessorKey: 'evs.additionalDisks',
|
|
359
|
+
defaultValue: [],
|
|
360
|
+
addText: 'Добавить диск',
|
|
361
|
+
ui: ['disk'],
|
|
362
|
+
controls: {
|
|
363
|
+
disk: getDisk({
|
|
364
|
+
space: {
|
|
365
|
+
label: 'Дополнительный диск',
|
|
366
|
+
accessorKey: 'diskSpace',
|
|
367
|
+
defaultValue: 10,
|
|
368
|
+
uiProps: {
|
|
369
|
+
min: 10,
|
|
370
|
+
max: 4_096,
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
specification: {
|
|
374
|
+
accessorKey: 'specification',
|
|
375
|
+
defaultValue: 'SSD',
|
|
376
|
+
uiProps: {
|
|
377
|
+
disabled: true,
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
}),
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
|
|
384
|
+
networkIsNeeded: {
|
|
385
|
+
type: CONTROL.Toggle,
|
|
386
|
+
defaultValue: false,
|
|
387
|
+
accessorKey: 'networkIsNeeded',
|
|
388
|
+
decoratorProps: {
|
|
389
|
+
label: 'Аренда публичного IP',
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
// Hidden
|
|
394
|
+
network: {
|
|
395
|
+
type: CONTROL.Object,
|
|
396
|
+
defaultValue: {
|
|
397
|
+
ipQuantity: 1,
|
|
398
|
+
bindingIpAddressesQuantity: 0,
|
|
399
|
+
publicGatewayQuantity: 0,
|
|
400
|
+
privateGatewayQuantity: 0,
|
|
401
|
+
},
|
|
402
|
+
ui: [],
|
|
403
|
+
controls: {},
|
|
404
|
+
visible: false,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
};
|