ydb-embedded-ui 4.19.3 → 4.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/CellWithPopover/CellWithPopover.scss +13 -0
  3. package/dist/components/CellWithPopover/CellWithPopover.tsx +26 -0
  4. package/dist/components/LinkToSchemaObject/LinkToSchemaObject.tsx +20 -0
  5. package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -2
  6. package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +28 -29
  7. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +3 -2
  8. package/dist/components/TruncatedQuery/TruncatedQuery.scss +8 -0
  9. package/dist/components/TruncatedQuery/TruncatedQuery.tsx +15 -1
  10. package/dist/components/UsageLabel/UsageLabel.scss +6 -0
  11. package/dist/components/UsageLabel/UsageLabel.tsx +22 -0
  12. package/dist/containers/AsideNavigation/AsideNavigation.tsx +13 -8
  13. package/dist/containers/AsideNavigation/i18n/en.json +13 -0
  14. package/dist/containers/AsideNavigation/i18n/index.ts +11 -0
  15. package/dist/containers/AsideNavigation/i18n/ru.json +13 -0
  16. package/dist/containers/Node/NodeStructure/Pdisk.tsx +74 -68
  17. package/dist/containers/Node/NodeStructure/Vdisk.tsx +9 -33
  18. package/dist/containers/Nodes/Nodes.tsx +10 -2
  19. package/dist/containers/Nodes/getNodesColumns.tsx +207 -123
  20. package/dist/containers/Storage/Storage.tsx +9 -2
  21. package/dist/containers/Storage/StorageGroups/StorageGroups.scss +0 -11
  22. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.tsx +11 -11
  23. package/dist/containers/Storage/utils/index.ts +1 -22
  24. package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +2 -3
  25. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +0 -1
  26. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +4 -2
  27. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +1 -0
  28. package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.tsx +8 -1
  29. package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.tsx +11 -1
  30. package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/IssuesViewer/IssueTree.tsx +0 -1
  31. package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.tsx +3 -0
  32. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.tsx +21 -0
  33. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.tsx +53 -0
  34. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.tsx +53 -0
  35. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.tsx +83 -0
  36. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.tsx +53 -0
  37. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.tsx +9 -0
  38. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.tsx +55 -0
  39. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +44 -0
  40. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +35 -19
  41. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.tsx +53 -0
  42. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.tsx +4 -2
  43. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.tsx +9 -36
  44. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.tsx +22 -41
  45. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +3 -3
  46. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/ru.json +3 -3
  47. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +0 -2
  48. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +19 -61
  49. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.tsx +102 -0
  50. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.tsx +2 -2
  51. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +18 -97
  52. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.tsx +138 -0
  53. package/dist/containers/Tenant/Info/ExternalTable/ExternalTable.tsx +2 -4
  54. package/dist/containers/Tenant/Query/ExecuteResult/{ExecuteResult.js → ExecuteResult.tsx} +51 -31
  55. package/dist/containers/Tenant/Query/Issues/Issues.tsx +4 -6
  56. package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.tsx +1 -1
  57. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +1 -1
  58. package/dist/routes.ts +26 -1
  59. package/dist/store/reducers/{executeTopQueries.ts → executeTopQueries/executeTopQueries.ts} +23 -75
  60. package/dist/{types/store/executeTopQueries.ts → store/reducers/executeTopQueries/types.ts} +3 -7
  61. package/dist/store/reducers/executeTopQueries/utils.ts +36 -0
  62. package/dist/store/reducers/index.ts +12 -2
  63. package/dist/store/reducers/nodes/types.ts +1 -0
  64. package/dist/store/reducers/nodes/utils.ts +16 -6
  65. package/dist/store/reducers/{shardsWorkload.ts → shardsWorkload/shardsWorkload.ts} +5 -11
  66. package/dist/{types/store/shardsWorkload.ts → store/reducers/shardsWorkload/types.ts} +3 -7
  67. package/dist/store/reducers/tenantOverview/topNodesByCpu/topNodesByCpu.ts +87 -0
  68. package/dist/store/reducers/tenantOverview/topNodesByCpu/types.ts +29 -0
  69. package/dist/store/reducers/tenantOverview/topNodesByLoad/topNodesByLoad.ts +87 -0
  70. package/dist/store/reducers/tenantOverview/topNodesByLoad/types.ts +29 -0
  71. package/dist/store/reducers/tenantOverview/topNodesByMemory/topNodesByMemory.ts +87 -0
  72. package/dist/store/reducers/tenantOverview/topNodesByMemory/types.ts +29 -0
  73. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.ts +93 -0
  74. package/dist/store/reducers/tenantOverview/topQueries/types.ts +14 -0
  75. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.ts +103 -0
  76. package/dist/store/reducers/tenantOverview/topShards/types.ts +14 -0
  77. package/dist/store/reducers/tenantOverview/topShards/utils.ts +3 -0
  78. package/dist/styles/mixins.scss +4 -0
  79. package/dist/types/additionalProps.ts +3 -1
  80. package/dist/types/api/compute.ts +1 -1
  81. package/dist/types/react-json-inspector.d.ts +21 -0
  82. package/dist/utils/diagnostics.ts +23 -0
  83. package/dist/utils/generateEvaluator.ts +21 -0
  84. package/dist/utils/generateHash.ts +11 -0
  85. package/package.json +3 -2
  86. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.scss +0 -41
@@ -26,6 +26,8 @@ export interface AdditionalTenantsProps {
26
26
 
27
27
  export type NodeAddress = Pick<TSystemStateInfo, 'Host' | 'Endpoints' | 'NodeId'>;
28
28
 
29
+ export type GetNodeRefFunc = (node?: NodeAddress) => string | null;
30
+
29
31
  export interface AdditionalNodesProps extends Record<string, unknown> {
30
- getNodeRef?: (node?: NodeAddress) => string | null;
32
+ getNodeRef?: GetNodeRefFunc;
31
33
  }
@@ -20,7 +20,7 @@ export interface TComputeInfo {
20
20
  Nodes?: TComputeNodeInfo[]; // v2
21
21
  }
22
22
 
23
- interface TComputeTenantInfo {
23
+ export interface TComputeTenantInfo {
24
24
  Overall: EFlag;
25
25
  Name: string;
26
26
  Nodes?: TComputeNodeInfo[];
@@ -0,0 +1,21 @@
1
+ declare module 'react-json-inspector' {
2
+ // This typing is sufficient for current use cases, but some types are incompelete
3
+ class JSONTree extends React.Component<{
4
+ data?: object;
5
+ search?: boolean;
6
+ searchOptions?: {
7
+ debounceTime?: number;
8
+ };
9
+ onClick?: ({path: string, key: string, value: object}) => void;
10
+ validateQuery?: (query: string) => boolean;
11
+ isExpanded?: (keypath: string) => boolean;
12
+ filterOptions?: {
13
+ cacheResults?: bool;
14
+ ignoreCase?: bool;
15
+ };
16
+ query?: string;
17
+ verboseShowOriginal?: boolean;
18
+ className?: string;
19
+ }> {}
20
+ export default JSONTree;
21
+ }
@@ -0,0 +1,23 @@
1
+ import {ValueOf} from '../types/common';
2
+
3
+ const TOP_SHARDS_SORT_VALUES = {
4
+ CPUCores: 'CPUCores',
5
+ DataSize: 'DataSize',
6
+ } as const;
7
+
8
+ const TOP_QUERIES_SORT_VALUES = {
9
+ CPUTimeUs: 'CPUTimeUs',
10
+ EndTime: 'EndTime',
11
+ ReadRows: 'ReadRows',
12
+ ReadBytes: 'ReadBytes',
13
+ UserSID: 'UserSID',
14
+ } as const;
15
+
16
+ type TopShardsSortValue = ValueOf<typeof TOP_SHARDS_SORT_VALUES>;
17
+ type TopQueriesSortValue = ValueOf<typeof TOP_QUERIES_SORT_VALUES>;
18
+
19
+ export const isSortableTopShardsProperty = (value: string): value is TopShardsSortValue =>
20
+ Object.values(TOP_SHARDS_SORT_VALUES).includes(value as TopShardsSortValue);
21
+
22
+ export const isSortableTopQueriesProperty = (value: string): value is TopQueriesSortValue =>
23
+ Object.values(TOP_QUERIES_SORT_VALUES).includes(value as TopQueriesSortValue);
@@ -0,0 +1,21 @@
1
+ export const generateEvaluator =
2
+ <OkLevel extends string, WarnLevel extends string, CritLevel extends string>(
3
+ warn: number,
4
+ crit: number,
5
+ levels: [OkLevel, WarnLevel, CritLevel],
6
+ ) =>
7
+ (value: number) => {
8
+ if (0 <= value && value < warn) {
9
+ return levels[0];
10
+ }
11
+
12
+ if (warn <= value && value < crit) {
13
+ return levels[1];
14
+ }
15
+
16
+ if (crit <= value) {
17
+ return levels[2];
18
+ }
19
+
20
+ return undefined;
21
+ };
@@ -0,0 +1,11 @@
1
+ import crc32 from 'crc-32';
2
+
3
+ export const generateHash = (value: string) => {
4
+ // 1. crc32.str(value) - generate crc32 hash
5
+ // 2. (>>>) - use unsigned right shift operator (>>>) to avoid negative values
6
+ // 3. toString(16) - convert hash to hex format
7
+ // 4. toUpperCase() - convert hash to uppercase
8
+ // 5. padStart(8, '0') - fill hash with leading zeros if hash length < 8
9
+ // eslint-disable-next-line no-bitwise
10
+ return (crc32.str(value) >>> 0).toString(16).toUpperCase().padStart(8, '0');
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.19.3",
3
+ "version": "4.20.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -15,9 +15,11 @@
15
15
  "@gravity-ui/navigation": "^0.4.0",
16
16
  "@gravity-ui/paranoid": "^1.4.0",
17
17
  "@gravity-ui/react-data-table": "^1.0.3",
18
+ "@types/react": "^17.0.58",
18
19
  "axios": "0.19.2",
19
20
  "bem-cn-lite": "4.0.0",
20
21
  "copy-to-clipboard": "^3.3.3",
22
+ "crc-32": "^1.2.2",
21
23
  "history": "4.10.1",
22
24
  "js-cookie": "2.2.1",
23
25
  "lodash": "4.17.11",
@@ -117,7 +119,6 @@
117
119
  "@types/lodash": "^4.14.178",
118
120
  "@types/numeral": "^2.0.2",
119
121
  "@types/qs": "^6.9.7",
120
- "@types/react": "^17.0.44",
121
122
  "@types/react-dom": "^17.0.11",
122
123
  "@types/react-router": "^5.1.17",
123
124
  "@types/react-router-dom": "^5.3.2",
@@ -1,41 +0,0 @@
1
- @import '../../../../../styles/mixins.scss';
2
-
3
- .tenant-overview-storage {
4
- &__info {
5
- margin-bottom: 36px;
6
- }
7
-
8
- &__title {
9
- margin-bottom: 10px;
10
-
11
- font-size: var(--yc-text-body-2-font-size);
12
- font-weight: 700;
13
- line-height: var(--yc-text-body-2-line-height);
14
- }
15
-
16
- &__table {
17
- width: var(--diagnostics-section-table-width);
18
- @include table-styles;
19
-
20
- &:not(:last-child) {
21
- margin-bottom: var(--diagnostics-section-margin);
22
- }
23
-
24
- th {
25
- height: 40px;
26
-
27
- vertical-align: middle;
28
- }
29
- }
30
-
31
- &__cell-with-popover-wrapper {
32
- display: flex;
33
- }
34
-
35
- &__cell-with-popover {
36
- overflow: hidden;
37
-
38
- white-space: nowrap;
39
- text-overflow: ellipsis;
40
- }
41
- }