ydb-embedded-ui 4.6.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/assets/icons/versions.svg +3 -0
  3. package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +6 -1
  4. package/dist/components/Tablet/Tablet.tsx +17 -3
  5. package/dist/components/TabletsStatistic/TabletsStatistic.tsx +23 -16
  6. package/dist/containers/App/Content.js +5 -2
  7. package/dist/containers/AsideNavigation/AsideNavigation.tsx +50 -18
  8. package/dist/containers/Cluster/Cluster.tsx +6 -13
  9. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +3 -3
  10. package/dist/containers/Cluster/{utils.ts → utils.tsx} +11 -0
  11. package/dist/containers/Header/Header.scss +9 -0
  12. package/dist/containers/Header/Header.tsx +70 -14
  13. package/dist/containers/Header/breadcrumbs.ts +146 -0
  14. package/dist/containers/Node/Node.tsx +21 -27
  15. package/dist/containers/Node/NodePages.ts +10 -6
  16. package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +11 -3
  17. package/dist/containers/Tablet/Tablet.tsx +35 -27
  18. package/dist/containers/Tablet/TabletInfo/TabletInfo.tsx +2 -2
  19. package/dist/containers/TabletsFilters/TabletsFilters.js +13 -15
  20. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +1 -1
  21. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +5 -1
  22. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +4 -14
  23. package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +5 -3
  24. package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.tsx +1 -1
  25. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -1
  26. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +9 -16
  27. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +11 -11
  28. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +7 -3
  29. package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.js → Query/ExecuteResult/ExecuteResult.js} +3 -5
  30. package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.scss → Query/ExecuteResult/ExecuteResult.scss} +1 -1
  31. package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.js → Query/ExplainResult/ExplainResult.js} +3 -5
  32. package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.scss → Query/ExplainResult/ExplainResult.scss} +1 -1
  33. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +20 -0
  34. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.tsx +60 -0
  35. package/dist/containers/Tenant/Query/Query.scss +16 -0
  36. package/dist/containers/Tenant/Query/Query.tsx +73 -0
  37. package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.js +39 -88
  38. package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.scss +7 -23
  39. package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.scss +1 -4
  40. package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.tsx +59 -0
  41. package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.js +5 -5
  42. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +55 -0
  43. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.tsx +150 -0
  44. package/dist/containers/Tenant/Query/i18n/en.json +12 -0
  45. package/dist/containers/Tenant/Query/i18n/ru.json +12 -0
  46. package/dist/containers/Tenant/Query/utils/getPreparedResult.ts +30 -0
  47. package/dist/containers/Tenant/Tenant.scss +0 -8
  48. package/dist/containers/Tenant/Tenant.tsx +24 -46
  49. package/dist/containers/Tenant/TenantPages.tsx +7 -16
  50. package/dist/containers/Tenant/utils/constants.ts +10 -0
  51. package/dist/containers/Tenant/utils/schemaActions.ts +9 -4
  52. package/dist/containers/Tenants/Tenants.js +26 -13
  53. package/dist/routes.ts +21 -7
  54. package/dist/services/api.ts +9 -5
  55. package/dist/store/reducers/executeQuery.ts +18 -4
  56. package/dist/store/reducers/header/header.ts +31 -0
  57. package/dist/store/reducers/header/types.ts +54 -0
  58. package/dist/store/reducers/index.ts +1 -1
  59. package/dist/store/reducers/node/types.ts +2 -0
  60. package/dist/store/reducers/settings/settings.ts +8 -3
  61. package/dist/store/reducers/tablet.ts +18 -1
  62. package/dist/store/reducers/tenant/constants.ts +9 -1
  63. package/dist/store/reducers/tenant/tenant.ts +23 -4
  64. package/dist/store/reducers/tenant/types.ts +9 -5
  65. package/dist/store/reducers/topic.ts +1 -1
  66. package/dist/store/state-url-mapping.js +6 -3
  67. package/dist/types/store/executeQuery.ts +4 -1
  68. package/dist/types/store/query.ts +5 -0
  69. package/dist/types/store/tablet.ts +7 -4
  70. package/dist/utils/constants.ts +5 -1
  71. package/package.json +2 -1
  72. package/dist/containers/Tenant/ObjectGeneralTabs/ObjectGeneralTabs.scss +0 -9
  73. package/dist/containers/Tenant/ObjectGeneralTabs/ObjectGeneralTabs.tsx +0 -68
  74. package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +0 -85
  75. package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +0 -95
  76. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +0 -161
  77. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +0 -93
  78. package/dist/containers/Tenant/QueryEditor/i18n/en.json +0 -3
  79. package/dist/containers/Tenant/QueryEditor/i18n/ru.json +0 -3
  80. package/dist/store/reducers/header.ts +0 -26
  81. /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.scss +0 -0
  82. /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.tsx +0 -0
  83. /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/models.ts +0 -0
  84. /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.scss +0 -0
  85. /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.tsx +0 -0
  86. /package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/OldQueryEditorControls.tsx +0 -0
  87. /package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.tsx +0 -0
  88. /package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/shared.ts +0 -0
  89. /package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.scss +0 -0
  90. /package/dist/containers/Tenant/{QueryEditor → Query}/i18n/index.ts +0 -0
@@ -1,85 +0,0 @@
1
- $popup-width: 700px;
2
-
3
- .kv-queries-history {
4
- $block: &;
5
- padding: 12px 16px;
6
-
7
- &__empty {
8
- font-weight: 600;
9
- text-align: center;
10
- }
11
- &__popup-wrapper {
12
- overflow: hidden;
13
-
14
- width: $popup-width;
15
- max-width: $popup-width !important;
16
-
17
- border-radius: 4px;
18
- :nth-child(2) {
19
- overflow-y: auto;
20
-
21
- max-height: 50vh;
22
- }
23
-
24
- &::before {
25
- width: $popup-width;
26
-
27
- border-radius: 4px;
28
- }
29
- }
30
- &__saved-queries-row {
31
- display: flex;
32
- align-items: center;
33
-
34
- padding: 8px 5px;
35
-
36
- border-bottom: 1px solid var(--yc-color-line-generic);
37
- &:hover {
38
- cursor: pointer;
39
-
40
- color: var(--yc-color-text-link-hover);
41
- background: var(--yc-color-base-simple-hover);
42
- #{$block}__query-controls {
43
- display: flex;
44
- }
45
- }
46
- &_header {
47
- font-weight: 600;
48
- &:hover {
49
- cursor: auto;
50
-
51
- color: var(--yc-color-text-primary);
52
- background: var(--yc-color-base-background);
53
- }
54
- }
55
- }
56
- &__query-body {
57
- overflow: hidden;
58
- flex-grow: 1;
59
-
60
- white-space: pre;
61
- text-overflow: ellipsis;
62
- &_header {
63
- display: flex;
64
- justify-content: center;
65
- }
66
- }
67
- &__query-controls {
68
- display: none;
69
- }
70
- &__control-button {
71
- display: flex;
72
- justify-content: center;
73
- align-items: center;
74
-
75
- width: 24px;
76
-
77
- color: var(--yc-color-text-hint);
78
- &:hover {
79
- color: var(--yc-color-text-secondary);
80
- }
81
- }
82
- &__dialog-query-name {
83
- font-weight: 500;
84
- }
85
- }
@@ -1,95 +0,0 @@
1
- import React, {useRef, useState} from 'react';
2
- import cn from 'bem-cn-lite';
3
- import _ from 'lodash';
4
- import {Button, Popup} from '@gravity-ui/uikit';
5
-
6
- import TruncatedQuery from '../../../../components/TruncatedQuery/TruncatedQuery';
7
- import {useTypedSelector} from '../../../../utils/hooks';
8
-
9
- import './QueriesHistory.scss';
10
-
11
- const b = cn('kv-queries-history');
12
-
13
- const MAX_QUERY_HEIGHT = 3;
14
-
15
- interface QueriesHistoryProps {
16
- changeUserInput: (value: {input: string}) => void;
17
- }
18
-
19
- function QueriesHistory(props: QueriesHistoryProps) {
20
- const [isHistoryVisible, setIsHistoryVisible] = useState(false);
21
- const history = useTypedSelector((state) => state.executeQuery.history.queries) ?? [];
22
- const anchor = useRef(null);
23
-
24
- const onShowHistoryClick = () => {
25
- setIsHistoryVisible(true);
26
- };
27
-
28
- const onCloseHistory = () => {
29
- setIsHistoryVisible(false);
30
- };
31
-
32
- const onQueryClick = (queryText: string) => {
33
- const {changeUserInput} = props;
34
- return () => {
35
- changeUserInput({input: queryText});
36
- onCloseHistory();
37
- };
38
- };
39
-
40
- const renderSavedQueries = () => {
41
- const reversedHistory = ([] as string[]).concat(history).reverse();
42
- return (
43
- <Popup
44
- className={b('popup-wrapper')}
45
- anchorRef={anchor}
46
- open={isHistoryVisible}
47
- placement={['bottom-end']}
48
- onClose={onCloseHistory}
49
- >
50
- <div className={b()}>
51
- {reversedHistory.length === 0 ? (
52
- <div className={b('empty')}>History is empty</div>
53
- ) : (
54
- <React.Fragment>
55
- <div className={b('saved-queries-row', {header: true})}>
56
- <div className={b('query-body', {header: true})}>
57
- <span>QueryText</span>
58
- </div>
59
- </div>
60
- <div>
61
- {reversedHistory.map((query, index) => {
62
- return (
63
- <div
64
- className={b('saved-queries-row')}
65
- onClick={onQueryClick(query)}
66
- key={index}
67
- >
68
- <div className={b('query-body')}>
69
- <TruncatedQuery
70
- value={query}
71
- maxQueryHeight={MAX_QUERY_HEIGHT}
72
- />
73
- </div>
74
- </div>
75
- );
76
- })}
77
- </div>
78
- </React.Fragment>
79
- )}
80
- </div>
81
- </Popup>
82
- );
83
- };
84
-
85
- return (
86
- <React.Fragment>
87
- <Button ref={anchor} onClick={onShowHistoryClick}>
88
- Query history
89
- </Button>
90
- {isHistoryVisible && renderSavedQueries()}
91
- </React.Fragment>
92
- );
93
- }
94
-
95
- export default QueriesHistory;
@@ -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,3 +0,0 @@
1
- {
2
- "controls.query-mode-selector_type": "Type:"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "controls.query-mode-selector_type": "Тип:"
3
- }
@@ -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;