@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.
Files changed (205) hide show
  1. package/CHANGELOG.md +1508 -0
  2. package/LICENSE +201 -0
  3. package/README.md +85 -0
  4. package/package.json +75 -0
  5. package/src/components/Calculator/Calculator.tsx +79 -0
  6. package/src/components/Calculator/index.ts +1 -0
  7. package/src/components/CalculatorContent/CalculatorContent.tsx +38 -0
  8. package/src/components/CalculatorContent/index.ts +1 -0
  9. package/src/components/CalculatorContent/styles.module.scss +79 -0
  10. package/src/components/Catalog/Catalog.tsx +225 -0
  11. package/src/components/Catalog/components/PrivateCardHeader.tsx +63 -0
  12. package/src/components/Catalog/components/index.ts +1 -0
  13. package/src/components/Catalog/components/styles.module.scss +35 -0
  14. package/src/components/Catalog/index.ts +1 -0
  15. package/src/components/Catalog/styles.module.scss +104 -0
  16. package/src/components/Controls/AlertControl/AlertControl.tsx +44 -0
  17. package/src/components/Controls/AlertControl/index.ts +1 -0
  18. package/src/components/Controls/ArrayControl/ArrayControl.tsx +105 -0
  19. package/src/components/Controls/ArrayControl/index.ts +1 -0
  20. package/src/components/Controls/ArrayControl/styles.module.scss +33 -0
  21. package/src/components/Controls/CarouselControl/CarouselControl.tsx +173 -0
  22. package/src/components/Controls/CarouselControl/index.ts +1 -0
  23. package/src/components/Controls/CarouselControl/styles.module.scss +32 -0
  24. package/src/components/Controls/Control/Control.tsx +205 -0
  25. package/src/components/Controls/Control/index.ts +1 -0
  26. package/src/components/Controls/ObjectControl/ObjectControl.tsx +150 -0
  27. package/src/components/Controls/ObjectControl/index.ts +1 -0
  28. package/src/components/Controls/ObjectControl/styles.module.scss +18 -0
  29. package/src/components/Controls/ObjectDecorator/ObjectDecorator.tsx +23 -0
  30. package/src/components/Controls/ObjectDecorator/index.ts +1 -0
  31. package/src/components/Controls/ObjectDecorator/styles.module.scss +15 -0
  32. package/src/components/Controls/SegmentedControl/SegmentedControl.tsx +79 -0
  33. package/src/components/Controls/SegmentedControl/SegmentedControlCard.tsx +38 -0
  34. package/src/components/Controls/SegmentedControl/index.ts +1 -0
  35. package/src/components/Controls/SegmentedControl/styles.module.scss +8 -0
  36. package/src/components/Controls/SelectControl/SelectControl.tsx +172 -0
  37. package/src/components/Controls/SelectControl/index.ts +1 -0
  38. package/src/components/Controls/SelectControl/styles.module.scss +5 -0
  39. package/src/components/Controls/SliderControl/SliderControl.tsx +92 -0
  40. package/src/components/Controls/SliderControl/index.ts +1 -0
  41. package/src/components/Controls/StepperControl/StepperControl.tsx +160 -0
  42. package/src/components/Controls/StepperControl/index.ts +1 -0
  43. package/src/components/Controls/StepperControl/styles.module.scss +16 -0
  44. package/src/components/Controls/TableControl/TableControl.tsx +162 -0
  45. package/src/components/Controls/TableControl/helperComponents/StepperWithAllowedValues.tsx +50 -0
  46. package/src/components/Controls/TableControl/helperComponents/index.ts +1 -0
  47. package/src/components/Controls/TableControl/helperComponents/styles.module.scss +53 -0
  48. package/src/components/Controls/TableControl/index.ts +1 -0
  49. package/src/components/Controls/TableControl/styles.module.scss +104 -0
  50. package/src/components/Controls/ToggleCard/ToggleCard.tsx +46 -0
  51. package/src/components/Controls/ToggleCard/index.ts +1 -0
  52. package/src/components/Controls/ToggleCard/styles.module.scss +11 -0
  53. package/src/components/Controls/ToggleCardsControl/ToggleCardsControl.tsx +93 -0
  54. package/src/components/Controls/ToggleCardsControl/index.ts +1 -0
  55. package/src/components/Controls/ToggleCardsControl/styles.module.scss +40 -0
  56. package/src/components/Controls/ToggleControl/ToggleControl.tsx +59 -0
  57. package/src/components/Controls/ToggleControl/components/SwitchRow.tsx +98 -0
  58. package/src/components/Controls/ToggleControl/components/index.ts +1 -0
  59. package/src/components/Controls/ToggleControl/components/styles.module.scss +110 -0
  60. package/src/components/Controls/ToggleControl/index.ts +1 -0
  61. package/src/components/Controls/ToggleObjectControl/ToggleObjectControl.tsx +111 -0
  62. package/src/components/Controls/ToggleObjectControl/index.ts +1 -0
  63. package/src/components/Controls/ToggleObjectControl/styles.module.scss +13 -0
  64. package/src/components/Controls/constants.ts +16 -0
  65. package/src/components/Controls/index.tsx +26 -0
  66. package/src/components/Controls/types.ts +181 -0
  67. package/src/components/Controls/utils.ts +49 -0
  68. package/src/components/Disclaimer/Disclaimer.tsx +33 -0
  69. package/src/components/Disclaimer/index.ts +1 -0
  70. package/src/components/Disclaimer/styles.module.scss +14 -0
  71. package/src/components/HeaderContainer/index.tsx +32 -0
  72. package/src/components/HeaderContainer/styles.module.scss +24 -0
  73. package/src/components/PriceSummary/PriceSummary.tsx +158 -0
  74. package/src/components/PriceSummary/components/PricePeriodSelect/PricePeriodSelect.tsx +81 -0
  75. package/src/components/PriceSummary/components/PricePeriodSelect/index.ts +1 -0
  76. package/src/components/PriceSummary/components/ProductCard/ProductCard.tsx +85 -0
  77. package/src/components/PriceSummary/components/ProductCard/index.ts +1 -0
  78. package/src/components/PriceSummary/components/ProductCard/styles.module.scss +7 -0
  79. package/src/components/PriceSummary/components/ProductListActions/ProductListActions.tsx +118 -0
  80. package/src/components/PriceSummary/components/ProductListActions/index.ts +1 -0
  81. package/src/components/PriceSummary/components/ProductListActions/styles.module.scss +38 -0
  82. package/src/components/PriceSummary/components/index.ts +3 -0
  83. package/src/components/PriceSummary/hooks.ts +36 -0
  84. package/src/components/PriceSummary/index.ts +1 -0
  85. package/src/components/PriceSummary/styles.module.scss +110 -0
  86. package/src/components/PriceSummary/utils/getTotalPrice.ts +19 -0
  87. package/src/components/PriceSummary/utils/index.ts +2 -0
  88. package/src/components/PriceSummary/utils/transformToProductCardData.ts +36 -0
  89. package/src/components/ProductHeadline/ProductPageHeadline.tsx +134 -0
  90. package/src/components/ProductHeadline/components/PriceCount.tsx +93 -0
  91. package/src/components/ProductHeadline/components/index.ts +1 -0
  92. package/src/components/ProductHeadline/components/styles.module.scss +52 -0
  93. package/src/components/ProductHeadline/index.ts +1 -0
  94. package/src/components/ProductHeadline/styles.module.scss +32 -0
  95. package/src/components/ProductPage/ProductPage.tsx +105 -0
  96. package/src/components/ProductPage/index.ts +1 -0
  97. package/src/components/ProductPage/styles.module.scss +13 -0
  98. package/src/components/Welcome/Welcome.tsx +138 -0
  99. package/src/components/Welcome/index.ts +1 -0
  100. package/src/components/Welcome/styles.module.scss +155 -0
  101. package/src/components/index.ts +3 -0
  102. package/src/config/config.tsx +27 -0
  103. package/src/config/index.ts +2 -0
  104. package/src/config/platforms/advanced/catalog.ts +82 -0
  105. package/src/config/platforms/advanced/constants.ts +23 -0
  106. package/src/config/platforms/advanced/index.ts +5 -0
  107. package/src/config/platforms/advanced/platform.tsx +13 -0
  108. package/src/config/platforms/advanced/product-config/AdvancedCloudBackup.ts +76 -0
  109. package/src/config/platforms/advanced/product-config/AdvancedCloudContainerEngine.tsx +260 -0
  110. package/src/config/platforms/advanced/product-config/AdvancedCloudServer.tsx +526 -0
  111. package/src/config/platforms/advanced/product-config/AdvancedDataAsYouUse.ts +159 -0
  112. package/src/config/platforms/advanced/product-config/AdvancedDataLakeInsight.ts +134 -0
  113. package/src/config/platforms/advanced/product-config/AdvancedDataWarehouseService.ts +94 -0
  114. package/src/config/platforms/advanced/product-config/AdvancedDcsMemcached.ts +69 -0
  115. package/src/config/platforms/advanced/product-config/AdvancedDcsRedis.ts +220 -0
  116. package/src/config/platforms/advanced/product-config/AdvancedDmsKafka.tsx +186 -0
  117. package/src/config/platforms/advanced/product-config/AdvancedDmsRabbitMq.ts +202 -0
  118. package/src/config/platforms/advanced/product-config/AdvancedDocumentDatabase.tsx +323 -0
  119. package/src/config/platforms/advanced/product-config/AdvancedElasticLoadBalance.tsx +252 -0
  120. package/src/config/platforms/advanced/product-config/AdvancedElasticSearch.ts +365 -0
  121. package/src/config/platforms/advanced/product-config/AdvancedFunctionGraph.tsx +65 -0
  122. package/src/config/platforms/advanced/product-config/AdvancedMapReduce.tsx +394 -0
  123. package/src/config/platforms/advanced/product-config/AdvancedMySqlDataBase.ts +417 -0
  124. package/src/config/platforms/advanced/product-config/AdvancedNetwork.ts +146 -0
  125. package/src/config/platforms/advanced/product-config/AdvancedObjectStorage.ts +232 -0
  126. package/src/config/platforms/advanced/product-config/AdvancedPostgreSqlDatabase.ts +402 -0
  127. package/src/config/platforms/advanced/product-config/AdvancedScalableFile.tsx +161 -0
  128. package/src/config/platforms/advanced/product-config/AdvancedSqlDatabase.ts +380 -0
  129. package/src/config/platforms/advanced/product-config/index.ts +21 -0
  130. package/src/config/platforms/advanced/products.ts +267 -0
  131. package/src/config/platforms/evolution/catalog.tsx +107 -0
  132. package/src/config/platforms/evolution/constants.ts +80 -0
  133. package/src/config/platforms/evolution/index.ts +5 -0
  134. package/src/config/platforms/evolution/platform.tsx +13 -0
  135. package/src/config/platforms/evolution/product-config/EvolutionArenadataDb.ts +151 -0
  136. package/src/config/platforms/evolution/product-config/EvolutionArtifactRegistry.ts +57 -0
  137. package/src/config/platforms/evolution/product-config/EvolutionBareMetal.tsx +172 -0
  138. package/src/config/platforms/evolution/product-config/EvolutionCloudServer.tsx +407 -0
  139. package/src/config/platforms/evolution/product-config/EvolutionCloudServerFreeTier.tsx +185 -0
  140. package/src/config/platforms/evolution/product-config/EvolutionCloudServerGpu.tsx +301 -0
  141. package/src/config/platforms/evolution/product-config/EvolutionContainerApps.ts +84 -0
  142. package/src/config/platforms/evolution/product-config/EvolutionContainerAppsFreeTier.ts +29 -0
  143. package/src/config/platforms/evolution/product-config/EvolutionKubernetes.ts +388 -0
  144. package/src/config/platforms/evolution/product-config/EvolutionManagedMetastore.ts +38 -0
  145. package/src/config/platforms/evolution/product-config/EvolutionManagedRedis.ts +161 -0
  146. package/src/config/platforms/evolution/product-config/EvolutionManagedSpark.ts +360 -0
  147. package/src/config/platforms/evolution/product-config/EvolutionManagedTrino.ts +53 -0
  148. package/src/config/platforms/evolution/product-config/EvolutionMlInference.tsx +703 -0
  149. package/src/config/platforms/evolution/product-config/EvolutionPostgreSql.ts +217 -0
  150. package/src/config/platforms/evolution/product-config/EvolutionPublicIp.ts +39 -0
  151. package/src/config/platforms/evolution/product-config/EvolutionSnatGateway.ts +22 -0
  152. package/src/config/platforms/evolution/product-config/EvolutionStorageS3.ts +223 -0
  153. package/src/config/platforms/evolution/product-config/EvolutionStorageS3FreeTier.ts +97 -0
  154. package/src/config/platforms/evolution/product-config/index.ts +17 -0
  155. package/src/config/platforms/evolution/products.ts +260 -0
  156. package/src/config/platforms/index.ts +3 -0
  157. package/src/config/platforms/vmware/catalog.ts +19 -0
  158. package/src/config/platforms/vmware/constants.ts +6 -0
  159. package/src/config/platforms/vmware/index.ts +5 -0
  160. package/src/config/platforms/vmware/platform.tsx +13 -0
  161. package/src/config/platforms/vmware/product-config/VmWareCloudBackup.ts +56 -0
  162. package/src/config/platforms/vmware/product-config/VmWareVirtualDataCenter.ts +309 -0
  163. package/src/config/platforms/vmware/product-config/VmWareVirtualMachinesBackup.ts +58 -0
  164. package/src/config/platforms/vmware/product-config/VmWareVirtualWorkspaces.tsx +210 -0
  165. package/src/config/platforms/vmware/product-config/index.ts +4 -0
  166. package/src/config/platforms/vmware/products.ts +63 -0
  167. package/src/config/styles.module.scss +9 -0
  168. package/src/config/utils/disk.ts +94 -0
  169. package/src/config/utils/diskPostgreSqlMySQL.ts +94 -0
  170. package/src/config/utils/eip.ts +104 -0
  171. package/src/config/utils/index.ts +52 -0
  172. package/src/config/utils/obs.ts +100 -0
  173. package/src/constants.ts +56 -0
  174. package/src/contexts/CalculatorContext.tsx +193 -0
  175. package/src/contexts/ProductContext.ts +25 -0
  176. package/src/contexts/index.ts +2 -0
  177. package/src/hooks/index.ts +6 -0
  178. package/src/hooks/useAdaptive.ts +20 -0
  179. package/src/hooks/useCatalogCardClick.ts +37 -0
  180. package/src/hooks/useProductClick.ts +14 -0
  181. package/src/hooks/useProductDelete.ts +46 -0
  182. package/src/index.ts +6 -0
  183. package/src/services/constants.ts +5 -0
  184. package/src/services/getFetcherFn.ts +57 -0
  185. package/src/services/getInitPrice.ts +64 -0
  186. package/src/services/getOnDownloadFileClick.ts +37 -0
  187. package/src/services/getOnShareClick.ts +56 -0
  188. package/src/services/index.ts +4 -0
  189. package/src/types/CalculatorType.ts +16 -0
  190. package/src/types/CatalogConfig.ts +13 -0
  191. package/src/types/Category.ts +14 -0
  192. package/src/types/FetcherFn.ts +26 -0
  193. package/src/types/FormValues.ts +4 -0
  194. package/src/types/Platform.ts +24 -0
  195. package/src/types/Price.ts +18 -0
  196. package/src/types/Product.ts +39 -0
  197. package/src/types/ProductState.ts +11 -0
  198. package/src/types/State.ts +7 -0
  199. package/src/types/index.ts +10 -0
  200. package/src/utils/filterNonEmptyArrays.ts +13 -0
  201. package/src/utils/formatNumber.ts +5 -0
  202. package/src/utils/getPrice.ts +38 -0
  203. package/src/utils/index.ts +5 -0
  204. package/src/utils/parseKeyToDataTest.ts +14 -0
  205. package/src/utils/value.ts +11 -0
@@ -0,0 +1,217 @@
1
+ import { CONTROL, FormConfig } from '../../../../components';
2
+ import { generateRamItems } from '../../../utils';
3
+ import { DeploymentMode, deploymentModes } from '../constants';
4
+
5
+ enum ClusterType {
6
+ Single = 'single',
7
+ Master_Replica = 'master/replica',
8
+ }
9
+
10
+ const clusterTypeItems = [
11
+ {
12
+ label: 'Single',
13
+ value: ClusterType.Single,
14
+ description: 'Одноузловая конфигурация',
15
+ },
16
+ {
17
+ label: 'Master/Replica',
18
+ value: ClusterType.Master_Replica,
19
+ description: 'Отказоустойчивый кластер высокой доступности',
20
+ },
21
+ ];
22
+
23
+ type MapType<T> = Record<DeploymentMode, Record<ClusterType, T>>;
24
+
25
+ const vCpuMap: MapType<number[]> = {
26
+ [DeploymentMode.Standard]: {
27
+ [ClusterType.Single]: [1, 2],
28
+ [ClusterType.Master_Replica]: [1, 2],
29
+ },
30
+ [DeploymentMode.Business]: {
31
+ [ClusterType.Single]: [4, 8],
32
+ [ClusterType.Master_Replica]: [4, 8],
33
+ },
34
+ };
35
+
36
+ const ramMap: MapType<Record<string, number[]>> = {
37
+ [DeploymentMode.Standard]: {
38
+ [ClusterType.Single]: {
39
+ '1': [2, 4, 8],
40
+ '2': [4, 8, 16],
41
+ '4': [8, 16],
42
+ '8': [32],
43
+ },
44
+ [ClusterType.Master_Replica]: {
45
+ '1': [2, 4, 8],
46
+ '2': [4, 8, 16],
47
+ '4': [8],
48
+ },
49
+ },
50
+ [DeploymentMode.Business]: {
51
+ [ClusterType.Single]: {
52
+ '4': [8, 16],
53
+ '8': [32],
54
+ '16': [32, 64, 128],
55
+ '24': [48],
56
+ '32': [64, 128, 256],
57
+ '64': [128, 256],
58
+ },
59
+ [ClusterType.Master_Replica]: {
60
+ '4': [8, 16],
61
+ '8': [16, 32, 64],
62
+ '16': [16, 64, 128, 256],
63
+ '24': [48],
64
+ '32': [64, 128, 256],
65
+ '64': [128, 256],
66
+ },
67
+ },
68
+ };
69
+
70
+ const ramAmount = generateRamItems([2, 4, 8, 16, 32]);
71
+
72
+ const getMinMaxDiskSize = ({ deploymentMode }: { deploymentMode: DeploymentMode }) => {
73
+ switch (deploymentMode) {
74
+ case DeploymentMode.Business: {
75
+ return {
76
+ uiProps: {
77
+ min: 40,
78
+ max: 16000,
79
+ },
80
+ };
81
+ }
82
+ case DeploymentMode.Standard:
83
+ default: {
84
+ return {
85
+ uiProps: {
86
+ min: 10,
87
+ max: 2000,
88
+ },
89
+ };
90
+ }
91
+ }
92
+ };
93
+
94
+ export const EVOLUTION_POSTGRE_SQL_FORM_CONFIG: FormConfig = {
95
+ ui: ['deploymentMode', 'clusterType', 'flavorConfig', ['systemDisk']],
96
+ controls: {
97
+ deploymentMode: {
98
+ type: CONTROL.Carousel,
99
+ accessorKey: 'deploymentMode',
100
+ defaultValue: DeploymentMode.Standard,
101
+ items: deploymentModes,
102
+ decoratorProps: {
103
+ label: 'Режим развертывания',
104
+ labelTooltip: 'Режимы развертывания кластера отличаются объемом ресурсов и уровнем безопасности',
105
+ },
106
+ onChangeFn: (value, setValue) => {
107
+ setValue([
108
+ ['deploymentMode', value],
109
+ ['systemDisk.diskSpace', 0],
110
+ ]);
111
+ },
112
+ },
113
+ clusterType: {
114
+ type: CONTROL.Carousel,
115
+ accessorKey: 'clusterType',
116
+ defaultValue: 'single',
117
+ items: clusterTypeItems,
118
+ decoratorProps: {
119
+ label: 'Тип кластера',
120
+ },
121
+ },
122
+ flavorConfig: {
123
+ type: CONTROL.Object,
124
+ ui: [['vCpu', 'ram']],
125
+ controls: {
126
+ vCpu: {
127
+ type: CONTROL.Slider,
128
+ accessorKey: 'flavorConfig.vCpu',
129
+ defaultValue: '1',
130
+ items: [],
131
+ decoratorProps: {
132
+ label: 'Количество ядер vCPU',
133
+ labelTooltip: 'Виртуальные ядра',
134
+ },
135
+ watchedControls: { deploymentMode: 'deploymentMode', clusterType: 'clusterType' },
136
+ relateFn: ({ deploymentMode, clusterType }: { deploymentMode: DeploymentMode; clusterType: ClusterType }) => {
137
+ const items = vCpuMap?.[deploymentMode]?.[clusterType];
138
+
139
+ if (items?.length > 0) {
140
+ return {
141
+ items,
142
+ };
143
+ }
144
+ },
145
+ },
146
+
147
+ ram: {
148
+ type: CONTROL.Segmented,
149
+ accessorKey: 'flavorConfig.ram',
150
+ defaultValue: '2',
151
+ items: ramAmount.slice(0, 3),
152
+ decoratorProps: {
153
+ label: 'Количество оперативной памяти (RAM)',
154
+ },
155
+ watchedControls: { deploymentMode: 'deploymentMode', clusterType: 'clusterType', vCpu: 'flavorConfig.vCpu' },
156
+ relateFn: ({
157
+ deploymentMode,
158
+ clusterType,
159
+ vCpu,
160
+ }: {
161
+ deploymentMode: DeploymentMode;
162
+ clusterType: ClusterType;
163
+ vCpu: string;
164
+ }) => {
165
+ const items = ramMap?.[deploymentMode]?.[clusterType]?.[vCpu];
166
+
167
+ if (items?.length > 0) {
168
+ return {
169
+ items: generateRamItems(items),
170
+ };
171
+ }
172
+ },
173
+ },
174
+ },
175
+ },
176
+ systemDisk: {
177
+ type: CONTROL.Object,
178
+ ui: [{ controls: ['diskSpace', 'specification'] }],
179
+ controls: {
180
+ diskSpace: {
181
+ type: CONTROL.Stepper,
182
+ decoratorProps: {
183
+ label: 'Диск',
184
+ },
185
+ accessorKey: 'systemDisk.diskSpace',
186
+ defaultValue: 10,
187
+ uiProps: {
188
+ min: 10,
189
+ max: 2000,
190
+ postfix: 'ГБ',
191
+ },
192
+ watchedControls: { deploymentMode: 'deploymentMode' },
193
+ relateFn: getMinMaxDiskSize,
194
+ },
195
+ specification: {
196
+ type: CONTROL.SelectSingle,
197
+ accessorKey: 'systemDisk.specification',
198
+ decoratorProps: {
199
+ label: '',
200
+ },
201
+ defaultValue: 'SSD',
202
+ items: [
203
+ {
204
+ value: 'SSD',
205
+ label: 'SSD',
206
+ },
207
+ ],
208
+ uiProps: {
209
+ disabled: true,
210
+ showClearButton: false,
211
+ searchable: false,
212
+ },
213
+ },
214
+ },
215
+ },
216
+ },
217
+ };
@@ -0,0 +1,39 @@
1
+ import { CONTROL, FormConfig } from '../../../../components';
2
+
3
+ export const EVOLUTION_PUBLIC_IP_FORM_CONFIG: FormConfig = {
4
+ ui: [['directCount', 'floatingCount']],
5
+ controls: {
6
+ directCount: {
7
+ type: CONTROL.Stepper,
8
+ defaultValue: 0,
9
+ accessorKey: 'directCount',
10
+ decoratorProps: {
11
+ label: 'Аренда прямого IP-адреса',
12
+ labelTooltip:
13
+ 'Публичный IP, который позволяет подключаться к интернету напрямую. Можно назначить только виртуальной машине',
14
+ },
15
+ uiProps: {
16
+ min: 0,
17
+ step: 1,
18
+ max: 50,
19
+ postfix: 'шт',
20
+ },
21
+ },
22
+ floatingCount: {
23
+ type: CONTROL.Stepper,
24
+ accessorKey: 'floatingCount',
25
+ defaultValue: 0,
26
+ decoratorProps: {
27
+ label: 'Аренда плавающего IP-адреса',
28
+ labelTooltip:
29
+ 'Публичный IP, который позволяет подключаться к интернету через подсеть. Можно назначить ресурсам, которые подключены к подсети',
30
+ },
31
+ uiProps: {
32
+ min: 0,
33
+ step: 1,
34
+ max: 50,
35
+ postfix: 'шт',
36
+ },
37
+ },
38
+ },
39
+ };
@@ -0,0 +1,22 @@
1
+ import { CONTROL, FormConfig } from '../../../../components';
2
+
3
+ export const EVOLUTION_SNAT_GATEWAY_FORM_CONFIG: FormConfig = {
4
+ ui: [['sNatCount']],
5
+ controls: {
6
+ sNatCount: {
7
+ type: CONTROL.Stepper,
8
+ defaultValue: 1,
9
+ accessorKey: 'sNatCount',
10
+ decoratorProps: {
11
+ label: 'Аренда публичного sNAT-шлюза',
12
+ labelTooltip: 'Предназначен для организации доступа нескольких виртуальных машин в интернет',
13
+ },
14
+ uiProps: {
15
+ min: 1,
16
+ step: 1,
17
+ max: 50,
18
+ postfix: 'шт',
19
+ },
20
+ },
21
+ },
22
+ };
@@ -0,0 +1,223 @@
1
+ import { CONTROL, FormConfig, StepperControl } from '../../../../components';
2
+
3
+ const StorageTypeItem = {
4
+ Standard:
5
+ // Бек требует именно так
6
+ 'standart',
7
+ Cold: 'cold',
8
+ Ice: 'ice',
9
+ Single: 'single',
10
+ };
11
+
12
+ const multiAZStorageTypeItems = [
13
+ {
14
+ value: StorageTypeItem.Standard,
15
+ label: 'Стандартное (Standard)',
16
+ description:
17
+ 'Для медиаконтента, писем и документов. Высокая стоимость хранения, низкая стоимость операций с данными',
18
+ },
19
+ {
20
+ value: StorageTypeItem.Cold,
21
+ label: 'Холодное (Cold)',
22
+ description:
23
+ 'Для редкоиспользуемых данных, логов, отчетов, озер данных. Низкая стоимость хранения, высокая стоимость операций с данными',
24
+ },
25
+ {
26
+ value: StorageTypeItem.Ice,
27
+ label: 'Ледяное (Ice)',
28
+ description:
29
+ 'Для бэкапов и архивов большого объема. Низкая стоимость хранения, высокая стоимость операций с данными',
30
+ },
31
+ ];
32
+
33
+ const singleAZStorageTypeItems = [
34
+ {
35
+ value: StorageTypeItem.Single,
36
+ label: 'Однозонное',
37
+ description: 'Для часто используемых данных',
38
+ },
39
+ ];
40
+
41
+ const DeploymentZoneItem = {
42
+ SingleAZ: '1AZ',
43
+ MultiAZ: 'MultiAZ',
44
+ };
45
+
46
+ const deploymentZoneItems = [
47
+ {
48
+ value: DeploymentZoneItem.MultiAZ,
49
+ label: 'Multi-AZ',
50
+ },
51
+ {
52
+ value: DeploymentZoneItem.SingleAZ,
53
+ label: 'Single-AZ',
54
+ },
55
+ ];
56
+
57
+ const apiUiOptions: Partial<StepperControl['uiProps']> = {
58
+ min: 0,
59
+ step: 1_000,
60
+ max: 9_999_999_999,
61
+ showHint: false,
62
+ postfix: 'Шт',
63
+ };
64
+
65
+ export const EVOLUTION_STORAGE_S3_FORM_CONFIG: FormConfig = {
66
+ ui: [
67
+ ['deploymentZone'],
68
+ 'storageType',
69
+ ['storageSize', 'outgoingTraffic'],
70
+ ['apiPut', 'apiPost'],
71
+ ['apiGet', 'apiHead'],
72
+ ['apiList'],
73
+ ],
74
+ controls: {
75
+ deploymentZone: {
76
+ type: CONTROL.Segmented,
77
+ accessorKey: 'deploymentZone',
78
+ defaultValue: DeploymentZoneItem.MultiAZ,
79
+ items: deploymentZoneItems,
80
+ decoratorProps: {
81
+ label: 'Зона доступности',
82
+ },
83
+ },
84
+ storageType: {
85
+ type: CONTROL.Carousel,
86
+ defaultValue: StorageTypeItem.Standard,
87
+ items: multiAZStorageTypeItems,
88
+ accessorKey: 'storageType',
89
+ decoratorProps: {
90
+ label: 'Класс хранения',
91
+ },
92
+ watchedControls: { deploymentZone: 'deploymentZone' },
93
+ relateFn: ({ deploymentZone }) => {
94
+ if (deploymentZone === DeploymentZoneItem.SingleAZ) {
95
+ return {
96
+ items: singleAZStorageTypeItems,
97
+ };
98
+ }
99
+ },
100
+ },
101
+ storageSize: {
102
+ type: CONTROL.Stepper,
103
+ defaultValue: 1,
104
+ accessorKey: 'storageSize',
105
+ decoratorProps: {
106
+ label: 'Размер хранилища',
107
+ },
108
+ uiProps: {
109
+ min: 0,
110
+ max: 9_999_999_999,
111
+ showHint: false,
112
+ postfix: 'ГБ',
113
+ },
114
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
115
+ relateFn: ({ deploymentZone, storageType }) => {
116
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
117
+ return {
118
+ decoratorProps: { label: 'Размер хранилища (бесплатно до 15 ГБ)' },
119
+ };
120
+ }
121
+ },
122
+ },
123
+ outgoingTraffic: {
124
+ type: CONTROL.Stepper,
125
+ defaultValue: 0,
126
+ accessorKey: 'outgoingTraffic',
127
+ decoratorProps: {
128
+ label: 'Исходящий трафик',
129
+ },
130
+ uiProps: {
131
+ min: 0,
132
+ max: 9_999_999_999,
133
+ showHint: false,
134
+ postfix: 'ГБ',
135
+ },
136
+ },
137
+ apiPut: {
138
+ type: CONTROL.Stepper,
139
+ defaultValue: 0,
140
+ accessorKey: 'apiPut',
141
+ decoratorProps: {
142
+ label: 'PUT-операции',
143
+ },
144
+ uiProps: apiUiOptions,
145
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
146
+ relateFn: ({ deploymentZone, storageType }) => {
147
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
148
+ return {
149
+ decoratorProps: { label: 'PUT-операции (бесплатно до 100 тысяч)' },
150
+ };
151
+ }
152
+ },
153
+ },
154
+ apiPost: {
155
+ type: CONTROL.Stepper,
156
+ defaultValue: 0,
157
+ accessorKey: 'apiPost',
158
+ decoratorProps: {
159
+ label: 'POST-операции',
160
+ },
161
+ uiProps: apiUiOptions,
162
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
163
+ relateFn: ({ deploymentZone, storageType }) => {
164
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
165
+ return {
166
+ decoratorProps: { label: 'POST-операции (бесплатно до 100 тысяч)' },
167
+ };
168
+ }
169
+ },
170
+ },
171
+ apiGet: {
172
+ type: CONTROL.Stepper,
173
+ defaultValue: 0,
174
+ accessorKey: 'apiGet',
175
+ decoratorProps: {
176
+ label: 'GET-операции',
177
+ },
178
+ uiProps: apiUiOptions,
179
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
180
+ relateFn: ({ deploymentZone, storageType }) => {
181
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
182
+ return {
183
+ decoratorProps: { label: 'GET-операции (бесплатно до 1 миллиона)' },
184
+ };
185
+ }
186
+ },
187
+ },
188
+ apiHead: {
189
+ type: CONTROL.Stepper,
190
+ defaultValue: 0,
191
+ accessorKey: 'apiHead',
192
+ decoratorProps: {
193
+ label: 'HEAD-операции',
194
+ },
195
+ uiProps: apiUiOptions,
196
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
197
+ relateFn: ({ deploymentZone, storageType }) => {
198
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
199
+ return {
200
+ decoratorProps: { label: 'HEAD-операции (бесплатно до 1 миллиона)' },
201
+ };
202
+ }
203
+ },
204
+ },
205
+ apiList: {
206
+ type: CONTROL.Stepper,
207
+ defaultValue: 0,
208
+ accessorKey: 'apiList',
209
+ decoratorProps: {
210
+ label: 'LIST-операции',
211
+ },
212
+ uiProps: apiUiOptions,
213
+ watchedControls: { deploymentZone: 'deploymentZone', storageType: 'storageType' },
214
+ relateFn: ({ deploymentZone, storageType }) => {
215
+ if (deploymentZone === DeploymentZoneItem.MultiAZ && storageType === StorageTypeItem.Standard) {
216
+ return {
217
+ decoratorProps: { label: 'LIST-операции (бесплатно до 100 тысяч)' },
218
+ };
219
+ }
220
+ },
221
+ },
222
+ },
223
+ };
@@ -0,0 +1,97 @@
1
+ import { CONTROL, FormConfig, StepperControl } from '../../../../components';
2
+
3
+ const apiUiProps: Partial<StepperControl['uiProps']> = { disabled: true, postfix: 'Шт', showHint: false };
4
+
5
+ export const EVOLUTION_STORAGE_S3_FREE_TIER_FORM_CONFIG: FormConfig = {
6
+ ui: ['storageType', ['storageSize', 'outgoingTraffic'], ['apiPut', 'apiPost'], ['apiGet', 'apiHead'], ['apiList']],
7
+ controls: {
8
+ storageType: {
9
+ type: CONTROL.Carousel,
10
+ defaultValue: 'standart',
11
+ items: [
12
+ {
13
+ label: 'Стандартное (Standard)',
14
+ description:
15
+ 'Для медиаконтента, писем и документов. Высокая стоимость хранения, низкая стоимость операций с данными',
16
+ value: 'standart',
17
+ },
18
+ ],
19
+ accessorKey: 'storageType',
20
+ decoratorProps: {
21
+ label: 'Тип хранилища',
22
+ },
23
+ },
24
+ storageSize: {
25
+ type: CONTROL.Stepper,
26
+ defaultValue: 15,
27
+ accessorKey: 'storageSize',
28
+ decoratorProps: {
29
+ label: 'Размер хранилища',
30
+ },
31
+ uiProps: {
32
+ disabled: true,
33
+ postfix: 'ГБ',
34
+ showHint: false,
35
+ },
36
+ },
37
+ outgoingTraffic: {
38
+ type: CONTROL.Stepper,
39
+ defaultValue: 10_000,
40
+ accessorKey: 'outgoingTraffic',
41
+ decoratorProps: {
42
+ label: 'Исходящий трафик',
43
+ },
44
+ uiProps: {
45
+ disabled: true,
46
+ postfix: 'ТБ',
47
+ showHint: false,
48
+ multiplier: 1000,
49
+ },
50
+ },
51
+ apiPut: {
52
+ type: CONTROL.Stepper,
53
+ defaultValue: 100_000,
54
+ accessorKey: 'apiPut',
55
+ decoratorProps: {
56
+ label: 'PUT-операции',
57
+ },
58
+ uiProps: apiUiProps,
59
+ },
60
+ apiPost: {
61
+ type: CONTROL.Stepper,
62
+ defaultValue: 100_000,
63
+ accessorKey: 'apiPost',
64
+ decoratorProps: {
65
+ label: 'POST-операции',
66
+ },
67
+ uiProps: apiUiProps,
68
+ },
69
+ apiGet: {
70
+ type: CONTROL.Stepper,
71
+ defaultValue: 100_000,
72
+ accessorKey: 'apiGet',
73
+ decoratorProps: {
74
+ label: 'GET-операции',
75
+ },
76
+ uiProps: apiUiProps,
77
+ },
78
+ apiHead: {
79
+ type: CONTROL.Stepper,
80
+ defaultValue: 100_000,
81
+ accessorKey: 'apiHead',
82
+ decoratorProps: {
83
+ label: 'HEAD-операции',
84
+ },
85
+ uiProps: apiUiProps,
86
+ },
87
+ apiList: {
88
+ type: CONTROL.Stepper,
89
+ defaultValue: 100_000,
90
+ accessorKey: 'apiList',
91
+ decoratorProps: {
92
+ label: 'LIST-операции',
93
+ },
94
+ uiProps: apiUiProps,
95
+ },
96
+ },
97
+ };
@@ -0,0 +1,17 @@
1
+ export * from './EvolutionBareMetal';
2
+ export * from './EvolutionCloudServer';
3
+ export * from './EvolutionCloudServerFreeTier';
4
+ export * from './EvolutionKubernetes';
5
+ export * from './EvolutionPostgreSql';
6
+ export * from './EvolutionStorageS3';
7
+ export * from './EvolutionStorageS3FreeTier';
8
+ export * from './EvolutionCloudServerGpu';
9
+ export * from './EvolutionContainerApps';
10
+ export * from './EvolutionContainerAppsFreeTier';
11
+ export * from './EvolutionArenadataDb';
12
+ export * from './EvolutionMlInference';
13
+ export * from './EvolutionSnatGateway';
14
+ export * from './EvolutionPublicIp';
15
+ export * from './EvolutionManagedMetastore';
16
+ export * from './EvolutionArtifactRegistry';
17
+ export * from './EvolutionManagedTrino';