ydb-embedded-ui 3.3.3 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/Errors/ResponseError/ResponseError.tsx +2 -2
  3. package/dist/components/InfoViewer/formatters/topicStats.tsx +8 -29
  4. package/dist/components/LabelWithPopover/LabelWithPopover.tsx +20 -0
  5. package/dist/components/LabelWithPopover/index.ts +1 -0
  6. package/dist/components/LagImages/LagImages.tsx +205 -0
  7. package/dist/components/LagImages/index.ts +1 -0
  8. package/dist/components/SpeedMultiMeter/SpeedMultiMeter.scss +92 -0
  9. package/dist/components/SpeedMultiMeter/SpeedMultiMeter.tsx +120 -0
  10. package/dist/components/SpeedMultiMeter/i18n/en.json +6 -0
  11. package/dist/components/SpeedMultiMeter/i18n/index.ts +13 -0
  12. package/dist/components/SpeedMultiMeter/i18n/ru.json +6 -0
  13. package/dist/components/SpeedMultiMeter/index.ts +1 -0
  14. package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +26 -14
  15. package/dist/containers/Storage/VDisk/VDisk.tsx +20 -5
  16. package/dist/containers/Storage/VDiskPopup/VDiskPopup.tsx +34 -5
  17. package/dist/containers/Storage/utils/types.ts +5 -0
  18. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.scss +32 -3
  19. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.tsx +62 -69
  20. package/dist/containers/Tenant/Diagnostics/Consumers/Headers/Headers.scss +13 -0
  21. package/dist/containers/Tenant/Diagnostics/Consumers/Headers/Headers.tsx +27 -0
  22. package/dist/containers/Tenant/Diagnostics/Consumers/Headers/index.ts +1 -0
  23. package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.scss +32 -0
  24. package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.tsx +43 -0
  25. package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/index.ts +1 -0
  26. package/dist/containers/Tenant/Diagnostics/Consumers/columns/Columns.scss +5 -0
  27. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +66 -0
  28. package/dist/containers/Tenant/Diagnostics/Consumers/columns/index.ts +1 -0
  29. package/dist/containers/Tenant/Diagnostics/Consumers/i18n/en.json +4 -3
  30. package/dist/containers/Tenant/Diagnostics/Consumers/i18n/ru.json +4 -3
  31. package/dist/containers/Tenant/Diagnostics/Consumers/utils/constants.ts +23 -0
  32. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +7 -3
  33. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +15 -9
  34. package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.scss +9 -1
  35. package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.tsx +6 -8
  36. package/dist/containers/Tenant/Diagnostics/Partitions/Headers/Headers.scss +33 -0
  37. package/dist/containers/Tenant/Diagnostics/Partitions/Headers/Headers.tsx +76 -0
  38. package/dist/containers/Tenant/Diagnostics/Partitions/Headers/index.ts +1 -0
  39. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +45 -0
  40. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +254 -0
  41. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsWrapper.tsx +79 -0
  42. package/dist/containers/Tenant/Diagnostics/Partitions/columns/Columns.scss +13 -0
  43. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.tsx +246 -0
  44. package/dist/containers/Tenant/Diagnostics/Partitions/columns/index.ts +1 -0
  45. package/dist/containers/Tenant/Diagnostics/Partitions/i18n/en.json +13 -0
  46. package/dist/containers/Tenant/Diagnostics/{OverloadedShards → Partitions}/i18n/index.ts +1 -1
  47. package/dist/containers/Tenant/Diagnostics/Partitions/i18n/ru.json +13 -0
  48. package/dist/containers/Tenant/Diagnostics/Partitions/index.ts +1 -0
  49. package/dist/containers/Tenant/Diagnostics/Partitions/utils/constants.ts +74 -0
  50. package/dist/containers/Tenant/Diagnostics/Partitions/utils/types.ts +6 -0
  51. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.scss +8 -0
  52. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.tsx +56 -0
  53. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/index.ts +1 -0
  54. package/dist/containers/Tenant/Diagnostics/{OverloadedShards/OverloadedShards.scss → TopShards/TopShards.scss} +2 -10
  55. package/dist/containers/Tenant/Diagnostics/{OverloadedShards/OverloadedShards.tsx → TopShards/TopShards.tsx} +61 -31
  56. package/dist/containers/Tenant/Diagnostics/TopShards/i18n/en.json +6 -0
  57. package/dist/containers/Tenant/Diagnostics/TopShards/i18n/index.ts +11 -0
  58. package/dist/containers/Tenant/Diagnostics/TopShards/i18n/ru.json +6 -0
  59. package/dist/containers/Tenant/Diagnostics/TopShards/index.ts +1 -0
  60. package/dist/containers/Tenant/utils/schema.ts +1 -16
  61. package/dist/services/api.d.ts +4 -0
  62. package/dist/services/api.js +22 -6
  63. package/dist/store/reducers/authentication.js +0 -15
  64. package/dist/store/reducers/consumer.ts +160 -0
  65. package/dist/store/reducers/index.ts +2 -0
  66. package/dist/store/reducers/settings.js +2 -0
  67. package/dist/store/reducers/shardsWorkload.ts +28 -2
  68. package/dist/store/reducers/topic.ts +82 -2
  69. package/dist/store/state-url-mapping.js +3 -0
  70. package/dist/types/store/consumer.ts +55 -0
  71. package/dist/types/store/shardsWorkload.ts +6 -0
  72. package/dist/types/store/topic.ts +23 -6
  73. package/dist/utils/bytesParsers/convertBytesObjectToSpeed.ts +24 -0
  74. package/dist/utils/bytesParsers/formatBytesCustom.ts +57 -0
  75. package/dist/utils/bytesParsers/i18n/en.json +7 -0
  76. package/dist/utils/bytesParsers/i18n/index.ts +11 -0
  77. package/dist/utils/bytesParsers/i18n/ru.json +7 -0
  78. package/dist/utils/bytesParsers/index.ts +2 -0
  79. package/dist/utils/constants.ts +3 -0
  80. package/dist/utils/index.js +6 -0
  81. package/dist/utils/storage.ts +2 -2
  82. package/dist/utils/timeParsers/index.ts +2 -1
  83. package/dist/utils/timeParsers/parsers.ts +18 -0
  84. package/dist/utils/timeParsers/{protobuf.ts → protobufParsers.ts} +0 -0
  85. package/dist/utils/typecheckers.ts +5 -0
  86. package/dist/utils/utils.js +3 -3
  87. package/package.json +2 -2
  88. package/dist/containers/Tenant/Diagnostics/OverloadedShards/i18n/en.json +0 -4
  89. package/dist/containers/Tenant/Diagnostics/OverloadedShards/i18n/ru.json +0 -4
  90. package/dist/containers/Tenant/Diagnostics/OverloadedShards/index.ts +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "b": "B",
3
+ "kb": "KB",
4
+ "mb": "MB",
5
+ "gb": "GB",
6
+ "perSecond": "/s"
7
+ }
@@ -0,0 +1,11 @@
1
+ import {i18n, Lang} from '../../i18n';
2
+
3
+ import en from './en.json';
4
+ import ru from './ru.json';
5
+
6
+ const COMPONENT = 'ydb-bytes-parsers';
7
+
8
+ i18n.registerKeyset(Lang.En, COMPONENT, en);
9
+ i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
10
+
11
+ export default i18n.keyset(COMPONENT);
@@ -0,0 +1,7 @@
1
+ {
2
+ "b": "Б",
3
+ "kb": "КБ",
4
+ "mb": "МБ",
5
+ "gb": "ГБ",
6
+ "perSecond": "/с"
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './formatBytesCustom';
2
+ export * from './convertBytesObjectToSpeed';
@@ -9,6 +9,7 @@ export const AUTO_RELOAD_INTERVAL = 10 * SECOND;
9
9
  // by agreement, display all byte values in decimal scale
10
10
  // values in data are always in bytes, never in higher units,
11
11
  // therefore there is no issue arbitrary converting them in UI
12
+ export const KILOBYTE = 1_000;
12
13
  export const MEGABYTE = 1_000_000;
13
14
  export const GIGABYTE = 1_000_000_000;
14
15
  export const TERABYTE = 1_000_000_000_000;
@@ -118,3 +119,5 @@ export const DEFAULT_TABLE_SETTINGS = {
118
119
 
119
120
  export const TENANT_INITIAL_TAB_KEY = 'saved_tenant_initial_tab';
120
121
  export const QUERY_INITIAL_RUN_ACTION_KEY = 'query_initial_run_action';
122
+
123
+ export const PARTITIONS_SELECTED_COLUMNS_KEY = 'partitionsSelectedColumns';
@@ -9,6 +9,8 @@ import {isNumeric} from './utils';
9
9
 
10
10
  numeral.locale(i18n.lang);
11
11
 
12
+ // Here you can't control displayed size and precision
13
+ // If you need more custom format, use formatBytesCustom instead
12
14
  export const formatBytes = (bytes) => {
13
15
  if (!isNumeric(bytes)) {
14
16
  return '';
@@ -42,6 +44,10 @@ export const formatUptime = (seconds) => {
42
44
  return uptime;
43
45
  };
44
46
 
47
+ export const formatMsToUptime = (ms) => {
48
+ return formatUptime(ms / 1000);
49
+ };
50
+
45
51
  export const formatIOPS = (value, capacity) => {
46
52
  return [Math.floor(value), Math.floor(capacity) + ' IOPS'];
47
53
  };
@@ -1,8 +1,8 @@
1
1
  import type {TVSlotId, TVDiskStateInfo} from '../types/api/vdisk';
2
2
  import type {IStoragePoolGroup} from '../types/store/storage';
3
3
 
4
- export const isFullDonorData = (donor: TVDiskStateInfo | TVSlotId): donor is TVDiskStateInfo =>
5
- 'VDiskId' in donor;
4
+ export const isFullVDiksData = (disk: TVDiskStateInfo | TVSlotId): disk is TVDiskStateInfo =>
5
+ 'VDiskId' in disk;
6
6
 
7
7
  export const getUsage = (data: IStoragePoolGroup, step = 1) => {
8
8
  // if limit is 0, display 0
@@ -1,2 +1,3 @@
1
1
  export * from './formatDuration';
2
- export * from './protobuf';
2
+ export * from './protobufParsers';
3
+ export * from './parsers';
@@ -0,0 +1,18 @@
1
+ import type {IProtobufTimeObject} from '../../types/api/common';
2
+
3
+ import {parseProtobufDurationToMs, parseProtobufTimestampToMs} from '.';
4
+
5
+ export const parseLag = (value: string | IProtobufTimeObject | undefined) =>
6
+ value ? parseProtobufDurationToMs(value) : 0;
7
+
8
+ export const parseTimestampToIdleTime = (value: string | IProtobufTimeObject | undefined) => {
9
+ if (!value) {
10
+ return 0;
11
+ }
12
+
13
+ const duration = Date.now() - parseProtobufTimestampToMs(value);
14
+
15
+ // Duration could be negative because of the difference between server and local time
16
+ // Usually it below 100ms, so it could be omitted
17
+ return duration < 0 ? 0 : duration;
18
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Intended to typecheck enums, but also checks if the value is any of the arbitrary object values
3
+ */
4
+ export const isEnumMember = <T extends Object>(object: T, value: any): value is T[keyof T] =>
5
+ Object.values(object).includes(value);
@@ -76,9 +76,9 @@ export function bytesToGB(bytes, shouldRound) {
76
76
 
77
77
  export function pad9(val) {
78
78
  const len = String(val).length;
79
- let result = val
79
+ let result = val;
80
80
  for (let i = len; i < 9; i++) {
81
- result = "0" + result;
81
+ result = '0' + result;
82
82
  }
83
83
  return result;
84
84
  }
@@ -88,4 +88,4 @@ export function isNumeric(value) {
88
88
  // - isNaN treats true/false/''/etc. as numbers, parseFloat fixes this
89
89
  // - parseFloat treats '123qwe' as number, isNaN fixes this
90
90
  return !isNaN(value) && !isNaN(parseFloat(value));
91
- };
91
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -39,7 +39,7 @@
39
39
  "reselect": "4.1.6",
40
40
  "sass": "1.32.8",
41
41
  "web-vitals": "1.1.2",
42
- "ydb-ui-components": "^3.0.2"
42
+ "ydb-ui-components": "^3.0.3"
43
43
  },
44
44
  "scripts": {
45
45
  "start": "react-app-rewired start",
@@ -1,4 +0,0 @@
1
- {
2
- "no-data": "No data",
3
- "description": "Shards with CPU load over 70% are listed"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "no-data": "Нет данных",
3
- "description": "Отображаются шарды с загрузкой CPU выше 70%"
4
- }
@@ -1 +0,0 @@
1
- export * from './OverloadedShards';