ydb-embedded-ui 3.2.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/dist/components/EntitiesCount/EntitiesCount.tsx +34 -0
- package/dist/components/EntitiesCount/i18n/en.json +3 -0
- package/dist/components/{AsideNavigation/Settings → EntitiesCount}/i18n/index.ts +2 -2
- package/dist/components/EntitiesCount/i18n/ru.json +3 -0
- package/dist/components/EntitiesCount/index.ts +1 -0
- package/dist/components/Fullscreen/Fullscreen.scss +7 -5
- package/dist/components/TabletsOverall/TabletsOverall.tsx +4 -4
- package/dist/components/TabletsStatistic/TabletsStatistic.tsx +56 -0
- package/dist/components/TabletsStatistic/index.ts +1 -0
- package/dist/containers/App/App.scss +4 -12
- package/dist/containers/AsideNavigation/AsideNavigation.scss +0 -18
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +95 -33
- package/dist/containers/Heatmap/Heatmap.scss +0 -7
- package/dist/containers/Heatmap/Heatmap.tsx +203 -0
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +2 -1
- package/dist/containers/Heatmap/index.ts +1 -0
- package/dist/containers/Node/Node.tsx +1 -1
- package/dist/containers/Storage/Storage.js +12 -19
- package/dist/containers/Tablets/Tablets.scss +0 -5
- package/dist/containers/Tablets/Tablets.tsx +172 -0
- package/dist/containers/Tablets/i18n/en.json +6 -0
- package/dist/{components/AsideNavigation → containers/Tablets}/i18n/index.ts +1 -1
- package/dist/containers/Tablets/i18n/ru.json +6 -0
- package/dist/containers/Tablets/index.ts +1 -0
- package/dist/containers/TabletsFilters/TabletsFilters.js +4 -8
- package/dist/containers/TabletsFilters/TabletsFilters.scss +6 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +4 -8
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -7
- package/dist/containers/Tenants/Tenants.js +1 -1
- package/dist/containers/UserSettings/UserSettings.tsx +4 -3
- package/dist/routes.ts +1 -1
- package/dist/store/reducers/{heatmap.js → heatmap.ts} +33 -18
- package/dist/store/reducers/settings.js +12 -2
- package/dist/types/api/compute.ts +1 -1
- package/dist/types/api/schema.ts +16 -3
- package/dist/types/store/heatmap.ts +51 -0
- package/dist/utils/constants.ts +1 -37
- package/dist/utils/getNodesColumns.js +7 -2
- package/dist/utils/tablet.ts +53 -0
- package/package.json +2 -1
- package/dist/components/AsideNavigation/AsideHeader.scss +0 -147
- package/dist/components/AsideNavigation/AsideHeader.tsx +0 -389
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +0 -82
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.tsx +0 -138
- package/dist/components/AsideNavigation/AsideHeaderFooterSlot/AsideHeaderFooterSlot.tsx +0 -33
- package/dist/components/AsideNavigation/AsideHeaderFooterSlot/SlotsContext.tsx +0 -49
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +0 -16
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.tsx +0 -37
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +0 -108
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.tsx +0 -282
- package/dist/components/AsideNavigation/Content/Content.tsx +0 -35
- package/dist/components/AsideNavigation/Drawer/Drawer.scss +0 -76
- package/dist/components/AsideNavigation/Drawer/Drawer.tsx +0 -134
- package/dist/components/AsideNavigation/Drawer/index.ts +0 -1
- package/dist/components/AsideNavigation/Logo/Logo.scss +0 -43
- package/dist/components/AsideNavigation/Logo/Logo.tsx +0 -82
- package/dist/components/AsideNavigation/Settings/README.md +0 -92
- package/dist/components/AsideNavigation/Settings/Settings.scss +0 -128
- package/dist/components/AsideNavigation/Settings/Settings.tsx +0 -270
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +0 -78
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.tsx +0 -141
- package/dist/components/AsideNavigation/Settings/SettingsSearch/SettingsSearch.tsx +0 -57
- package/dist/components/AsideNavigation/Settings/collect-settings.ts +0 -156
- package/dist/components/AsideNavigation/Settings/filter-settings.ts +0 -38
- package/dist/components/AsideNavigation/Settings/helpers.ts +0 -39
- package/dist/components/AsideNavigation/Settings/i18n/en.json +0 -5
- package/dist/components/AsideNavigation/Settings/i18n/ru.json +0 -5
- package/dist/components/AsideNavigation/Settings/index.ts +0 -1
- package/dist/components/AsideNavigation/constants.ts +0 -28
- package/dist/components/AsideNavigation/helpers.ts +0 -34
- package/dist/components/AsideNavigation/i18n/en.json +0 -4
- package/dist/components/AsideNavigation/i18n/ru.json +0 -4
- package/dist/components/AsideNavigation/icons.ts +0 -32
- package/dist/components/AsideNavigation/types.ts +0 -23
- package/dist/components/TabletsStatistic/TabletsStatistic.js +0 -58
- package/dist/containers/Heatmap/Heatmap.js +0 -244
- package/dist/containers/Tablets/Tablets.js +0 -228
package/dist/types/api/schema.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import {TMetrics} from './tenant';
|
2
|
+
|
1
3
|
export interface TEvDescribeSchemeResult {
|
2
4
|
Status?: EStatus;
|
3
5
|
Reason?: string;
|
@@ -50,8 +52,10 @@ export interface TPathDescription {
|
|
50
52
|
// for table
|
51
53
|
Table?: TTableDescription;
|
52
54
|
TableStats?: TTableStats;
|
53
|
-
TabletMetrics?:
|
54
|
-
TablePartitions?:
|
55
|
+
TabletMetrics?: TMetrics;
|
56
|
+
TablePartitions?: TTablePartition[];
|
57
|
+
TablePartitionStats?: TTableStats[];
|
58
|
+
TablePartitionMetrics?: TMetrics[];
|
55
59
|
|
56
60
|
ColumnStoreDescription?: TColumnStoreDescription;
|
57
61
|
ColumnTableDescription?: TColumnTableDescription;
|
@@ -254,7 +258,7 @@ export interface TFollowerGroup {
|
|
254
258
|
AllowedDataCenters?: string[];
|
255
259
|
}
|
256
260
|
|
257
|
-
interface TTableStats {
|
261
|
+
export interface TTableStats {
|
258
262
|
/** uint64 */
|
259
263
|
DataSize?: string;
|
260
264
|
/** uint64 */
|
@@ -791,3 +795,12 @@ interface TColumnTableSchemaPreset {
|
|
791
795
|
Name?: string;
|
792
796
|
Schema?: TColumnTableSchema;
|
793
797
|
}
|
798
|
+
|
799
|
+
interface TTablePartition {
|
800
|
+
/** bytes */
|
801
|
+
EndOfRangeKeyPrefix?: unknown;
|
802
|
+
IsPoint?: boolean;
|
803
|
+
IsInclusive?: boolean;
|
804
|
+
/** uint64 */
|
805
|
+
DatashardId?: string;
|
806
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import type {ApiRequestAction} from '../../store/utils';
|
2
|
+
import {FETCH_HEATMAP, setHeatmapOptions} from '../../store/reducers/heatmap';
|
3
|
+
|
4
|
+
import type {IResponseError} from '../api/error';
|
5
|
+
import type {TTabletStateInfo} from '../api/tablet';
|
6
|
+
import type {TTableStats} from '../api/schema';
|
7
|
+
import type {TMetrics} from '../api/tenant';
|
8
|
+
|
9
|
+
export interface IHeatmapTabletData extends TTabletStateInfo {
|
10
|
+
metrics?: TTableStats & TMetrics;
|
11
|
+
}
|
12
|
+
|
13
|
+
export type IHeatmapMetricValue = keyof TTableStats | keyof TMetrics;
|
14
|
+
|
15
|
+
interface IHeatmapMetric {
|
16
|
+
value: IHeatmapMetricValue;
|
17
|
+
content: IHeatmapMetricValue;
|
18
|
+
}
|
19
|
+
|
20
|
+
export interface IHeatmapState {
|
21
|
+
loading: boolean;
|
22
|
+
wasLoaded: boolean;
|
23
|
+
currentMetric?: IHeatmapMetricValue;
|
24
|
+
sort: boolean;
|
25
|
+
heatmap: boolean;
|
26
|
+
data?: IHeatmapTabletData[];
|
27
|
+
metrics?: IHeatmapMetric[];
|
28
|
+
error?: IResponseError;
|
29
|
+
}
|
30
|
+
|
31
|
+
export interface IHeatmapApiRequestParams {
|
32
|
+
nodes?: string[];
|
33
|
+
path: string;
|
34
|
+
}
|
35
|
+
|
36
|
+
interface IHeatmapHandledResponse {
|
37
|
+
data: IHeatmapTabletData[];
|
38
|
+
metrics?: IHeatmapMetric[];
|
39
|
+
}
|
40
|
+
|
41
|
+
type IHeatmapApiRequestAction = ApiRequestAction<
|
42
|
+
typeof FETCH_HEATMAP,
|
43
|
+
IHeatmapHandledResponse,
|
44
|
+
IResponseError
|
45
|
+
>;
|
46
|
+
|
47
|
+
export type IHeatmapAction = IHeatmapApiRequestAction | ReturnType<typeof setHeatmapOptions>;
|
48
|
+
|
49
|
+
export interface IHeatmapRootStateSlice {
|
50
|
+
heatmap: IHeatmapState;
|
51
|
+
}
|
package/dist/utils/constants.ts
CHANGED
@@ -39,39 +39,6 @@ export const TABLET_COLORS = {
|
|
39
39
|
Active: 'lightgreen',
|
40
40
|
};
|
41
41
|
|
42
|
-
export const TABLET_COLOR_TO_STATES = {
|
43
|
-
Red: [
|
44
|
-
'Created',
|
45
|
-
'ResolveStateStorage',
|
46
|
-
'Candidate',
|
47
|
-
'BlockBlobStorage',
|
48
|
-
'WriteZeroEntry',
|
49
|
-
'Restored',
|
50
|
-
'Discover',
|
51
|
-
'Lock',
|
52
|
-
'Dead',
|
53
|
-
],
|
54
|
-
Orange: ['RebuildGraph'],
|
55
|
-
Yellow: ['ResolveMaster', 'ResolveLeader'],
|
56
|
-
Green: ['Deleted', 'Active'],
|
57
|
-
};
|
58
|
-
|
59
|
-
export const TABLETS_STATES = [
|
60
|
-
'Active',
|
61
|
-
'Deleted',
|
62
|
-
'Created',
|
63
|
-
'ResolveStateStorage',
|
64
|
-
'Candidate',
|
65
|
-
'BlockBlobStorage',
|
66
|
-
'WriteZeroEntry',
|
67
|
-
'Restored',
|
68
|
-
'Discover',
|
69
|
-
'Lock',
|
70
|
-
'Dead',
|
71
|
-
'RebuildGraph',
|
72
|
-
'ResolveLeader',
|
73
|
-
];
|
74
|
-
|
75
42
|
export const TxAllocator = 'TxAllocator';
|
76
43
|
|
77
44
|
export const TABLET_SYMBOLS = {
|
@@ -123,13 +90,10 @@ export type IProblemFilterValues = typeof ALL | typeof PROBLEMS;
|
|
123
90
|
export const THEME_KEY = 'theme';
|
124
91
|
export const INVERTED_DISKS_KEY = 'invertedDisks';
|
125
92
|
export const SAVED_QUERIES_KEY = 'saved_queries';
|
93
|
+
export const ASIDE_HEADER_COMPACT_KEY = 'asideHeaderCompact';
|
126
94
|
export const QUERIES_HISTORY_KEY = 'queries_history';
|
127
95
|
export const DATA_QA_TUNE_COLUMNS_POPUP = 'tune-columns-popup';
|
128
96
|
|
129
|
-
export const defaultUserSettings = {
|
130
|
-
[THEME_KEY]: 'light',
|
131
|
-
[INVERTED_DISKS_KEY]: false,
|
132
|
-
};
|
133
97
|
export const DEFAULT_SIZE_RESULT_PANE_KEY = 'default-size-result-pane';
|
134
98
|
export const DEFAULT_SIZE_TENANT_SUMMARY_KEY = 'default-size-tenant-summary-pane';
|
135
99
|
export const DEFAULT_SIZE_TENANT_KEY = 'default-size-tenant-pane';
|
@@ -6,7 +6,7 @@ import Icon from '../components/Icon/Icon';
|
|
6
6
|
import EntityStatus from '../components/EntityStatus/EntityStatus';
|
7
7
|
import PoolsGraph from '../components/PoolsGraph/PoolsGraph';
|
8
8
|
import ProgressViewer from '../components/ProgressViewer/ProgressViewer';
|
9
|
-
import TabletsStatistic from '../components/TabletsStatistic
|
9
|
+
import {TabletsStatistic} from '../components/TabletsStatistic';
|
10
10
|
|
11
11
|
import {getDefaultNodePath} from '../containers/Node/NodePages';
|
12
12
|
import {formatBytes} from './index';
|
@@ -41,7 +41,12 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
|
|
41
41
|
className={b('host-name')}
|
42
42
|
/>
|
43
43
|
{nodeRef && (
|
44
|
-
<Button
|
44
|
+
<Button
|
45
|
+
size="s"
|
46
|
+
href={nodeRef}
|
47
|
+
className={b('external-button')}
|
48
|
+
target="_blank"
|
49
|
+
>
|
45
50
|
<Icon name="external" />
|
46
51
|
</Button>
|
47
52
|
)}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import {EFlag} from '../types/api/enums';
|
2
|
+
import {ETabletState} from '../types/api/tablet';
|
3
|
+
|
4
|
+
const tabletStateToColorState: Record<ETabletState, EFlag> = {
|
5
|
+
[ETabletState.Active]: EFlag.Green,
|
6
|
+
[ETabletState.Deleted]: EFlag.Green,
|
7
|
+
|
8
|
+
[ETabletState.RebuildGraph]: EFlag.Orange,
|
9
|
+
[ETabletState.ResolveLeader]: EFlag.Yellow,
|
10
|
+
|
11
|
+
[ETabletState.Created]: EFlag.Red,
|
12
|
+
[ETabletState.ResolveStateStorage]: EFlag.Red,
|
13
|
+
[ETabletState.Candidate]: EFlag.Red,
|
14
|
+
[ETabletState.BlockBlobStorage]: EFlag.Red,
|
15
|
+
[ETabletState.WriteZeroEntry]: EFlag.Red,
|
16
|
+
[ETabletState.Restored]: EFlag.Red,
|
17
|
+
[ETabletState.Discover]: EFlag.Red,
|
18
|
+
[ETabletState.Lock]: EFlag.Red,
|
19
|
+
[ETabletState.Dead]: EFlag.Red,
|
20
|
+
[ETabletState.Stopped]: EFlag.Red,
|
21
|
+
};
|
22
|
+
|
23
|
+
export const tabletStates = Object.keys(ETabletState);
|
24
|
+
|
25
|
+
export const tabletColorToTabletState = Object.entries(tabletStateToColorState).reduce(
|
26
|
+
(acc, [state, color]) => {
|
27
|
+
if (acc[color]) {
|
28
|
+
acc[color].push(state as ETabletState);
|
29
|
+
} else {
|
30
|
+
acc[color] = [state as ETabletState];
|
31
|
+
}
|
32
|
+
|
33
|
+
return acc;
|
34
|
+
},
|
35
|
+
{} as Record<EFlag, ETabletState[]>,
|
36
|
+
);
|
37
|
+
|
38
|
+
// Tablet State in different versions or in different endpoint
|
39
|
+
// could be represented as ETabletState of EFlag
|
40
|
+
export const mapTabletStateToColorState = (state?: ETabletState | EFlag): EFlag => {
|
41
|
+
if (!state) {
|
42
|
+
return EFlag.Grey;
|
43
|
+
}
|
44
|
+
|
45
|
+
const isEFlag = (value: ETabletState | EFlag): value is EFlag =>
|
46
|
+
Object.values(EFlag).includes(value as EFlag);
|
47
|
+
|
48
|
+
if (isEFlag(state)) {
|
49
|
+
return state;
|
50
|
+
}
|
51
|
+
|
52
|
+
return tabletStateToColorState[state];
|
53
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.2",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"dependencies": {
|
12
12
|
"@gravity-ui/axios-wrapper": "^1.3.0",
|
13
13
|
"@gravity-ui/i18n": "^1.0.0",
|
14
|
+
"@gravity-ui/navigation": "^0.3.1",
|
14
15
|
"@yandex-cloud/paranoid": "^1.3.0",
|
15
16
|
"@yandex-cloud/react-data-table": "^1.0.2",
|
16
17
|
"axios": "0.19.2",
|
@@ -1,147 +0,0 @@
|
|
1
|
-
.nv-aside-header {
|
2
|
-
$class: &;
|
3
|
-
--nv-aside-header-min-width: 56px;
|
4
|
-
position: relative;
|
5
|
-
|
6
|
-
width: 100%;
|
7
|
-
height: 100%;
|
8
|
-
|
9
|
-
background-color: var(--yc-color-base-background);
|
10
|
-
|
11
|
-
&__aside {
|
12
|
-
position: sticky;
|
13
|
-
z-index: 100;
|
14
|
-
top: 0;
|
15
|
-
left: 0;
|
16
|
-
|
17
|
-
display: flex;
|
18
|
-
flex-direction: column;
|
19
|
-
|
20
|
-
width: inherit;
|
21
|
-
height: 100vh;
|
22
|
-
|
23
|
-
border-right: 1px solid var(--yc-color-line-generic);
|
24
|
-
background-color: var(--yc-color-base-background);
|
25
|
-
|
26
|
-
&-popup-anchor {
|
27
|
-
position: absolute;
|
28
|
-
z-index: 1;
|
29
|
-
top: 0;
|
30
|
-
right: 0;
|
31
|
-
bottom: 0;
|
32
|
-
left: 0;
|
33
|
-
}
|
34
|
-
|
35
|
-
&-content {
|
36
|
-
position: relative;
|
37
|
-
z-index: 2;
|
38
|
-
|
39
|
-
display: flex;
|
40
|
-
overflow-x: hidden;
|
41
|
-
flex-direction: column;
|
42
|
-
|
43
|
-
width: inherit;
|
44
|
-
height: inherit;
|
45
|
-
|
46
|
-
user-select: none;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
&__footer {
|
51
|
-
display: flex;
|
52
|
-
flex-direction: column;
|
53
|
-
flex-shrink: 0;
|
54
|
-
|
55
|
-
width: 100%;
|
56
|
-
margin: 8px 0;
|
57
|
-
|
58
|
-
&::before {
|
59
|
-
position: relative;
|
60
|
-
top: -8px;
|
61
|
-
|
62
|
-
content: '';
|
63
|
-
|
64
|
-
border-top: 1px solid var(--yc-color-line-generic);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
&__drawer {
|
69
|
-
position: fixed;
|
70
|
-
z-index: 98;
|
71
|
-
top: 0;
|
72
|
-
right: 0;
|
73
|
-
bottom: 0;
|
74
|
-
left: 0;
|
75
|
-
|
76
|
-
overflow: auto;
|
77
|
-
}
|
78
|
-
|
79
|
-
&__panel {
|
80
|
-
height: 100%;
|
81
|
-
}
|
82
|
-
|
83
|
-
&__content-container {
|
84
|
-
height: 100%;
|
85
|
-
}
|
86
|
-
|
87
|
-
&__pane-container {
|
88
|
-
display: flex;
|
89
|
-
overflow: visible;
|
90
|
-
flex: 1 1 0;
|
91
|
-
flex-direction: row;
|
92
|
-
|
93
|
-
user-select: text;
|
94
|
-
|
95
|
-
outline: none;
|
96
|
-
}
|
97
|
-
|
98
|
-
&__content {
|
99
|
-
z-index: 90;
|
100
|
-
|
101
|
-
width: calc(100% - var(--nv-aside-header-size));
|
102
|
-
}
|
103
|
-
|
104
|
-
&__all-services-button {
|
105
|
-
&_top {
|
106
|
-
box-sizing: border-box;
|
107
|
-
|
108
|
-
border-bottom: 1px solid var(--yc-color-line-generic);
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
|
-
&__collapse-button {
|
113
|
-
position: absolute;
|
114
|
-
z-index: 3;
|
115
|
-
right: 14px;
|
116
|
-
bottom: 14px;
|
117
|
-
|
118
|
-
width: 28px;
|
119
|
-
height: 28px;
|
120
|
-
|
121
|
-
transition: none;
|
122
|
-
&_compact {
|
123
|
-
right: -29px;
|
124
|
-
|
125
|
-
border: 1px solid var(--yc-color-line-generic);
|
126
|
-
border-left: none;
|
127
|
-
border-radius: 0 4px 4px 0;
|
128
|
-
background-color: inherit;
|
129
|
-
|
130
|
-
&.yc-button::before {
|
131
|
-
border-radius: 0 3px 3px 0;
|
132
|
-
}
|
133
|
-
}
|
134
|
-
|
135
|
-
&:not(#{&}_compact) {
|
136
|
-
transform: rotate(180deg);
|
137
|
-
}
|
138
|
-
|
139
|
-
&:hover {
|
140
|
-
color: var(--yc-color-text-misc);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
&__collapse-icon {
|
145
|
-
color: var(--yc-color-text-misc);
|
146
|
-
}
|
147
|
-
}
|