ydb-embedded-ui 4.5.2 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +1 -1
- package/dist/containers/App/Content.js +3 -2
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +4 -50
- package/dist/containers/Cluster/Cluster.scss +7 -48
- package/dist/containers/Cluster/Cluster.tsx +136 -20
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +34 -17
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +57 -91
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.scss +48 -0
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.tsx +34 -0
- package/dist/containers/Cluster/utils.ts +34 -0
- package/dist/containers/Header/Header.scss +0 -24
- package/dist/containers/Header/Header.tsx +14 -44
- package/dist/containers/Node/Node.tsx +22 -20
- 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/Tablet/Tablet.tsx +28 -0
- package/dist/containers/TabletsFilters/TabletsFilters.js +16 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +3 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +3 -3
- 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/TopShards/TopShards.tsx +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/Preview/Preview.js +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +26 -22
- package/dist/containers/Tenant/QueryEditor/QueryEditorControls/OldQueryEditorControls.tsx +10 -3
- package/dist/containers/Tenant/QueryEditor/QueryEditorControls/QueryEditorControls.tsx +8 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditorControls/shared.ts +1 -6
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +1 -1
- package/dist/containers/Tenant/Tenant.tsx +7 -12
- package/dist/containers/Tenant/utils/schemaActions.ts +1 -1
- package/dist/containers/Tenants/Tenants.js +18 -28
- 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 +0 -7
- package/dist/services/api.ts +6 -2
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +4 -0
- package/dist/store/reducers/index.ts +3 -1
- 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/types/api/query.ts +78 -44
- package/dist/types/store/explainQuery.ts +2 -2
- package/dist/types/store/query.ts +4 -2
- package/dist/utils/constants.ts +3 -1
- package/dist/utils/nodes.ts +1 -1
- package/dist/utils/query.ts +3 -3
- package/package.json +1 -1
@@ -1,85 +1,88 @@
|
|
1
1
|
import {ReactNode, useCallback} from 'react';
|
2
|
-
import {shallowEqual, useDispatch
|
2
|
+
import {shallowEqual, useDispatch} from 'react-redux';
|
3
3
|
|
4
4
|
import {Loader} from '../../../../components/Loader';
|
5
|
-
|
6
|
-
//@ts-ignore
|
7
5
|
import {TableIndexInfo} from '../../../../components/InfoViewer/schemaInfo';
|
8
6
|
import {ResponseError} from '../../../../components/Errors/ResponseError';
|
9
7
|
|
10
|
-
import {TopicInfo} from './TopicInfo';
|
11
|
-
import {ChangefeedInfo} from './ChangefeedInfo';
|
12
|
-
import {TableInfo} from './TableInfo';
|
13
|
-
|
14
8
|
import {EPathType} from '../../../../types/api/schema';
|
9
|
+
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
10
|
+
import {selectSchemaMergedChildrenPaths} from '../../../../store/reducers/schema/schema';
|
11
|
+
import {getTopic} from '../../../../store/reducers/topic';
|
12
|
+
import {
|
13
|
+
getOlapStats,
|
14
|
+
resetLoadingState as resetOlapLoadingState,
|
15
|
+
} from '../../../../store/reducers/olapStats';
|
16
|
+
import {
|
17
|
+
getOverview,
|
18
|
+
getOverviewBatched,
|
19
|
+
setCurrentOverviewPath,
|
20
|
+
setDataWasNotLoaded,
|
21
|
+
} from '../../../../store/reducers/overview/overview';
|
22
|
+
|
15
23
|
import {
|
16
24
|
isEntityWithMergedImplementation,
|
17
25
|
isColumnEntityType,
|
18
26
|
isTableType,
|
19
27
|
isPathTypeWithTopic,
|
20
28
|
} from '../../utils/schema';
|
21
|
-
|
22
|
-
import {
|
23
|
-
|
24
|
-
|
25
|
-
resetLoadingState,
|
26
|
-
selectSchemaMergedChildrenPaths,
|
27
|
-
} from '../../../../store/reducers/schema';
|
28
|
-
import {getTopic} from '../../../../store/reducers/topic';
|
29
|
-
//@ts-ignore
|
30
|
-
import {
|
31
|
-
getOlapStats,
|
32
|
-
resetLoadingState as resetOlapLoadingState,
|
33
|
-
} from '../../../../store/reducers/olapStats';
|
34
|
-
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
29
|
+
|
30
|
+
import {TopicInfo} from './TopicInfo';
|
31
|
+
import {ChangefeedInfo} from './ChangefeedInfo';
|
32
|
+
import {TableInfo} from './TableInfo';
|
35
33
|
|
36
34
|
interface OverviewProps {
|
37
35
|
type?: EPathType;
|
38
|
-
className?: string;
|
39
36
|
tenantName?: string;
|
40
37
|
}
|
41
38
|
|
42
|
-
function Overview({type, tenantName
|
39
|
+
function Overview({type, tenantName}: OverviewProps) {
|
43
40
|
const dispatch = useDispatch();
|
44
41
|
|
42
|
+
const {autorefresh, currentSchemaPath} = useTypedSelector((state) => state.schema);
|
45
43
|
const {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
const loading = schemaLoading || olapStatsLoading;
|
44
|
+
data,
|
45
|
+
additionalData,
|
46
|
+
loading: overviewLoading,
|
47
|
+
wasLoaded: overviewWasLoaded,
|
48
|
+
error: overviewError,
|
49
|
+
} = useTypedSelector((state) => state.overview);
|
50
|
+
const {
|
51
|
+
data: {result: olapStats} = {result: undefined},
|
52
|
+
loading: olapStatsLoading,
|
53
|
+
wasLoaded: olapStatsWasLoaded,
|
54
|
+
} = useTypedSelector((state) => state.olapStats);
|
58
55
|
|
59
56
|
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
|
60
57
|
|
61
|
-
//
|
62
|
-
// When data in store updated on fetch request,
|
63
|
-
// new object is set there, so source children array is updated
|
64
|
-
// This updates selector, the selector returns a new array, and data is fetched again
|
65
|
-
// To prevent it, shallowEqual, which compares array content, was added
|
58
|
+
// shalloEqual prevents rerenders when new schema data is loaded
|
66
59
|
const mergedChildrenPaths = useTypedSelector(
|
67
60
|
(state) => selectSchemaMergedChildrenPaths(state, currentSchemaPath, type),
|
68
61
|
shallowEqual,
|
69
62
|
);
|
70
63
|
|
64
|
+
const entityLoading =
|
65
|
+
(overviewLoading && !overviewWasLoaded) || (olapStatsLoading && !olapStatsWasLoaded);
|
66
|
+
const entityNotReady = isEntityWithMergedImpl && !mergedChildrenPaths;
|
67
|
+
|
71
68
|
const fetchData = useCallback(
|
72
69
|
(isBackground: boolean) => {
|
73
|
-
|
74
|
-
|
70
|
+
const schemaPath = currentSchemaPath || tenantName;
|
71
|
+
|
72
|
+
if (!schemaPath) {
|
73
|
+
return;
|
75
74
|
}
|
76
75
|
|
77
|
-
|
76
|
+
dispatch(setCurrentOverviewPath(schemaPath));
|
77
|
+
|
78
|
+
if (!isBackground) {
|
79
|
+
dispatch(setDataWasNotLoaded());
|
80
|
+
}
|
78
81
|
|
79
82
|
if (!isEntityWithMergedImpl) {
|
80
|
-
dispatch(
|
83
|
+
dispatch(getOverview({path: schemaPath}));
|
81
84
|
} else if (mergedChildrenPaths) {
|
82
|
-
dispatch(
|
85
|
+
dispatch(getOverviewBatched([schemaPath, ...mergedChildrenPaths]));
|
83
86
|
}
|
84
87
|
|
85
88
|
if (isTableType(type) && isColumnEntityType(type)) {
|
@@ -113,32 +116,32 @@ function Overview({type, tenantName, className}: OverviewProps) {
|
|
113
116
|
[EPathType.EPathTypeDir]: undefined,
|
114
117
|
[EPathType.EPathTypeTable]: undefined,
|
115
118
|
[EPathType.EPathTypeSubDomain]: undefined,
|
116
|
-
[EPathType.EPathTypeTableIndex]: () => <TableIndexInfo data={
|
119
|
+
[EPathType.EPathTypeTableIndex]: () => <TableIndexInfo data={data} />,
|
117
120
|
[EPathType.EPathTypeExtSubDomain]: undefined,
|
118
121
|
[EPathType.EPathTypeColumnStore]: undefined,
|
119
122
|
[EPathType.EPathTypeColumnTable]: undefined,
|
120
123
|
[EPathType.EPathTypeCdcStream]: () => (
|
121
|
-
<ChangefeedInfo data={
|
124
|
+
<ChangefeedInfo data={data} topic={additionalData?.[0]} />
|
122
125
|
),
|
123
|
-
[EPathType.EPathTypePersQueueGroup]: () => <TopicInfo data={
|
126
|
+
[EPathType.EPathTypePersQueueGroup]: () => <TopicInfo data={data} />,
|
124
127
|
};
|
125
128
|
|
126
129
|
return (
|
127
130
|
(type && pathTypeToComponent[type]?.()) || (
|
128
|
-
<TableInfo data={
|
131
|
+
<TableInfo data={data} type={type} olapStats={olapStats} />
|
129
132
|
)
|
130
133
|
);
|
131
134
|
};
|
132
135
|
|
133
|
-
if (
|
136
|
+
if (entityLoading || entityNotReady) {
|
134
137
|
return <Loader size="m" />;
|
135
138
|
}
|
136
139
|
|
137
|
-
if (
|
138
|
-
return <ResponseError error={
|
140
|
+
if (overviewError) {
|
141
|
+
return <ResponseError error={overviewError} />;
|
139
142
|
}
|
140
143
|
|
141
|
-
return <div
|
144
|
+
return <div>{renderContent()}</div>;
|
142
145
|
}
|
143
146
|
|
144
147
|
export default Overview;
|
@@ -16,7 +16,7 @@ import {
|
|
16
16
|
setShardsState,
|
17
17
|
setShardsQueryFilters,
|
18
18
|
} from '../../../../store/reducers/shardsWorkload';
|
19
|
-
import {setCurrentSchemaPath, getSchema} from '../../../../store/reducers/schema';
|
19
|
+
import {setCurrentSchemaPath, getSchema} from '../../../../store/reducers/schema/schema';
|
20
20
|
import {EShardsWorkloadMode, IShardsWorkloadFilters} from '../../../../types/store/shardsWorkload';
|
21
21
|
|
22
22
|
import type {EPathType} from '../../../../types/api/schema';
|
@@ -46,7 +46,7 @@ import {
|
|
46
46
|
paneVisibilityToggleReducerCreator,
|
47
47
|
PaneVisibilityToggleButtons,
|
48
48
|
} from '../utils/paneVisibilityToggleHelpers';
|
49
|
-
import {setShowPreview} from '../../../store/reducers/schema';
|
49
|
+
import {setShowPreview} from '../../../store/reducers/schema/schema';
|
50
50
|
import {setTopLevelTab} from '../../../store/reducers/tenant/tenant';
|
51
51
|
import {TENANT_GENERAL_TABS_IDS} from '../../../store/reducers/tenant/constants';
|
52
52
|
|
@@ -15,7 +15,7 @@ import {prepareQueryError} from '../../../utils/query';
|
|
15
15
|
import {isTableType} from '../utils/schema';
|
16
16
|
import {AutoFetcher} from '../../../utils/autofetcher';
|
17
17
|
import EnableFullscreenButton from '../../../components/EnableFullscreenButton/EnableFullscreenButton';
|
18
|
-
import {setShowPreview} from '../../../store/reducers/schema';
|
18
|
+
import {setShowPreview} from '../../../store/reducers/schema/schema';
|
19
19
|
|
20
20
|
import './Preview.scss';
|
21
21
|
|
@@ -8,12 +8,6 @@ import MonacoEditor from 'react-monaco-editor';
|
|
8
8
|
import SplitPane from '../../../components/SplitPane';
|
9
9
|
import {QueryResultTable} from '../../../components/QueryResultTable';
|
10
10
|
|
11
|
-
import SavedQueries from './SavedQueries/SavedQueries';
|
12
|
-
import QueryResult from './QueryResult/QueryResult';
|
13
|
-
import QueryExplain from './QueryExplain/QueryExplain';
|
14
|
-
import {QueryEditorControls} from './QueryEditorControls/QueryEditorControls';
|
15
|
-
import {OldQueryEditorControls} from './QueryEditorControls/OldQueryEditorControls';
|
16
|
-
|
17
11
|
import {
|
18
12
|
sendExecuteQuery,
|
19
13
|
changeUserInput,
|
@@ -25,22 +19,31 @@ import {
|
|
25
19
|
} from '../../../store/reducers/executeQuery';
|
26
20
|
import {getExplainQuery, getExplainQueryAst} from '../../../store/reducers/explainQuery';
|
27
21
|
import {getParsedSettingValue, setSettingValue} from '../../../store/reducers/settings/settings';
|
22
|
+
import {setShowPreview} from '../../../store/reducers/schema/schema';
|
28
23
|
import {
|
29
24
|
DEFAULT_IS_QUERY_RESULT_COLLAPSED,
|
30
25
|
DEFAULT_SIZE_RESULT_PANE_KEY,
|
31
26
|
SAVED_QUERIES_KEY,
|
32
27
|
QUERY_INITIAL_MODE_KEY,
|
33
|
-
|
28
|
+
ENABLE_ADDITIONAL_QUERY_MODES,
|
34
29
|
} from '../../../utils/constants';
|
30
|
+
import {useSetting} from '../../../utils/hooks';
|
31
|
+
import {QueryModes} from '../../../types/store/query';
|
35
32
|
|
36
|
-
import './QueryEditor.scss';
|
37
|
-
import QueriesHistory from './QueriesHistory/QueriesHistory';
|
38
33
|
import {
|
39
34
|
PaneVisibilityActionTypes,
|
40
35
|
paneVisibilityToggleReducerCreator,
|
41
36
|
} from '../utils/paneVisibilityToggleHelpers';
|
42
37
|
import Preview from '../Preview/Preview';
|
43
|
-
|
38
|
+
|
39
|
+
import SavedQueries from './SavedQueries/SavedQueries';
|
40
|
+
import QueryResult from './QueryResult/QueryResult';
|
41
|
+
import QueryExplain from './QueryExplain/QueryExplain';
|
42
|
+
import {QueryEditorControls} from './QueryEditorControls/QueryEditorControls';
|
43
|
+
import {OldQueryEditorControls} from './QueryEditorControls/OldQueryEditorControls';
|
44
|
+
import QueriesHistory from './QueriesHistory/QueriesHistory';
|
45
|
+
|
46
|
+
import './QueryEditor.scss';
|
44
47
|
|
45
48
|
const TABLE_SETTINGS = {
|
46
49
|
sortable: false,
|
@@ -83,7 +86,15 @@ function QueryEditor(props) {
|
|
83
86
|
const [resultType, setResultType] = useState(RESULT_TYPES.EXECUTE);
|
84
87
|
|
85
88
|
const [isResultLoaded, setIsResultLoaded] = useState(false);
|
86
|
-
const [queryMode, setQueryMode] =
|
89
|
+
const [queryMode, setQueryMode] = useSetting(QUERY_INITIAL_MODE_KEY);
|
90
|
+
const [enableAdditionalQueryModes] = useSetting(ENABLE_ADDITIONAL_QUERY_MODES);
|
91
|
+
|
92
|
+
useEffect(() => {
|
93
|
+
const isNewQueryMode = queryMode !== QueryModes.script && queryMode !== QueryModes.scan;
|
94
|
+
if (!enableAdditionalQueryModes && isNewQueryMode) {
|
95
|
+
setQueryMode(QueryModes.script);
|
96
|
+
}
|
97
|
+
}, [enableAdditionalQueryModes, queryMode, setQueryMode]);
|
87
98
|
|
88
99
|
const [resultVisibilityState, dispatchResultVisibilityState] = useReducer(
|
89
100
|
paneVisibilityToggleReducerCreator(DEFAULT_IS_QUERY_RESULT_COLLAPSED),
|
@@ -510,15 +521,10 @@ function QueryEditor(props) {
|
|
510
521
|
setSettingValue(SAVED_QUERIES_KEY, JSON.stringify(newSavedQueries));
|
511
522
|
};
|
512
523
|
|
513
|
-
const onUpdateQueryMode = (mode) => {
|
514
|
-
setQueryMode(mode);
|
515
|
-
props.setSettingValue(QUERY_INITIAL_MODE_KEY, mode);
|
516
|
-
};
|
517
|
-
|
518
524
|
const renderControls = () => {
|
519
|
-
const {executeQuery, explainQuery, savedQueries
|
525
|
+
const {executeQuery, explainQuery, savedQueries} = props;
|
520
526
|
|
521
|
-
if (
|
527
|
+
if (enableAdditionalQueryModes) {
|
522
528
|
return (
|
523
529
|
<QueryEditorControls
|
524
530
|
onRunButtonClick={handleSendExecuteClick}
|
@@ -528,7 +534,7 @@ function QueryEditor(props) {
|
|
528
534
|
onSaveQueryClick={onSaveQueryHandler}
|
529
535
|
savedQueries={savedQueries}
|
530
536
|
disabled={!executeQuery.input}
|
531
|
-
onUpdateQueryMode={
|
537
|
+
onUpdateQueryMode={setQueryMode}
|
532
538
|
queryMode={queryMode}
|
533
539
|
/>
|
534
540
|
);
|
@@ -543,7 +549,7 @@ function QueryEditor(props) {
|
|
543
549
|
onSaveQueryClick={onSaveQueryHandler}
|
544
550
|
savedQueries={savedQueries}
|
545
551
|
disabled={!executeQuery.input}
|
546
|
-
onUpdateQueryMode={
|
552
|
+
onUpdateQueryMode={setQueryMode}
|
547
553
|
queryMode={queryMode}
|
548
554
|
/>
|
549
555
|
);
|
@@ -607,8 +613,6 @@ const mapStateToProps = (state) => {
|
|
607
613
|
executeQuery: state.executeQuery,
|
608
614
|
explainQuery: state.explainQuery,
|
609
615
|
savedQueries: getParsedSettingValue(state, SAVED_QUERIES_KEY),
|
610
|
-
initialQueryMode: getParsedSettingValue(state, QUERY_INITIAL_MODE_KEY),
|
611
|
-
enableQueryModesForExplain: getParsedSettingValue(state, ENABLE_QUERY_MODES_FOR_EXPLAIN),
|
612
616
|
showPreview: state.schema.showPreview,
|
613
617
|
currentSchema: state.schema.currentSchema,
|
614
618
|
monacoHotKey: state.executeQuery?.monacoHotKey,
|
@@ -6,10 +6,17 @@ import {Icon} from '../../../../components/Icon';
|
|
6
6
|
|
7
7
|
import SaveQuery from '../SaveQuery/SaveQuery';
|
8
8
|
|
9
|
-
import {
|
9
|
+
import {QueryEditorControlsProps, b} from './shared';
|
10
10
|
|
11
11
|
import './QueryEditorControls.scss';
|
12
12
|
|
13
|
+
type OldQueryModes = QueryModes.script | QueryModes.scan;
|
14
|
+
|
15
|
+
export const QueryModeSelectorTitles = {
|
16
|
+
[QueryModes.script]: 'Script',
|
17
|
+
[QueryModes.scan]: 'Scan',
|
18
|
+
} as const;
|
19
|
+
|
13
20
|
export const OldQueryEditorControls = ({
|
14
21
|
onRunButtonClick,
|
15
22
|
runIsLoading,
|
@@ -26,7 +33,7 @@ export const OldQueryEditorControls = ({
|
|
26
33
|
return {
|
27
34
|
text: `Run ${title}`,
|
28
35
|
action: () => {
|
29
|
-
onUpdateQueryMode(mode as
|
36
|
+
onUpdateQueryMode(mode as OldQueryModes);
|
30
37
|
},
|
31
38
|
};
|
32
39
|
});
|
@@ -44,7 +51,7 @@ export const OldQueryEditorControls = ({
|
|
44
51
|
loading={runIsLoading}
|
45
52
|
>
|
46
53
|
<Icon name="startPlay" viewBox="0 0 16 16" width={16} height={16} />
|
47
|
-
{`Run ${QueryModeSelectorTitles[queryMode]}`}
|
54
|
+
{`Run ${QueryModeSelectorTitles[queryMode as OldQueryModes]}`}
|
48
55
|
</Button>
|
49
56
|
<DropdownMenu
|
50
57
|
items={runModeSelectorMenuItems}
|
@@ -8,10 +8,17 @@ import SaveQuery from '../SaveQuery/SaveQuery';
|
|
8
8
|
|
9
9
|
import i18n from '../i18n';
|
10
10
|
|
11
|
-
import {
|
11
|
+
import {QueryEditorControlsProps, b} from './shared';
|
12
12
|
|
13
13
|
import './QueryEditorControls.scss';
|
14
14
|
|
15
|
+
export const QueryModeSelectorTitles = {
|
16
|
+
[QueryModes.script]: 'Script',
|
17
|
+
[QueryModes.scan]: 'Scan',
|
18
|
+
[QueryModes.data]: 'Data',
|
19
|
+
[QueryModes.query]: 'Query',
|
20
|
+
} as const;
|
21
|
+
|
15
22
|
export const QueryEditorControls = ({
|
16
23
|
onRunButtonClick,
|
17
24
|
runIsLoading,
|
@@ -1,14 +1,9 @@
|
|
1
1
|
import block from 'bem-cn-lite';
|
2
2
|
|
3
|
-
import {QueryModes} from '../../../../types/store/query';
|
3
|
+
import type {QueryModes} from '../../../../types/store/query';
|
4
4
|
|
5
5
|
export const b = block('ydb-query-editor-controls');
|
6
6
|
|
7
|
-
export const QueryModeSelectorTitles = {
|
8
|
-
[QueryModes.script]: 'Script',
|
9
|
-
[QueryModes.scan]: 'Scan',
|
10
|
-
} as const;
|
11
|
-
|
12
7
|
export interface QueryEditorControlsProps {
|
13
8
|
onRunButtonClick: (mode?: QueryModes) => void;
|
14
9
|
runIsLoading: boolean;
|
@@ -3,7 +3,7 @@ import {useDispatch} from 'react-redux';
|
|
3
3
|
|
4
4
|
import {NavigationTree} from 'ydb-ui-components';
|
5
5
|
|
6
|
-
import {setCurrentSchemaPath, preloadSchemas} from '../../../../store/reducers/schema';
|
6
|
+
import {setCurrentSchemaPath, preloadSchemas} from '../../../../store/reducers/schema/schema';
|
7
7
|
import type {EPathType, TEvDescribeSchemeResult} from '../../../../types/api/schema';
|
8
8
|
|
9
9
|
import {isChildlessPathType, mapPathTypeToNavigationTreeType} from '../../utils/schema';
|
@@ -8,15 +8,16 @@ import type {TEvDescribeSchemeResult} from '../../types/api/schema';
|
|
8
8
|
|
9
9
|
import {DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY} from '../../utils/constants';
|
10
10
|
import {useTypedSelector} from '../../utils/hooks';
|
11
|
-
import routes, {
|
11
|
+
import routes, {createHref} from '../../routes';
|
12
12
|
import {setHeader} from '../../store/reducers/header';
|
13
|
-
import {disableAutorefresh, getSchema
|
13
|
+
import {disableAutorefresh, getSchema} from '../../store/reducers/schema/schema';
|
14
14
|
import {getSchemaAcl} from '../../store/reducers/schemaAcl/schemaAcl';
|
15
|
-
import {getTenantInfo, clearTenant} from '../../store/reducers/tenant/tenant';
|
16
15
|
|
17
16
|
import SplitPane from '../../components/SplitPane';
|
18
17
|
import {AccessDenied} from '../../components/Errors/403';
|
19
18
|
|
19
|
+
import {getClusterPath} from '../Cluster/utils';
|
20
|
+
|
20
21
|
import ObjectGeneralTabs from './ObjectGeneralTabs/ObjectGeneralTabs';
|
21
22
|
import ObjectSummary from './ObjectSummary/ObjectSummary';
|
22
23
|
import ObjectGeneral from './ObjectGeneral/ObjectGeneral';
|
@@ -62,7 +63,6 @@ function Tenant(props: TenantProps) {
|
|
62
63
|
const {PathType: currentPathType, PathSubType: currentPathSubType} =
|
63
64
|
(currentItem as TEvDescribeSchemeResult).PathDescription?.Self || {};
|
64
65
|
|
65
|
-
const {error: {status: tenantStatus = 200} = {}} = useTypedSelector((state) => state.tenant);
|
66
66
|
const {error: {status: schemaStatus = 200} = {}} = useTypedSelector((state) => state.schema);
|
67
67
|
|
68
68
|
const dispatch = useDispatch();
|
@@ -82,7 +82,6 @@ function Tenant(props: TenantProps) {
|
|
82
82
|
}, [tenantName, dispatch]);
|
83
83
|
|
84
84
|
useEffect(() => {
|
85
|
-
dispatch(resetLoadingState());
|
86
85
|
dispatch(getSchema({path: currentSchemaPath}));
|
87
86
|
dispatch(getSchemaAcl({path: currentSchemaPath}));
|
88
87
|
}, [currentSchemaPath, dispatch]);
|
@@ -93,12 +92,11 @@ function Tenant(props: TenantProps) {
|
|
93
92
|
|
94
93
|
useEffect(() => {
|
95
94
|
if (tenantName) {
|
96
|
-
dispatch(getTenantInfo({path: tenantName}));
|
97
95
|
dispatch(
|
98
96
|
setHeader([
|
99
97
|
{
|
100
|
-
text:
|
101
|
-
link:
|
98
|
+
text: 'Cluster',
|
99
|
+
link: getClusterPath(),
|
102
100
|
},
|
103
101
|
{
|
104
102
|
text: tenantName.startsWith('/') ? tenantName.slice(1) : tenantName,
|
@@ -109,9 +107,6 @@ function Tenant(props: TenantProps) {
|
|
109
107
|
]),
|
110
108
|
);
|
111
109
|
}
|
112
|
-
return () => {
|
113
|
-
dispatch(clearTenant());
|
114
|
-
};
|
115
110
|
}, [tenantName, dispatch]);
|
116
111
|
|
117
112
|
const onCollapseSummaryHandler = () => {
|
@@ -125,7 +120,7 @@ function Tenant(props: TenantProps) {
|
|
125
120
|
dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.clear);
|
126
121
|
};
|
127
122
|
|
128
|
-
const showBlockingError =
|
123
|
+
const showBlockingError = schemaStatus === 403;
|
129
124
|
|
130
125
|
return (
|
131
126
|
<div className={b()}>
|
@@ -2,7 +2,7 @@ import {Dispatch} from 'react';
|
|
2
2
|
import type {NavigationTreeNodeType, NavigationTreeProps} from 'ydb-ui-components';
|
3
3
|
|
4
4
|
import {changeUserInput} from '../../../store/reducers/executeQuery';
|
5
|
-
import {setShowPreview} from '../../../store/reducers/schema';
|
5
|
+
import {setShowPreview} from '../../../store/reducers/schema/schema';
|
6
6
|
import {setTopLevelTab} from '../../../store/reducers/tenant/tenant';
|
7
7
|
import {TENANT_GENERAL_TABS_IDS} from '../../../store/reducers/tenant/constants';
|
8
8
|
import createToast from '../../../utils/createToast';
|
@@ -15,7 +15,7 @@ import {ProblemFilter} from '../../components/ProblemFilter';
|
|
15
15
|
import {Illustration} from '../../components/Illustration';
|
16
16
|
import {AutoFetcher} from '../../utils/autofetcher';
|
17
17
|
|
18
|
-
import routes, {
|
18
|
+
import routes, {createHref} from '../../routes';
|
19
19
|
import {formatCPU, formatBytesToGigabyte, formatNumber} from '../../utils';
|
20
20
|
import {withSearch} from '../../HOCS';
|
21
21
|
import {DEFAULT_TABLE_SETTINGS, TENANT_INITIAL_TAB_KEY} from '../../utils/constants';
|
@@ -25,7 +25,6 @@ import {
|
|
25
25
|
getSettingValue,
|
26
26
|
ProblemFilterValues,
|
27
27
|
} from '../../store/reducers/settings/settings';
|
28
|
-
import {setHeader} from '../../store/reducers/header';
|
29
28
|
|
30
29
|
import {clusterName} from '../../store';
|
31
30
|
import {TenantTabsGroups, TENANT_GENERAL_TABS, TENANT_INFO_TABS} from '../Tenant/TenantPages';
|
@@ -51,7 +50,6 @@ class Tenants extends React.Component {
|
|
51
50
|
tenants: PropTypes.array,
|
52
51
|
searchQuery: PropTypes.string,
|
53
52
|
handleSearchQuery: PropTypes.func,
|
54
|
-
setHeader: PropTypes.func,
|
55
53
|
filter: PropTypes.string,
|
56
54
|
changeFilter: PropTypes.func,
|
57
55
|
cluster: PropTypes.object,
|
@@ -77,12 +75,6 @@ class Tenants extends React.Component {
|
|
77
75
|
this.autofetcher = new AutoFetcher();
|
78
76
|
this.props.getTenantsInfo(clusterName);
|
79
77
|
this.autofetcher.fetch(() => this.props.getTenantsInfo(clusterName));
|
80
|
-
this.props.setHeader([
|
81
|
-
{
|
82
|
-
text: CLUSTER_PAGES.tenants.title,
|
83
|
-
link: createHref(routes.cluster, {activeTab: CLUSTER_PAGES.tenants.id}),
|
84
|
-
},
|
85
|
-
]);
|
86
78
|
}
|
87
79
|
|
88
80
|
componentWillUnmount() {
|
@@ -94,14 +86,15 @@ class Tenants extends React.Component {
|
|
94
86
|
|
95
87
|
return (
|
96
88
|
<div className={b('controls')}>
|
97
|
-
<
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
89
|
+
<div className={b('search')}>
|
90
|
+
<TextInput
|
91
|
+
placeholder="Database name"
|
92
|
+
value={searchQuery}
|
93
|
+
onUpdate={handleSearchQuery}
|
94
|
+
hasClear
|
95
|
+
autoFocus
|
96
|
+
/>
|
97
|
+
</div>
|
105
98
|
<ProblemFilter value={filter} onChange={changeFilter} />
|
106
99
|
</div>
|
107
100
|
);
|
@@ -309,16 +302,14 @@ class Tenants extends React.Component {
|
|
309
302
|
|
310
303
|
return (
|
311
304
|
<div className={b('table-wrapper')}>
|
312
|
-
<
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
/>
|
321
|
-
</div>
|
305
|
+
<DataTable
|
306
|
+
theme="yandex-cloud"
|
307
|
+
data={filteredTenants}
|
308
|
+
columns={columns}
|
309
|
+
settings={DEFAULT_TABLE_SETTINGS}
|
310
|
+
dynamicRender={true}
|
311
|
+
emptyDataMessage="No such tenants"
|
312
|
+
/>
|
322
313
|
</div>
|
323
314
|
);
|
324
315
|
};
|
@@ -363,7 +354,6 @@ const mapStateToProps = (state) => {
|
|
363
354
|
const mapDispatchToProps = {
|
364
355
|
getTenantsInfo,
|
365
356
|
changeFilter,
|
366
|
-
setHeader,
|
367
357
|
};
|
368
358
|
|
369
359
|
export default withSearch(connect(mapStateToProps, mapDispatchToProps)(Tenants));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.tenants {
|
4
|
-
|
4
|
+
height: 100%;
|
5
5
|
@include flex-container();
|
6
6
|
|
7
7
|
&__format-label {
|
@@ -34,10 +34,8 @@
|
|
34
34
|
|
35
35
|
&__table-wrapper {
|
36
36
|
overflow: auto;
|
37
|
-
|
38
|
-
}
|
37
|
+
flex-grow: 1;
|
39
38
|
|
40
|
-
&__table-content {
|
41
39
|
@include freeze-nth-column(1);
|
42
40
|
|
43
41
|
@include table-styles;
|
@@ -15,6 +15,6 @@
|
|
15
15
|
"settings.useNodesEndpoint.title": "Break the Nodes tab in Diagnostics",
|
16
16
|
"settings.useNodesEndpoint.popover": "Use /viewer/json/nodes endpoint for Nodes Tab in diagnostics. It returns incorrect data on versions before 23-1",
|
17
17
|
|
18
|
-
"settings.
|
19
|
-
"settings.
|
18
|
+
"settings.enableAdditionalQueryModes.title": "Enable additional query modes",
|
19
|
+
"settings.enableAdditionalQueryModes.popover": "Adds 'data' and 'query' modes for run. Enables query modes for explain. May not work on some versions"
|
20
20
|
}
|
@@ -15,6 +15,6 @@
|
|
15
15
|
"settings.useNodesEndpoint.title": "Сломать вкладку Nodes в диагностике",
|
16
16
|
"settings.useNodesEndpoint.popover": "Использовать эндпоинт /viewer/json/nodes для вкладки Nodes в диагностике. Может возвращать некорректные данные на версиях до 23-1",
|
17
17
|
|
18
|
-
"settings.
|
19
|
-
"settings.
|
18
|
+
"settings.enableAdditionalQueryModes.title": "Включить дополнительные режимы выполнения запросов",
|
19
|
+
"settings.enableAdditionalQueryModes.popover": "Добавляет режимы 'data' и 'query' для run. Включает возможность выбрать режим выполнения запроса для explain. Может работать некорректно на некоторых версиях"
|
20
20
|
}
|
@@ -4,7 +4,7 @@ import favoriteFilledIcon from '../../assets/icons/star.svg';
|
|
4
4
|
import flaskIcon from '../../assets/icons/flask.svg';
|
5
5
|
|
6
6
|
import {
|
7
|
-
|
7
|
+
ENABLE_ADDITIONAL_QUERY_MODES,
|
8
8
|
INVERTED_DISKS_KEY,
|
9
9
|
THEME_KEY,
|
10
10
|
USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY,
|
@@ -59,9 +59,9 @@ export const useNodesEndpointSetting: SettingProps = {
|
|
59
59
|
helpPopoverContent: i18n('settings.useNodesEndpoint.popover'),
|
60
60
|
};
|
61
61
|
export const enableQueryModesForExplainSetting: SettingProps = {
|
62
|
-
settingKey:
|
63
|
-
title: i18n('settings.
|
64
|
-
helpPopoverContent: i18n('settings.
|
62
|
+
settingKey: ENABLE_ADDITIONAL_QUERY_MODES,
|
63
|
+
title: i18n('settings.enableAdditionalQueryModes.title'),
|
64
|
+
helpPopoverContent: i18n('settings.enableAdditionalQueryModes.popover'),
|
65
65
|
};
|
66
66
|
|
67
67
|
export const generalSection: SettingsSection = {
|