ydb-embedded-ui 1.0.2 → 1.1.0
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 +40 -0
- package/dist/assets/icons/question.svg +1 -0
- package/dist/components/ClusterInfo/ClusterInfo.tsx +8 -4
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +4 -9
- package/dist/components/InfoViewer/InfoViewer.scss +3 -2
- package/dist/components/InternalLink/InternalLink.js +8 -0
- package/dist/components/Loader/Loader.scss +5 -0
- package/dist/components/Loader/Loader.tsx +16 -0
- package/dist/components/PDiskViewer/PDiskViewer.js +3 -4
- package/dist/containers/App/App.scss +4 -0
- package/dist/containers/App/Content.js +0 -2
- package/dist/containers/AppIcons/AppIcons.js +4 -0
- package/dist/containers/Authentication/Authentication.tsx +1 -1
- package/dist/containers/Cluster/Cluster.tsx +1 -1
- package/dist/containers/Header/Header.tsx +6 -1
- package/dist/containers/Heatmap/Heatmap.js +0 -1
- package/dist/containers/Node/Node.scss +12 -1
- package/dist/containers/Node/Node.tsx +187 -0
- package/dist/containers/Node/NodeOverview/NodeOverview.scss +0 -0
- package/dist/containers/Node/NodeOverview/NodeOverview.tsx +23 -0
- package/dist/containers/Node/NodePages.js +16 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +148 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.tsx +153 -0
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +299 -0
- package/dist/containers/Node/NodeStructure/Vdisk.tsx +153 -0
- package/dist/containers/Pdisk/Pdisk.js +2 -5
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +10 -3
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.tsx +20 -15
- package/dist/containers/Storage/Pdisk/Pdisk.scss +1 -0
- package/dist/containers/Storage/Pdisk/Pdisk.tsx +7 -5
- package/dist/containers/Storage/Storage.js +12 -9
- package/dist/containers/Storage/StorageGroups/StorageGroups.scss +2 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +5 -2
- package/dist/containers/Storage/StorageNodes/StorageNodes.scss +3 -2
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +7 -2
- package/dist/containers/Storage/Vdisk/Vdisk.js +7 -6
- package/dist/containers/Storage/Vdisk/Vdisk.scss +1 -0
- package/dist/containers/Tablet/Tablet.js +2 -7
- package/dist/containers/Tablets/Tablets.js +4 -12
- package/dist/containers/Tenant/Acl/Acl.js +0 -3
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.js +1 -3
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -6
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +1 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +26 -33
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +4 -0
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +29 -22
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +1 -0
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +2 -0
- package/dist/containers/Vdisk/Vdisk.js +2 -4
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +4 -6
- package/dist/services/api.js +0 -1
- package/dist/store/reducers/executeQuery.js +5 -2
- package/dist/store/reducers/header.ts +1 -1
- package/dist/store/reducers/node.js +98 -3
- package/dist/store/reducers/nodes.js +0 -3
- package/dist/store/reducers/storage.js +6 -0
- package/dist/store/reducers/tablets.js +0 -3
- package/dist/utils/constants.js +0 -6
- package/dist/utils/getNodesColumns.js +2 -9
- package/dist/utils/utils.js +10 -1
- package/package.json +44 -33
- package/dist/containers/Node/Node.js +0 -184
@@ -5,8 +5,7 @@ import cn from 'bem-cn-lite';
|
|
5
5
|
import _ from 'lodash';
|
6
6
|
import MonacoEditor from 'react-monaco-editor';
|
7
7
|
import DataTable from '@yandex-cloud/react-data-table';
|
8
|
-
import {Button} from '@yandex-cloud/uikit';
|
9
|
-
import {Select} from '@yandex-cloud/uikit/build/esm/components/unstable/Select';
|
8
|
+
import {Button, DropdownMenu} from '@yandex-cloud/uikit';
|
10
9
|
import SplitPane from '../../../components/SplitPane';
|
11
10
|
|
12
11
|
import SaveQuery from './SaveQuery/SaveQuery';
|
@@ -154,7 +153,7 @@ function QueryEditor(props) {
|
|
154
153
|
useEffect(() => {
|
155
154
|
const {monacoHotKey, setMonacoHotKey} = props;
|
156
155
|
if (monacoHotKey === null) {
|
157
|
-
return
|
156
|
+
return;
|
158
157
|
}
|
159
158
|
setMonacoHotKey(null);
|
160
159
|
switch (monacoHotKey) {
|
@@ -340,6 +339,7 @@ function QueryEditor(props) {
|
|
340
339
|
data={preparedData}
|
341
340
|
settings={TABLE_SETTINGS}
|
342
341
|
theme="yandex-cloud"
|
342
|
+
rowKey={(_, index) => index}
|
343
343
|
/>
|
344
344
|
) : (
|
345
345
|
<div>{result}</div>
|
@@ -464,19 +464,12 @@ function QueryEditor(props) {
|
|
464
464
|
};
|
465
465
|
|
466
466
|
const getExecuteResult = () => {
|
467
|
-
const {
|
468
|
-
data = [],
|
469
|
-
error,
|
470
|
-
loading,
|
471
|
-
history: {queries},
|
472
|
-
} = props.executeQuery;
|
467
|
+
const {data = [], error} = props.executeQuery;
|
473
468
|
|
474
469
|
if (error) {
|
475
470
|
return error.data || error;
|
476
471
|
} else if (data.length > 0) {
|
477
472
|
return data;
|
478
|
-
} else if (!loading && queries.length) {
|
479
|
-
return 'The request was successful';
|
480
473
|
} else {
|
481
474
|
return '';
|
482
475
|
}
|
@@ -559,10 +552,18 @@ function QueryEditor(props) {
|
|
559
552
|
};
|
560
553
|
|
561
554
|
const renderControls = () => {
|
562
|
-
const {executeQuery, explainQuery, savedQueries} = props;
|
555
|
+
const {executeQuery, explainQuery, savedQueries, selectRunAction} = props;
|
563
556
|
const {runAction} = executeQuery;
|
564
557
|
const runIsDisabled = !executeQuery.input || executeQuery.loading;
|
565
558
|
const runText = _.find(RUN_ACTIONS, {value: runAction}).content;
|
559
|
+
|
560
|
+
const menuItems = RUN_ACTIONS.map((action) => {
|
561
|
+
return {
|
562
|
+
text: action.content,
|
563
|
+
action: () => selectRunAction(action.value),
|
564
|
+
};
|
565
|
+
});
|
566
|
+
|
566
567
|
return (
|
567
568
|
<div className={b('controls')}>
|
568
569
|
<div className={b('control-run')}>
|
@@ -576,27 +577,19 @@ function QueryEditor(props) {
|
|
576
577
|
<Icon name="startPlay" viewBox="0 0 16 16" width={16} height={16} />
|
577
578
|
{runText}
|
578
579
|
</Button>
|
579
|
-
<
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
// >
|
593
|
-
// <Icon name="chevron-down" width={16} height={16} />
|
594
|
-
// </Button>
|
595
|
-
// </div>
|
596
|
-
// )}
|
597
|
-
onUpdate={(value) => {
|
598
|
-
props.selectRunAction(value[0]);
|
599
|
-
}}
|
580
|
+
<DropdownMenu
|
581
|
+
items={menuItems}
|
582
|
+
switcher={
|
583
|
+
<Button
|
584
|
+
view="action"
|
585
|
+
pin="brick-round"
|
586
|
+
disabled={runIsDisabled}
|
587
|
+
loading={executeQuery.loading}
|
588
|
+
className={b('select-query-action')}
|
589
|
+
>
|
590
|
+
<Icon name="chevron-down" width={16} height={16} />
|
591
|
+
</Button>
|
592
|
+
}
|
600
593
|
/>
|
601
594
|
</div>
|
602
595
|
<Button
|
@@ -72,6 +72,9 @@ function GraphRoot(props) {
|
|
72
72
|
paranoid = getCompactTopology('graphRoot', data, opts);
|
73
73
|
paranoid.renderCompactTopology();
|
74
74
|
}
|
75
|
+
return () => {
|
76
|
+
paranoid = undefined;
|
77
|
+
};
|
75
78
|
}, []);
|
76
79
|
|
77
80
|
useEffect(() => {
|
@@ -89,7 +92,7 @@ function GraphRoot(props) {
|
|
89
92
|
}, [props.opts.colors]);
|
90
93
|
|
91
94
|
useEffect(() => {
|
92
|
-
paranoid
|
95
|
+
paranoid?.updateData(props.data);
|
93
96
|
}, [props.data]);
|
94
97
|
|
95
98
|
return <div id="graphRoot" style={{height: '100vh'}} />;
|
@@ -252,28 +255,32 @@ function QueryExplain(props) {
|
|
252
255
|
return (
|
253
256
|
<React.Fragment>
|
254
257
|
<div className={b('controls')}>
|
255
|
-
|
256
|
-
<
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
258
|
+
{!props.loading && (
|
259
|
+
<React.Fragment>
|
260
|
+
<div className={b('controls-right')}>
|
261
|
+
<QueryExecutionStatus hasError={Boolean(props.error)} />
|
262
|
+
{!props.error && (
|
263
|
+
<React.Fragment>
|
264
|
+
<Divider />
|
265
|
+
<RadioButton
|
266
|
+
options={explainOptions}
|
267
|
+
value={activeOption}
|
268
|
+
onUpdate={onSelectOption}
|
269
|
+
/>
|
270
|
+
</React.Fragment>
|
271
|
+
)}
|
272
|
+
</div>
|
273
|
+
<div className={b('controls-left')}>
|
274
|
+
<EnableFullscreenButton disabled={Boolean(props.error)} />
|
275
|
+
<PaneVisibilityToggleButtons
|
276
|
+
onCollapse={props.onCollapseResults}
|
277
|
+
onExpand={props.onExpandResults}
|
278
|
+
isCollapsed={props.isResultsCollapsed}
|
279
|
+
initialDirection="bottom"
|
264
280
|
/>
|
265
|
-
</
|
266
|
-
|
267
|
-
|
268
|
-
<div className={b('controls-left')}>
|
269
|
-
<EnableFullscreenButton disabled={Boolean(props.error)} />
|
270
|
-
<PaneVisibilityToggleButtons
|
271
|
-
onCollapse={props.onCollapseResults}
|
272
|
-
onExpand={props.onExpandResults}
|
273
|
-
isCollapsed={props.isResultsCollapsed}
|
274
|
-
initialDirection="bottom"
|
275
|
-
/>
|
276
|
-
</div>
|
281
|
+
</div>
|
282
|
+
</React.Fragment>
|
283
|
+
)}
|
277
284
|
</div>
|
278
285
|
<div className={b('result')}>{renderContent()}</div>
|
279
286
|
</React.Fragment>
|
@@ -15,6 +15,7 @@
|
|
15
15
|
}
|
16
16
|
&_fullscreen {
|
17
17
|
width: 100%;
|
18
|
+
margin-top: 0;
|
18
19
|
padding: 10px;
|
19
20
|
}
|
20
21
|
}
|
@@ -28,6 +29,7 @@
|
|
28
29
|
justify-content: space-between;
|
29
30
|
align-items: center;
|
30
31
|
|
32
|
+
height: 53px;
|
31
33
|
padding: 12px 20px;
|
32
34
|
|
33
35
|
border-bottom: 1px solid var(--yc-color-line-generic);
|
@@ -13,6 +13,7 @@ import {getVdiskInfo, clearStore} from '../../store/reducers/vdisk';
|
|
13
13
|
import {VDISK_AUTO_RELOAD_INTERVAL} from '../../utils/constants';
|
14
14
|
import {formatBytes, calcUptime, stringifyVdiskId} from '../../utils';
|
15
15
|
import routes, {createHref} from '../../routes';
|
16
|
+
import {getDefaultNodePath} from '../Node/NodePages';
|
16
17
|
|
17
18
|
import './Vdisk.scss';
|
18
19
|
|
@@ -80,10 +81,7 @@ class Vdisk extends React.Component {
|
|
80
81
|
{
|
81
82
|
label: 'NodeId',
|
82
83
|
value: (
|
83
|
-
<Link
|
84
|
-
className={b('link')}
|
85
|
-
to={createHref(routes.node, {id: NodeId, activeTab: 'storage'})}
|
86
|
-
>
|
84
|
+
<Link className={b('link')} to={getDefaultNodePath(NodeId)}>
|
87
85
|
{NodeId}
|
88
86
|
</Link>
|
89
87
|
),
|
@@ -20,6 +20,7 @@ import {getNodeInfo} from '../../store/reducers/node';
|
|
20
20
|
import {calcUptime, stringifyVdiskId, formatStorageValuesToGb} from '../../utils';
|
21
21
|
import routes, {createHref} from '../../routes';
|
22
22
|
import {bytesToSpeed, bytesToGB} from '../../utils/utils';
|
23
|
+
import {getDefaultNodePath} from '../Node/NodePages';
|
23
24
|
|
24
25
|
import './VdiskPdiskNode.scss';
|
25
26
|
|
@@ -29,7 +30,7 @@ function valueIsDefined(value) {
|
|
29
30
|
return value !== null && value !== undefined;
|
30
31
|
}
|
31
32
|
|
32
|
-
function Vdisk({
|
33
|
+
export function Vdisk({
|
33
34
|
AllocatedSize,
|
34
35
|
DiskSpace,
|
35
36
|
FrontQueues,
|
@@ -83,7 +84,7 @@ function Vdisk({
|
|
83
84
|
value: <EntityStatus status={SatisfactionRank.LevelRank.Flag} />,
|
84
85
|
});
|
85
86
|
}
|
86
|
-
vdiskInfo.push({label: 'Replicated', value: Replicated ? '
|
87
|
+
vdiskInfo.push({label: 'Replicated', value: Replicated ? 'Yes' : 'No'});
|
87
88
|
vdiskInfo.push({label: 'Allocated Size', value: bytesToGB(AllocatedSize)});
|
88
89
|
vdiskInfo.push({label: 'Available Size', value: bytesToGB(AvailableSize)});
|
89
90
|
if (Number(AllocatedSize) >= 0 && Number(AvailableSize) >= 0) {
|
@@ -329,10 +330,7 @@ class VdiskPdiskNode extends React.Component {
|
|
329
330
|
{
|
330
331
|
label: 'Node Id',
|
331
332
|
value: (
|
332
|
-
<Link
|
333
|
-
className={b('link')}
|
334
|
-
to={createHref(routes.node, {id: NodeId, activeTab: 'storage'})}
|
335
|
-
>
|
333
|
+
<Link className={b('link')} to={getDefaultNodePath(NodeId)}>
|
336
334
|
{NodeId}
|
337
335
|
</Link>
|
338
336
|
),
|
package/dist/services/api.js
CHANGED
@@ -13,7 +13,7 @@ const GO_TO_NEXT_QUERY = 'query/GO_TO_NEXT_QUERY';
|
|
13
13
|
const SELECT_RUN_ACTION = 'query/SELECT_RUN_ACTION';
|
14
14
|
const MONACO_HOT_KEY = 'query/MONACO_HOT_KEY';
|
15
15
|
|
16
|
-
const queriesHistoryInitial = parseJson(getValueFromLS(QUERIES_HISTORY_KEY, []));
|
16
|
+
const queriesHistoryInitial = parseJson(getValueFromLS(QUERIES_HISTORY_KEY, '[]'));
|
17
17
|
|
18
18
|
const sliceLimit = queriesHistoryInitial.length - MAXIMUM_QUERIES_IN_HISTORY;
|
19
19
|
|
@@ -34,7 +34,10 @@ const initialState = {
|
|
34
34
|
input: '',
|
35
35
|
history: {
|
36
36
|
queries: queriesHistoryInitial.slice(sliceLimit < 0 ? 0 : sliceLimit),
|
37
|
-
currentIndex:
|
37
|
+
currentIndex:
|
38
|
+
queriesHistoryInitial.length > MAXIMUM_QUERIES_IN_HISTORY
|
39
|
+
? MAXIMUM_QUERIES_IN_HISTORY - 1
|
40
|
+
: queriesHistoryInitial.length - 1,
|
38
41
|
},
|
39
42
|
runAction: RUN_ACTIONS_VALUES.script,
|
40
43
|
monacoHotKey: null,
|
@@ -1,9 +1,23 @@
|
|
1
1
|
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
2
|
import '../../services/api';
|
3
|
+
import {stringifyVdiskId} from '../../utils';
|
4
|
+
import {createSelector} from 'reselect';
|
3
5
|
|
4
|
-
const FETCH_NODE = createRequestActionTypes('
|
6
|
+
const FETCH_NODE = createRequestActionTypes('node', 'FETCH_NODE');
|
7
|
+
const FETCH_NODE_STRUCTURE = createRequestActionTypes('node', 'FETCH_NODE_STRUCTURE');
|
8
|
+
const RESET_NODE = 'node/RESET_NODE';
|
5
9
|
|
6
|
-
const
|
10
|
+
const node = (
|
11
|
+
state = {
|
12
|
+
data: {},
|
13
|
+
loading: true,
|
14
|
+
wasLoaded: false,
|
15
|
+
nodeStructure: {},
|
16
|
+
loadingStructure: true,
|
17
|
+
wasLoadedStructure: false,
|
18
|
+
},
|
19
|
+
action,
|
20
|
+
) => {
|
7
21
|
switch (action.type) {
|
8
22
|
case FETCH_NODE.REQUEST: {
|
9
23
|
return {
|
@@ -27,6 +41,37 @@ const NODE = (state = {data: {}, loading: true, wasLoaded: false}, action) => {
|
|
27
41
|
loading: false,
|
28
42
|
};
|
29
43
|
}
|
44
|
+
case FETCH_NODE_STRUCTURE.REQUEST: {
|
45
|
+
return {
|
46
|
+
...state,
|
47
|
+
loadingStructure: true,
|
48
|
+
};
|
49
|
+
}
|
50
|
+
case FETCH_NODE_STRUCTURE.SUCCESS: {
|
51
|
+
return {
|
52
|
+
...state,
|
53
|
+
nodeStructure: action.data,
|
54
|
+
loadingStructure: false,
|
55
|
+
wasLoadedStructure: true,
|
56
|
+
errorStructure: undefined,
|
57
|
+
};
|
58
|
+
}
|
59
|
+
case FETCH_NODE_STRUCTURE.FAILURE: {
|
60
|
+
return {
|
61
|
+
...state,
|
62
|
+
errorStructure: action.error,
|
63
|
+
loadingStructure: false,
|
64
|
+
};
|
65
|
+
}
|
66
|
+
case RESET_NODE: {
|
67
|
+
return {
|
68
|
+
...state,
|
69
|
+
data: {},
|
70
|
+
wasLoaded: false,
|
71
|
+
nodeStructure: {},
|
72
|
+
wasLoadedStructure: false,
|
73
|
+
};
|
74
|
+
}
|
30
75
|
default:
|
31
76
|
return state;
|
32
77
|
}
|
@@ -39,4 +84,54 @@ export const getNodeInfo = (id) => {
|
|
39
84
|
});
|
40
85
|
};
|
41
86
|
|
42
|
-
export
|
87
|
+
export const getNodeStructure = (nodeId) => {
|
88
|
+
return createApiRequest({
|
89
|
+
request: window.api.getStorageInfo({nodeId}),
|
90
|
+
actions: FETCH_NODE_STRUCTURE,
|
91
|
+
});
|
92
|
+
};
|
93
|
+
|
94
|
+
export function resetNode() {
|
95
|
+
return {
|
96
|
+
type: RESET_NODE,
|
97
|
+
};
|
98
|
+
}
|
99
|
+
|
100
|
+
const getNodeId = (state) => state.node?.data?.SystemStateInfo?.[0].NodeId;
|
101
|
+
|
102
|
+
const getRawNodeStructure = (state) => state.node?.nodeStructure;
|
103
|
+
|
104
|
+
export const selectNodeStructure = createSelector(
|
105
|
+
[getNodeId, getRawNodeStructure],
|
106
|
+
(nodeId, rawNodeStructure) => {
|
107
|
+
const pools = rawNodeStructure?.StoragePools;
|
108
|
+
const structure = {};
|
109
|
+
pools?.forEach((pool) => {
|
110
|
+
const groups = pool.Groups;
|
111
|
+
groups?.forEach((group) => {
|
112
|
+
const vDisks = group.VDisks?.filter((el) => el.NodeId === nodeId);
|
113
|
+
vDisks?.forEach((vd) => {
|
114
|
+
const vDiskId = stringifyVdiskId(vd.VDiskId);
|
115
|
+
const pDiskId = vd.PDisk?.PDiskId;
|
116
|
+
if (!structure[String(pDiskId)]) {
|
117
|
+
structure[String(pDiskId)] = {vDisks: {}, ...vd.PDisk};
|
118
|
+
}
|
119
|
+
structure[String(pDiskId)].vDisks[vDiskId] = vd;
|
120
|
+
});
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
124
|
+
const structureWithVdisksArray = Object.keys(structure).reduce((acc, el) => {
|
125
|
+
const vDisks = structure[el].vDisks;
|
126
|
+
const vDisksArray = Object.keys(vDisks).reduce((acc, key, index) => {
|
127
|
+
acc.push({...vDisks[key], id: key, order: index});
|
128
|
+
return acc;
|
129
|
+
}, []);
|
130
|
+
acc[el] = {...structure[el], vDisks: vDisksArray};
|
131
|
+
return acc;
|
132
|
+
}, {});
|
133
|
+
return structureWithVdisksArray;
|
134
|
+
},
|
135
|
+
);
|
136
|
+
|
137
|
+
export default node;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
2
|
import '../../services/api';
|
3
|
-
import {AUTO_RELOAD_INTERVAL} from '../../utils/constants';
|
4
3
|
|
5
4
|
const FETCH_NODES = createRequestActionTypes('nodes', 'FETCH_NODES');
|
6
5
|
|
@@ -14,13 +13,11 @@ const nodes = function z(state = {loading: true, wasLoaded: false}, action) {
|
|
14
13
|
};
|
15
14
|
}
|
16
15
|
case FETCH_NODES.SUCCESS: {
|
17
|
-
const timeout = new Date().getTime() - state.requestTime;
|
18
16
|
return {
|
19
17
|
...state,
|
20
18
|
data: action.data,
|
21
19
|
loading: false,
|
22
20
|
wasLoaded: true,
|
23
|
-
timeoutForRequest: timeout > AUTO_RELOAD_INTERVAL ? timeout : AUTO_RELOAD_INTERVAL,
|
24
21
|
error: undefined,
|
25
22
|
};
|
26
23
|
}
|
@@ -10,6 +10,12 @@ export const VisibleEntities = {
|
|
10
10
|
Space: 'Space',
|
11
11
|
};
|
12
12
|
|
13
|
+
export const VisibleEntitiesTitles = {
|
14
|
+
[VisibleEntities.All]: 'All',
|
15
|
+
[VisibleEntities.Missing]: 'Degraded',
|
16
|
+
[VisibleEntities.Space]: 'Out of Space',
|
17
|
+
};
|
18
|
+
|
13
19
|
export const StorageTypes = {
|
14
20
|
groups: 'Groups',
|
15
21
|
nodes: 'Nodes',
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
2
|
import '../../services/api';
|
3
|
-
import {AUTO_RELOAD_INTERVAL} from '../../utils/constants';
|
4
3
|
|
5
4
|
const FETCH_TABLETS = createRequestActionTypes('tablets', 'FETCH_TABLETS');
|
6
5
|
|
@@ -21,12 +20,10 @@ const tablets = function z(state = initialState, action) {
|
|
21
20
|
};
|
22
21
|
}
|
23
22
|
case FETCH_TABLETS.SUCCESS: {
|
24
|
-
const timeout = new Date().getTime() - state.requestTime;
|
25
23
|
return {
|
26
24
|
...state,
|
27
25
|
data: action.data,
|
28
26
|
loading: false,
|
29
|
-
timeoutForRequest: timeout > AUTO_RELOAD_INTERVAL ? timeout : AUTO_RELOAD_INTERVAL,
|
30
27
|
error: undefined,
|
31
28
|
wasLoaded: true,
|
32
29
|
};
|
package/dist/utils/constants.js
CHANGED
@@ -2,16 +2,10 @@ import DataTable from '@yandex-cloud/react-data-table';
|
|
2
2
|
|
3
3
|
const SECOND = 1000;
|
4
4
|
|
5
|
-
export const CLUSTER_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
6
|
-
export const TENANT_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
7
|
-
export const TENANTS_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
8
|
-
export const STORAGE_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
9
5
|
export const GROUP_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
10
|
-
export const NODE_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
11
6
|
export const PDISK_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
12
7
|
export const VDISK_AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
13
8
|
export const AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
14
|
-
export const HEALTHCHECK_RELOAD_INTERVAL = 10 * SECOND;
|
15
9
|
export const MEGABYTE = 1_000_000;
|
16
10
|
export const GIGABYTE = 1_000_000_000;
|
17
11
|
export const TERABYTE = 1_000_000_000_000;
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
|
-
import _ from 'lodash';
|
4
3
|
import DataTable from '@yandex-cloud/react-data-table';
|
5
4
|
import {Button, Tooltip} from '@yandex-cloud/uikit';
|
6
5
|
|
7
6
|
import Icon from '../components/Icon/Icon';
|
8
7
|
import EntityStatus from '../components/EntityStatus/EntityStatus';
|
9
|
-
import {STORAGE_ROLE} from '../containers/Node/Node';
|
10
8
|
import PoolsGraph from '../components/PoolsGraph/PoolsGraph';
|
11
9
|
import ProgressViewer from '../components/ProgressViewer/ProgressViewer';
|
12
10
|
import TabletsStatistic from '../components/TabletsStatistic/TabletsStatistic';
|
13
11
|
|
14
|
-
import
|
15
|
-
import {STORAGE, TABLETS} from '../containers/Node/NodePages';
|
12
|
+
import {getDefaultNodePath} from '../containers/Node/NodePages';
|
16
13
|
import {formatBytes} from './index';
|
17
14
|
|
18
15
|
const b = cn('kv-nodes');
|
@@ -28,7 +25,6 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
|
|
28
25
|
{
|
29
26
|
name: 'Host',
|
30
27
|
render: ({row, value}) => {
|
31
|
-
const hasStorage = _.find(row?.Roles, (el) => el === STORAGE_ROLE);
|
32
28
|
const nodeRef = getNodeRef ? getNodeRef(row) : undefined;
|
33
29
|
|
34
30
|
if (typeof value === 'undefined') {
|
@@ -39,10 +35,7 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
|
|
39
35
|
<EntityStatus
|
40
36
|
name={row.Host}
|
41
37
|
status={row.Overall}
|
42
|
-
path={
|
43
|
-
id: row.NodeId,
|
44
|
-
activeTab: hasStorage ? STORAGE : TABLETS,
|
45
|
-
})}
|
38
|
+
path={getDefaultNodePath(row.NodeId)}
|
46
39
|
hasClipboardButton
|
47
40
|
className={b('host-name')}
|
48
41
|
/>
|
package/dist/utils/utils.js
CHANGED
@@ -19,7 +19,7 @@ export function getValueFromLS(key, defaultValue) {
|
|
19
19
|
return;
|
20
20
|
}
|
21
21
|
|
22
|
-
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
|
22
|
+
const sizes = [' B', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB'];
|
23
23
|
const base = 1000;
|
24
24
|
|
25
25
|
export function bytesToSize(bytes) {
|
@@ -73,3 +73,12 @@ export function bytesToGB(bytes, shouldRound) {
|
|
73
73
|
return val.toFixed() + sizes[3];
|
74
74
|
}
|
75
75
|
}
|
76
|
+
|
77
|
+
export function pad9(val) {
|
78
|
+
const len = String(val).length;
|
79
|
+
let result = val
|
80
|
+
for (let i = len; i < 9; i++) {
|
81
|
+
result = "0" + result;
|
82
|
+
}
|
83
|
+
return result;
|
84
|
+
}
|