ydb-embedded-ui 1.2.5 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -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/Storage/Pdisk/Pdisk.tsx +3 -9
- package/dist/containers/Storage/Vdisk/Vdisk.js +13 -10
- package/dist/containers/Storage/utils/constants.ts +10 -0
- package/dist/containers/Storage/utils/index.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +14 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +2 -2
- 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,37 @@
|
|
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
|
+
|
20
|
+
## [1.3.0](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.6...v1.3.0) (2022-05-12)
|
21
|
+
|
22
|
+
|
23
|
+
### Features
|
24
|
+
|
25
|
+
* **Storage:** red progress bars for unavailable disks ([17cf94d](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/17cf94defb23681bc62c768d3282eed00c7e974d))
|
26
|
+
|
27
|
+
### [1.2.6](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.5...v1.2.6) (2022-05-05)
|
28
|
+
|
29
|
+
|
30
|
+
### Bug Fixes
|
31
|
+
|
32
|
+
* code-review ([1068339](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/1068339d128fb44b661837b7d777b5e5f725a611))
|
33
|
+
* **Diagnostics:** layout ([2b11c35](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/2b11c35c14cd1fa17d36bbeb2a371fb2fef3fb70))
|
34
|
+
|
3
35
|
### [1.2.5](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.4...v1.2.5) (2022-05-05)
|
4
36
|
|
5
37
|
|
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
|
}
|
@@ -13,6 +13,8 @@ import DiskStateProgressBar, {
|
|
13
13
|
} from '../DiskStateProgressBar/DiskStateProgressBar';
|
14
14
|
import {STRUCTURE} from '../../Node/NodePages';
|
15
15
|
|
16
|
+
import {colorSeverity, NOT_AVAILABLE_SEVERITY} from '../utils';
|
17
|
+
|
16
18
|
import './Pdisk.scss';
|
17
19
|
|
18
20
|
const b = cn('pdisk-storage');
|
@@ -34,14 +36,6 @@ const stateSeverity = {
|
|
34
36
|
DeviceIoError: 5,
|
35
37
|
};
|
36
38
|
|
37
|
-
const colorSeverity = {
|
38
|
-
Grey: 0,
|
39
|
-
Green: 1,
|
40
|
-
Blue: 2,
|
41
|
-
Yellow: 3,
|
42
|
-
Orange: 4,
|
43
|
-
Red: 5,
|
44
|
-
};
|
45
39
|
type PDiskState = keyof typeof stateSeverity;
|
46
40
|
|
47
41
|
interface PDiskProps {
|
@@ -57,7 +51,7 @@ interface PDiskProps {
|
|
57
51
|
}
|
58
52
|
|
59
53
|
const getStateSeverity = (pDiskState?: PDiskState) => {
|
60
|
-
return pDiskState ? stateSeverity[pDiskState] :
|
54
|
+
return pDiskState ? stateSeverity[pDiskState] : NOT_AVAILABLE_SEVERITY;
|
61
55
|
};
|
62
56
|
|
63
57
|
function Pdisk(props: PDiskProps) {
|
@@ -12,6 +12,8 @@ import DiskStateProgressBar, {
|
|
12
12
|
} from '../DiskStateProgressBar/DiskStateProgressBar';
|
13
13
|
import {STRUCTURE} from '../../Node/NodePages';
|
14
14
|
|
15
|
+
import {colorSeverity, NOT_AVAILABLE_SEVERITY} from '../utils';
|
16
|
+
|
15
17
|
import './Vdisk.scss';
|
16
18
|
|
17
19
|
const b = cn('vdisk-storage');
|
@@ -34,17 +36,8 @@ const stateSeverity = {
|
|
34
36
|
OK: 1,
|
35
37
|
};
|
36
38
|
|
37
|
-
const colorSeverity = {
|
38
|
-
Grey: 0,
|
39
|
-
Green: 1,
|
40
|
-
Blue: 2,
|
41
|
-
Yellow: 3,
|
42
|
-
Orange: 4,
|
43
|
-
Red: 5,
|
44
|
-
};
|
45
|
-
|
46
39
|
const getStateSeverity = (vDiskState) => {
|
47
|
-
return stateSeverity[vDiskState] ??
|
40
|
+
return stateSeverity[vDiskState] ?? NOT_AVAILABLE_SEVERITY;
|
48
41
|
};
|
49
42
|
|
50
43
|
const getColorSeverity = (color) => {
|
@@ -57,15 +50,25 @@ function Vdisk(props) {
|
|
57
50
|
|
58
51
|
const anchor = useRef();
|
59
52
|
|
53
|
+
// determine disk status severity
|
60
54
|
useEffect(() => {
|
61
55
|
const {DiskSpace, VDiskState, FrontQueues, Replicated} = props;
|
56
|
+
|
57
|
+
// if the disk is not available, this determines its status severity regardless of other features
|
58
|
+
if (!VDiskState) {
|
59
|
+
setSeverity(NOT_AVAILABLE_SEVERITY);
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
|
62
63
|
const DiskSpaceSeverity = getColorSeverity(DiskSpace);
|
63
64
|
const VDiskSpaceSeverity = getStateSeverity(VDiskState);
|
64
65
|
const FrontQueuesSeverity = Math.min(colorSeverity.Orange, getColorSeverity(FrontQueues));
|
66
|
+
|
65
67
|
let newSeverity = Math.max(DiskSpaceSeverity, VDiskSpaceSeverity, FrontQueuesSeverity);
|
66
68
|
if (!Replicated && newSeverity === colorSeverity.Green) {
|
67
69
|
newSeverity = colorSeverity.Blue;
|
68
70
|
}
|
71
|
+
|
69
72
|
setSeverity(newSeverity);
|
70
73
|
}, [props.VDiskState, props.DiskSpace, props.FrontQueues, props.Replicated]);
|
71
74
|
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './constants';
|
@@ -3,6 +3,14 @@
|
|
3
3
|
.healthcheck {
|
4
4
|
padding: 25px 20px 20px;
|
5
5
|
|
6
|
+
&__issues {
|
7
|
+
overflow-x: hidden;
|
8
|
+
overflow-y: auto;
|
9
|
+
|
10
|
+
height: 70vh;
|
11
|
+
max-height: 70vh;
|
12
|
+
}
|
13
|
+
|
6
14
|
&__loader {
|
7
15
|
display: flex;
|
8
16
|
justify-content: center;
|
@@ -29,18 +37,23 @@
|
|
29
37
|
|
30
38
|
&__status-wrapper {
|
31
39
|
display: flex;
|
32
|
-
|
40
|
+
align-items: baseline;
|
33
41
|
|
34
42
|
margin-bottom: 15px;
|
43
|
+
gap: 8px;
|
35
44
|
}
|
36
45
|
|
37
46
|
&__preview-title {
|
38
47
|
font-weight: 600;
|
48
|
+
line-height: 24px;
|
39
49
|
}
|
40
50
|
|
41
51
|
&__self-check-status-indicator {
|
42
52
|
padding: 0 8px;
|
43
53
|
|
54
|
+
font-size: 13px;
|
55
|
+
line-height: 24px;
|
56
|
+
|
44
57
|
border-radius: 4px;
|
45
58
|
|
46
59
|
&_good,
|
@@ -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',
|