ydb-embedded-ui 4.5.2 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +33 -0
- package/dist/assets/icons/versions.svg +3 -0
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +7 -2
- package/dist/components/Tablet/Tablet.tsx +17 -3
- package/dist/components/TabletsStatistic/TabletsStatistic.tsx +23 -16
- package/dist/containers/App/Content.js +8 -4
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +4 -50
- package/dist/containers/Cluster/Cluster.scss +7 -48
- package/dist/containers/Cluster/Cluster.tsx +129 -20
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +34 -17
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +58 -92
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.scss +48 -0
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.tsx +34 -0
- package/dist/containers/Cluster/utils.tsx +45 -0
- package/dist/containers/Header/Header.scss +4 -19
- package/dist/containers/Header/Header.tsx +72 -46
- package/dist/containers/Header/breadcrumbs.ts +146 -0
- package/dist/containers/Node/Node.tsx +25 -29
- package/dist/containers/Node/NodePages.ts +10 -6
- package/dist/containers/Nodes/Nodes.tsx +0 -16
- package/dist/containers/Nodes/getNodesColumns.tsx +1 -1
- package/dist/containers/Storage/Storage.js +1 -11
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +11 -3
- package/dist/containers/Tablet/Tablet.tsx +40 -4
- package/dist/containers/Tablet/TabletInfo/TabletInfo.tsx +2 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +15 -2
- package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +7 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +4 -4
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +5 -3
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.tsx +4 -6
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +56 -53
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +11 -13
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +1 -1
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +2 -2
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +7 -3
- package/dist/containers/Tenant/Preview/Preview.js +1 -1
- package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.js → Query/ExecuteResult/ExecuteResult.js} +3 -5
- package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.scss → Query/ExecuteResult/ExecuteResult.scss} +1 -1
- package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.js → Query/ExplainResult/ExplainResult.js} +3 -5
- package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.scss → Query/ExplainResult/ExplainResult.scss} +1 -1
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +20 -0
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.tsx +60 -0
- package/dist/containers/Tenant/Query/Query.scss +16 -0
- package/dist/containers/Tenant/Query/Query.tsx +73 -0
- package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.js +43 -100
- package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.scss +7 -23
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/OldQueryEditorControls.tsx +10 -3
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.scss +1 -4
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.tsx +8 -1
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/shared.ts +1 -6
- package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.tsx +59 -0
- package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.js +5 -5
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +55 -0
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.tsx +150 -0
- package/dist/containers/Tenant/Query/i18n/en.json +12 -0
- package/dist/containers/Tenant/Query/i18n/ru.json +12 -0
- package/dist/containers/Tenant/Query/utils/getPreparedResult.ts +30 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +1 -1
- package/dist/containers/Tenant/Tenant.tsx +4 -25
- package/dist/containers/Tenant/TenantPages.tsx +8 -2
- package/dist/containers/Tenant/utils/constants.ts +10 -0
- package/dist/containers/Tenant/utils/schemaActions.ts +8 -3
- package/dist/containers/Tenants/Tenants.js +39 -37
- package/dist/containers/Tenants/Tenants.scss +2 -4
- package/dist/containers/UserSettings/i18n/en.json +2 -2
- package/dist/containers/UserSettings/i18n/ru.json +2 -2
- package/dist/containers/UserSettings/settings.ts +4 -4
- package/dist/containers/Versions/Versions.scss +0 -4
- package/dist/containers/Versions/Versions.tsx +74 -66
- package/dist/routes.ts +8 -6
- package/dist/services/api.ts +15 -7
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +4 -0
- package/dist/store/reducers/executeQuery.ts +1 -1
- package/dist/store/reducers/header/header.ts +31 -0
- package/dist/store/reducers/header/types.ts +54 -0
- package/dist/store/reducers/index.ts +4 -2
- package/dist/store/reducers/node/types.ts +2 -0
- package/dist/store/reducers/overview/overview.ts +109 -0
- package/dist/store/reducers/overview/types.ts +24 -0
- package/dist/store/reducers/{schema.ts → schema/schema.ts} +24 -50
- package/dist/{types/store/schema.ts → store/reducers/schema/types.ts} +16 -15
- package/dist/store/reducers/settings/settings.ts +5 -3
- package/dist/store/reducers/tablet.ts +18 -1
- package/dist/store/reducers/tenant/constants.ts +6 -0
- package/dist/store/reducers/tenant/tenant.ts +21 -2
- package/dist/store/reducers/tenant/types.ts +9 -2
- package/dist/store/reducers/topic.ts +1 -1
- package/dist/store/state-url-mapping.js +4 -1
- package/dist/types/api/query.ts +78 -44
- package/dist/types/store/explainQuery.ts +2 -2
- package/dist/types/store/query.ts +9 -2
- package/dist/types/store/tablet.ts +7 -4
- package/dist/utils/constants.ts +5 -1
- package/dist/utils/nodes.ts +1 -1
- package/dist/utils/query.ts +3 -3
- package/package.json +2 -1
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +0 -85
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +0 -95
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +0 -161
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +0 -93
- package/dist/containers/Tenant/QueryEditor/i18n/en.json +0 -3
- package/dist/containers/Tenant/QueryEditor/i18n/ru.json +0 -3
- package/dist/store/reducers/header.ts +0 -26
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.tsx +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/models.ts +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.tsx +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/i18n/index.ts +0 -0
@@ -1,161 +0,0 @@
|
|
1
|
-
import React, {useRef, useState} from 'react';
|
2
|
-
import _ from 'lodash';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
import {Dialog, Popup, Button} from '@gravity-ui/uikit';
|
5
|
-
|
6
|
-
import TruncatedQuery from '../../../../components/TruncatedQuery/TruncatedQuery';
|
7
|
-
import {Icon} from '../../../../components/Icon';
|
8
|
-
import './SavedQueries.scss';
|
9
|
-
import {setQueryNameToEdit} from '../../../../store/reducers/saveQuery';
|
10
|
-
import {useDispatch} from 'react-redux';
|
11
|
-
|
12
|
-
const b = cn('saved-queries');
|
13
|
-
|
14
|
-
const MAX_QUERY_HEIGHT = 3;
|
15
|
-
|
16
|
-
function SavedQueries({savedQueries, changeUserInput, onDeleteQuery}) {
|
17
|
-
const [isSavedQueriesVisible, setIsSavedQueriesVisible] = useState(false);
|
18
|
-
const [isDeleteDialogVisible, setIsDeleteDialogVisible] = useState(false);
|
19
|
-
const [queryNameToDelete, setQueryNameToDelete] = useState(null);
|
20
|
-
|
21
|
-
const [popupForceRender, setPopupForceRender] = useState(null);
|
22
|
-
|
23
|
-
const dispatch = useDispatch();
|
24
|
-
const anchor = useRef(null);
|
25
|
-
|
26
|
-
const onShowSavedQueriesClick = () => {
|
27
|
-
setIsSavedQueriesVisible(true);
|
28
|
-
};
|
29
|
-
|
30
|
-
const onCloseSavedQueries = () => {
|
31
|
-
setIsSavedQueriesVisible(false);
|
32
|
-
};
|
33
|
-
|
34
|
-
const onSavedQueryClick = (queryText, queryName) => {
|
35
|
-
return () => {
|
36
|
-
changeUserInput({input: queryText});
|
37
|
-
dispatch(setQueryNameToEdit(queryName));
|
38
|
-
setIsSavedQueriesVisible(false);
|
39
|
-
};
|
40
|
-
};
|
41
|
-
|
42
|
-
const onDeleteQueryClick = (queryName) => {
|
43
|
-
return (event) => {
|
44
|
-
event.stopPropagation();
|
45
|
-
setIsDeleteDialogVisible(true);
|
46
|
-
setQueryNameToDelete(queryName);
|
47
|
-
};
|
48
|
-
};
|
49
|
-
|
50
|
-
const closeDeleteDialog = () => {
|
51
|
-
setIsDeleteDialogVisible(false);
|
52
|
-
setQueryNameToDelete(null);
|
53
|
-
};
|
54
|
-
|
55
|
-
const onClickCancelDelete = (e) => {
|
56
|
-
e.stopPropagation();
|
57
|
-
closeDeleteDialog();
|
58
|
-
};
|
59
|
-
|
60
|
-
const onConfirmDeleteClick = (e) => {
|
61
|
-
e.stopPropagation();
|
62
|
-
onDeleteQuery(queryNameToDelete);
|
63
|
-
closeDeleteDialog();
|
64
|
-
setPopupForceRender(queryNameToDelete);
|
65
|
-
};
|
66
|
-
|
67
|
-
const renderDialog = () => {
|
68
|
-
return (
|
69
|
-
<Dialog
|
70
|
-
open={isDeleteDialogVisible}
|
71
|
-
hasCloseButton={false}
|
72
|
-
size="s"
|
73
|
-
onClose={onClickCancelDelete}
|
74
|
-
onEnterKeyDown={onConfirmDeleteClick}
|
75
|
-
>
|
76
|
-
<Dialog.Header caption="Delete query" />
|
77
|
-
<Dialog.Body className={b('dialog-body')}>
|
78
|
-
Are you sure you want to delete query
|
79
|
-
<span className={b('dialog-query-name')}>{` ${queryNameToDelete}?`}</span>
|
80
|
-
</Dialog.Body>
|
81
|
-
<Dialog.Footer
|
82
|
-
textButtonApply="Delete"
|
83
|
-
textButtonCancel="Cancel"
|
84
|
-
onClickButtonCancel={onClickCancelDelete}
|
85
|
-
onClickButtonApply={onConfirmDeleteClick}
|
86
|
-
/>
|
87
|
-
</Dialog>
|
88
|
-
);
|
89
|
-
};
|
90
|
-
const renderSavedQueries = () => {
|
91
|
-
return (
|
92
|
-
<Popup
|
93
|
-
key={popupForceRender}
|
94
|
-
className={b('popup-wrapper')}
|
95
|
-
anchorRef={anchor}
|
96
|
-
open={isSavedQueriesVisible}
|
97
|
-
placement={['bottom-end']}
|
98
|
-
onClose={onCloseSavedQueries}
|
99
|
-
>
|
100
|
-
<div className={b()}>
|
101
|
-
<div className={b('saved-queries-row', {header: true})}>
|
102
|
-
<div className={b('query-name')}>Name</div>
|
103
|
-
<div className={b('query-body', {header: true})}>
|
104
|
-
<span>QueryText</span>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
<div>
|
108
|
-
{_.sortBy(savedQueries, (query) => query.name.toLowerCase()).map(
|
109
|
-
(query) => {
|
110
|
-
return (
|
111
|
-
<div
|
112
|
-
className={b('saved-queries-row')}
|
113
|
-
onClick={onSavedQueryClick(query.body, query.name)}
|
114
|
-
key={query.name}
|
115
|
-
>
|
116
|
-
<div className={b('query-name')}>{query.name}</div>
|
117
|
-
<div className={b('query-body')}>
|
118
|
-
<TruncatedQuery
|
119
|
-
value={query.body}
|
120
|
-
maxQueryHeight={MAX_QUERY_HEIGHT}
|
121
|
-
/>
|
122
|
-
</div>
|
123
|
-
<div className={b('query-controls')}>
|
124
|
-
<Icon
|
125
|
-
name="pencil"
|
126
|
-
viewBox="0 0 24 24"
|
127
|
-
height={14}
|
128
|
-
width={14}
|
129
|
-
className={b('control-button')}
|
130
|
-
/>
|
131
|
-
<Icon
|
132
|
-
name="trash"
|
133
|
-
viewBox="0 0 24 24"
|
134
|
-
height={14}
|
135
|
-
width={14}
|
136
|
-
className={b('control-button')}
|
137
|
-
onClick={onDeleteQueryClick(query.name)}
|
138
|
-
/>
|
139
|
-
</div>
|
140
|
-
</div>
|
141
|
-
);
|
142
|
-
},
|
143
|
-
)}
|
144
|
-
</div>
|
145
|
-
</div>
|
146
|
-
</Popup>
|
147
|
-
);
|
148
|
-
};
|
149
|
-
|
150
|
-
return (
|
151
|
-
<React.Fragment>
|
152
|
-
<Button ref={anchor} onClick={onShowSavedQueriesClick}>
|
153
|
-
Saved queries
|
154
|
-
</Button>
|
155
|
-
{isSavedQueriesVisible && renderSavedQueries()}
|
156
|
-
{isDeleteDialogVisible && queryNameToDelete && renderDialog()}
|
157
|
-
</React.Fragment>
|
158
|
-
);
|
159
|
-
}
|
160
|
-
|
161
|
-
export default SavedQueries;
|
@@ -1,93 +0,0 @@
|
|
1
|
-
$popup-width: 700px;
|
2
|
-
|
3
|
-
.saved-queries {
|
4
|
-
$block: &;
|
5
|
-
padding: 12px 16px;
|
6
|
-
&__popup-wrapper {
|
7
|
-
overflow: hidden;
|
8
|
-
|
9
|
-
width: $popup-width;
|
10
|
-
max-width: $popup-width !important;
|
11
|
-
|
12
|
-
border-radius: 4px;
|
13
|
-
:nth-child(2) {
|
14
|
-
overflow-y: auto;
|
15
|
-
|
16
|
-
max-height: 50vh;
|
17
|
-
}
|
18
|
-
|
19
|
-
&::before {
|
20
|
-
width: $popup-width;
|
21
|
-
|
22
|
-
border-radius: 4px;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
&__saved-queries-row {
|
26
|
-
display: flex;
|
27
|
-
align-items: center;
|
28
|
-
|
29
|
-
padding: 8px 5px;
|
30
|
-
|
31
|
-
border-bottom: 1px solid var(--yc-color-line-generic);
|
32
|
-
&:hover {
|
33
|
-
cursor: pointer;
|
34
|
-
|
35
|
-
color: var(--yc-color-text-link-hover);
|
36
|
-
background: var(--yc-color-base-simple-hover);
|
37
|
-
#{$block}__query-controls {
|
38
|
-
display: flex;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
&_header {
|
42
|
-
font-weight: 500;
|
43
|
-
&:hover {
|
44
|
-
cursor: auto;
|
45
|
-
|
46
|
-
color: var(--yc-color-text-primary);
|
47
|
-
background: var(--yc-color-base-background);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}
|
51
|
-
&__query-name {
|
52
|
-
overflow: hidden;
|
53
|
-
flex: 0 0 90px;
|
54
|
-
|
55
|
-
max-width: 90px;
|
56
|
-
margin-right: 8px;
|
57
|
-
|
58
|
-
font-weight: 500;
|
59
|
-
white-space: pre-wrap;
|
60
|
-
text-overflow: ellipsis;
|
61
|
-
}
|
62
|
-
&__query-body {
|
63
|
-
overflow: hidden;
|
64
|
-
flex-grow: 1;
|
65
|
-
|
66
|
-
max-width: 75%;
|
67
|
-
|
68
|
-
white-space: pre;
|
69
|
-
text-overflow: ellipsis;
|
70
|
-
&_header {
|
71
|
-
display: flex;
|
72
|
-
justify-content: center;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
&__query-controls {
|
76
|
-
display: none;
|
77
|
-
}
|
78
|
-
&__control-button {
|
79
|
-
display: flex;
|
80
|
-
justify-content: center;
|
81
|
-
align-items: center;
|
82
|
-
|
83
|
-
width: 24px;
|
84
|
-
|
85
|
-
color: var(--yc-color-text-hint);
|
86
|
-
&:hover {
|
87
|
-
color: var(--yc-color-text-secondary);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
&__dialog-query-name {
|
91
|
-
font-weight: 500;
|
92
|
-
}
|
93
|
-
}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import {Reducer} from 'redux';
|
2
|
-
|
3
|
-
const SET_HEADER = 'SET_HEADER';
|
4
|
-
|
5
|
-
type IHeaderAction = ReturnType<typeof setHeader>;
|
6
|
-
export type HeaderItemType = {text: string; link?: string};
|
7
|
-
|
8
|
-
const initialState: HeaderItemType[] = [];
|
9
|
-
|
10
|
-
const header: Reducer<HeaderItemType[], IHeaderAction> = function (state = initialState, action) {
|
11
|
-
switch (action.type) {
|
12
|
-
case SET_HEADER:
|
13
|
-
return action.data;
|
14
|
-
default:
|
15
|
-
return state;
|
16
|
-
}
|
17
|
-
};
|
18
|
-
|
19
|
-
export function setHeader(headerItems: HeaderItemType[]) {
|
20
|
-
return {
|
21
|
-
type: SET_HEADER,
|
22
|
-
data: headerItems,
|
23
|
-
} as const;
|
24
|
-
}
|
25
|
-
|
26
|
-
export default header;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|