ydb-embedded-ui 3.4.3 → 3.4.4

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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.4.4](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.4.3...v3.4.4) (2023-03-22)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **Diagnostics:** display nodes tab for not db entities ([a542dbc](https://github.com/ydb-platform/ydb-embedded-ui/commit/a542dbc23d01138a5c1a4126cfc1836a1543b68c))
9
+
3
10
  ## [3.4.3](https://github.com/ydb-platform/ydb-embedded-ui/compare/v3.4.2...v3.4.3) (2023-03-17)
4
11
 
5
12
 
@@ -4,10 +4,11 @@ import {useDispatch} from 'react-redux';
4
4
 
5
5
  import DataTable from '@gravity-ui/react-data-table';
6
6
 
7
+ import type {EPathType} from '../../types/api/schema';
8
+
7
9
  import {AccessDenied} from '../../components/Errors/403';
8
10
  import {Illustration} from '../../components/Illustration';
9
11
  import {Loader} from '../../components/Loader';
10
-
11
12
  import {Search} from '../../components/Search';
12
13
  import {ProblemFilter} from '../../components/ProblemFilter';
13
14
  import {UptimeFilter} from '../../components/UptimeFIlter';
@@ -35,6 +36,8 @@ import {
35
36
  import {changeFilter, getSettingValue} from '../../store/reducers/settings';
36
37
  import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
37
38
 
39
+ import {isDatabaseEntityType} from '../Tenant/utils/schema';
40
+
38
41
  import {getNodesColumns} from './getNodesColumns';
39
42
 
40
43
  import './Nodes.scss';
@@ -48,22 +51,23 @@ interface IAdditionalNodesInfo extends Record<string, unknown> {
48
51
  }
49
52
 
50
53
  interface NodesProps {
51
- tenantPath?: string;
54
+ path?: string;
55
+ type?: EPathType;
52
56
  className?: string;
53
57
  additionalNodesInfo?: IAdditionalNodesInfo;
54
58
  }
55
59
 
56
- export const Nodes = ({tenantPath, className, additionalNodesInfo = {}}: NodesProps) => {
60
+ export const Nodes = ({path, type, className, additionalNodesInfo = {}}: NodesProps) => {
57
61
  const dispatch = useDispatch();
58
62
 
59
- const isClusterNodes = !tenantPath;
63
+ const isClusterNodes = !path;
60
64
 
61
65
  // Since Nodes component is used in several places,
62
66
  // we need to reset filters, searchValue and loading state
63
67
  // in nodes reducer when path changes
64
68
  useEffect(() => {
65
69
  dispatch(resetNodesState());
66
- }, [dispatch, tenantPath]);
70
+ }, [dispatch, path]);
67
71
 
68
72
  const {wasLoaded, loading, error, nodesUptimeFilter, searchValue, totalNodes} =
69
73
  useTypedSelector((state) => state.nodes);
@@ -77,12 +81,14 @@ export const Nodes = ({tenantPath, className, additionalNodesInfo = {}}: NodesPr
77
81
  );
78
82
 
79
83
  const fetchNodes = useCallback(() => {
80
- if (tenantPath && !JSON.parse(useNodesEndpoint)) {
81
- dispatch(getComputeNodes(tenantPath));
84
+ // For not DB entities we always use /compute endpoint instead of /nodes
85
+ // since /nodes can return data only for tenants
86
+ if (path && (!JSON.parse(useNodesEndpoint) || !isDatabaseEntityType(type))) {
87
+ dispatch(getComputeNodes(path));
82
88
  } else {
83
- dispatch(getNodes({tenant: tenantPath}));
89
+ dispatch(getNodes({tenant: path}));
84
90
  }
85
- }, [dispatch, tenantPath, useNodesEndpoint]);
91
+ }, [dispatch, path, type, useNodesEndpoint]);
86
92
 
87
93
  useAutofetcher(fetchNodes, [fetchNodes], isClusterNodes ? true : autorefresh);
88
94
 
@@ -131,7 +131,8 @@ function Diagnostics(props: DiagnosticsProps) {
131
131
  case GeneralPagesIds.nodes: {
132
132
  return (
133
133
  <Nodes
134
- tenantPath={tenantNameString}
134
+ path={currentSchemaPath}
135
+ type={type}
135
136
  additionalNodesInfo={props.additionalNodesInfo}
136
137
  />
137
138
  );
@@ -89,12 +89,12 @@ export const DATABASE_PAGES = [
89
89
  describe,
90
90
  ];
91
91
 
92
- export const TABLE_PAGES = [overview, topShards, graph, tablets, hotKeys, describe];
92
+ export const TABLE_PAGES = [overview, topShards, nodes, graph, tablets, hotKeys, describe];
93
93
 
94
- export const DIR_PAGES = [overview, topShards, describe];
94
+ export const DIR_PAGES = [overview, topShards, nodes, describe];
95
95
 
96
- export const CDC_STREAM_PAGES = [overview, consumers, partitions, describe];
97
- export const TOPIC_PAGES = [overview, consumers, partitions, describe];
96
+ export const CDC_STREAM_PAGES = [overview, consumers, partitions, nodes, describe];
97
+ export const TOPIC_PAGES = [overview, consumers, partitions, nodes, describe];
98
98
 
99
99
  // verbose mapping to guarantee correct tabs for new path types
100
100
  // TS will error when a new type is added but not mapped here
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],