@cloud-ru/uikit-product-calculator 1.14.5 → 1.15.0

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 1.15.0 (2026-09-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * **EVODBAAS-8814:** added vCPU RAM for ClickHouse ([f20b8b0](https://github.com/cloud-ru-tech/uikit-product/commit/f20b8b0e4b71f6302255f90bbc60a7d2f3b94152))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 1.14.5 (2026-09-09)
7
18
 
8
19
  ### Only dependencies have been changed
@@ -6,21 +6,13 @@ const utils_1 = require("../../../utils");
6
6
  const valueSingleNode = 'Single-node';
7
7
  const valueSingleShard = 'Single-shard';
8
8
  const valueMultiShard = 'Multi-shard';
9
- const CPU = [4, 8];
10
- const RAM = [16, 32];
9
+ const CPU = [2, 4, 8, 16];
10
+ const RAM = [16, 32, 64, 128];
11
11
  const cpuToRamMap = {
12
- '4': [16],
13
- '8': [32],
14
- };
15
- const cpuConfigItems = {
16
- [valueSingleNode]: (0, utils_1.generateCpuItems)(CPU),
17
- [valueSingleShard]: (0, utils_1.generateCpuItems)(CPU),
18
- [valueMultiShard]: (0, utils_1.generateCpuItems)([CPU[0]]),
19
- };
20
- const ramConfigItems = {
21
- [valueSingleNode]: RAM,
22
- [valueSingleShard]: RAM,
23
- [valueMultiShard]: [RAM[0]],
12
+ '2': [16],
13
+ '4': [16, 32],
14
+ '8': [16, 32, 64],
15
+ '16': [32, 64, 128],
24
16
  };
25
17
  const instanceTypePartCards = [
26
18
  {
@@ -93,12 +85,6 @@ exports.EVOLUTION_MANAGED_CLICKHOUSE_CONFIG = {
93
85
  decoratorProps: {
94
86
  label: 'Количество ядер vCPU',
95
87
  },
96
- relateFn: ({ instanceType }) => {
97
- const items = cpuConfigItems[instanceType];
98
- if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
99
- return { items };
100
- }
101
- },
102
88
  },
103
89
  ramAmount: {
104
90
  type: components_1.CONTROL.Segmented,
@@ -109,13 +95,11 @@ exports.EVOLUTION_MANAGED_CLICKHOUSE_CONFIG = {
109
95
  decoratorProps: {
110
96
  label: 'Количество оперативной памяти (RAM)',
111
97
  },
112
- relateFn: ({ instanceType, vCpuCoreCount }) => {
113
- const itemsByInstanceType = ramConfigItems[instanceType];
114
- const itemsByCpu = new Set(cpuToRamMap[vCpuCoreCount]);
115
- if ((itemsByInstanceType === null || itemsByInstanceType === void 0 ? void 0 : itemsByInstanceType.length) > 0) {
116
- const resolvedItems = itemsByInstanceType.filter(item => itemsByCpu.has(item));
98
+ relateFn: ({ vCpuCoreCount }) => {
99
+ const itemsByCpu = cpuToRamMap[vCpuCoreCount];
100
+ if ((itemsByCpu === null || itemsByCpu === void 0 ? void 0 : itemsByCpu.length) > 0) {
117
101
  return {
118
- items: (0, utils_1.generateRamItems)(resolvedItems),
102
+ items: (0, utils_1.generateRamItems)(itemsByCpu),
119
103
  };
120
104
  }
121
105
  },
@@ -3,21 +3,13 @@ import { generateCpuItems, generateRamItems, getDisk } from '../../../utils';
3
3
  const valueSingleNode = 'Single-node';
4
4
  const valueSingleShard = 'Single-shard';
5
5
  const valueMultiShard = 'Multi-shard';
6
- const CPU = [4, 8];
7
- const RAM = [16, 32];
6
+ const CPU = [2, 4, 8, 16];
7
+ const RAM = [16, 32, 64, 128];
8
8
  const cpuToRamMap = {
9
- '4': [16],
10
- '8': [32],
11
- };
12
- const cpuConfigItems = {
13
- [valueSingleNode]: generateCpuItems(CPU),
14
- [valueSingleShard]: generateCpuItems(CPU),
15
- [valueMultiShard]: generateCpuItems([CPU[0]]),
16
- };
17
- const ramConfigItems = {
18
- [valueSingleNode]: RAM,
19
- [valueSingleShard]: RAM,
20
- [valueMultiShard]: [RAM[0]],
9
+ '2': [16],
10
+ '4': [16, 32],
11
+ '8': [16, 32, 64],
12
+ '16': [32, 64, 128],
21
13
  };
22
14
  const instanceTypePartCards = [
23
15
  {
@@ -90,12 +82,6 @@ export const EVOLUTION_MANAGED_CLICKHOUSE_CONFIG = {
90
82
  decoratorProps: {
91
83
  label: 'Количество ядер vCPU',
92
84
  },
93
- relateFn: ({ instanceType }) => {
94
- const items = cpuConfigItems[instanceType];
95
- if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
96
- return { items };
97
- }
98
- },
99
85
  },
100
86
  ramAmount: {
101
87
  type: CONTROL.Segmented,
@@ -106,13 +92,11 @@ export const EVOLUTION_MANAGED_CLICKHOUSE_CONFIG = {
106
92
  decoratorProps: {
107
93
  label: 'Количество оперативной памяти (RAM)',
108
94
  },
109
- relateFn: ({ instanceType, vCpuCoreCount }) => {
110
- const itemsByInstanceType = ramConfigItems[instanceType];
111
- const itemsByCpu = new Set(cpuToRamMap[vCpuCoreCount]);
112
- if ((itemsByInstanceType === null || itemsByInstanceType === void 0 ? void 0 : itemsByInstanceType.length) > 0) {
113
- const resolvedItems = itemsByInstanceType.filter(item => itemsByCpu.has(item));
95
+ relateFn: ({ vCpuCoreCount }) => {
96
+ const itemsByCpu = cpuToRamMap[vCpuCoreCount];
97
+ if ((itemsByCpu === null || itemsByCpu === void 0 ? void 0 : itemsByCpu.length) > 0) {
114
98
  return {
115
- items: generateRamItems(resolvedItems),
99
+ items: generateRamItems(itemsByCpu),
116
100
  };
117
101
  }
118
102
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-calculator",
3
3
  "title": "Calculator",
4
- "version": "1.14.5",
4
+ "version": "1.15.0",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -71,5 +71,5 @@
71
71
  "devDependencies": {
72
72
  "@types/lodash": "4.17.13"
73
73
  },
74
- "gitHead": "be0899466862c8165b118bc16b07e9d2b9ed2513"
74
+ "gitHead": "238046dc433803a09ddb969be2c5143350cfda71"
75
75
  }
@@ -5,31 +5,14 @@ const valueSingleNode = 'Single-node';
5
5
  const valueSingleShard = 'Single-shard';
6
6
  const valueMultiShard = 'Multi-shard';
7
7
 
8
- const CPU = [4, 8];
9
- const RAM = [16, 32];
8
+ const CPU = [2, 4, 8, 16];
9
+ const RAM = [16, 32, 64, 128];
10
10
 
11
11
  const cpuToRamMap: Record<string, number[]> = {
12
- '4': [16],
13
- '8': [32],
14
- };
15
-
16
- const cpuConfigItems: {
17
- [key: string]: {
18
- value: string;
19
- label: string;
20
- }[];
21
- } = {
22
- [valueSingleNode]: generateCpuItems(CPU),
23
- [valueSingleShard]: generateCpuItems(CPU),
24
- [valueMultiShard]: generateCpuItems([CPU[0]]),
25
- };
26
-
27
- const ramConfigItems: {
28
- [key: string]: number[];
29
- } = {
30
- [valueSingleNode]: RAM,
31
- [valueSingleShard]: RAM,
32
- [valueMultiShard]: [RAM[0]],
12
+ '2': [16],
13
+ '4': [16, 32],
14
+ '8': [16, 32, 64],
15
+ '16': [32, 64, 128],
33
16
  };
34
17
 
35
18
  const instanceTypePartCards = [
@@ -104,13 +87,6 @@ export const EVOLUTION_MANAGED_CLICKHOUSE_CONFIG: FormConfig = {
104
87
  decoratorProps: {
105
88
  label: 'Количество ядер vCPU',
106
89
  },
107
- relateFn: ({ instanceType }) => {
108
- const items = cpuConfigItems[instanceType];
109
-
110
- if (items?.length > 0) {
111
- return { items };
112
- }
113
- },
114
90
  },
115
91
 
116
92
  ramAmount: {
@@ -122,14 +98,12 @@ export const EVOLUTION_MANAGED_CLICKHOUSE_CONFIG: FormConfig = {
122
98
  decoratorProps: {
123
99
  label: 'Количество оперативной памяти (RAM)',
124
100
  },
125
- relateFn: ({ instanceType, vCpuCoreCount }) => {
126
- const itemsByInstanceType = ramConfigItems[instanceType];
127
- const itemsByCpu = new Set(cpuToRamMap[vCpuCoreCount as string]);
101
+ relateFn: ({ vCpuCoreCount }) => {
102
+ const itemsByCpu = cpuToRamMap[vCpuCoreCount as string];
128
103
 
129
- if (itemsByInstanceType?.length > 0) {
130
- const resolvedItems = itemsByInstanceType.filter(item => itemsByCpu.has(item));
104
+ if (itemsByCpu?.length > 0) {
131
105
  return {
132
- items: generateRamItems(resolvedItems),
106
+ items: generateRamItems(itemsByCpu),
133
107
  };
134
108
  }
135
109
  },