ydb-embedded-ui 4.8.0 → 4.8.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/dist/components/Tablet/Tablet.tsx +2 -13
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +15 -7
- package/dist/containers/Header/breadcrumbs.ts +22 -6
- package/dist/containers/Tablet/Tablet.tsx +2 -11
- package/dist/containers/TabletsFilters/TabletsFilters.js +8 -3
- package/dist/containers/Tenants/Tenants.js +2 -11
- package/dist/store/reducers/header/types.ts +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.8.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.1...v4.8.2) (2023-06-27)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* **breadcrumbs:** update tenant and tablet params ([#443](https://github.com/ydb-platform/ydb-embedded-ui/issues/443)) ([b0d31ac](https://github.com/ydb-platform/ydb-embedded-ui/commit/b0d31acce6d6e97d759180c885e6aea3b762a91c))
|
9
|
+
|
10
|
+
## [4.8.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.0...v4.8.1) (2023-06-26)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* **Tenants:** fix tenant link ([#439](https://github.com/ydb-platform/ydb-embedded-ui/issues/439)) ([432c621](https://github.com/ydb-platform/ydb-embedded-ui/commit/432c621eb2fb2ffd5a747299af930236d5cc06f7))
|
16
|
+
|
3
17
|
## [4.8.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.7.0...v4.8.0) (2023-06-26)
|
4
18
|
|
5
19
|
|
@@ -18,21 +18,10 @@ interface TabletProps {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
export const Tablet = ({tablet = {}, tenantName}: TabletProps) => {
|
21
|
-
const {TabletId: id, NodeId
|
21
|
+
const {TabletId: id, NodeId} = tablet;
|
22
22
|
const status = tablet.Overall?.toLowerCase();
|
23
23
|
|
24
|
-
const tabletPath =
|
25
|
-
id &&
|
26
|
-
createHref(
|
27
|
-
routes.tablet,
|
28
|
-
{id},
|
29
|
-
{
|
30
|
-
nodeId: NodeId,
|
31
|
-
type: Type,
|
32
|
-
state: State,
|
33
|
-
tenantName,
|
34
|
-
},
|
35
|
-
);
|
24
|
+
const tabletPath = id && createHref(routes.tablet, {id}, {nodeId: NodeId, tenantName});
|
36
25
|
|
37
26
|
return (
|
38
27
|
<ContentWithPopup
|
@@ -120,19 +120,13 @@ enum Panel {
|
|
120
120
|
UserSettings = 'UserSettings',
|
121
121
|
}
|
122
122
|
|
123
|
-
|
123
|
+
export const useGetLeftNavigationItems = () => {
|
124
124
|
const location = useLocation();
|
125
125
|
const history = useHistory();
|
126
126
|
|
127
|
-
const [visiblePanel, setVisiblePanel] = useState<Panel>();
|
128
|
-
|
129
127
|
const [initialTenantPage, setInitialTenantPage] = useSetting<string>(TENANT_INITIAL_PAGE_KEY);
|
130
128
|
const {tenantPage = initialTenantPage} = useTypedSelector((state) => state.tenant);
|
131
129
|
|
132
|
-
const setIsCompact = (compact: boolean) => {
|
133
|
-
props.setSettingValue(ASIDE_HEADER_COMPACT_KEY, JSON.stringify(compact));
|
134
|
-
};
|
135
|
-
|
136
130
|
const {pathname} = location;
|
137
131
|
const queryParams = parseQuery(location);
|
138
132
|
|
@@ -183,6 +177,20 @@ function AsideNavigation(props: AsideNavigationProps) {
|
|
183
177
|
});
|
184
178
|
}, [tenantPage, isTenantPage, setInitialTenantPage, history, queryParams]);
|
185
179
|
|
180
|
+
return menuItems;
|
181
|
+
};
|
182
|
+
|
183
|
+
function AsideNavigation(props: AsideNavigationProps) {
|
184
|
+
const history = useHistory();
|
185
|
+
|
186
|
+
const [visiblePanel, setVisiblePanel] = useState<Panel>();
|
187
|
+
|
188
|
+
const setIsCompact = (compact: boolean) => {
|
189
|
+
props.setSettingValue(ASIDE_HEADER_COMPACT_KEY, JSON.stringify(compact));
|
190
|
+
};
|
191
|
+
|
192
|
+
const menuItems = useGetLeftNavigationItems();
|
193
|
+
|
186
194
|
return (
|
187
195
|
<React.Fragment>
|
188
196
|
<AsideHeader
|
@@ -10,10 +10,15 @@ import type {
|
|
10
10
|
TabletsBreadcrumbsOptions,
|
11
11
|
TenantBreadcrumbsOptions,
|
12
12
|
} from '../../store/reducers/header/types';
|
13
|
+
import {
|
14
|
+
TENANT_DIAGNOSTICS_TABS_IDS,
|
15
|
+
TENANT_PAGE,
|
16
|
+
TENANT_PAGES_IDS,
|
17
|
+
} from '../../store/reducers/tenant/constants';
|
13
18
|
import routes, {createHref} from '../../routes';
|
14
19
|
|
15
20
|
import {getClusterPath} from '../Cluster/utils';
|
16
|
-
import {getTenantPath} from '../Tenant/TenantPages';
|
21
|
+
import {TenantTabsGroups, getTenantPath} from '../Tenant/TenantPages';
|
17
22
|
import {getDefaultNodePath} from '../Node/NodePages';
|
18
23
|
|
19
24
|
const prepareTenantName = (tenantName: string) => {
|
@@ -61,10 +66,16 @@ const getNodeBreadcrumbs = (options: NodeBreadcrumbsOptions, query = {}): RawBre
|
|
61
66
|
// Compute nodes have tenantName, storage nodes doesn't
|
62
67
|
const isStorageNode = !tenantName;
|
63
68
|
|
69
|
+
const newQuery = {
|
70
|
+
...query,
|
71
|
+
[TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics,
|
72
|
+
[TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.nodes,
|
73
|
+
};
|
74
|
+
|
64
75
|
if (isStorageNode) {
|
65
76
|
breadcrumbs = getClusterBreadcrumbs(options, query);
|
66
77
|
} else {
|
67
|
-
breadcrumbs = getTenantBreadcrumbs(options,
|
78
|
+
breadcrumbs = getTenantBreadcrumbs(options, newQuery);
|
68
79
|
}
|
69
80
|
|
70
81
|
const text = nodeId ? `Node ${nodeId}` : 'Node';
|
@@ -79,21 +90,26 @@ const getTabletsBreadcrubms = (
|
|
79
90
|
options: TabletsBreadcrumbsOptions,
|
80
91
|
query = {},
|
81
92
|
): RawBreadcrumbItem[] => {
|
82
|
-
const {tenantName, nodeIds
|
93
|
+
const {tenantName, nodeIds} = options;
|
94
|
+
|
95
|
+
const newQuery = {
|
96
|
+
...query,
|
97
|
+
[TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics,
|
98
|
+
[TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.tablets,
|
99
|
+
};
|
83
100
|
|
84
101
|
let breadcrumbs: RawBreadcrumbItem[];
|
85
102
|
|
86
103
|
// Cluster system tablets don't have tenantName
|
87
104
|
if (tenantName) {
|
88
|
-
breadcrumbs = getTenantBreadcrumbs(options,
|
105
|
+
breadcrumbs = getTenantBreadcrumbs(options, newQuery);
|
89
106
|
} else {
|
90
107
|
breadcrumbs = getClusterBreadcrumbs(options, query);
|
91
108
|
}
|
92
109
|
|
93
110
|
const link = createHref(routes.tabletsFilters, undefined, {
|
111
|
+
...query,
|
94
112
|
nodeIds,
|
95
|
-
state,
|
96
|
-
type,
|
97
113
|
path: tenantName,
|
98
114
|
});
|
99
115
|
|
@@ -48,16 +48,9 @@ export const Tablet = () => {
|
|
48
48
|
error,
|
49
49
|
} = useTypedSelector((state) => state.tablet);
|
50
50
|
|
51
|
-
const {
|
52
|
-
nodeId: queryNodeId,
|
53
|
-
type: queryType,
|
54
|
-
state: queryState,
|
55
|
-
tenantName: queryTenantName,
|
56
|
-
} = parseQuery(location);
|
51
|
+
const {nodeId: queryNodeId, tenantName: queryTenantName} = parseQuery(location);
|
57
52
|
|
58
53
|
const nodeId = tablet.NodeId?.toString() || queryNodeId?.toString();
|
59
|
-
const tabletState = tablet.State || queryState?.toString();
|
60
|
-
const tabletType = tablet.Type || queryType?.toString();
|
61
54
|
const tenantName = tenantPath || queryTenantName?.toString();
|
62
55
|
|
63
56
|
// NOTE: should be reviewed when migrating to React 18
|
@@ -84,13 +77,11 @@ export const Tablet = () => {
|
|
84
77
|
dispatch(
|
85
78
|
setHeaderBreadcrumbs('tablet', {
|
86
79
|
nodeIds: nodeId ? [nodeId] : [],
|
87
|
-
state: tabletState,
|
88
|
-
type: tabletType,
|
89
80
|
tenantName,
|
90
81
|
tabletId: id,
|
91
82
|
}),
|
92
83
|
);
|
93
|
-
}, [dispatch, tenantName, id, nodeId
|
84
|
+
}, [dispatch, tenantName, id, nodeId]);
|
94
85
|
|
95
86
|
const renderExternalLinks = (link: {name: string; path: string}, index: number) => {
|
96
87
|
return (
|
@@ -81,10 +81,15 @@ class TabletsFilters extends React.Component {
|
|
81
81
|
});
|
82
82
|
const {nodeIds, type, path, state} = queryParams;
|
83
83
|
const nodes = TabletsFilters.parseNodes(nodeIds);
|
84
|
-
const stateFilter = TabletsFilters.getStateFiltersFromColor(state);
|
85
84
|
|
86
|
-
|
87
|
-
|
85
|
+
if (state) {
|
86
|
+
const stateFilter = TabletsFilters.getStateFiltersFromColor(state);
|
87
|
+
setStateFilter(stateFilter);
|
88
|
+
}
|
89
|
+
|
90
|
+
if (type) {
|
91
|
+
setTypeFilter([type]);
|
92
|
+
}
|
88
93
|
|
89
94
|
this.setState({nodeFilter: nodes, tenantPath: path}, () => {
|
90
95
|
this.makeRequest();
|
@@ -18,14 +18,9 @@ import {AutoFetcher} from '../../utils/autofetcher';
|
|
18
18
|
import routes, {createHref} from '../../routes';
|
19
19
|
import {formatCPU, formatBytesToGigabyte, formatNumber} from '../../utils';
|
20
20
|
import {withSearch} from '../../HOCS';
|
21
|
-
import {DEFAULT_TABLE_SETTINGS
|
22
|
-
import {TENANT_PAGES_IDS} from '../../store/reducers/tenant/constants';
|
21
|
+
import {DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
23
22
|
import {getTenantsInfo} from '../../store/reducers/tenants/tenants';
|
24
|
-
import {
|
25
|
-
changeFilter,
|
26
|
-
getSettingValue,
|
27
|
-
ProblemFilterValues,
|
28
|
-
} from '../../store/reducers/settings/settings';
|
23
|
+
import {changeFilter, ProblemFilterValues} from '../../store/reducers/settings/settings';
|
29
24
|
|
30
25
|
import {clusterName} from '../../store';
|
31
26
|
import {TenantTabsGroups, TENANT_INFO_TABS} from '../Tenant/TenantPages';
|
@@ -115,7 +110,6 @@ class Tenants extends React.Component {
|
|
115
110
|
filter,
|
116
111
|
handleSearchQuery,
|
117
112
|
additionalTenantsInfo = {},
|
118
|
-
savedTenantInitialTab,
|
119
113
|
} = this.props;
|
120
114
|
|
121
115
|
const filteredTenantsBySearch = tenants.filter((item) => {
|
@@ -124,7 +118,6 @@ class Tenants extends React.Component {
|
|
124
118
|
});
|
125
119
|
const filteredTenants = Tenants.filterTenants(filteredTenantsBySearch, filter);
|
126
120
|
|
127
|
-
const initialTenantGeneralTab = savedTenantInitialTab || TENANT_PAGES_IDS.query;
|
128
121
|
const initialTenantInfoTab = TENANT_INFO_TABS[0].id;
|
129
122
|
|
130
123
|
const getTenantBackend = (tenant) => {
|
@@ -154,7 +147,6 @@ class Tenants extends React.Component {
|
|
154
147
|
name: value,
|
155
148
|
backend,
|
156
149
|
[TenantTabsGroups.info]: initialTenantInfoTab,
|
157
|
-
[TenantTabsGroups.general]: initialTenantGeneralTab,
|
158
150
|
})}
|
159
151
|
/>
|
160
152
|
{additionalTenantsInfo.name && additionalTenantsInfo.name(value, row)}
|
@@ -360,7 +352,6 @@ const mapStateToProps = (state) => {
|
|
360
352
|
loading,
|
361
353
|
error,
|
362
354
|
filter: state.settings.problemFilter,
|
363
|
-
savedTenantInitialTab: getSettingValue(state, TENANT_INITIAL_PAGE_KEY),
|
364
355
|
};
|
365
356
|
};
|
366
357
|
|
@@ -19,8 +19,6 @@ export interface NodeBreadcrumbsOptions extends TenantBreadcrumbsOptions {
|
|
19
19
|
|
20
20
|
export interface TabletsBreadcrumbsOptions extends TenantBreadcrumbsOptions {
|
21
21
|
nodeIds?: string[] | number[];
|
22
|
-
state?: string;
|
23
|
-
type?: string;
|
24
22
|
}
|
25
23
|
|
26
24
|
export interface TabletBreadcrumbsOptions extends TabletsBreadcrumbsOptions {
|