ydb-embedded-ui 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +17 -0
- package/README.md +1 -1
- package/dist/components/EntityStatus/EntityStatus.scss +2 -3
- package/dist/containers/App/App.scss +1 -1
- package/dist/containers/App/NodesTable.scss +7 -4
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +10 -1
- package/dist/containers/Tenants/Tenants.js +9 -4
- package/dist/store/reducers/settings.js +5 -1
- package/dist/utils/constants.js +2 -0
- package/dist/utils/getNodesColumns.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.4.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.3.0...v1.4.0) (2022-05-16)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* **Tenant:** save initial tab preference ([7195d0f](https://github.com/ydb-platform/ydb-embedded-ui/commit/7195d0f7f5754c461555211515f80ea96464ca15))
|
9
|
+
|
10
|
+
|
11
|
+
### UI Updtaes
|
12
|
+
|
13
|
+
* **NodesTable:** don't reserve space for icons next to node fqdn ([8fcf1b3](https://github.com/ydb-platform/ydb-embedded-ui/commit/8fcf1b3269dee7ada83d7c5abcf44ad004191851))
|
14
|
+
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
* **Tenant:** mapDispatchToProps types ([7dcaf56](https://github.com/ydb-platform/ydb-embedded-ui/commit/7dcaf561ec0c361d52d789b2ea3b1aba75339d83))
|
19
|
+
|
3
20
|
## [1.3.0](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.6...v1.3.0) (2022-05-12)
|
4
21
|
|
5
22
|
|
package/README.md
CHANGED
@@ -8,7 +8,7 @@ Local viewer for YDB clusters
|
|
8
8
|
|
9
9
|
1) Run on a machine with Docker installed:
|
10
10
|
```
|
11
|
-
docker pull cr.yandex/yc/yandex-docker-local-ydb
|
11
|
+
docker pull cr.yandex/yc/yandex-docker-local-ydb
|
12
12
|
docker run --hostname localhost -e YDB_ALLOW_ORIGIN="http://localhost:3000" -dp 2135:2135 -dp 8765:8765 cr.yandex/yc/yandex-docker-local-ydb
|
13
13
|
```
|
14
14
|
2) Run the frontend app in the development mode, via invoking `npm run dev`
|
@@ -9,8 +9,7 @@
|
|
9
9
|
line-height: var(--yc-text-body2-line-height);
|
10
10
|
|
11
11
|
&__clipboard-button {
|
12
|
-
display:
|
13
|
-
visibility: hidden;
|
12
|
+
display: none;
|
14
13
|
align-items: center;
|
15
14
|
|
16
15
|
margin-left: 8px;
|
@@ -22,7 +21,7 @@
|
|
22
21
|
}
|
23
22
|
|
24
23
|
&_visible {
|
25
|
-
|
24
|
+
display: flex;
|
26
25
|
}
|
27
26
|
}
|
28
27
|
|
@@ -1,7 +1,10 @@
|
|
1
1
|
.kv-nodes {
|
2
|
+
&__host-name-wrapper {
|
3
|
+
display: flex;
|
4
|
+
}
|
5
|
+
|
2
6
|
&__external-button {
|
3
|
-
display:
|
4
|
-
visibility: hidden;
|
7
|
+
display: none;
|
5
8
|
align-items: center;
|
6
9
|
|
7
10
|
margin-left: 4px;
|
@@ -14,12 +17,12 @@
|
|
14
17
|
}
|
15
18
|
|
16
19
|
&__host-name {
|
17
|
-
|
20
|
+
overflow: hidden;
|
18
21
|
}
|
19
22
|
}
|
20
23
|
|
21
24
|
.data-table__row:hover {
|
22
25
|
.kv-nodes__external-button {
|
23
|
-
|
26
|
+
display: inline-flex;
|
24
27
|
}
|
25
28
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import {connect} from 'react-redux';
|
1
2
|
import {Link} from 'react-router-dom';
|
2
3
|
import cn from 'bem-cn-lite';
|
3
4
|
import {useLocation} from 'react-router';
|
@@ -11,6 +12,8 @@ import Diagnostics from '../Diagnostics/Diagnostics';
|
|
11
12
|
|
12
13
|
import {TenantGeneralTabsIds, TenantTabsGroups, TENANT_GENERAL_TABS} from '../TenantPages';
|
13
14
|
import routes, {createHref} from '../../../routes';
|
15
|
+
import {setSettingValue} from '../../../store/reducers/settings';
|
16
|
+
import {TENANT_INITIAL_TAB_KEY} from '../../../utils/constants';
|
14
17
|
|
15
18
|
import './ObjectGeneral.scss';
|
16
19
|
|
@@ -20,6 +23,7 @@ interface ObjectGeneralProps {
|
|
20
23
|
type: string;
|
21
24
|
additionalTenantInfo?: any;
|
22
25
|
additionalNodesInfo?: any;
|
26
|
+
setSettingValue: (name: string, value: string) => void;
|
23
27
|
}
|
24
28
|
|
25
29
|
function ObjectGeneral(props: ObjectGeneralProps) {
|
@@ -63,6 +67,7 @@ function ObjectGeneral(props: ObjectGeneralProps) {
|
|
63
67
|
);
|
64
68
|
}}
|
65
69
|
allowNotSelected
|
70
|
+
onSelectTab={(id) => props.setSettingValue(TENANT_INITIAL_TAB_KEY, id)}
|
66
71
|
/>
|
67
72
|
</div>
|
68
73
|
);
|
@@ -101,4 +106,8 @@ function ObjectGeneral(props: ObjectGeneralProps) {
|
|
101
106
|
return renderContent();
|
102
107
|
}
|
103
108
|
|
104
|
-
|
109
|
+
const mapDispatchToProps = {
|
110
|
+
setSettingValue,
|
111
|
+
};
|
112
|
+
|
113
|
+
export default connect(null, mapDispatchToProps)(ObjectGeneral);
|
@@ -17,9 +17,9 @@ import routes, {CLUSTER_PAGES, createHref} from '../../routes';
|
|
17
17
|
import {formatCPU, formatBytesToGigabyte} from '../../utils';
|
18
18
|
import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
|
19
19
|
import {withSearch} from '../../HOCS';
|
20
|
-
import {ALL, DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
20
|
+
import {ALL, DEFAULT_TABLE_SETTINGS, TENANT_INITIAL_TAB_KEY} from '../../utils/constants';
|
21
21
|
import {getTenantsInfo} from '../../store/reducers/tenants';
|
22
|
-
import {changeFilter} from '../../store/reducers/settings';
|
22
|
+
import {changeFilter, getSettingValue} from '../../store/reducers/settings';
|
23
23
|
import {setHeader} from '../../store/reducers/header';
|
24
24
|
|
25
25
|
import {clusterName} from '../../store';
|
@@ -119,6 +119,7 @@ class Tenants extends React.Component {
|
|
119
119
|
filter,
|
120
120
|
handleSearchQuery,
|
121
121
|
additionalTenantsInfo = {},
|
122
|
+
savedTenantInitialTab,
|
122
123
|
} = this.props;
|
123
124
|
|
124
125
|
const filteredTenantsBySearch = tenants.filter(
|
@@ -129,6 +130,9 @@ class Tenants extends React.Component {
|
|
129
130
|
);
|
130
131
|
const filteredTenants = Tenants.filterTenants(filteredTenantsBySearch, filter);
|
131
132
|
|
133
|
+
const initialTenantGeneralTab = savedTenantInitialTab || TENANT_GENERAL_TABS[0].id;
|
134
|
+
const initialTenantInfoTab = TENANT_INFO_TABS[0].id;
|
135
|
+
|
132
136
|
const columns = [
|
133
137
|
{
|
134
138
|
name: 'Name',
|
@@ -150,8 +154,8 @@ class Tenants extends React.Component {
|
|
150
154
|
path={createHref(routes.tenant, undefined, {
|
151
155
|
name: value,
|
152
156
|
backend: tenantBackend,
|
153
|
-
[TenantTabsGroups.info]:
|
154
|
-
[TenantTabsGroups.general]:
|
157
|
+
[TenantTabsGroups.info]: initialTenantInfoTab,
|
158
|
+
[TenantTabsGroups.general]: initialTenantGeneralTab,
|
155
159
|
})}
|
156
160
|
/>
|
157
161
|
{additionalTenantsInfo.name && additionalTenantsInfo.name(value, row)}
|
@@ -347,6 +351,7 @@ const mapStateToProps = (state) => {
|
|
347
351
|
loading,
|
348
352
|
error,
|
349
353
|
filter: state.settings.problemFilter,
|
354
|
+
savedTenantInitialTab: getSettingValue(state, TENANT_INITIAL_TAB_KEY),
|
350
355
|
};
|
351
356
|
};
|
352
357
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {ALL, defaultUserSettings, SAVED_QUERIES_KEY, THEME_KEY} from '../../utils/constants';
|
1
|
+
import {ALL, defaultUserSettings, SAVED_QUERIES_KEY, THEME_KEY, TENANT_INITIAL_TAB_KEY} from '../../utils/constants';
|
2
2
|
import '../../services/api';
|
3
3
|
import {getValueFromLS} from '../../utils/utils';
|
4
4
|
|
@@ -13,6 +13,9 @@ const theme = window.web_version
|
|
13
13
|
const savedQueries = window.web_version
|
14
14
|
? userSettings[SAVED_QUERIES_KEY]
|
15
15
|
: getValueFromLS(SAVED_QUERIES_KEY, '[]');
|
16
|
+
const savedTenantGeneralTab = window.web_version
|
17
|
+
? userSettings[TENANT_INITIAL_TAB_KEY]
|
18
|
+
: getValueFromLS(TENANT_INITIAL_TAB_KEY);
|
16
19
|
|
17
20
|
export const initialState = {
|
18
21
|
problemFilter: ALL,
|
@@ -21,6 +24,7 @@ export const initialState = {
|
|
21
24
|
...userSettings,
|
22
25
|
theme,
|
23
26
|
[SAVED_QUERIES_KEY]: savedQueries,
|
27
|
+
[TENANT_INITIAL_TAB_KEY]: savedTenantGeneralTab,
|
24
28
|
},
|
25
29
|
systemSettings,
|
26
30
|
};
|
package/dist/utils/constants.js
CHANGED
@@ -31,7 +31,7 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
|
|
31
31
|
return <span>—</span>;
|
32
32
|
}
|
33
33
|
return (
|
34
|
-
<
|
34
|
+
<div className={b('host-name-wrapper')}>
|
35
35
|
<EntityStatus
|
36
36
|
name={row.Host}
|
37
37
|
status={row.Overall}
|
@@ -44,7 +44,7 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
|
|
44
44
|
<Icon name="external" />
|
45
45
|
</Button>
|
46
46
|
)}
|
47
|
-
</
|
47
|
+
</div>
|
48
48
|
);
|
49
49
|
},
|
50
50
|
width: '350px',
|