ydb-embedded-ui 6.3.0 → 6.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +39 -17
- package/dist/assets/icons/disableFullscreen.svg +4 -0
- package/dist/assets/icons/emptyState.svg +13 -0
- package/dist/assets/icons/key.svg +6 -0
- package/dist/assets/icons/monitoring.svg +9 -0
- package/dist/assets/icons/network.svg +21 -0
- package/dist/components/AsyncReplicationState/AsyncReplicationState.d.ts +6 -0
- package/dist/components/AsyncReplicationState/AsyncReplicationState.js +20 -0
- package/dist/components/AsyncReplicationState/index.d.ts +1 -0
- package/dist/components/AsyncReplicationState/index.js +1 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.js +11 -5
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +6 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +12 -3
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +3 -4
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +2 -0
- package/dist/components/EmptyState/EmptyState.js +3 -2
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.js +3 -3
- package/dist/components/Errors/ResponseError/ResponseError.js +3 -0
- package/dist/components/Fullscreen/Fullscreen.js +3 -3
- package/dist/components/MonitoringButton/MonitoringButton.js +3 -3
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -3
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.d.ts +1 -2
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +6 -6
- package/dist/components/StatusIcon/StatusIcon.js +5 -7
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/containers/App/App.js +1 -2
- package/dist/containers/AsideNavigation/AsideNavigation.js +4 -9
- package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +2 -3
- package/dist/containers/AsideNavigation/useNavigationMenuItems.js +5 -6
- package/dist/containers/Authentication/Authentication.js +2 -4
- package/dist/containers/Clusters/Clusters.js +7 -2
- package/dist/containers/Clusters/constants.d.ts +1 -3
- package/dist/containers/Clusters/constants.js +0 -18
- package/dist/containers/Node/NodeStructure/Pdisk.js +4 -4
- package/dist/containers/Nodes/Nodes.js +19 -15
- package/dist/containers/Nodes/VirtualNodes.js +23 -6
- package/dist/containers/PDiskPage/PDiskPage.js +3 -2
- package/dist/containers/PDiskPage/i18n/en.json +2 -1
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Storage.js +50 -22
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +2 -2
- package/dist/containers/Storage/VirtualStorage.js +32 -10
- package/dist/containers/Storage/utils/index.d.ts +4 -1
- package/dist/containers/Storage/utils/index.js +29 -0
- package/dist/containers/Tablet/Tablet.js +3 -3
- package/dist/containers/Tablet/TabletControls/TabletControls.js +3 -1
- package/dist/containers/Tablet/i18n/en.json +3 -0
- package/dist/containers/Tablet/i18n/index.d.ts +1 -1
- package/dist/containers/Tablet/i18n/index.js +1 -2
- package/dist/containers/Tablets/Tablets.d.ts +1 -2
- package/dist/containers/Tablets/Tablets.js +113 -53
- package/dist/containers/Tablets/i18n/en.json +10 -4
- package/dist/containers/Tablets/i18n/index.d.ts +1 -1
- package/dist/containers/Tablets/i18n/index.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +5 -5
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -0
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +31 -19
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +14 -4
- package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +2 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +39 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.d.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.js +14 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/en.json +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.js +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js +34 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.scss +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/en.json +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.js +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.js +2 -8
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +23 -9
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -6
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +6 -14
- package/dist/containers/Tenant/Query/Issues/Issues.js +6 -9
- package/dist/containers/Tenant/Query/Preview/Preview.js +5 -5
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -8
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +18 -19
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +4 -4
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +3 -3
- package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +3 -2
- package/dist/containers/Tenant/Tenant.js +3 -2
- package/dist/containers/Tenant/utils/ToggleButton.scss +0 -2
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js +4 -4
- package/dist/containers/Tenant/utils/schema.js +8 -0
- package/dist/containers/Tenant/utils/schemaActions.js +1 -0
- package/dist/containers/Tenant/utils/schemaControls.js +4 -3
- package/dist/containers/VDiskPage/VDiskPage.js +3 -2
- package/dist/containers/VDiskPage/i18n/en.json +2 -1
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/services/api.d.ts +3 -3
- package/dist/services/settings.d.ts +19 -1
- package/dist/services/settings.js +2 -1
- package/dist/store/configureStore.d.ts +0 -12
- package/dist/store/defaultStore.d.ts +0 -6
- package/dist/store/reducers/authentication/authentication.d.ts +187 -13
- package/dist/store/reducers/authentication/authentication.js +12 -3
- package/dist/store/reducers/authentication/types.d.ts +5 -1
- package/dist/store/reducers/cluster/cluster.js +4 -0
- package/dist/store/reducers/executeQuery.d.ts +4 -65
- package/dist/store/reducers/executeQuery.js +38 -34
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -1
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +9 -0
- package/dist/store/reducers/explainQuery/explainQuery.js +32 -0
- package/dist/store/reducers/explainQuery/types.d.ts +12 -0
- package/dist/store/reducers/explainQuery/utils.d.ts +6 -0
- package/dist/store/reducers/explainQuery/utils.js +40 -0
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +0 -60
- package/dist/store/reducers/host.d.ts +61 -4
- package/dist/store/reducers/index.d.ts +0 -9
- package/dist/store/reducers/index.js +0 -6
- package/dist/store/reducers/node/selectors.d.ts +0 -3
- package/dist/store/reducers/nodes/nodes.d.ts +1 -5
- package/dist/store/reducers/nodes/nodes.js +0 -27
- package/dist/store/reducers/nodes/types.d.ts +4 -13
- package/dist/store/reducers/nodesList.d.ts +0 -3
- package/dist/store/reducers/olapStats.js +4 -1
- package/dist/store/reducers/preview.js +4 -1
- package/dist/store/reducers/schema/schema.d.ts +61 -4
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +61 -4
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +4 -1
- package/dist/store/reducers/storage/selectors.d.ts +2 -17
- package/dist/store/reducers/storage/selectors.js +1 -36
- package/dist/store/reducers/storage/storage.d.ts +2 -6
- package/dist/store/reducers/storage/storage.js +0 -44
- package/dist/store/reducers/storage/types.d.ts +15 -22
- package/dist/store/reducers/storage/types.js +4 -1
- package/dist/store/reducers/tablets.d.ts +91 -1
- package/dist/store/reducers/tablets.js +16 -1
- package/dist/store/reducers/tabletsFilters.d.ts +61 -4
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenant/tenant.js +10 -1
- package/dist/store/reducers/tenant/types.d.ts +8 -3
- package/dist/store/reducers/tenant/types.js +3 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +6 -3
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +6 -3
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +6 -3
- package/dist/store/reducers/tenants/selectors.d.ts +0 -27
- package/dist/store/reducers/tenants/utils.d.ts +4 -4
- package/dist/store/reducers/tenants/utils.js +8 -8
- package/dist/store/reducers/topic.d.ts +0 -45
- package/dist/store/state-url-mapping.js +0 -22
- package/dist/store/utils.d.ts +2 -3
- package/dist/store/utils.js +1 -1
- package/dist/types/api/schema/replication.d.ts +74 -0
- package/dist/types/api/schema/replication.js +7 -0
- package/dist/types/api/schema/schema.d.ts +4 -1
- package/dist/types/api/schema/schema.js +1 -0
- package/dist/types/api/whoami.d.ts +6 -0
- package/dist/types/store/executeQuery.d.ts +2 -9
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/monaco/yql/constants.d.ts +2 -0
- package/dist/utils/monaco/yql/constants.js +33 -0
- package/dist/utils/monaco/yql/generateSuggestions.d.ts +1 -0
- package/dist/utils/monaco/yql/generateSuggestions.js +28 -11
- package/dist/utils/monaco/yql/yqlSuggestions.js +6 -1
- package/dist/utils/nodes.d.ts +2 -0
- package/dist/utils/nodes.js +4 -0
- package/dist/utils/query.d.ts +5 -3
- package/dist/utils/query.js +27 -4
- package/dist/utils/response.d.ts +4 -0
- package/dist/utils/response.js +9 -0
- package/dist/utils/tablet.d.ts +2 -0
- package/dist/utils/tablet.js +14 -0
- package/package.json +4 -3
- package/dist/assets/icons/bug.svg +0 -1
- package/dist/assets/icons/circle-exclamation.svg +0 -1
- package/dist/assets/icons/circle-info.svg +0 -1
- package/dist/assets/icons/circle-xmark.svg +0 -1
- package/dist/assets/icons/close.svg +0 -1
- package/dist/assets/icons/control-menu-button.svg +0 -1
- package/dist/assets/icons/dots.svg +0 -1
- package/dist/assets/icons/hide.svg +0 -1
- package/dist/assets/icons/question.svg +0 -1
- package/dist/assets/icons/server.svg +0 -1
- package/dist/assets/icons/settings-with-dot.svg +0 -1
- package/dist/assets/icons/settings.svg +0 -1
- package/dist/assets/icons/shield.svg +0 -3
- package/dist/assets/icons/show.svg +0 -1
- package/dist/assets/icons/signIn.svg +0 -1
- package/dist/assets/icons/signOut.svg +0 -1
- package/dist/assets/icons/storage.svg +0 -1
- package/dist/assets/icons/support.svg +0 -1
- package/dist/assets/icons/triangle-exclamation.svg +0 -1
- package/dist/assets/icons/update-arrow.svg +0 -6
- package/dist/components/Icon/Icon.d.ts +0 -14
- package/dist/components/Icon/Icon.js +0 -16
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/containers/AppIcons/AppIcons.d.ts +0 -2
- package/dist/containers/AppIcons/AppIcons.js +0 -9
- package/dist/containers/Tablet/i18n/ru.json +0 -10
- package/dist/containers/Tablets/Tablets.scss +0 -35
- package/dist/containers/Tablets/i18n/ru.json +0 -6
- package/dist/store/reducers/explainQuery.d.ts +0 -149
- package/dist/store/reducers/explainQuery.js +0 -94
- package/dist/types/store/explainQuery.d.ts +0 -27
- package/dist/utils/error.d.ts +0 -2
- package/dist/utils/error.js +0 -13
- /package/dist/{types/store/explainQuery.js → store/reducers/explainQuery/types.js} +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Label } from '@gravity-ui/uikit';
|
3
|
+
export function Credentials({ connection }) {
|
4
|
+
if (!connection) {
|
5
|
+
return null;
|
6
|
+
}
|
7
|
+
if (connection.StaticCredentials) {
|
8
|
+
return (_jsx(Label, { value: connection.StaticCredentials.User, theme: "normal", children: "user" }));
|
9
|
+
}
|
10
|
+
if ('OAuthToken' in connection) {
|
11
|
+
return 'OAuth';
|
12
|
+
}
|
13
|
+
return 'unknown';
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationInfo';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationInfo';
|
package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.d.ts
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { TReplicationConfig } from '../../../../../types/api/schema/replication';
|
2
|
+
import './AsyncReplicationPaths.scss';
|
3
|
+
interface AsyncReplicationPathsProps {
|
4
|
+
config?: TReplicationConfig;
|
5
|
+
}
|
6
|
+
export declare function AsyncReplicationPaths({ config }: AsyncReplicationPathsProps): import("react/jsx-runtime").JSX.Element | null;
|
7
|
+
export {};
|
package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Text } from '@gravity-ui/uikit';
|
3
|
+
import { ResizeableDataTable } from '../../../../../components/ResizeableDataTable/ResizeableDataTable';
|
4
|
+
import { cn } from '../../../../../utils/cn';
|
5
|
+
import { TENANT_OVERVIEW_TABLES_SETTINGS } from '../../../../../utils/constants';
|
6
|
+
import i18n from './i18n';
|
7
|
+
import './AsyncReplicationPaths.scss';
|
8
|
+
const b = cn('ydb-async-replication-paths');
|
9
|
+
const columns = [
|
10
|
+
{
|
11
|
+
name: i18n('column.srcPath.name'),
|
12
|
+
render: ({ row }) => row.SrcPath,
|
13
|
+
sortAccessor: (row) => row.SrcPath,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: i18n('column.dstPath.name'),
|
17
|
+
render: ({ row }) => row.DstPath,
|
18
|
+
sortAccessor: (row) => row.DstPath,
|
19
|
+
},
|
20
|
+
];
|
21
|
+
export function AsyncReplicationPaths({ config }) {
|
22
|
+
var _a, _b;
|
23
|
+
if (!config) {
|
24
|
+
return null;
|
25
|
+
}
|
26
|
+
let content = i18n('noData');
|
27
|
+
if (config.Everything) {
|
28
|
+
content = (_jsxs("span", { children: [i18n('everythingWithPrefix'), ' ', _jsx(Text, { variant: "code-inline-2", children: (_b = (_a = config.Everything) === null || _a === void 0 ? void 0 : _a.DstPrefix) !== null && _b !== void 0 ? _b : 'undefined' }), "."] }));
|
29
|
+
}
|
30
|
+
if (config.Specific) {
|
31
|
+
content = (_jsx(ResizeableDataTable, { data: config.Specific.Targets, settings: TENANT_OVERVIEW_TABLES_SETTINGS, columns: columns }));
|
32
|
+
}
|
33
|
+
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('title'), children: i18n('title') }), content] }));
|
34
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationPaths';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationPaths';
|
@@ -12,6 +12,7 @@ import { useTypedSelector } from '../../../../utils/hooks';
|
|
12
12
|
import { ExternalDataSourceInfo } from '../../Info/ExternalDataSource/ExternalDataSource';
|
13
13
|
import { ExternalTableInfo } from '../../Info/ExternalTable/ExternalTable';
|
14
14
|
import { isColumnEntityType, isEntityWithMergedImplementation, isTableType, } from '../../utils/schema';
|
15
|
+
import { AsyncReplicationInfo } from './AsyncReplicationInfo';
|
15
16
|
import { ChangefeedInfo } from './ChangefeedInfo';
|
16
17
|
import { TableInfo } from './TableInfo';
|
17
18
|
import { TopicInfo } from './TopicInfo';
|
@@ -63,6 +64,7 @@ function Overview({ type, tenantName }) {
|
|
63
64
|
[EPathType.EPathTypeExternalTable]: () => _jsx(ExternalTableInfo, { data: data }),
|
64
65
|
[EPathType.EPathTypeExternalDataSource]: () => _jsx(ExternalDataSourceInfo, { data: data }),
|
65
66
|
[EPathType.EPathTypeView]: undefined,
|
67
|
+
[EPathType.EPathTypeReplication]: () => _jsx(AsyncReplicationInfo, { data: data }),
|
66
68
|
};
|
67
69
|
return ((type && ((_a = pathTypeToComponent[type]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent))) || (_jsx(TableInfo, { data: data, type: type, olapStats: olapStats })));
|
68
70
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
+
import { ArrowsRotateRight } from '@gravity-ui/icons';
|
3
4
|
import { Button, Icon } from '@gravity-ui/uikit';
|
4
5
|
import { DiagnosticCard } from '../../../../../components/DiagnosticCard/DiagnosticCard';
|
5
6
|
import { EntityStatus } from '../../../../../components/EntityStatus/EntityStatus';
|
@@ -8,7 +9,6 @@ import { Loader } from '../../../../../components/Loader';
|
|
8
9
|
import { hcStatusToColorFlag } from '../../../../../store/reducers/healthcheckInfo/utils';
|
9
10
|
import { cn } from '../../../../../utils/cn';
|
10
11
|
import i18n from './i18n';
|
11
|
-
import updateArrow from '../../../../../assets/icons/update-arrow.svg';
|
12
12
|
import './Healthcheck.scss';
|
13
13
|
const b = cn('healthcheck');
|
14
14
|
export function HealthcheckPreview(props) {
|
@@ -22,7 +22,7 @@ export function HealthcheckPreview(props) {
|
|
22
22
|
// FIXME: refactor card to remove the button from the anchor link.
|
23
23
|
event.preventDefault();
|
24
24
|
onUpdate();
|
25
|
-
}, loading: loading, view: "flat-secondary", children: _jsx(Icon, { data:
|
25
|
+
}, loading: loading, view: "flat-secondary", children: _jsx(Icon, { data: ArrowsRotateRight, size: 20 }) })] }), _jsx("div", { className: b('self-check-status-indicator', { [modifier]: true }), children: selfCheckResult })] }));
|
26
26
|
};
|
27
27
|
const renderContent = () => {
|
28
28
|
if (error) {
|
@@ -6,6 +6,7 @@ import { changeUserInput } from '../../../../../store/reducers/executeQuery';
|
|
6
6
|
import { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_PAGE, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, } from '../../../../../store/reducers/tenant/constants';
|
7
7
|
import { topQueriesApi } from '../../../../../store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries';
|
8
8
|
import { useTypedDispatch, useTypedSelector } from '../../../../../utils/hooks';
|
9
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
9
10
|
import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
|
10
11
|
import { TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, getTenantOverviewTopQueriesColumns, } from '../../TopQueries/getTopQueriesColumns';
|
11
12
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
@@ -34,5 +35,5 @@ export function TopQueries({ path }) {
|
|
34
35
|
postfix: i18n('by-cpu-time'),
|
35
36
|
link: getTenantPath(Object.assign(Object.assign({}, query), { [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.topQueries })),
|
36
37
|
});
|
37
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, onRowClick: handleRowClick, title: title, loading: loading, error: error, rowClassName: () => b('top-queries-row') }));
|
38
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, onRowClick: handleRowClick, title: title, loading: loading, error: parseQueryErrorToString(error), rowClassName: () => b('top-queries-row') }));
|
38
39
|
}
|
@@ -4,6 +4,7 @@ import { parseQuery } from '../../../../../routes';
|
|
4
4
|
import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../../../store/reducers/tenant/constants';
|
5
5
|
import { topShardsApi } from '../../../../../store/reducers/tenantOverview/topShards/tenantOverviewTopShards';
|
6
6
|
import { useTypedSelector } from '../../../../../utils/hooks';
|
7
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
7
8
|
import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
|
8
9
|
import { TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, getTopShardsColumns, } from '../../TopShards/getTopShardsColumns';
|
9
10
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
@@ -22,5 +23,5 @@ export const TopShards = ({ path }) => {
|
|
22
23
|
postfix: i18n('by-cpu-usage'),
|
23
24
|
link: getTenantPath(Object.assign(Object.assign({}, query), { [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.topShards })),
|
24
25
|
});
|
25
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: error }));
|
26
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: parseQueryErrorToString(error) }));
|
26
27
|
};
|
@@ -6,6 +6,7 @@ import { LinkToSchemaObject } from '../../../../../components/LinkToSchemaObject
|
|
6
6
|
import { topTablesApi } from '../../../../../store/reducers/tenantOverview/executeTopTables/executeTopTables';
|
7
7
|
import { formatBytes, getSizeWithSignificantDigits } from '../../../../../utils/bytesParsers';
|
8
8
|
import { useTypedSelector } from '../../../../../utils/hooks';
|
9
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
9
10
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
10
11
|
import { getSectionTitle } from '../getSectionTitle';
|
11
12
|
import i18n from '../i18n';
|
@@ -40,5 +41,5 @@ export function TopTables({ path }) {
|
|
40
41
|
entity: i18n('tables'),
|
41
42
|
postfix: i18n('by-size'),
|
42
43
|
});
|
43
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_TABLES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: error }));
|
44
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_TABLES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: parseQueryErrorToString(error) }));
|
44
45
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "nodes" | "queries" | "groups" | "
|
1
|
+
declare const _default: (key: "nodes" | "queries" | "groups" | "top" | "shards" | "tables" | "no-data" | "no-pools-data" | "top-nodes.empty-data" | "top-groups.empty-data" | "by-pools-usage" | "by-cpu-time" | "by-cpu-usage" | "by-load" | "by-memory" | "by-usage" | "by-size" | "cards.cpu-label" | "cards.storage-label" | "cards.memory-label" | "charts.queries-per-second" | "charts.transaction-latency" | "charts.cpu-usage" | "charts.storage-usage" | "charts.memory-usage" | "storage.tablet-storage-title" | "storage.tablet-storage-description" | "storage.db-storage-title" | "storage.db-storage-description", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
2
2
|
export default _default;
|
@@ -12,7 +12,7 @@ import { TENANT_PAGE, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, } from '../../../.
|
|
12
12
|
import { cn } from '../../../../utils/cn';
|
13
13
|
import { isSortableTopQueriesProperty } from '../../../../utils/diagnostics';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
|
-
import {
|
15
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
16
16
|
import { TenantTabsGroups, getTenantPath } from '../../TenantPages';
|
17
17
|
import { QUERY_TABLE_SETTINGS } from '../../utils/constants';
|
18
18
|
import { isColumnEntityType } from '../../utils/schema';
|
@@ -48,8 +48,8 @@ export const TopQueries = ({ path, type }) => {
|
|
48
48
|
dispatch(setTopQueriesFilters(value));
|
49
49
|
};
|
50
50
|
const renderContent = () => {
|
51
|
-
if (error
|
52
|
-
return _jsx("div", { className: "error", children:
|
51
|
+
if (error) {
|
52
|
+
return _jsx("div", { className: "error", children: parseQueryErrorToString(error) });
|
53
53
|
}
|
54
54
|
if (!data || isColumnEntityType(type)) {
|
55
55
|
return i18n('no-data');
|
@@ -11,7 +11,7 @@ import { DEFAULT_TABLE_SETTINGS, HOUR_IN_SECONDS } from '../../../../utils/const
|
|
11
11
|
import { formatDateTime } from '../../../../utils/dataFormatters/dataFormatters';
|
12
12
|
import { isSortableTopShardsProperty } from '../../../../utils/diagnostics';
|
13
13
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
14
|
-
import {
|
14
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
15
15
|
import { isColumnEntityType } from '../../utils/schema';
|
16
16
|
import { Filters } from './Filters';
|
17
17
|
import { TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, getShardsWorkloadColumns } from './getTopShardsColumns';
|
@@ -134,8 +134,8 @@ export const TopShards = ({ tenantPath, type }) => {
|
|
134
134
|
return _jsx(Filters, { value: filters, onChange: handleFiltersChange });
|
135
135
|
};
|
136
136
|
const renderContent = () => {
|
137
|
-
if (error
|
138
|
-
return _jsx("div", { className: "error", children:
|
137
|
+
if (error) {
|
138
|
+
return _jsx("div", { className: "error", children: parseQueryErrorToString(error) });
|
139
139
|
}
|
140
140
|
if (!data || isColumnEntityType(type)) {
|
141
141
|
return i18n('no-data');
|
@@ -1,21 +1,15 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { useThemeValue } from '@gravity-ui/uikit';
|
3
|
-
import { useLocation } from 'react-router';
|
4
|
-
import { parseQuery } from '../../../routes';
|
5
3
|
import { TENANT_PAGES_IDS } from '../../../store/reducers/tenant/constants';
|
6
4
|
import { cn } from '../../../utils/cn';
|
7
|
-
import {
|
8
|
-
import { useSetting } from '../../../utils/hooks';
|
5
|
+
import { useTypedSelector } from '../../../utils/hooks';
|
9
6
|
import Diagnostics from '../Diagnostics/Diagnostics';
|
10
7
|
import { Query } from '../Query/Query';
|
11
8
|
import './ObjectGeneral.scss';
|
12
9
|
const b = cn('object-general');
|
13
10
|
function ObjectGeneral(props) {
|
14
|
-
const location = useLocation();
|
15
11
|
const theme = useThemeValue();
|
16
|
-
const
|
17
|
-
const queryParams = parseQuery(location);
|
18
|
-
const { tenantPage = initialPage } = queryParams;
|
12
|
+
const { tenantPage } = useTypedSelector((state) => state.tenant);
|
19
13
|
const renderTabContent = () => {
|
20
14
|
const { type, additionalTenantProps, additionalNodesProps, tenantName } = props;
|
21
15
|
switch (tenantPage) {
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { HelpPopover } from '@gravity-ui/components';
|
4
|
-
import {
|
4
|
+
import { LayoutHeaderCellsLargeFill } from '@gravity-ui/icons';
|
5
|
+
import { Button, Icon, Tabs } from '@gravity-ui/uikit';
|
5
6
|
import qs from 'qs';
|
6
7
|
import { useLocation } from 'react-router';
|
7
8
|
import { Link } from 'react-router-dom';
|
9
|
+
import { AsyncReplicationState } from '../../../components/AsyncReplicationState';
|
8
10
|
import { ClipboardButton } from '../../../components/ClipboardButton';
|
9
|
-
import { Icon } from '../../../components/Icon';
|
10
11
|
import InfoViewer from '../../../components/InfoViewer/InfoViewer';
|
11
12
|
import { CDCStreamOverview, PersQueueGroupOverview, } from '../../../components/InfoViewer/schemaOverview';
|
12
13
|
import { Loader } from '../../../components/Loader';
|
@@ -71,6 +72,11 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
|
|
71
72
|
};
|
72
73
|
const renderObjectOverview = () => {
|
73
74
|
var _a;
|
75
|
+
const startTimeInMilliseconds = Number(currentSchemaData === null || currentSchemaData === void 0 ? void 0 : currentSchemaData.CreateStep);
|
76
|
+
const createdAt = startTimeInMilliseconds
|
77
|
+
? formatDateTime(startTimeInMilliseconds)
|
78
|
+
: 'unknown';
|
79
|
+
const createdAtLabel = 'Created At';
|
74
80
|
// verbose mapping to guarantee a correct render for new path types
|
75
81
|
// TS will error when a new type is added but not mapped here
|
76
82
|
const pathTypeToComponent = {
|
@@ -87,15 +93,23 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
|
|
87
93
|
[EPathType.EPathTypeExternalTable]: () => (_jsx(ExternalTableSummary, { data: currentObjectData })),
|
88
94
|
[EPathType.EPathTypeExternalDataSource]: () => (_jsx(ExternalDataSourceSummary, { data: currentObjectData })),
|
89
95
|
[EPathType.EPathTypeView]: undefined,
|
96
|
+
[EPathType.EPathTypeReplication]: () => {
|
97
|
+
var _a, _b;
|
98
|
+
return (_jsx(InfoViewer, { info: [
|
99
|
+
{
|
100
|
+
label: createdAtLabel,
|
101
|
+
value: createdAt,
|
102
|
+
},
|
103
|
+
{
|
104
|
+
label: 'State',
|
105
|
+
value: (_jsx(AsyncReplicationState, { state: (_b = (_a = currentObjectData === null || currentObjectData === void 0 ? void 0 : currentObjectData.PathDescription) === null || _a === void 0 ? void 0 : _a.ReplicationDescription) === null || _b === void 0 ? void 0 : _b.State })),
|
106
|
+
},
|
107
|
+
] }));
|
108
|
+
},
|
90
109
|
};
|
91
110
|
let component = (currentSchemaData === null || currentSchemaData === void 0 ? void 0 : currentSchemaData.PathType) && ((_a = pathTypeToComponent[currentSchemaData.PathType]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent));
|
92
111
|
if (!component) {
|
93
|
-
|
94
|
-
let createTime = '';
|
95
|
-
if (startTimeInMilliseconds) {
|
96
|
-
createTime = formatDateTime(startTimeInMilliseconds);
|
97
|
-
}
|
98
|
-
component = _jsx(InfoViewer, { info: [{ label: 'Create time', value: createTime }] });
|
112
|
+
component = _jsx(InfoViewer, { info: [{ label: createdAtLabel, value: createdAt }] });
|
99
113
|
}
|
100
114
|
return component;
|
101
115
|
};
|
@@ -138,7 +152,7 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
|
|
138
152
|
};
|
139
153
|
const renderCommonInfoControls = () => {
|
140
154
|
const showPreview = isTableType(type) && !isIndexTableType(subType);
|
141
|
-
return (_jsxs(React.Fragment, { children: [showPreview && (_jsx(Button, { view: "flat-secondary", onClick: onOpenPreview, title: i18n('summary.showPreview'), children: _jsx(Icon, {
|
155
|
+
return (_jsxs(React.Fragment, { children: [showPreview && (_jsx(Button, { view: "flat-secondary", onClick: onOpenPreview, title: i18n('summary.showPreview'), children: _jsx(Icon, { data: LayoutHeaderCellsLargeFill }) })), currentSchemaPath && (_jsx(ClipboardButton, { text: currentSchemaPath, view: "flat-secondary", title: i18n('summary.copySchemaPath') })), _jsx(PaneVisibilityToggleButtons, { onCollapse: onCollapseInfoHandler, onExpand: onExpandInfoHandler, isCollapsed: commonInfoVisibilityState.collapsed, initialDirection: "bottom" })] }));
|
142
156
|
};
|
143
157
|
const renderEntityTypeBadge = () => {
|
144
158
|
const { Status, Reason } = currentItem;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { IQueryResult
|
1
|
+
import type { IQueryResult } from '../../../../types/store/query';
|
2
2
|
import './ExecuteResult.scss';
|
3
3
|
interface ExecuteResultProps {
|
4
4
|
data: IQueryResult | undefined;
|
5
5
|
stats: IQueryResult['stats'] | undefined;
|
6
|
-
error:
|
6
|
+
error: unknown;
|
7
7
|
isResultsCollapsed?: boolean;
|
8
8
|
onCollapseResults: VoidFunction;
|
9
9
|
onExpandResults: VoidFunction;
|
@@ -12,7 +12,7 @@ import { disableFullscreen } from '../../../../store/reducers/fullscreen';
|
|
12
12
|
import { getArray } from '../../../../utils';
|
13
13
|
import { cn } from '../../../../utils/cn';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
|
-
import {
|
15
|
+
import { parseQueryError } from '../../../../utils/query';
|
16
16
|
import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
|
17
17
|
import { ResultIssues } from '../Issues/Issues';
|
18
18
|
import { QueryDuration } from '../QueryDuration/QueryDuration';
|
@@ -39,6 +39,7 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
39
39
|
const currentColumns = isMulti ? (_c = data === null || data === void 0 ? void 0 : data.resultSets) === null || _c === void 0 ? void 0 : _c[selectedResultSet].columns : data === null || data === void 0 ? void 0 : data.columns;
|
40
40
|
const textResults = getPreparedResult(currentResult);
|
41
41
|
const copyDisabled = !textResults.length;
|
42
|
+
const parsedError = parseQueryError(error);
|
42
43
|
React.useEffect(() => {
|
43
44
|
return () => {
|
44
45
|
dispatch(disableFullscreen());
|
@@ -70,15 +71,13 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
70
71
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('result-fullscreen-wrapper'), children: content }) }))] }));
|
71
72
|
};
|
72
73
|
const renderIssues = () => {
|
73
|
-
|
74
|
-
if (!error) {
|
74
|
+
if (!parsedError) {
|
75
75
|
return null;
|
76
76
|
}
|
77
|
-
if (typeof
|
78
|
-
const content = _jsx(ResultIssues, { data:
|
77
|
+
if (typeof parsedError === 'object') {
|
78
|
+
const content = _jsx(ResultIssues, { data: parsedError });
|
79
79
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('result-fullscreen-wrapper', b('result')), children: content }) }))] }));
|
80
80
|
}
|
81
|
-
const parsedError = typeof error === 'string' ? error : prepareQueryError(error);
|
82
81
|
return _jsx("div", { className: b('error'), children: parsedError });
|
83
82
|
};
|
84
83
|
const renderResultSection = () => {
|
@@ -8,11 +8,12 @@ import EnableFullscreenButton from '../../../../components/EnableFullscreenButto
|
|
8
8
|
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
|
9
9
|
import { MonacoEditor } from '../../../../components/MonacoEditor/MonacoEditor';
|
10
10
|
import { QueryExecutionStatus } from '../../../../components/QueryExecutionStatus';
|
11
|
-
import { explainVersions } from '../../../../store/reducers/explainQuery';
|
11
|
+
import { explainVersions } from '../../../../store/reducers/explainQuery/utils';
|
12
12
|
import { disableFullscreen } from '../../../../store/reducers/fullscreen';
|
13
13
|
import { cn } from '../../../../utils/cn';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
15
|
import { LANGUAGE_S_EXPRESSION_ID } from '../../../../utils/monaco/s-expression/constants';
|
16
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
16
17
|
import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
|
17
18
|
import { renderExplainNode } from './utils';
|
18
19
|
import './ExplainResult.scss';
|
@@ -97,7 +98,7 @@ export function ExplainResult(props) {
|
|
97
98
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && _jsx(Fullscreen, { children: content })] }));
|
98
99
|
};
|
99
100
|
const renderAstExplain = () => {
|
100
|
-
const content = (_jsx("div", { className: b('ast'), children: _jsx(MonacoEditor, { language: LANGUAGE_S_EXPRESSION_ID, value: props.ast, options: EDITOR_OPTIONS, wrappingIndent: "indent" }) }));
|
101
|
+
const content = (_jsx("div", { className: b('ast'), children: _jsx(MonacoEditor, { language: LANGUAGE_S_EXPRESSION_ID, value: props.ast, options: EDITOR_OPTIONS, wrappingIndent: "indent", theme: `vs-${props.theme}` }) }));
|
101
102
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && _jsx(Fullscreen, { children: content })] }));
|
102
103
|
};
|
103
104
|
const renderGraph = () => {
|
@@ -117,20 +118,11 @@ export function ExplainResult(props) {
|
|
117
118
|
return (_jsxs(React.Fragment, { children: [!isFullscreen && content, isFullscreen && _jsx(Fullscreen, { children: content })] }));
|
118
119
|
};
|
119
120
|
const renderError = () => {
|
120
|
-
|
121
|
-
const { error } = props;
|
122
|
-
let message;
|
123
|
-
if (error.data) {
|
124
|
-
message = typeof error.data === 'string' ? error.data : (_a = error.data.error) === null || _a === void 0 ? void 0 : _a.message;
|
125
|
-
}
|
126
|
-
else {
|
127
|
-
message = error;
|
128
|
-
}
|
129
|
-
return _jsx("div", { className: b('text-message'), children: message });
|
121
|
+
return _jsx("div", { className: b('text-message'), children: parseQueryErrorToString(props.error) });
|
130
122
|
};
|
131
123
|
const renderContent = () => {
|
132
|
-
const { error, loading
|
133
|
-
if (loading
|
124
|
+
const { error, loading } = props;
|
125
|
+
if (loading) {
|
134
126
|
return renderLoader();
|
135
127
|
}
|
136
128
|
if (error) {
|
@@ -1,13 +1,10 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
+
import { CircleExclamationFill, CircleInfoFill, CircleXmarkFill, TriangleExclamationFill, } from '@gravity-ui/icons';
|
3
4
|
import { ArrowToggle, Button, Icon } from '@gravity-ui/uikit';
|
4
5
|
import ShortyString from '../../../../components/ShortyString/ShortyString';
|
5
6
|
import { cn } from '../../../../utils/cn';
|
6
7
|
import { getSeverity } from './models';
|
7
|
-
import warningIcon from '../../../../assets/icons/circle-exclamation.svg';
|
8
|
-
import infoIcon from '../../../../assets/icons/circle-info.svg';
|
9
|
-
import fatalIcon from '../../../../assets/icons/circle-xmark.svg';
|
10
|
-
import errorIcon from '../../../../assets/icons/triangle-exclamation.svg';
|
11
8
|
import './Issues.scss';
|
12
9
|
const blockWrapper = cn('kv-result-issues');
|
13
10
|
const blockIssues = cn('kv-issues');
|
@@ -55,15 +52,15 @@ function IssueList(props) {
|
|
55
52
|
return (_jsx("div", { className: blockIssue('list'), children: issues.map((issue, index) => (_jsx(Issue, { issue: issue, level: level, expanded: expanded }, index))) }));
|
56
53
|
}
|
57
54
|
const severityIcons = {
|
58
|
-
S_INFO:
|
59
|
-
S_WARNING:
|
60
|
-
S_ERROR:
|
61
|
-
S_FATAL:
|
55
|
+
S_INFO: CircleInfoFill,
|
56
|
+
S_WARNING: CircleExclamationFill,
|
57
|
+
S_ERROR: TriangleExclamationFill,
|
58
|
+
S_FATAL: CircleXmarkFill,
|
62
59
|
};
|
63
60
|
const blockIssueSeverity = cn('yql-issue-severity');
|
64
61
|
function IssueSeverity({ severity }) {
|
65
62
|
const shortenSeverity = severity.slice(2).toLowerCase();
|
66
|
-
return (_jsxs("span", { className: blockIssueSeverity({ severity: shortenSeverity }), children: [_jsx(Icon, { className: blockIssueSeverity('icon'), data: severityIcons[severity]
|
63
|
+
return (_jsxs("span", { className: blockIssueSeverity({ severity: shortenSeverity }), children: [_jsx(Icon, { className: blockIssueSeverity('icon'), data: severityIcons[severity] }), _jsx("span", { className: blockIssueSeverity('title'), children: shortenSeverity })] }));
|
67
64
|
}
|
68
65
|
function getIssuePosition(issue) {
|
69
66
|
const { position = {} } = issue;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { Xmark } from '@gravity-ui/icons';
|
3
|
+
import { Button, Icon, Loader } from '@gravity-ui/uikit';
|
3
4
|
import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
|
4
5
|
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
|
5
|
-
import { Icon } from '../../../../components/Icon';
|
6
6
|
import { QueryResultTable } from '../../../../components/QueryResultTable';
|
7
7
|
import { previewApi } from '../../../../store/reducers/preview';
|
8
8
|
import { setShowPreview } from '../../../../store/reducers/schema/schema';
|
9
9
|
import { cn } from '../../../../utils/cn';
|
10
10
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
11
|
-
import {
|
11
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
12
12
|
import { isExternalTableType, isTableType } from '../../utils/schema';
|
13
13
|
import i18n from '../i18n';
|
14
14
|
import './Preview.scss';
|
@@ -26,7 +26,7 @@ export const Preview = ({ database, type }) => {
|
|
26
26
|
dispatch(setShowPreview(false));
|
27
27
|
};
|
28
28
|
const renderHeader = () => {
|
29
|
-
return (_jsxs("div", { className: b('header'), children: [_jsxs("div", { className: b('title'), children: [i18n('preview.title'), ' ', _jsx("div", { className: b('table-name'), children: currentSchemaPath })] }), _jsxs("div", { className: b('controls-left'), children: [_jsx(EnableFullscreenButton, { disabled: Boolean(error) }), _jsx(Button, { view: "flat-secondary", onClick: handleClosePreview, title: i18n('preview.close'), children: _jsx(Icon, {
|
29
|
+
return (_jsxs("div", { className: b('header'), children: [_jsxs("div", { className: b('title'), children: [i18n('preview.title'), ' ', _jsx("div", { className: b('table-name'), children: currentSchemaPath })] }), _jsxs("div", { className: b('controls-left'), children: [_jsx(EnableFullscreenButton, { disabled: Boolean(error) }), _jsx(Button, { view: "flat-secondary", onClick: handleClosePreview, title: i18n('preview.close'), children: _jsx(Icon, { data: Xmark, size: 18 }) })] })] }));
|
30
30
|
};
|
31
31
|
if (loading) {
|
32
32
|
return (_jsx("div", { className: b('loader-container'), children: _jsx(Loader, { size: "m" }) }));
|
@@ -36,7 +36,7 @@ export const Preview = ({ database, type }) => {
|
|
36
36
|
message = _jsx("div", { className: b('message-container'), children: i18n('preview.not-available') });
|
37
37
|
}
|
38
38
|
else if (error) {
|
39
|
-
message = _jsx("div", { className: b('message-container', 'error'), children:
|
39
|
+
message = (_jsx("div", { className: b('message-container', 'error'), children: parseQueryErrorToString(error) }));
|
40
40
|
}
|
41
41
|
const content = message !== null && message !== void 0 ? message : (_jsx("div", { className: b('result'), children: _jsx(QueryResultTable, { data: data.result, columns: data.columns }) }));
|
42
42
|
return (_jsxs("div", { className: b(), children: [renderHeader(), isFullscreen ? _jsx(Fullscreen, { children: content }) : content] }));
|
@@ -1,16 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { goToNextQuery, goToPreviousQuery, saveQueryToHistory,
|
3
|
-
import { getExplainQuery, getExplainQueryAst } from '../../../../store/reducers/explainQuery';
|
2
|
+
import { goToNextQuery, goToPreviousQuery, saveQueryToHistory, setTenantPath } from '../../../../store/reducers/executeQuery';
|
4
3
|
import { setShowPreview } from '../../../../store/reducers/schema/schema';
|
5
4
|
import type { EPathType } from '../../../../types/api/schema';
|
6
5
|
import type { ExecuteQueryState } from '../../../../types/store/executeQuery';
|
7
|
-
import type { ExplainQueryState } from '../../../../types/store/explainQuery';
|
8
6
|
import './QueryEditor.scss';
|
9
7
|
interface QueryEditorProps {
|
10
8
|
path: string;
|
11
|
-
sendExecuteQuery: (...args: Parameters<typeof sendExecuteQuery>) => void;
|
12
|
-
getExplainQuery: (...args: Parameters<typeof getExplainQuery>) => void;
|
13
|
-
getExplainQueryAst: (...args: Parameters<typeof getExplainQueryAst>) => void;
|
14
9
|
changeUserInput: (arg: {
|
15
10
|
input: string;
|
16
11
|
}) => void;
|
@@ -18,7 +13,6 @@ interface QueryEditorProps {
|
|
18
13
|
goToPreviousQuery: (...args: Parameters<typeof goToPreviousQuery>) => void;
|
19
14
|
setTenantPath: (...args: Parameters<typeof setTenantPath>) => void;
|
20
15
|
executeQuery: ExecuteQueryState;
|
21
|
-
explainQuery: ExplainQueryState;
|
22
16
|
theme: string;
|
23
17
|
type?: EPathType;
|
24
18
|
showPreview: boolean;
|
@@ -28,8 +22,8 @@ interface QueryEditorProps {
|
|
28
22
|
declare function QueryEditor(props: QueryEditorProps): import("react/jsx-runtime").JSX.Element;
|
29
23
|
declare const _default: import("react-redux").ConnectedComponent<typeof QueryEditor, {
|
30
24
|
theme: string;
|
31
|
-
type?: EPathType | undefined;
|
32
25
|
path: string;
|
26
|
+
type?: EPathType | undefined;
|
33
27
|
changeUserInput: (arg: {
|
34
28
|
input: string;
|
35
29
|
}) => void;
|