ydb-embedded-ui 3.3.2 → 3.3.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +27 -0
- package/dist/components/Errors/ResponseError/ResponseError.tsx +17 -0
- package/dist/components/Errors/ResponseError/index.ts +1 -0
- package/dist/components/Errors/i18n/en.json +2 -1
- package/dist/components/Errors/i18n/ru.json +2 -1
- package/dist/components/FullGroupViewer/FullGroupViewer.js +1 -1
- package/dist/components/InfoViewer/InfoViewer.scss +1 -1
- package/dist/components/InfoViewer/InfoViewer.tsx +29 -21
- package/dist/components/InfoViewer/formatters/index.ts +1 -0
- package/dist/components/InfoViewer/formatters/table.ts +40 -0
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +26 -8
- package/dist/components/QueryExecutionStatus/index.ts +1 -0
- package/dist/components/QueryResultTable/QueryResultTable.tsx +2 -2
- package/dist/containers/App/Content.js +12 -5
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +10 -13
- package/dist/containers/Authentication/Authentication.scss +6 -0
- package/dist/containers/Authentication/Authentication.tsx +34 -15
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +7 -10
- package/dist/containers/Nodes/Nodes.tsx +1 -1
- package/dist/containers/Nodes/getNodesColumns.tsx +4 -4
- package/dist/containers/Storage/PDisk/PDisk.tsx +25 -17
- package/dist/containers/Storage/PDisk/__tests__/colors.tsx +64 -1
- package/dist/containers/Storage/Storage.js +1 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +12 -3
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +1 -1
- package/dist/containers/Storage/utils/index.ts +26 -10
- package/dist/containers/Tablet/Tablet.js +1 -1
- package/dist/containers/Tenant/Acl/Acl.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.tsx +2 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +3 -3
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +7 -7
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +10 -21
- package/dist/containers/Tenant/{Schema/SchemaInfoViewer/SchemaInfoViewer.scss → Diagnostics/Overview/TableInfo/TableInfo.scss} +8 -10
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.tsx +71 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +5 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.ts +11 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/ru.json +5 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/index.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +96 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +7 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.scss +8 -0
- package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.tsx +56 -0
- package/dist/containers/Tenant/Diagnostics/TopShards/Filters/index.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/{OverloadedShards/OverloadedShards.scss → TopShards/TopShards.scss} +2 -10
- package/dist/containers/Tenant/Diagnostics/{OverloadedShards/OverloadedShards.tsx → TopShards/TopShards.tsx} +64 -29
- package/dist/containers/Tenant/Diagnostics/TopShards/i18n/en.json +6 -0
- package/dist/containers/Tenant/Diagnostics/{OverloadedShards → TopShards}/i18n/index.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/i18n/ru.json +6 -0
- package/dist/containers/Tenant/Diagnostics/TopShards/index.ts +1 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +3 -1
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +16 -11
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +37 -23
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +4 -0
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +1 -1
- package/dist/containers/Tenants/Tenants.js +4 -3
- package/dist/routes.ts +1 -0
- package/dist/services/api.js +4 -1
- package/dist/store/reducers/authentication.js +0 -15
- package/dist/store/reducers/shardsWorkload.ts +30 -3
- package/dist/store/reducers/storage.js +1 -1
- package/dist/store/state-url-mapping.js +3 -0
- package/dist/types/store/shardsWorkload.ts +6 -0
- package/dist/utils/constants.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/prepareQueryExplain.ts +1 -1
- package/dist/utils/typecheckers.ts +5 -0
- package/package.json +5 -3
- package/dist/containers/Tenant/Diagnostics/OverloadedShards/i18n/en.json +0 -4
- package/dist/containers/Tenant/Diagnostics/OverloadedShards/i18n/ru.json +0 -4
- package/dist/containers/Tenant/Diagnostics/OverloadedShards/index.ts +0 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.scss +0 -13
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +0 -201
@@ -3,11 +3,17 @@ import type {ApiRequestAction} from '../../store/utils';
|
|
3
3
|
import type {IResponseError} from '../api/error';
|
4
4
|
import type {IQueryResult} from './query';
|
5
5
|
|
6
|
+
export enum EShardsWorkloadMode {
|
7
|
+
Immediate = 'immediate',
|
8
|
+
History = 'history',
|
9
|
+
}
|
10
|
+
|
6
11
|
export interface IShardsWorkloadFilters {
|
7
12
|
/** ms from epoch */
|
8
13
|
from?: number;
|
9
14
|
/** ms from epoch */
|
10
15
|
to?: number;
|
16
|
+
mode?: EShardsWorkloadMode;
|
11
17
|
}
|
12
18
|
|
13
19
|
export interface IShardsWorkloadState {
|
package/dist/utils/constants.ts
CHANGED
package/dist/utils/index.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import numeral from 'numeral';
|
2
2
|
import locales from 'numeral/locales'; // eslint-disable-line no-unused-vars
|
3
3
|
|
4
|
+
import {dateTimeParse} from '@gravity-ui/date-utils';
|
5
|
+
|
4
6
|
import {i18n} from './i18n';
|
5
7
|
import {MEGABYTE, TERABYTE, GIGABYTE, DAY_IN_SECONDS} from './constants';
|
6
8
|
import {isNumeric} from './utils';
|
@@ -76,7 +78,7 @@ export const formatDateTime = (value) => {
|
|
76
78
|
return '';
|
77
79
|
}
|
78
80
|
|
79
|
-
return value > 0 ?
|
81
|
+
return value > 0 ? dateTimeParse(Number(value)).format('YYYY-MM-DD HH:mm') : 'N/A';
|
80
82
|
};
|
81
83
|
|
82
84
|
export const calcUptimeInSeconds = (milliseconds) => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.4",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -10,10 +10,11 @@
|
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@gravity-ui/axios-wrapper": "^1.3.0",
|
13
|
+
"@gravity-ui/date-utils": "^1.1.1",
|
13
14
|
"@gravity-ui/i18n": "^1.0.0",
|
14
15
|
"@gravity-ui/navigation": "^0.3.1",
|
15
|
-
"@
|
16
|
-
"@
|
16
|
+
"@gravity-ui/paranoid": "^1.4.0",
|
17
|
+
"@gravity-ui/react-data-table": "^1.0.3",
|
17
18
|
"axios": "0.19.2",
|
18
19
|
"bem-cn-lite": "4.0.0",
|
19
20
|
"history": "4.10.1",
|
@@ -107,6 +108,7 @@
|
|
107
108
|
"@testing-library/react": "^11.2.7",
|
108
109
|
"@testing-library/user-event": "^12.8.3",
|
109
110
|
"@types/lodash": "^4.14.178",
|
111
|
+
"@types/numeral": "^2.0.2",
|
110
112
|
"@types/qs": "^6.9.7",
|
111
113
|
"@types/react": "^17.0.44",
|
112
114
|
"@types/react-dom": "^17.0.11",
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './OverloadedShards';
|
@@ -1,201 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import {formatCPU, formatBytes, formatNumber, formatBps, formatDateTime} from '../../../../utils';
|
6
|
-
|
7
|
-
import {InfoViewer, createInfoFormatter} from '../../../../components/InfoViewer';
|
8
|
-
|
9
|
-
import {getEntityName} from '../../utils';
|
10
|
-
|
11
|
-
import './SchemaInfoViewer.scss';
|
12
|
-
|
13
|
-
const b = cn('schema-info-viewer');
|
14
|
-
|
15
|
-
const formatTabletMetricsItem = createInfoFormatter({
|
16
|
-
values: {
|
17
|
-
CPU: formatCPU,
|
18
|
-
Memory: formatBytes,
|
19
|
-
Storage: formatBytes,
|
20
|
-
Network: formatBps,
|
21
|
-
ReadThroughput: formatBps,
|
22
|
-
WriteThroughput: formatBps,
|
23
|
-
},
|
24
|
-
defaultValueFormatter: formatNumber,
|
25
|
-
});
|
26
|
-
|
27
|
-
const formatFollowerGroupItem = createInfoFormatter({
|
28
|
-
values: {
|
29
|
-
FollowerCount: formatNumber,
|
30
|
-
},
|
31
|
-
});
|
32
|
-
|
33
|
-
const formatPartitionConfigItem = createInfoFormatter({
|
34
|
-
values: {
|
35
|
-
FollowerCount: formatNumber,
|
36
|
-
CrossDataCenterFollowerCount: formatNumber,
|
37
|
-
},
|
38
|
-
});
|
39
|
-
|
40
|
-
const formatTableStatsItem = createInfoFormatter({
|
41
|
-
values: {
|
42
|
-
DataSize: formatBytes,
|
43
|
-
IndexSize: formatBytes,
|
44
|
-
LastAccessTime: formatDateTime,
|
45
|
-
LastUpdateTime: formatDateTime,
|
46
|
-
},
|
47
|
-
defaultValueFormatter: formatNumber,
|
48
|
-
});
|
49
|
-
|
50
|
-
const formatTableStats = (fields) =>
|
51
|
-
Object.entries(fields)
|
52
|
-
.map(([label, value]) => formatTableStatsItem(label, value))
|
53
|
-
.filter(({value}) => Boolean(value));
|
54
|
-
|
55
|
-
class SchemaInfoViewer extends React.Component {
|
56
|
-
static propTypes = {
|
57
|
-
data: PropTypes.object.isRequired,
|
58
|
-
};
|
59
|
-
|
60
|
-
renderItem(itemData, title) {
|
61
|
-
if (!Array.isArray(itemData) || !itemData.length) {
|
62
|
-
return null;
|
63
|
-
}
|
64
|
-
|
65
|
-
return (
|
66
|
-
<div className={b('item')}>
|
67
|
-
<InfoViewer title={title} info={itemData} />
|
68
|
-
</div>
|
69
|
-
);
|
70
|
-
}
|
71
|
-
|
72
|
-
renderContent(data) {
|
73
|
-
const {PathDescription = {}} = data;
|
74
|
-
const entityName = getEntityName(PathDescription);
|
75
|
-
|
76
|
-
const {
|
77
|
-
TableStats = {},
|
78
|
-
TabletMetrics = {},
|
79
|
-
Table: {PartitionConfig = {}} = {},
|
80
|
-
} = PathDescription;
|
81
|
-
const {
|
82
|
-
PartCount,
|
83
|
-
RowCount,
|
84
|
-
DataSize,
|
85
|
-
IndexSize,
|
86
|
-
|
87
|
-
LastAccessTime,
|
88
|
-
LastUpdateTime,
|
89
|
-
|
90
|
-
ImmediateTxCompleted,
|
91
|
-
PlannedTxCompleted,
|
92
|
-
TxRejectedByOverload,
|
93
|
-
TxRejectedBySpace,
|
94
|
-
TxCompleteLagMsec,
|
95
|
-
InFlightTxCount,
|
96
|
-
|
97
|
-
RowUpdates,
|
98
|
-
RowDeletes,
|
99
|
-
RowReads,
|
100
|
-
RangeReads,
|
101
|
-
RangeReadRows,
|
102
|
-
|
103
|
-
...restTableStats
|
104
|
-
} = TableStats;
|
105
|
-
const {FollowerGroups, FollowerCount, CrossDataCenterFollowerCount} = PartitionConfig;
|
106
|
-
|
107
|
-
const generalTableInfo = formatTableStats({
|
108
|
-
PartCount,
|
109
|
-
RowCount,
|
110
|
-
DataSize,
|
111
|
-
IndexSize,
|
112
|
-
...restTableStats,
|
113
|
-
});
|
114
|
-
|
115
|
-
const tableStatsInfo = [
|
116
|
-
formatTableStats({
|
117
|
-
LastAccessTime,
|
118
|
-
LastUpdateTime,
|
119
|
-
}),
|
120
|
-
formatTableStats({
|
121
|
-
ImmediateTxCompleted,
|
122
|
-
PlannedTxCompleted,
|
123
|
-
TxRejectedByOverload,
|
124
|
-
TxRejectedBySpace,
|
125
|
-
TxCompleteLagMsec,
|
126
|
-
InFlightTxCount,
|
127
|
-
}),
|
128
|
-
formatTableStats({
|
129
|
-
RowUpdates,
|
130
|
-
RowDeletes,
|
131
|
-
RowReads,
|
132
|
-
RangeReads,
|
133
|
-
RangeReadRows,
|
134
|
-
}),
|
135
|
-
];
|
136
|
-
|
137
|
-
const tabletMetricsInfo = Object.keys(TabletMetrics).map((key) =>
|
138
|
-
formatTabletMetricsItem(key, TabletMetrics[key]),
|
139
|
-
);
|
140
|
-
|
141
|
-
const partitionConfigInfo = [];
|
142
|
-
|
143
|
-
if (Array.isArray(FollowerGroups) && FollowerGroups.length > 0) {
|
144
|
-
partitionConfigInfo.push(
|
145
|
-
...Object.keys(FollowerGroups[0]).map((key) =>
|
146
|
-
formatFollowerGroupItem(key, FollowerGroups[0][key]),
|
147
|
-
),
|
148
|
-
);
|
149
|
-
} else if (FollowerCount !== undefined) {
|
150
|
-
partitionConfigInfo.push(formatPartitionConfigItem('FollowerCount', FollowerCount));
|
151
|
-
} else if (CrossDataCenterFollowerCount !== undefined) {
|
152
|
-
partitionConfigInfo.push(
|
153
|
-
formatPartitionConfigItem(
|
154
|
-
'CrossDataCenterFollowerCount',
|
155
|
-
CrossDataCenterFollowerCount,
|
156
|
-
),
|
157
|
-
);
|
158
|
-
}
|
159
|
-
|
160
|
-
if (
|
161
|
-
[generalTableInfo, tabletMetricsInfo, partitionConfigInfo, tableStatsInfo.flat()].flat()
|
162
|
-
.length === 0
|
163
|
-
) {
|
164
|
-
return <div className={b('title')}>{entityName}</div>;
|
165
|
-
}
|
166
|
-
|
167
|
-
return (
|
168
|
-
<div>
|
169
|
-
<div>{this.renderItem(generalTableInfo, entityName)}</div>
|
170
|
-
<div className={b('row')}>
|
171
|
-
{tabletMetricsInfo.length > 0 || partitionConfigInfo.length > 0 ? (
|
172
|
-
<div className={b('col')}>
|
173
|
-
{this.renderItem(tabletMetricsInfo, 'Tablet Metrics')}
|
174
|
-
{this.renderItem(partitionConfigInfo, 'Partition Config')}
|
175
|
-
</div>
|
176
|
-
) : null}
|
177
|
-
<div className={b('col')}>
|
178
|
-
{tableStatsInfo.map((info, index) => (
|
179
|
-
<React.Fragment key={index}>
|
180
|
-
{this.renderItem(info, index === 0 ? 'Table Stats' : undefined)}
|
181
|
-
</React.Fragment>
|
182
|
-
))}
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
);
|
187
|
-
}
|
188
|
-
|
189
|
-
render() {
|
190
|
-
const {data} = this.props;
|
191
|
-
const entityName = getEntityName(data?.PathDescription);
|
192
|
-
|
193
|
-
if (data) {
|
194
|
-
return <div className={b()}>{this.renderContent(data)}</div>;
|
195
|
-
} else {
|
196
|
-
return <div className="error">No {entityName} data</div>;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
}
|
200
|
-
|
201
|
-
export default SchemaInfoViewer;
|