ydb-embedded-ui 4.16.2 → 4.18.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +30 -0
- package/dist/components/CircularProgressBar/CircularProgressBar.scss +42 -0
- package/dist/components/CircularProgressBar/CircularProgressBar.tsx +59 -0
- package/dist/components/DiagnosticCard/DiagnosticCard.scss +20 -3
- package/dist/components/DiagnosticCard/DiagnosticCard.tsx +5 -6
- package/dist/components/FullNodeViewer/FullNodeViewer.tsx +2 -2
- package/dist/components/InfoViewer/formatters/common.ts +1 -1
- package/dist/components/InfoViewer/formatters/pqGroup.ts +1 -1
- package/dist/components/InfoViewer/formatters/table.ts +6 -1
- package/dist/components/ProgressViewer/ProgressViewer.tsx +99 -0
- package/dist/components/TooltipsContent/TabletTooltipContent/TabletTooltipContent.tsx +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +3 -1
- package/dist/containers/Authentication/Authentication.tsx +14 -4
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +2 -2
- package/dist/containers/Heatmap/Heatmap.tsx +1 -1
- package/dist/containers/Heatmap/Histogram/Histogram.js +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +2 -2
- package/dist/containers/Node/NodeStructure/Vdisk.tsx +5 -2
- package/dist/containers/Nodes/getNodesColumns.tsx +2 -2
- package/dist/containers/Storage/PDisk/PDisk.tsx +1 -1
- package/dist/containers/Storage/PDiskPopup/PDiskPopup.tsx +1 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +1 -1
- package/dist/containers/Storage/VDisk/VDisk.tsx +1 -1
- package/dist/containers/Storage/VDiskPopup/VDiskPopup.tsx +1 -1
- package/dist/containers/Tablet/TabletInfo/TabletInfo.tsx +1 -1
- package/dist/containers/Tablet/TabletTable/TabletTable.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +1 -5
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +40 -17
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Details/Details.tsx +3 -3
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Healthcheck.scss +27 -14
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Healthcheck.tsx +6 -6
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Preview/Preview.tsx +15 -16
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +108 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.tsx +45 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.tsx +83 -0
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/IssuesViewer/IssueTree.scss +1 -3
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/IssuesViewer/IssueTree.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/IssuesViewer/IssueTreeItem/IssueTreeItem.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/i18n/en.json +2 -1
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/i18n/index.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/i18n/ru.json +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.scss +52 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.tsx +48 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.scss +12 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.tsx +134 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/OldTenantOverview.tsx +155 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +3 -5
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +76 -86
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +3 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/ru.json +3 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/useHealthcheck.ts +53 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/TenantPages.tsx +1 -0
- package/dist/containers/Tenants/Tenants.tsx +5 -1
- package/dist/containers/UserSettings/i18n/en.json +4 -1
- package/dist/containers/UserSettings/i18n/ru.json +4 -1
- package/dist/containers/UserSettings/settings.ts +7 -0
- package/dist/containers/Versions/NodesTable/NodesTable.tsx +2 -2
- package/dist/services/api.ts +6 -4
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +1 -1
- package/dist/store/reducers/healthcheckInfo.ts +20 -12
- package/dist/store/reducers/node/selectors.ts +1 -1
- package/dist/store/reducers/nodes/selectors.ts +1 -1
- package/dist/store/reducers/nodes/types.ts +1 -1
- package/dist/store/reducers/nodes/utils.ts +1 -1
- package/dist/store/reducers/settings/settings.ts +6 -1
- package/dist/store/reducers/storage/types.ts +1 -1
- package/dist/store/reducers/storage/utils.ts +1 -1
- package/dist/store/reducers/tenant/constants.ts +7 -0
- package/dist/store/reducers/tenant/tenant.ts +15 -0
- package/dist/store/reducers/tenant/types.ts +5 -0
- package/dist/store/reducers/tenants/contants.ts +6 -0
- package/dist/store/reducers/tenants/types.ts +4 -0
- package/dist/store/reducers/tenants/utils.ts +114 -7
- package/dist/store/state-url-mapping.js +3 -0
- package/dist/styles/constants.scss +2 -0
- package/dist/types/api/tenant.ts +3 -0
- package/dist/types/api/vdisk.ts +1 -1
- package/dist/utils/bytesParsers/formatBytes.ts +1 -1
- package/dist/utils/constants.ts +2 -0
- package/dist/utils/dataFormatters/dataFormatters.ts +128 -0
- package/dist/utils/dataFormatters/i18n/en.json +3 -0
- package/dist/utils/dataFormatters/i18n/index.ts +11 -0
- package/dist/utils/dataFormatters/i18n/ru.json +3 -0
- package/dist/utils/index.js +0 -102
- package/package.json +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.js +0 -92
- /package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Details/index.ts +0 -0
- /package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/Preview/index.ts +0 -0
- /package/dist/containers/Tenant/Diagnostics/{Healthcheck → OldHealthcheck}/index.ts +0 -0
- /package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/IssuesViewer/IssueTreeItem/IssueTreeItem.scss +0 -0
- /package/dist/containers/Tenant/Diagnostics/{Healthcheck → TenantOverview/Healthcheck}/IssuesViewer/IssueTreeItem/index.ts +0 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.18.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.17.0...v4.18.0) (2023-09-25)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* **ProgressViewer:** add custom threasholds to ProgressViewer ([#540](https://github.com/ydb-platform/ydb-embedded-ui/issues/540)) ([3553065](https://github.com/ydb-platform/ydb-embedded-ui/commit/35530655581357f4a79c277a5bf9846b3befb784))
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* **Authentication:** enable page redirect ([#539](https://github.com/ydb-platform/ydb-embedded-ui/issues/539)) ([721883c](https://github.com/ydb-platform/ydb-embedded-ui/commit/721883cc7f4ca60e64d4a5f77b939dbb8e960855))
|
14
|
+
* **Healthcheck:** add merge_records request param ([#538](https://github.com/ydb-platform/ydb-embedded-ui/issues/538)) ([6a47481](https://github.com/ydb-platform/ydb-embedded-ui/commit/6a474814f71c3318715a8ce638fd522a770d8038))
|
15
|
+
* **Nodes:** use nodes endpoint by default ([#535](https://github.com/ydb-platform/ydb-embedded-ui/issues/535)) ([12d4fef](https://github.com/ydb-platform/ydb-embedded-ui/commit/12d4fefde7a6663bb1a11f46b4e94fb24b23e966))
|
16
|
+
* rename flag for display metrics cards for database diagnostics ([#536](https://github.com/ydb-platform/ydb-embedded-ui/issues/536)) ([957e1fa](https://github.com/ydb-platform/ydb-embedded-ui/commit/957e1fafbbc43928498ae9e8d0bc119bcda5288d))
|
17
|
+
|
18
|
+
## [4.17.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.16.2...v4.17.0) (2023-09-18)
|
19
|
+
|
20
|
+
|
21
|
+
### Features
|
22
|
+
|
23
|
+
* add sorting of issues in issues tree ([#532](https://github.com/ydb-platform/ydb-embedded-ui/issues/532)) ([9f7837c](https://github.com/ydb-platform/ydb-embedded-ui/commit/9f7837c95bd1132dd287011e1aadc96c0819b40d))
|
24
|
+
* move healthcheck to tabs ([#531](https://github.com/ydb-platform/ydb-embedded-ui/issues/531)) ([1879d3d](https://github.com/ydb-platform/ydb-embedded-ui/commit/1879d3d8f717a0baaec0d506ad354d81a226fa62))
|
25
|
+
* update TenantOverview design ([#527](https://github.com/ydb-platform/ydb-embedded-ui/issues/527)) ([8a752e0](https://github.com/ydb-platform/ydb-embedded-ui/commit/8a752e0def3dc4317fd18519aed210bdc23fefa2))
|
26
|
+
|
27
|
+
|
28
|
+
### Bug Fixes
|
29
|
+
|
30
|
+
* fix Healthcheck blinking ([#528](https://github.com/ydb-platform/ydb-embedded-ui/issues/528)) ([0fc6c46](https://github.com/ydb-platform/ydb-embedded-ui/commit/0fc6c46eb15aeb73a984ba2c2cbe18ef7116382e))
|
31
|
+
* **Tenants:** use blob storage ([#530](https://github.com/ydb-platform/ydb-embedded-ui/issues/530)) ([8a546a1](https://github.com/ydb-platform/ydb-embedded-ui/commit/8a546a1ab2f812acc1523c1c35738f4c605c32a5))
|
32
|
+
|
3
33
|
## [4.16.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.16.1...v4.16.2) (2023-08-28)
|
4
34
|
|
5
35
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
.ydb-circular-progress-bar {
|
2
|
+
display: block;
|
3
|
+
|
4
|
+
max-width: 100%;
|
5
|
+
|
6
|
+
transform: rotate(90deg);
|
7
|
+
|
8
|
+
&__wrapper {
|
9
|
+
position: relative;
|
10
|
+
}
|
11
|
+
&__content {
|
12
|
+
position: absolute;
|
13
|
+
top: 50%;
|
14
|
+
left: 50%;
|
15
|
+
|
16
|
+
overflow: hidden;
|
17
|
+
|
18
|
+
max-width: 100%;
|
19
|
+
|
20
|
+
transform: translate(-50%, -50%);
|
21
|
+
}
|
22
|
+
|
23
|
+
&__circle-bg {
|
24
|
+
stroke: var(--yc-color-base-simple-hover);
|
25
|
+
|
26
|
+
fill: none;
|
27
|
+
}
|
28
|
+
|
29
|
+
&__circle {
|
30
|
+
fill: none;
|
31
|
+
|
32
|
+
&_status_good {
|
33
|
+
stroke: var(--yc-color-private-green-550);
|
34
|
+
}
|
35
|
+
&_status_warning {
|
36
|
+
stroke: var(--yc-color-private-yellow-550);
|
37
|
+
}
|
38
|
+
&_status_danger {
|
39
|
+
stroke: var(--yc-color-private-red-550);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
import type {ReactNode} from 'react';
|
3
|
+
|
4
|
+
import type {MetricStatus} from '../../store/reducers/tenants/types';
|
5
|
+
import {normalizeProgress} from '../../store/reducers/tenants/utils';
|
6
|
+
|
7
|
+
import './CircularProgressBar.scss';
|
8
|
+
|
9
|
+
const b = cn('ydb-circular-progress-bar');
|
10
|
+
|
11
|
+
interface CircularProgressBarProps {
|
12
|
+
size?: number;
|
13
|
+
progress?: number;
|
14
|
+
strokeWidth?: number;
|
15
|
+
content?: ReactNode;
|
16
|
+
status?: MetricStatus;
|
17
|
+
circleBgClassName?: string;
|
18
|
+
}
|
19
|
+
|
20
|
+
export function CircularProgressBar({
|
21
|
+
size = 100,
|
22
|
+
progress = 0,
|
23
|
+
strokeWidth = 10,
|
24
|
+
content,
|
25
|
+
status,
|
26
|
+
circleBgClassName,
|
27
|
+
}: CircularProgressBarProps) {
|
28
|
+
const center = size / 2;
|
29
|
+
|
30
|
+
const radius = size / 2 - strokeWidth / 2;
|
31
|
+
const circumference = 2 * Math.PI * radius;
|
32
|
+
|
33
|
+
const normalizedProgress = normalizeProgress(progress);
|
34
|
+
|
35
|
+
const offset = ((100 - normalizedProgress) / 100) * circumference;
|
36
|
+
return (
|
37
|
+
<div className={b('wrapper')}>
|
38
|
+
{content && <div className={b('content')}>{content}</div>}
|
39
|
+
<svg className={b()} width={size} height={size}>
|
40
|
+
<circle
|
41
|
+
className={b('circle-bg', circleBgClassName)}
|
42
|
+
cx={center}
|
43
|
+
cy={center}
|
44
|
+
r={radius}
|
45
|
+
strokeWidth={strokeWidth}
|
46
|
+
/>
|
47
|
+
<circle
|
48
|
+
className={b('circle', {status: status?.toLocaleLowerCase()})}
|
49
|
+
cx={center}
|
50
|
+
cy={center}
|
51
|
+
r={radius}
|
52
|
+
strokeWidth={strokeWidth}
|
53
|
+
strokeDasharray={circumference}
|
54
|
+
strokeDashoffset={offset}
|
55
|
+
/>
|
56
|
+
</svg>
|
57
|
+
</div>
|
58
|
+
);
|
59
|
+
}
|
@@ -1,5 +1,22 @@
|
|
1
|
-
.diagnostic-card {
|
2
|
-
|
3
|
-
|
1
|
+
.ydb-diagnostic-card {
|
2
|
+
flex-shrink: 0;
|
3
|
+
|
4
|
+
width: 206px;
|
4
5
|
padding: 16px;
|
6
|
+
padding-bottom: 28px;
|
7
|
+
|
8
|
+
border: 1px solid var(--yc-color-line-generic);
|
9
|
+
border-radius: 8px;
|
10
|
+
background-color: transparent;
|
11
|
+
|
12
|
+
&_active {
|
13
|
+
border-color: var(--yc-color-base-info-heavy);
|
14
|
+
background-color: var(--yc-color-base-selection);
|
15
|
+
}
|
16
|
+
|
17
|
+
&:hover {
|
18
|
+
cursor: pointer;
|
19
|
+
|
20
|
+
box-shadow: 0px 1px 5px var(--yc-color-sfx-shadow);
|
21
|
+
}
|
5
22
|
}
|
@@ -1,17 +1,16 @@
|
|
1
|
-
import {ReactNode} from 'react';
|
1
|
+
import type {ReactNode} from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
|
4
|
-
import {Card} from '@gravity-ui/uikit';
|
5
|
-
|
6
4
|
import './DiagnosticCard.scss';
|
7
5
|
|
8
|
-
const b = cn('diagnostic-card');
|
6
|
+
const b = cn('ydb-diagnostic-card');
|
9
7
|
|
10
8
|
interface DiagnosticCardProps {
|
11
9
|
children?: ReactNode;
|
12
10
|
className?: string;
|
11
|
+
active?: boolean;
|
13
12
|
}
|
14
13
|
|
15
|
-
export function DiagnosticCard({children, className}: DiagnosticCardProps) {
|
16
|
-
return <
|
14
|
+
export function DiagnosticCard({children, className, active}: DiagnosticCardProps) {
|
15
|
+
return <div className={b({active}, className)}>{children}</div>;
|
17
16
|
}
|
@@ -3,10 +3,10 @@ import cn from 'bem-cn-lite';
|
|
3
3
|
import type {TSystemStateInfo} from '../../types/api/nodes';
|
4
4
|
|
5
5
|
import {LOAD_AVERAGE_TIME_INTERVALS} from '../../utils/constants';
|
6
|
-
import {calcUptime} from '../../utils';
|
6
|
+
import {calcUptime} from '../../utils/dataFormatters/dataFormatters';
|
7
7
|
|
8
8
|
import InfoViewer from '../InfoViewer/InfoViewer';
|
9
|
-
import ProgressViewer from '../ProgressViewer/ProgressViewer';
|
9
|
+
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
|
10
10
|
import {PoolUsage} from '../PoolUsage/PoolUsage';
|
11
11
|
|
12
12
|
import './FullNodeViewer.scss';
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
TPQPartitionConfig,
|
5
5
|
TPQTabletConfig,
|
6
6
|
} from '../../../types/api/schema';
|
7
|
-
import {formatBps, formatBytes, formatNumber} from '../../../utils';
|
7
|
+
import {formatBps, formatBytes, formatNumber} from '../../../utils/dataFormatters/dataFormatters';
|
8
8
|
import {HOUR_IN_SECONDS} from '../../../utils/constants';
|
9
9
|
|
10
10
|
import {createInfoFormatter} from '../utils';
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import type {TFollowerGroup, TPartitionConfig, TTableStats} from '../../../types/api/schema';
|
2
2
|
import type {TMetrics} from '../../../types/api/tenant';
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
formatBps,
|
5
|
+
formatCPU,
|
6
|
+
formatDateTime,
|
7
|
+
formatNumber,
|
8
|
+
} from '../../../utils/dataFormatters/dataFormatters';
|
4
9
|
import {toFormattedSize} from '../../FormattedBytes/utils';
|
5
10
|
|
6
11
|
import {createInfoFormatter} from '../utils';
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
|
3
|
+
import type {ValueOf} from '../../types/common';
|
4
|
+
|
5
|
+
import './ProgressViewer.scss';
|
6
|
+
|
7
|
+
const b = cn('progress-viewer');
|
8
|
+
|
9
|
+
export const PROGRESS_VIEWER_SIZE_IDS = {
|
10
|
+
xs: 'xs',
|
11
|
+
s: 's',
|
12
|
+
ns: 'ns',
|
13
|
+
m: 'm',
|
14
|
+
n: 'n',
|
15
|
+
l: 'l',
|
16
|
+
head: 'head',
|
17
|
+
} as const;
|
18
|
+
|
19
|
+
type ProgressViewerSize = ValueOf<typeof PROGRESS_VIEWER_SIZE_IDS>;
|
20
|
+
|
21
|
+
/*
|
22
|
+
|
23
|
+
Props description:
|
24
|
+
1) value - the amount of progress
|
25
|
+
2) capacity - maximum possible progress value
|
26
|
+
3) formatValues - function for formatting the value and capacity
|
27
|
+
4) percents - display progress in percents
|
28
|
+
5) colorizeProgress - change the color of the progress bar depending on its value
|
29
|
+
6) inverseColorize - invert the colors of the progress bar
|
30
|
+
7) warningThreshold - the percentage of fullness at which the color of the progress bar changes to yellow
|
31
|
+
8) dangerThreshold - the percentage of fullness at which the color of the progress bar changes to red
|
32
|
+
*/
|
33
|
+
|
34
|
+
interface ProgressViewerProps {
|
35
|
+
value?: number | string;
|
36
|
+
capacity?: number | string;
|
37
|
+
formatValues?: (value?: number, capacity?: number) => (string | undefined)[];
|
38
|
+
percents?: boolean;
|
39
|
+
className?: string;
|
40
|
+
size?: ProgressViewerSize;
|
41
|
+
colorizeProgress?: boolean;
|
42
|
+
inverseColorize?: boolean;
|
43
|
+
warningThreshold?: number;
|
44
|
+
dangerThreshold?: number;
|
45
|
+
}
|
46
|
+
|
47
|
+
export function ProgressViewer({
|
48
|
+
value,
|
49
|
+
capacity = 100,
|
50
|
+
formatValues,
|
51
|
+
percents,
|
52
|
+
className,
|
53
|
+
size = PROGRESS_VIEWER_SIZE_IDS.xs,
|
54
|
+
colorizeProgress,
|
55
|
+
inverseColorize,
|
56
|
+
warningThreshold = 60,
|
57
|
+
dangerThreshold = 80,
|
58
|
+
}: ProgressViewerProps) {
|
59
|
+
let fillWidth = Math.round((parseFloat(String(value)) / parseFloat(String(capacity))) * 100);
|
60
|
+
fillWidth = fillWidth > 100 ? 100 : fillWidth;
|
61
|
+
let valueText: number | string | undefined = Math.round(Number(value)),
|
62
|
+
capacityText: number | string | undefined = capacity,
|
63
|
+
divider = '/';
|
64
|
+
if (formatValues) {
|
65
|
+
[valueText, capacityText] = formatValues(Number(value), Number(capacity));
|
66
|
+
} else if (percents) {
|
67
|
+
valueText = fillWidth + '%';
|
68
|
+
capacityText = '';
|
69
|
+
divider = '';
|
70
|
+
}
|
71
|
+
|
72
|
+
let bg = inverseColorize ? 'scarlet' : 'apple';
|
73
|
+
if (colorizeProgress) {
|
74
|
+
if (fillWidth > warningThreshold && fillWidth <= dangerThreshold) {
|
75
|
+
bg = 'saffron';
|
76
|
+
} else if (fillWidth > dangerThreshold) {
|
77
|
+
bg = inverseColorize ? 'apple' : 'scarlet';
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
const lineStyle = {
|
82
|
+
width: fillWidth + '%',
|
83
|
+
};
|
84
|
+
|
85
|
+
const text = fillWidth > 60 ? 'contrast0' : 'contrast70';
|
86
|
+
|
87
|
+
if (!isNaN(fillWidth)) {
|
88
|
+
return (
|
89
|
+
<div className={b({size}, className)}>
|
90
|
+
<div className={b('line', {bg})} style={lineStyle}></div>
|
91
|
+
<span
|
92
|
+
className={b('text', {text})}
|
93
|
+
>{`${valueText} ${divider} ${capacityText}`}</span>
|
94
|
+
</div>
|
95
|
+
);
|
96
|
+
}
|
97
|
+
|
98
|
+
return <div className={`${b({size})} ${className} error`}>no data</div>;
|
99
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type {TTabletStateInfo} from '../../../types/api/tablet';
|
2
2
|
|
3
|
-
import {calcUptime} from '../../../utils';
|
3
|
+
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
|
4
4
|
import {InfoViewer, createInfoFormatter, formatObject} from '../../InfoViewer';
|
5
5
|
|
6
6
|
const formatTablet = createInfoFormatter<TTabletStateInfo>({
|
@@ -50,7 +50,9 @@ function YbdInternalUser({ydbUser, logout}: YbdInternalUserProps) {
|
|
50
50
|
const history = useHistory();
|
51
51
|
|
52
52
|
const handleLoginClick = () => {
|
53
|
-
history.push(
|
53
|
+
history.push(
|
54
|
+
createHref(routes.auth, undefined, {returnUrl: encodeURIComponent(location.href)}),
|
55
|
+
);
|
54
56
|
};
|
55
57
|
|
56
58
|
return (
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import {KeyboardEvent, useEffect, useState} from 'react';
|
2
2
|
import {useDispatch} from 'react-redux';
|
3
|
-
import {useHistory} from 'react-router';
|
3
|
+
import {useHistory, useLocation} from 'react-router';
|
4
4
|
import cn from 'bem-cn-lite';
|
5
5
|
|
6
6
|
import {Button, TextInput, Icon, Link as ExternalLink} from '@gravity-ui/uikit';
|
7
7
|
|
8
8
|
import {authenticate} from '../../store/reducers/authentication/authentication';
|
9
9
|
import {useTypedSelector} from '../../utils/hooks';
|
10
|
+
import {parseQuery} from '../../routes';
|
10
11
|
|
11
12
|
import ydbLogoIcon from '../../assets/icons/ydb.svg';
|
12
13
|
import showIcon from '../../assets/icons/show.svg';
|
@@ -18,13 +19,15 @@ import './Authentication.scss';
|
|
18
19
|
const b = cn('authentication');
|
19
20
|
|
20
21
|
interface AuthenticationProps {
|
21
|
-
returnUrl?: string;
|
22
22
|
closable?: boolean;
|
23
23
|
}
|
24
24
|
|
25
|
-
function Authentication({
|
25
|
+
function Authentication({closable = false}: AuthenticationProps) {
|
26
26
|
const dispatch = useDispatch();
|
27
27
|
const history = useHistory();
|
28
|
+
const location = useLocation();
|
29
|
+
|
30
|
+
const {returnUrl} = parseQuery(location);
|
28
31
|
|
29
32
|
const {error} = useTypedSelector((state) => state.authentication);
|
30
33
|
|
@@ -58,7 +61,14 @@ function Authentication({returnUrl, closable = false}: AuthenticationProps) {
|
|
58
61
|
// typed dispatch required, remove error expectation after adding it
|
59
62
|
dispatch(authenticate(login, pass)).then(() => {
|
60
63
|
if (returnUrl) {
|
61
|
-
|
64
|
+
const decodedUrl = decodeURIComponent(returnUrl.toString());
|
65
|
+
|
66
|
+
// to prevent page reload we use router history
|
67
|
+
// history navigates relative to origin
|
68
|
+
// so we remove origin to make it work properly
|
69
|
+
const url = new URL(decodedUrl);
|
70
|
+
const path = url.pathname + url.search;
|
71
|
+
history.replace(path);
|
62
72
|
}
|
63
73
|
});
|
64
74
|
};
|
@@ -3,7 +3,7 @@ import block from 'bem-cn-lite';
|
|
3
3
|
import {Skeleton} from '@gravity-ui/uikit';
|
4
4
|
|
5
5
|
import EntityStatus from '../../../components/EntityStatus/EntityStatus';
|
6
|
-
import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
|
6
|
+
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
|
7
7
|
import InfoViewer, {InfoViewerItem} from '../../../components/InfoViewer/InfoViewer';
|
8
8
|
import {Tags} from '../../../components/Tags';
|
9
9
|
import {Tablet} from '../../../components/Tablet';
|
@@ -16,7 +16,7 @@ import type {AdditionalClusterProps, ClusterLink} from '../../../types/additiona
|
|
16
16
|
import type {VersionValue} from '../../../types/versions';
|
17
17
|
import type {TClusterInfo} from '../../../types/api/cluster';
|
18
18
|
import {backend, customBackend} from '../../../store';
|
19
|
-
import {formatStorageValues} from '../../../utils';
|
19
|
+
import {formatStorageValues} from '../../../utils/dataFormatters/dataFormatters';
|
20
20
|
import {useSetting, useTypedSelector} from '../../../utils/hooks';
|
21
21
|
import {
|
22
22
|
CLUSTER_DEFAULT_TITLE,
|
@@ -7,7 +7,7 @@ import {Checkbox, Select} from '@gravity-ui/uikit';
|
|
7
7
|
import type {IHeatmapMetricValue} from '../../types/store/heatmap';
|
8
8
|
import {getTabletsInfo, setHeatmapOptions} from '../../store/reducers/heatmap';
|
9
9
|
import {showTooltip, hideTooltip} from '../../store/reducers/tooltip';
|
10
|
-
import {formatNumber} from '../../utils';
|
10
|
+
import {formatNumber} from '../../utils/dataFormatters/dataFormatters';
|
11
11
|
import {useAutofetcher, useTypedSelector} from '../../utils/hooks';
|
12
12
|
|
13
13
|
import {Loader} from '../../components/Loader';
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
|
5
5
|
import {getColorRange, getCurrentMetricLimits} from '../util';
|
6
|
-
import {formatNumber} from '../../../utils';
|
6
|
+
import {formatNumber} from '../../../utils/dataFormatters/dataFormatters';
|
7
7
|
|
8
8
|
import './Histogram.scss';
|
9
9
|
|
@@ -8,12 +8,12 @@ import DataTable, {Column, Settings} from '@gravity-ui/react-data-table';
|
|
8
8
|
|
9
9
|
import EntityStatus from '../../../components/EntityStatus/EntityStatus';
|
10
10
|
import InfoViewer from '../../../components/InfoViewer/InfoViewer';
|
11
|
-
import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
|
11
|
+
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
|
12
12
|
import {Icon} from '../../../components/Icon';
|
13
13
|
import {Vdisk} from './Vdisk';
|
14
14
|
|
15
15
|
import {bytesToGB, pad9} from '../../../utils/utils';
|
16
|
-
import {formatStorageValuesToGb} from '../../../utils';
|
16
|
+
import {formatStorageValuesToGb} from '../../../utils/dataFormatters/dataFormatters';
|
17
17
|
import {getPDiskType} from '../../../utils/pdisk';
|
18
18
|
|
19
19
|
import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
|
4
|
-
import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
|
5
|
-
import {
|
4
|
+
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
|
5
|
+
import {
|
6
|
+
formatStorageValuesToGb,
|
7
|
+
stringifyVdiskId,
|
8
|
+
} from '../../../utils/dataFormatters/dataFormatters';
|
6
9
|
import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
|
7
10
|
import EntityStatus from '../../../components/EntityStatus/EntityStatus';
|
8
11
|
import {valueIsDefined} from './NodeStructure';
|
@@ -2,12 +2,12 @@ import DataTable, {Column} from '@gravity-ui/react-data-table';
|
|
2
2
|
import {Popover} from '@gravity-ui/uikit';
|
3
3
|
|
4
4
|
import {PoolsGraph} from '../../components/PoolsGraph/PoolsGraph';
|
5
|
-
import ProgressViewer from '../../components/ProgressViewer/ProgressViewer';
|
5
|
+
import {ProgressViewer} from '../../components/ProgressViewer/ProgressViewer';
|
6
6
|
import {TabletsStatistic} from '../../components/TabletsStatistic';
|
7
7
|
import {NodeHostWrapper} from '../../components/NodeHostWrapper/NodeHostWrapper';
|
8
8
|
|
9
9
|
import {isSortableNodesProperty} from '../../utils/nodes';
|
10
|
-
import {formatBytesToGigabyte} from '../../utils/
|
10
|
+
import {formatBytesToGigabyte} from '../../utils/dataFormatters/dataFormatters';
|
11
11
|
|
12
12
|
import type {NodesPreparedEntity} from '../../store/reducers/nodes/types';
|
13
13
|
|
@@ -7,7 +7,7 @@ import {Stack} from '../../../components/Stack/Stack';
|
|
7
7
|
import routes, {createHref} from '../../../routes';
|
8
8
|
import {selectVDisksForPDisk} from '../../../store/reducers/storage/selectors';
|
9
9
|
import {TPDiskStateInfo, TPDiskState} from '../../../types/api/pdisk';
|
10
|
-
import {stringifyVdiskId} from '../../../utils';
|
10
|
+
import {stringifyVdiskId} from '../../../utils/dataFormatters/dataFormatters';
|
11
11
|
import {useTypedSelector} from '../../../utils/hooks';
|
12
12
|
import {getPDiskType} from '../../../utils/pdisk';
|
13
13
|
import {isFullVDiskData} from '../../../utils/storage';
|
@@ -9,7 +9,7 @@ import {InfoViewer, InfoViewerItem} from '../../../components/InfoViewer';
|
|
9
9
|
|
10
10
|
import {EFlag} from '../../../types/api/enums';
|
11
11
|
import {TPDiskStateInfo} from '../../../types/api/pdisk';
|
12
|
-
import {getPDiskId} from '../../../utils';
|
12
|
+
import {getPDiskId} from '../../../utils/dataFormatters/dataFormatters';
|
13
13
|
import {getPDiskType} from '../../../utils/pdisk';
|
14
14
|
import {bytesToGB} from '../../../utils/utils';
|
15
15
|
|
@@ -10,7 +10,7 @@ import type {HandleSort} from '../../../utils/hooks/useTableSort';
|
|
10
10
|
|
11
11
|
import {VISIBLE_ENTITIES} from '../../../store/reducers/storage/constants';
|
12
12
|
import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
|
13
|
-
import {stringifyVdiskId} from '../../../utils';
|
13
|
+
import {stringifyVdiskId} from '../../../utils/dataFormatters/dataFormatters';
|
14
14
|
import {getUsage, isFullVDiskData, isSortableStorageProperty} from '../../../utils/storage';
|
15
15
|
|
16
16
|
import shieldIcon from '../../../assets/icons/shield.svg';
|
@@ -8,7 +8,7 @@ import {InternalLink} from '../../../components/InternalLink';
|
|
8
8
|
import routes, {createHref} from '../../../routes';
|
9
9
|
import {EFlag} from '../../../types/api/enums';
|
10
10
|
import {EVDiskState, TVDiskStateInfo} from '../../../types/api/vdisk';
|
11
|
-
import {stringifyVdiskId} from '../../../utils';
|
11
|
+
import {stringifyVdiskId} from '../../../utils/dataFormatters/dataFormatters';
|
12
12
|
import {isFullVDiskData} from '../../../utils/storage';
|
13
13
|
|
14
14
|
import {STRUCTURE} from '../../Node/NodePages';
|
@@ -9,7 +9,7 @@ import {InfoViewer, InfoViewerItem} from '../../../components/InfoViewer';
|
|
9
9
|
|
10
10
|
import {EFlag} from '../../../types/api/enums';
|
11
11
|
import type {TVDiskStateInfo} from '../../../types/api/vdisk';
|
12
|
-
import {stringifyVdiskId} from '../../../utils';
|
12
|
+
import {stringifyVdiskId} from '../../../utils/dataFormatters/dataFormatters';
|
13
13
|
import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
|
14
14
|
import {isFullVDiskData} from '../../../utils/storage';
|
15
15
|
|
@@ -5,7 +5,7 @@ import {Link as UIKitLink} from '@gravity-ui/uikit';
|
|
5
5
|
import {ETabletState, TTabletStateInfo} from '../../../types/api/tablet';
|
6
6
|
import {InfoViewer, InfoViewerItem} from '../../../components/InfoViewer';
|
7
7
|
import routes, {createHref} from '../../../routes';
|
8
|
-
import {calcUptime} from '../../../utils';
|
8
|
+
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
|
9
9
|
import {getDefaultNodePath} from '../../Node/NodePages';
|
10
10
|
|
11
11
|
import {b} from '../Tablet';
|
@@ -4,7 +4,7 @@ import EntityStatus from '../../../components/EntityStatus/EntityStatus';
|
|
4
4
|
import {InternalLink} from '../../../components/InternalLink/InternalLink';
|
5
5
|
|
6
6
|
import type {ITabletPreparedHistoryItem} from '../../../types/store/tablet';
|
7
|
-
import {calcUptime} from '../../../utils';
|
7
|
+
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
|
8
8
|
import {getDefaultNodePath} from '../../Node/NodePages';
|
9
9
|
|
10
10
|
import {b} from '../Tablet';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import block from 'bem-cn-lite';
|
2
2
|
|
3
3
|
import type {IPreparedTopicStats} from '../../../../../types/store/topic';
|
4
|
-
import {formatMsToUptime} from '../../../../../utils';
|
4
|
+
import {formatMsToUptime} from '../../../../../utils/dataFormatters/dataFormatters';
|
5
5
|
import {SpeedMultiMeter} from '../../../../../components/SpeedMultiMeter';
|
6
6
|
|
7
7
|
import './ConsumersTopicStats.scss';
|
@@ -6,7 +6,7 @@ import type {IPreparedConsumerData} from '../../../../../types/store/topic';
|
|
6
6
|
import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../../../store/reducers/tenant/constants';
|
7
7
|
import {SpeedMultiMeter} from '../../../../../components/SpeedMultiMeter';
|
8
8
|
import {InternalLink} from '../../../../../components/InternalLink';
|
9
|
-
import {formatMsToUptime} from '../../../../../utils';
|
9
|
+
import {formatMsToUptime} from '../../../../../utils/dataFormatters/dataFormatters';
|
10
10
|
import routes, {createHref} from '../../../../../routes';
|
11
11
|
|
12
12
|
import {TenantTabsGroups} from '../../../TenantPages';
|
@@ -1,6 +1,3 @@
|
|
1
|
-
$section-title-margin: 20px;
|
2
|
-
$section-title-line-height: 24px;
|
3
|
-
|
4
1
|
.kv-detailed-overview {
|
5
2
|
display: flex;
|
6
3
|
|
@@ -10,8 +7,7 @@ $section-title-line-height: 24px;
|
|
10
7
|
|
11
8
|
&__section {
|
12
9
|
display: flex;
|
13
|
-
|
14
|
-
flex: 0 0 calc(50% - 10px);
|
10
|
+
flex: 1 0 calc(50% - 10px);
|
15
11
|
flex-direction: column;
|
16
12
|
|
17
13
|
min-width: 300px;
|