ydb-embedded-ui 4.9.0 → 4.10.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +25 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.tsx +7 -4
- package/dist/components/EntityStatus/EntityStatus.js +3 -1
- package/dist/components/FormattedBytes/FormattedBytes.tsx +10 -0
- package/dist/components/FormattedBytes/utils.tsx +13 -0
- package/dist/components/FullNodeViewer/FullNodeViewer.tsx +73 -0
- package/dist/components/InfoViewer/formatters/schema.ts +3 -1
- package/dist/components/InfoViewer/formatters/table.ts +6 -5
- package/dist/components/ProblemFilter/ProblemFilter.tsx +2 -2
- package/dist/components/SpeedMultiMeter/SpeedMultiMeter.tsx +4 -4
- package/dist/components/TableWithControlsLayout/TableWithControlsLayout.scss +32 -0
- package/dist/components/TableWithControlsLayout/TableWithControlsLayout.tsx +43 -0
- package/dist/components/TruncatedQuery/{TruncatedQuery.js → TruncatedQuery.tsx} +10 -8
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +8 -8
- package/dist/containers/Cluster/Cluster.scss +4 -5
- package/dist/containers/Cluster/Cluster.tsx +13 -28
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +4 -0
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +7 -0
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.tsx +1 -1
- package/dist/containers/Cluster/utils.tsx +0 -11
- package/dist/containers/Header/Header.scss +1 -5
- package/dist/containers/Node/Node.tsx +3 -3
- package/dist/containers/Nodes/Nodes.scss +1 -24
- package/dist/containers/Nodes/Nodes.tsx +30 -40
- package/dist/containers/Storage/PDisk/PDisk.tsx +2 -7
- package/dist/containers/Storage/Storage.scss +1 -14
- package/dist/containers/Storage/Storage.tsx +237 -0
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +45 -40
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +12 -16
- package/dist/containers/Storage/StorageTypeFilter/StorageTypeFilter.tsx +3 -1
- package/dist/containers/Storage/{StorageVisibleEntityFilter/StorageVisibleEntityFilter.tsx → StorageVisibleEntitiesFilter/StorageVisibleEntitiesFilter.tsx} +4 -2
- package/dist/containers/Storage/UsageFilter/UsageFilter.scss +1 -0
- package/dist/containers/Storage/UsageFilter/UsageFilter.tsx +17 -17
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +6 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +3 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -4
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +0 -15
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +10 -3
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +3 -12
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +2 -7
- package/dist/containers/Tenant/{Preview → Query/Preview}/Preview.scss +1 -1
- package/dist/containers/Tenant/Query/Preview/Preview.tsx +121 -0
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.tsx +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +6 -8
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.tsx +1 -1
- package/dist/containers/Tenant/Query/i18n/en.json +9 -2
- package/dist/containers/Tenant/Query/i18n/ru.json +9 -2
- package/dist/containers/Tenants/Tenants.scss +1 -13
- package/dist/containers/Tenants/Tenants.tsx +262 -0
- package/dist/services/api.ts +8 -3
- package/dist/store/reducers/nodes/nodes.ts +4 -112
- package/dist/store/reducers/nodes/selectors.ts +74 -0
- package/dist/store/reducers/nodes/utils.ts +46 -0
- package/dist/store/reducers/partitions/types.ts +3 -3
- package/dist/store/reducers/settings/settings.ts +4 -2
- package/dist/store/reducers/settings/types.ts +3 -1
- package/dist/store/reducers/storage/selectors.ts +279 -0
- package/dist/store/reducers/storage/storage.ts +191 -0
- package/dist/store/reducers/storage/types.ts +80 -0
- package/dist/store/reducers/tenants/selectors.ts +46 -0
- package/dist/store/reducers/tenants/tenants.ts +21 -14
- package/dist/store/reducers/tenants/types.ts +20 -5
- package/dist/store/reducers/tenants/utils.ts +68 -0
- package/dist/types/additionalProps.ts +8 -0
- package/dist/types/api/compute.ts +27 -2
- package/dist/types/api/nodes.ts +12 -1
- package/dist/types/api/schema/cdcStream.ts +32 -0
- package/dist/types/api/schema/columnEntity.ts +138 -0
- package/dist/types/api/schema/externalDataSource.ts +24 -0
- package/dist/types/api/schema/externalTable.ts +14 -0
- package/dist/types/api/schema/index.ts +10 -0
- package/dist/types/api/schema/persQueueGroup.ts +191 -0
- package/dist/types/api/schema/schema.ts +299 -0
- package/dist/types/api/schema/shared.ts +42 -0
- package/dist/types/api/schema/table.ts +616 -0
- package/dist/types/api/schema/tableIndex.ts +33 -0
- package/dist/types/api/storage.ts +1 -1
- package/dist/types/store/topic.ts +3 -3
- package/dist/utils/bytesParsers/__test__/formatBytes.test.ts +38 -0
- package/dist/utils/bytesParsers/convertBytesObjectToSpeed.ts +2 -2
- package/dist/utils/bytesParsers/formatBytes.ts +132 -0
- package/dist/utils/bytesParsers/i18n/en.json +1 -0
- package/dist/utils/bytesParsers/i18n/ru.json +1 -0
- package/dist/utils/bytesParsers/index.ts +1 -1
- package/dist/utils/index.js +5 -10
- package/dist/utils/numeral.ts +8 -0
- package/package.json +1 -1
- package/dist/assets/icons/versions.svg +0 -3
- package/dist/components/FullNodeViewer/FullNodeViewer.js +0 -89
- package/dist/containers/Node/NodeOverview/NodeOverview.scss +0 -0
- package/dist/containers/Node/NodeOverview/NodeOverview.tsx +0 -21
- package/dist/containers/Storage/Storage.js +0 -350
- package/dist/containers/Tenant/Preview/Preview.js +0 -168
- package/dist/containers/Tenants/Tenants.js +0 -363
- package/dist/store/reducers/storage/storage.js +0 -404
- package/dist/types/api/schema.ts +0 -1326
- package/dist/utils/bytesParsers/formatBytesCustom.ts +0 -57
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.10.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.10.0...v4.10.1) (2023-07-14)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* apply design fixes ([#475](https://github.com/ydb-platform/ydb-embedded-ui/issues/475)) ([5e7c9ca](https://github.com/ydb-platform/ydb-embedded-ui/commit/5e7c9caa9f54094a3eb6448d92d43242d3e738dd))
|
9
|
+
* **AsideNavigation:** replace query icon ([#466](https://github.com/ydb-platform/ydb-embedded-ui/issues/466)) ([4495eb2](https://github.com/ydb-platform/ydb-embedded-ui/commit/4495eb2634e48feda677c03591b92393ad28981e))
|
10
|
+
* **ClusterInfo:** add Databases field ([#474](https://github.com/ydb-platform/ydb-embedded-ui/issues/474)) ([28a9936](https://github.com/ydb-platform/ydb-embedded-ui/commit/28a99364bf5e916381a54a59d4d3f979b35f6eff))
|
11
|
+
* **Cluster:** make global scroll ([#470](https://github.com/ydb-platform/ydb-embedded-ui/issues/470)) ([30f8bc5](https://github.com/ydb-platform/ydb-embedded-ui/commit/30f8bc5ce52fceda076d278b1464d413e899ae21))
|
12
|
+
* **Cluster:** remove tabs icons and numbers ([#473](https://github.com/ydb-platform/ydb-embedded-ui/issues/473)) ([d2e43d4](https://github.com/ydb-platform/ydb-embedded-ui/commit/d2e43d41759b085f34b7f29f52f3aba60cd0588f))
|
13
|
+
* **Query:** rename New Query tab to Query ([#467](https://github.com/ydb-platform/ydb-embedded-ui/issues/467)) ([c3f5585](https://github.com/ydb-platform/ydb-embedded-ui/commit/c3f5585562a204ef0831d0c45766b17c3dc72f82))
|
14
|
+
* **TableIndexInfo:** format DataSize ([#468](https://github.com/ydb-platform/ydb-embedded-ui/issues/468)) ([a189b8c](https://github.com/ydb-platform/ydb-embedded-ui/commit/a189b8cf9610f6b1b7b5f4c01896eda5f8347ebf))
|
15
|
+
|
16
|
+
## [4.10.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.9.0...v4.10.0) (2023-07-07)
|
17
|
+
|
18
|
+
|
19
|
+
### Bug Fixes
|
20
|
+
|
21
|
+
* **AsideNavigation:** swap icons ([#465](https://github.com/ydb-platform/ydb-embedded-ui/issues/465)) ([13bc92a](https://github.com/ydb-platform/ydb-embedded-ui/commit/13bc92a0150ee8d809b3811b528f5d31f4999815))
|
22
|
+
* move sendQuery timeout to request query ([#464](https://github.com/ydb-platform/ydb-embedded-ui/issues/464)) ([6323038](https://github.com/ydb-platform/ydb-embedded-ui/commit/6323038b9e327a9e348812b43514008e9d07640c))
|
23
|
+
* **QueryEditor:** do not reset input on empty savedPath ([#451](https://github.com/ydb-platform/ydb-embedded-ui/issues/451)) ([7f98e44](https://github.com/ydb-platform/ydb-embedded-ui/commit/7f98e44834b54bfc1398bb418909fae21e22a3dc))
|
24
|
+
* show 5 digits size in table info ([#461](https://github.com/ydb-platform/ydb-embedded-ui/issues/461)) ([8c4ecc4](https://github.com/ydb-platform/ydb-embedded-ui/commit/8c4ecc41ed41cad34debaa6ff7f39f1f10f8d974))
|
25
|
+
* **TenantOverview:** add copy button to tenant name ([#459](https://github.com/ydb-platform/ydb-embedded-ui/issues/459)) ([2d8b380](https://github.com/ydb-platform/ydb-embedded-ui/commit/2d8b38049a038fb889e82d0135c026462107a124))
|
26
|
+
* **UsageFilter:** fix bar flashes ([#457](https://github.com/ydb-platform/ydb-embedded-ui/issues/457)) ([ae1965e](https://github.com/ydb-platform/ydb-embedded-ui/commit/ae1965ec894c7d012f0ebfc5949b73d4499b390e))
|
27
|
+
|
3
28
|
## [4.9.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.2...v4.9.0) (2023-06-30)
|
4
29
|
|
5
30
|
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import cn from 'bem-cn-lite';
|
2
2
|
|
3
|
+
import type {TSystemStateInfo} from '../../types/api/nodes';
|
4
|
+
import type {AdditionalNodesInfo} from '../../utils/nodes';
|
5
|
+
|
3
6
|
import EntityStatus from '../EntityStatus/EntityStatus';
|
4
7
|
import {Tags} from '../Tags';
|
5
8
|
import {Icon} from '../Icon';
|
@@ -9,8 +12,8 @@ import './BasicNodeViewer.scss';
|
|
9
12
|
const b = cn('basic-node-viewer');
|
10
13
|
|
11
14
|
interface BasicNodeViewerProps {
|
12
|
-
node:
|
13
|
-
additionalNodesInfo?:
|
15
|
+
node: TSystemStateInfo;
|
16
|
+
additionalNodesInfo?: AdditionalNodesInfo;
|
14
17
|
className?: string;
|
15
18
|
}
|
16
19
|
|
@@ -41,8 +44,8 @@ export const BasicNodeViewer = ({node, additionalNodesInfo, className}: BasicNod
|
|
41
44
|
<label>{node.NodeId}</label>
|
42
45
|
</div>
|
43
46
|
|
44
|
-
<Tags tags={[node.DataCenter]} />
|
45
|
-
<Tags tags={node.Roles} tagsType="blue" />
|
47
|
+
{node.DataCenter && <Tags tags={[node.DataCenter]} />}
|
48
|
+
{node.Roles && <Tags tags={node.Roles} tagsType="blue" />}
|
46
49
|
</>
|
47
50
|
) : (
|
48
51
|
<div className="error">no data</div>
|
@@ -31,6 +31,7 @@ class EntityStatus extends React.Component {
|
|
31
31
|
label: PropTypes.string,
|
32
32
|
iconPath: PropTypes.string,
|
33
33
|
hasClipboardButton: PropTypes.bool,
|
34
|
+
clipboardButtonAlwaysVisible: PropTypes.bool,
|
34
35
|
showStatus: PropTypes.bool,
|
35
36
|
externalLink: PropTypes.bool,
|
36
37
|
className: PropTypes.string,
|
@@ -47,6 +48,7 @@ class EntityStatus extends React.Component {
|
|
47
48
|
externalLink: false,
|
48
49
|
mode: 'color',
|
49
50
|
withLeftTrim: false,
|
51
|
+
clipboardButtonAlwaysVisible: false,
|
50
52
|
};
|
51
53
|
renderIcon() {
|
52
54
|
const {status, size, showStatus, mode} = this.props;
|
@@ -123,7 +125,7 @@ class EntityStatus extends React.Component {
|
|
123
125
|
component="span"
|
124
126
|
size="s"
|
125
127
|
className={b('clipboard-button', {
|
126
|
-
visible:
|
128
|
+
visible: this.props.clipboardButtonAlwaysVisible,
|
127
129
|
})}
|
128
130
|
>
|
129
131
|
<ClipboardButton text={name} size={16} />
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import {FormatBytesArgs, formatBytes} from '../../utils/bytesParsers';
|
2
|
+
|
3
|
+
type FormattedBytesProps = FormatBytesArgs;
|
4
|
+
|
5
|
+
export const FormattedBytes = ({value, withSpeedLabel, ...params}: FormattedBytesProps) => {
|
6
|
+
const formatted = formatBytes({value, withSpeedLabel, ...params});
|
7
|
+
const bytes = formatBytes({value, withSpeedLabel, size: 'b'});
|
8
|
+
|
9
|
+
return <span title={bytes}>{formatted}</span>;
|
10
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type {FormatBytesArgs} from '../../utils/bytesParsers';
|
2
|
+
import {FormattedBytes} from './FormattedBytes';
|
3
|
+
|
4
|
+
export const toFormattedSize = (
|
5
|
+
value: number | string | undefined,
|
6
|
+
params?: Omit<FormatBytesArgs, 'value'>,
|
7
|
+
) => {
|
8
|
+
if (!value) {
|
9
|
+
return null;
|
10
|
+
}
|
11
|
+
|
12
|
+
return <FormattedBytes value={value} significantDigits={2} {...params} />;
|
13
|
+
};
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
|
3
|
+
import type {TSystemStateInfo} from '../../types/api/nodes';
|
4
|
+
|
5
|
+
import {LOAD_AVERAGE_TIME_INTERVALS} from '../../utils/constants';
|
6
|
+
import {calcUptime} from '../../utils';
|
7
|
+
|
8
|
+
import InfoViewer from '../InfoViewer/InfoViewer';
|
9
|
+
import ProgressViewer from '../ProgressViewer/ProgressViewer';
|
10
|
+
import {PoolUsage} from '../PoolUsage/PoolUsage';
|
11
|
+
|
12
|
+
import './FullNodeViewer.scss';
|
13
|
+
|
14
|
+
const b = cn('full-node-viewer');
|
15
|
+
|
16
|
+
interface FullNodeViewerProps {
|
17
|
+
node: TSystemStateInfo | undefined;
|
18
|
+
className?: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
|
22
|
+
const endpointsInfo = node?.Endpoints?.map(({Name, Address}) => ({
|
23
|
+
label: Name,
|
24
|
+
value: Address,
|
25
|
+
}));
|
26
|
+
|
27
|
+
const commonInfo = [
|
28
|
+
{label: 'Version', value: node?.Version},
|
29
|
+
{label: 'Uptime', value: calcUptime(node?.StartTime)},
|
30
|
+
{label: 'DC', value: node?.DataCenterDescription},
|
31
|
+
{label: 'Rack', value: node?.Rack},
|
32
|
+
];
|
33
|
+
|
34
|
+
const averageInfo = node?.LoadAverage?.map((load, loadIndex) => ({
|
35
|
+
label: LOAD_AVERAGE_TIME_INTERVALS[loadIndex],
|
36
|
+
value: <ProgressViewer value={load} percents={true} colorizeProgress={true} />,
|
37
|
+
}));
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div className={`${b()} ${className}`}>
|
41
|
+
{node ? (
|
42
|
+
<div className={b('common-info')}>
|
43
|
+
<div>
|
44
|
+
<div className={b('section-title')}>Pools</div>
|
45
|
+
<div className={b('section', {pools: true})}>
|
46
|
+
{node?.PoolStats?.map((pool, poolIndex) => (
|
47
|
+
<PoolUsage key={poolIndex} data={pool} />
|
48
|
+
))}
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
{endpointsInfo && endpointsInfo.length && (
|
53
|
+
<InfoViewer
|
54
|
+
title="Endpoints"
|
55
|
+
className={b('section')}
|
56
|
+
info={endpointsInfo}
|
57
|
+
/>
|
58
|
+
)}
|
59
|
+
|
60
|
+
<InfoViewer title="Common info" className={b('section')} info={commonInfo} />
|
61
|
+
|
62
|
+
<InfoViewer
|
63
|
+
title="Load average"
|
64
|
+
className={b('section', {average: true})}
|
65
|
+
info={averageInfo}
|
66
|
+
/>
|
67
|
+
</div>
|
68
|
+
) : (
|
69
|
+
<div className="error">no data</div>
|
70
|
+
)}
|
71
|
+
</div>
|
72
|
+
);
|
73
|
+
};
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {TIndexDescription} from '../../../types/api/schema';
|
1
|
+
import type {TIndexDescription} from '../../../types/api/schema';
|
2
|
+
import {toFormattedSize} from '../../FormattedBytes/utils';
|
2
3
|
|
3
4
|
import {createInfoFormatter} from '../utils';
|
4
5
|
|
@@ -8,6 +9,7 @@ export const formatTableIndexItem = createInfoFormatter<TIndexDescription>({
|
|
8
9
|
State: (value) => value?.substring(11), // trims EIndexState prefix
|
9
10
|
KeyColumnNames: (value) => value?.join(', '),
|
10
11
|
DataColumnNames: (value) => value?.join(', '),
|
12
|
+
DataSize: toFormattedSize,
|
11
13
|
},
|
12
14
|
labels: {
|
13
15
|
KeyColumnNames: 'Columns',
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import type {TFollowerGroup, TPartitionConfig, TTableStats} from '../../../types/api/schema';
|
2
2
|
import type {TMetrics} from '../../../types/api/tenant';
|
3
|
-
import {formatCPU,
|
3
|
+
import {formatCPU, formatNumber, formatBps, formatDateTime} from '../../../utils';
|
4
|
+
import {toFormattedSize} from '../../FormattedBytes/utils';
|
4
5
|
|
5
6
|
import {createInfoFormatter} from '../utils';
|
6
7
|
|
7
8
|
export const formatTabletMetricsItem = createInfoFormatter<TMetrics>({
|
8
9
|
values: {
|
9
10
|
CPU: formatCPU,
|
10
|
-
Memory:
|
11
|
-
Storage:
|
11
|
+
Memory: toFormattedSize,
|
12
|
+
Storage: toFormattedSize,
|
12
13
|
Network: formatBps,
|
13
14
|
ReadThroughput: formatBps,
|
14
15
|
WriteThroughput: formatBps,
|
@@ -37,8 +38,8 @@ export const formatPartitionConfigItem = createInfoFormatter<TPartitionConfig>({
|
|
37
38
|
|
38
39
|
export const formatTableStatsItem = createInfoFormatter<TTableStats>({
|
39
40
|
values: {
|
40
|
-
DataSize:
|
41
|
-
IndexSize:
|
41
|
+
DataSize: toFormattedSize,
|
42
|
+
IndexSize: toFormattedSize,
|
42
43
|
LastAccessTime: formatDateTime,
|
43
44
|
LastUpdateTime: formatDateTime,
|
44
45
|
},
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import {RadioButton} from '@gravity-ui/uikit';
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type {ProblemFilterValue} from '../../store/reducers/settings/types';
|
4
4
|
import {ProblemFilterValues} from '../../store/reducers/settings/settings';
|
5
5
|
|
6
6
|
interface ProblemFilterProps {
|
7
|
-
value:
|
7
|
+
value: ProblemFilterValue;
|
8
8
|
onChange: (value: string) => void;
|
9
9
|
className?: string;
|
10
10
|
}
|
@@ -2,7 +2,7 @@ import {useState} from 'react';
|
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import {Popover} from '@gravity-ui/uikit';
|
4
4
|
|
5
|
-
import {
|
5
|
+
import {formatBytes, BytesSizes, ProcessSpeedStats} from '../../utils/bytesParsers';
|
6
6
|
|
7
7
|
import './SpeedMultiMeter.scss';
|
8
8
|
|
@@ -11,8 +11,8 @@ import i18n from './i18n';
|
|
11
11
|
const b = cn('speed-multimeter');
|
12
12
|
|
13
13
|
interface SpeedMultiMeterProps {
|
14
|
-
data?:
|
15
|
-
speedSize?:
|
14
|
+
data?: ProcessSpeedStats;
|
15
|
+
speedSize?: BytesSizes;
|
16
16
|
withValue?: boolean;
|
17
17
|
withPopover?: boolean;
|
18
18
|
}
|
@@ -27,7 +27,7 @@ export const SpeedMultiMeter = ({
|
|
27
27
|
const rawValues = [perMinute, perHour, perDay];
|
28
28
|
|
29
29
|
const formatValue = (value: number) =>
|
30
|
-
|
30
|
+
formatBytes({value: value, size: speedSize, withSpeedLabel: true});
|
31
31
|
|
32
32
|
const formattedValues = [
|
33
33
|
{value: formatValue(perMinute), label: i18n('perMinute')},
|
@@ -0,0 +1,32 @@
|
|
1
|
+
@import '../../styles/mixins.scss';
|
2
|
+
|
3
|
+
.ydb-table-with-controls-layout {
|
4
|
+
display: inline-block;
|
5
|
+
|
6
|
+
box-sizing: border-box;
|
7
|
+
min-width: 100%;
|
8
|
+
|
9
|
+
&__controls-wrapper {
|
10
|
+
z-index: 3;
|
11
|
+
|
12
|
+
box-sizing: border-box;
|
13
|
+
width: 100%;
|
14
|
+
|
15
|
+
@include sticky-top();
|
16
|
+
}
|
17
|
+
|
18
|
+
&__controls {
|
19
|
+
z-index: 3;
|
20
|
+
|
21
|
+
width: max-content;
|
22
|
+
height: 62px;
|
23
|
+
|
24
|
+
@include controls();
|
25
|
+
@include sticky-top();
|
26
|
+
}
|
27
|
+
|
28
|
+
.data-table__sticky_moving {
|
29
|
+
// Place table head right after controls
|
30
|
+
top: 62px !important;
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import type {ReactNode} from 'react';
|
2
|
+
import block from 'bem-cn-lite';
|
3
|
+
|
4
|
+
import {TableSkeleton} from '../TableSkeleton/TableSkeleton';
|
5
|
+
|
6
|
+
import './TableWithControlsLayout.scss';
|
7
|
+
|
8
|
+
const b = block('ydb-table-with-controls-layout');
|
9
|
+
|
10
|
+
interface TableWithControlsLayoutItemProps {
|
11
|
+
children: ReactNode;
|
12
|
+
className?: string;
|
13
|
+
}
|
14
|
+
|
15
|
+
interface TableProps extends TableWithControlsLayoutItemProps {
|
16
|
+
loading?: boolean;
|
17
|
+
}
|
18
|
+
|
19
|
+
export const TableWithControlsLayout = ({
|
20
|
+
children,
|
21
|
+
className,
|
22
|
+
}: TableWithControlsLayoutItemProps) => {
|
23
|
+
return <div className={b(null, className)}>{children}</div>;
|
24
|
+
};
|
25
|
+
|
26
|
+
TableWithControlsLayout.Controls = function TableControls({
|
27
|
+
children,
|
28
|
+
className,
|
29
|
+
}: TableWithControlsLayoutItemProps) {
|
30
|
+
return (
|
31
|
+
<div className={b('controls-wrapper')}>
|
32
|
+
<div className={b('controls', className)}>{children}</div>
|
33
|
+
</div>
|
34
|
+
);
|
35
|
+
};
|
36
|
+
|
37
|
+
TableWithControlsLayout.Table = function Table({children, loading, className}: TableProps) {
|
38
|
+
if (loading) {
|
39
|
+
return <TableSkeleton className={b('loader')} />;
|
40
|
+
}
|
41
|
+
|
42
|
+
return <div className={b('table', className)}>{children}</div>;
|
43
|
+
};
|
@@ -1,11 +1,15 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import cn from 'bem-cn-lite';
|
3
2
|
|
4
3
|
import './TruncatedQuery.scss';
|
5
4
|
|
6
5
|
const b = cn('kv-truncated-query');
|
7
6
|
|
8
|
-
|
7
|
+
interface TruncatedQueryProps {
|
8
|
+
value: string | undefined;
|
9
|
+
maxQueryHeight?: number;
|
10
|
+
}
|
11
|
+
|
12
|
+
export const TruncatedQuery = ({value = '', maxQueryHeight = 6}: TruncatedQueryProps) => {
|
9
13
|
const lines = value.split('\n');
|
10
14
|
const truncated = lines.length > maxQueryHeight;
|
11
15
|
|
@@ -14,13 +18,11 @@ function TruncatedQuery({value, maxQueryHeight}) {
|
|
14
18
|
const message =
|
15
19
|
'\n...\nThe request was truncated. Click on the line to show the full query on the query tab';
|
16
20
|
return (
|
17
|
-
|
21
|
+
<>
|
18
22
|
<span className={b()}>{content}</span>
|
19
23
|
<span className={b('message', {color: 'secondary'})}>{message}</span>
|
20
|
-
|
24
|
+
</>
|
21
25
|
);
|
22
26
|
}
|
23
|
-
return value
|
24
|
-
}
|
25
|
-
|
26
|
-
export default TruncatedQuery;
|
27
|
+
return <>{value}</>;
|
28
|
+
};
|
@@ -7,7 +7,7 @@ import cn from 'bem-cn-lite';
|
|
7
7
|
import {Icon, Button} from '@gravity-ui/uikit';
|
8
8
|
import {AsideHeader, MenuItem as AsideHeaderMenuItem, FooterItem} from '@gravity-ui/navigation';
|
9
9
|
|
10
|
-
import
|
10
|
+
import terminalIcon from '@gravity-ui/icons/svgs/terminal.svg';
|
11
11
|
import pulseIcon from '@gravity-ui/icons/svgs/pulse.svg';
|
12
12
|
|
13
13
|
import signOutIcon from '../../assets/icons/signOut.svg';
|
@@ -139,23 +139,23 @@ export const useGetLeftNavigationItems = () => {
|
|
139
139
|
|
140
140
|
const items: MenuItem[] = [
|
141
141
|
{
|
142
|
-
id: TENANT_PAGES_IDS.
|
143
|
-
title: '
|
144
|
-
icon:
|
142
|
+
id: TENANT_PAGES_IDS.query,
|
143
|
+
title: 'Query',
|
144
|
+
icon: terminalIcon,
|
145
145
|
iconSize: 20,
|
146
146
|
location: getTenantPath({
|
147
147
|
...queryParams,
|
148
|
-
[TENANT_PAGE]: TENANT_PAGES_IDS.
|
148
|
+
[TENANT_PAGE]: TENANT_PAGES_IDS.query,
|
149
149
|
}),
|
150
150
|
},
|
151
151
|
{
|
152
|
-
id: TENANT_PAGES_IDS.
|
153
|
-
title: '
|
152
|
+
id: TENANT_PAGES_IDS.diagnostics,
|
153
|
+
title: 'Diagnostics',
|
154
154
|
icon: pulseIcon,
|
155
155
|
iconSize: 20,
|
156
156
|
location: getTenantPath({
|
157
157
|
...queryParams,
|
158
|
-
[TENANT_PAGE]: TENANT_PAGES_IDS.
|
158
|
+
[TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics,
|
159
159
|
}),
|
160
160
|
},
|
161
161
|
];
|
@@ -6,7 +6,11 @@ import qs from 'qs';
|
|
6
6
|
|
7
7
|
import {Tabs} from '@gravity-ui/uikit';
|
8
8
|
|
9
|
-
import type {
|
9
|
+
import type {
|
10
|
+
AdditionalClusterProps,
|
11
|
+
AdditionalTenantsProps,
|
12
|
+
AdditionalVersionsProps,
|
13
|
+
} from '../../types/additionalProps';
|
10
14
|
import type {AdditionalNodesInfo} from '../../utils/nodes';
|
11
15
|
import routes from '../../routes';
|
12
16
|
|
@@ -17,9 +21,9 @@ import {parseNodesToVersionsValues, parseVersionsToVersionToColorMap} from '../.
|
|
17
21
|
import {useAutofetcher, useTypedSelector} from '../../utils/hooks';
|
18
22
|
|
19
23
|
import {InternalLink} from '../../components/InternalLink';
|
20
|
-
import Tenants from '../Tenants/Tenants';
|
24
|
+
import {Tenants} from '../Tenants/Tenants';
|
21
25
|
import {Nodes} from '../Nodes/Nodes';
|
22
|
-
import Storage from '../Storage/Storage';
|
26
|
+
import {Storage} from '../Storage/Storage';
|
23
27
|
import {Versions} from '../Versions/Versions';
|
24
28
|
|
25
29
|
import {ClusterInfo} from './ClusterInfo/ClusterInfo';
|
@@ -30,7 +34,7 @@ import './Cluster.scss';
|
|
30
34
|
const b = cn('cluster');
|
31
35
|
|
32
36
|
interface ClusterProps {
|
33
|
-
|
37
|
+
additionalTenantsProps?: AdditionalTenantsProps;
|
34
38
|
additionalNodesInfo?: AdditionalNodesInfo;
|
35
39
|
additionalClusterProps?: AdditionalClusterProps;
|
36
40
|
additionalVersionsProps?: AdditionalVersionsProps;
|
@@ -38,7 +42,7 @@ interface ClusterProps {
|
|
38
42
|
|
39
43
|
function Cluster({
|
40
44
|
additionalClusterProps,
|
41
|
-
|
45
|
+
additionalTenantsProps,
|
42
46
|
additionalNodesInfo,
|
43
47
|
additionalVersionsProps,
|
44
48
|
}: ClusterProps) {
|
@@ -97,7 +101,7 @@ function Cluster({
|
|
97
101
|
const renderTab = () => {
|
98
102
|
switch (activeTab) {
|
99
103
|
case clusterTabsIds.tenants: {
|
100
|
-
return <Tenants
|
104
|
+
return <Tenants additionalTenantsProps={additionalTenantsProps} />;
|
101
105
|
}
|
102
106
|
case clusterTabsIds.nodes: {
|
103
107
|
return <Nodes additionalNodesInfo={additionalNodesInfo} />;
|
@@ -114,20 +118,6 @@ function Cluster({
|
|
114
118
|
}
|
115
119
|
};
|
116
120
|
|
117
|
-
const getTabEntityCount = (tabId: ClusterTab) => {
|
118
|
-
switch (tabId) {
|
119
|
-
case clusterTabsIds.tenants: {
|
120
|
-
return cluster?.Tenants ? Number(cluster.Tenants) : undefined;
|
121
|
-
}
|
122
|
-
case clusterTabsIds.nodes: {
|
123
|
-
return cluster?.NodesTotal ? Number(cluster.NodesTotal) : undefined;
|
124
|
-
}
|
125
|
-
default: {
|
126
|
-
return undefined;
|
127
|
-
}
|
128
|
-
}
|
129
|
-
};
|
130
|
-
|
131
121
|
return (
|
132
122
|
<div className={b()}>
|
133
123
|
<ClusterInfo
|
@@ -138,17 +128,12 @@ function Cluster({
|
|
138
128
|
additionalClusterProps={additionalClusterProps}
|
139
129
|
/>
|
140
130
|
|
141
|
-
<div>
|
131
|
+
<div className={b('tabs')}>
|
142
132
|
<Tabs
|
143
133
|
size="l"
|
144
134
|
allowNotSelected={true}
|
145
135
|
activeTab={activeTab as string}
|
146
|
-
items={clusterTabs
|
147
|
-
return {
|
148
|
-
...item,
|
149
|
-
counter: getTabEntityCount(item.id),
|
150
|
-
};
|
151
|
-
})}
|
136
|
+
items={clusterTabs}
|
152
137
|
wrapTo={({id}, node) => {
|
153
138
|
const path = getClusterPath(id as ClusterTab, queryParams);
|
154
139
|
return (
|
@@ -160,7 +145,7 @@ function Cluster({
|
|
160
145
|
/>
|
161
146
|
</div>
|
162
147
|
|
163
|
-
<div
|
148
|
+
<div>{renderTab()}</div>
|
164
149
|
</div>
|
165
150
|
);
|
166
151
|
}
|
@@ -18,7 +18,7 @@ interface ClusterInfoSkeletonProps {
|
|
18
18
|
rows?: number;
|
19
19
|
}
|
20
20
|
|
21
|
-
export const ClusterInfoSkeleton = ({rows =
|
21
|
+
export const ClusterInfoSkeleton = ({rows = 7, className}: ClusterInfoSkeletonProps) => (
|
22
22
|
<div className={b(null, className)}>
|
23
23
|
{[...new Array(rows)].map((_, index) => (
|
24
24
|
<div className={b('row')} key={`skeleton-row-${index}`}>
|
@@ -1,10 +1,3 @@
|
|
1
|
-
import {Icon} from '@gravity-ui/uikit';
|
2
|
-
import cubes3Icon from '@gravity-ui/icons/svgs/cubes-3.svg';
|
3
|
-
import databasesIcon from '@gravity-ui/icons/svgs/databases.svg';
|
4
|
-
import hardDriveIcon from '@gravity-ui/icons/svgs/hard-drive.svg';
|
5
|
-
|
6
|
-
import versionsIcon from '../../assets/icons/versions.svg';
|
7
|
-
|
8
1
|
import type {ValueOf} from '../../types/common';
|
9
2
|
import routes, {createHref} from '../../routes';
|
10
3
|
|
@@ -20,22 +13,18 @@ export type ClusterTab = ValueOf<typeof clusterTabsIds>;
|
|
20
13
|
const tenants = {
|
21
14
|
id: clusterTabsIds.tenants,
|
22
15
|
title: 'Databases',
|
23
|
-
icon: <Icon data={databasesIcon} />,
|
24
16
|
};
|
25
17
|
const nodes = {
|
26
18
|
id: clusterTabsIds.nodes,
|
27
19
|
title: 'Nodes',
|
28
|
-
icon: <Icon data={cubes3Icon} />,
|
29
20
|
};
|
30
21
|
const storage = {
|
31
22
|
id: clusterTabsIds.storage,
|
32
23
|
title: 'Storage',
|
33
|
-
icon: <Icon data={hardDriveIcon} />,
|
34
24
|
};
|
35
25
|
const versions = {
|
36
26
|
id: clusterTabsIds.versions,
|
37
27
|
title: 'Versions',
|
38
|
-
icon: <Icon data={versionsIcon} />,
|
39
28
|
};
|
40
29
|
|
41
30
|
export const clusterTabs = [tenants, nodes, storage, versions];
|
@@ -6,14 +6,10 @@
|
|
6
6
|
justify-content: space-between;
|
7
7
|
align-items: center;
|
8
8
|
|
9
|
-
padding: 0 20px 0
|
10
|
-
|
11
|
-
font-weight: 600;
|
9
|
+
padding: 0 20px 0 12px;
|
12
10
|
|
13
11
|
border-bottom: 1px solid var(--yc-color-line-generic);
|
14
12
|
|
15
|
-
@include body2-typography;
|
16
|
-
|
17
13
|
&__breadcrumb {
|
18
14
|
display: flex;
|
19
15
|
align-items: center;
|
@@ -9,11 +9,11 @@ import {Link} from 'react-router-dom';
|
|
9
9
|
|
10
10
|
import {TABLETS, STORAGE, NODE_PAGES, OVERVIEW, STRUCTURE} from './NodePages';
|
11
11
|
import {Tablets} from '../Tablets';
|
12
|
-
import Storage from '../Storage/Storage';
|
13
|
-
import NodeOverview from './NodeOverview/NodeOverview';
|
12
|
+
import {Storage} from '../Storage/Storage';
|
14
13
|
import NodeStructure from './NodeStructure/NodeStructure';
|
15
14
|
import {Loader} from '../../components/Loader';
|
16
15
|
import {BasicNodeViewer} from '../../components/BasicNodeViewer';
|
16
|
+
import {FullNodeViewer} from '../../components/FullNodeViewer/FullNodeViewer';
|
17
17
|
|
18
18
|
import {getNodeInfo, resetNode} from '../../store/reducers/node/node';
|
19
19
|
import routes, {createHref, parseQuery} from '../../routes';
|
@@ -128,7 +128,7 @@ function Node(props: NodeProps) {
|
|
128
128
|
}
|
129
129
|
|
130
130
|
case OVERVIEW: {
|
131
|
-
return <
|
131
|
+
return <FullNodeViewer node={node} className={b('overview-wrapper')} />;
|
132
132
|
}
|
133
133
|
|
134
134
|
case STRUCTURE: {
|