ydb-embedded-ui 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/assets/icons/cluster.svg +1 -0
- package/dist/assets/icons/hide.svg +1 -0
- package/dist/assets/icons/show.svg +1 -0
- package/dist/assets/icons/user-check.svg +1 -1
- package/dist/assets/icons/user-secret.svg +1 -1
- package/dist/components/AsideNavigation/AsideHeader.scss +1 -2
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +7 -7
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +2 -2
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +6 -6
- package/dist/components/AsideNavigation/Drawer/Drawer.scss +5 -5
- package/dist/components/AsideNavigation/Logo/Logo.scss +3 -4
- package/dist/components/AsideNavigation/Settings/Settings.scss +27 -12
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +14 -6
- package/dist/components/Breadcrumbs/Breadcrumbs.scss +2 -1
- package/dist/components/ClusterInfo/ClusterInfo.scss +19 -12
- package/dist/components/ClusterInfo/ClusterInfo.tsx +110 -10
- package/dist/components/CopyToClipboard/CopyToClipboard.tsx +39 -0
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +5 -4
- package/dist/components/Divider/Divider.scss +7 -0
- package/dist/components/Divider/Divider.tsx +11 -0
- package/dist/components/EmptyState/EmptyState.scss +14 -10
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +22 -0
- package/dist/components/EntityStatus/EntityStatus.js +5 -3
- package/dist/components/EntityStatus/EntityStatus.scss +35 -13
- package/dist/components/FullGroupViewer/FullGroupViewer.js +2 -4
- package/dist/components/FullGroupViewer/FullGroupViewer.scss +6 -3
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +19 -11
- package/dist/components/Fullscreen/Fullscreen.scss +28 -0
- package/dist/components/Fullscreen/Fullscreen.tsx +81 -0
- package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +1 -0
- package/dist/components/GroupViewer/GroupViewer.scss +8 -4
- package/dist/components/Icon/Icon.js +2 -0
- package/dist/components/InfoViewer/InfoViewer.scss +22 -16
- package/dist/components/NodesViewer/NodesViewer.js +25 -35
- package/dist/components/NodesViewer/NodesViewer.scss +15 -11
- package/dist/components/PDiskViewer/PDiskViewer.scss +10 -4
- package/dist/components/Pagination/Pagination.scss +6 -3
- package/dist/components/PoolBar/PoolBar.scss +14 -10
- package/dist/components/PoolUsage/PoolUsage.scss +17 -9
- package/dist/components/ProgressViewer/ProgressViewer.js +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.scss +28 -18
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +14 -0
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +29 -0
- package/dist/components/SplitPane/SplitPane.scss +33 -40
- package/dist/components/SplitPane/SplitPane.tsx +94 -0
- package/dist/components/Tablet/Tablet.scss +9 -6
- package/dist/components/TabletsOverall/TabletsOverall.scss +19 -0
- package/dist/components/TabletsOverall/TabletsOverall.tsx +105 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.scss +24 -18
- package/dist/components/TabletsViewer/TabletsViewer.scss +12 -9
- package/dist/components/Tag/Tag.scss +6 -4
- package/dist/components/Tags/Tags.scss +1 -1
- package/dist/components/TreeView/TreeView.js +1 -1
- package/dist/components/TreeView/TreeView.scss +9 -0
- package/dist/components/TruncatedQuery/TruncatedQuery.scss +4 -3
- package/dist/containers/App/App.js +1 -0
- package/dist/containers/App/App.scss +50 -31
- package/dist/containers/App/Content.js +2 -2
- package/dist/containers/App/NodesTable.scss +25 -0
- package/dist/containers/App/TipPopup/TipPopup.scss +10 -6
- package/dist/containers/AppIcons/AppIcons.js +46 -22
- package/dist/containers/AsideNavigation/AsideNavigation.scss +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +12 -5
- package/dist/containers/Authentication/Authentication.scss +63 -14
- package/dist/containers/Authentication/Authentication.tsx +42 -9
- package/dist/containers/Cluster/Cluster.scss +5 -3
- package/dist/containers/Cluster/Cluster.tsx +49 -0
- package/dist/containers/Group/Group.scss +1 -1
- package/dist/containers/Header/Header.scss +15 -59
- package/dist/containers/Header/Header.tsx +75 -0
- package/dist/containers/Header/Host/Host.scss +10 -3
- package/dist/containers/Heatmap/Heatmap.js +1 -1
- package/dist/containers/Heatmap/Heatmap.scss +16 -7
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +3 -3
- package/dist/containers/Heatmap/Histogram/Histogram.scss +21 -9
- package/dist/containers/Node/Node.js +1 -1
- package/dist/containers/Node/Node.scss +6 -4
- package/dist/containers/Nodes/Nodes.js +28 -27
- package/dist/containers/Nodes/Nodes.scss +5 -17
- package/dist/containers/Pdisk/Pdisk.scss +6 -4
- package/dist/containers/Pool/Pool.scss +7 -4
- package/dist/containers/ReduxTooltip/ReduxTooltip.scss +5 -1
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +77 -0
- package/dist/containers/{StorageV2 → Storage}/DiskStateProgressBar/DiskStateProgressBar.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.scss +6 -4
- package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.tsx +1 -2
- package/dist/containers/{StorageV2 → Storage}/Storage.js +72 -34
- package/dist/containers/{StorageV2 → Storage}/Storage.scss +12 -14
- package/dist/containers/{StorageV2 → Storage}/StorageFilter/StorageFilter.js +1 -9
- package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.scss +2 -0
- package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.scss +2 -0
- package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.js +0 -0
- package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.scss +6 -4
- package/dist/containers/Tablet/Tablet.scss +13 -9
- package/dist/containers/Tablets/Tablets.js +21 -90
- package/dist/containers/Tablets/Tablets.scss +9 -35
- package/dist/containers/TabletsFilters/TabletsFilters.js +2 -75
- package/dist/containers/TabletsFilters/TabletsFilters.scss +15 -35
- package/dist/containers/Tenant/Acl/Acl.js +54 -47
- package/dist/containers/Tenant/Acl/Acl.scss +15 -4
- package/dist/containers/Tenant/{Compute → Diagnostics/Compute}/Compute.js +35 -12
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.scss +14 -0
- package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.js +50 -1
- package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.scss +5 -3
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +27 -0
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +88 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +50 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +208 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +75 -0
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.js +191 -0
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +79 -0
- package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssueViewer.scss +25 -13
- package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssuesViewer.js +2 -2
- package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.js +14 -8
- package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.scss +7 -5
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.js +39 -9
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.scss +35 -36
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.js +0 -0
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.scss +11 -9
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.scss +13 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +123 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +200 -0
- package/dist/{components → containers/Tenant/Diagnostics}/TenantOverview/TenantOverview.scss +24 -17
- package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.js +32 -30
- package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.scss +10 -9
- package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.js +25 -29
- package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.scss +1 -13
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.scss +38 -0
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +104 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +165 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +310 -0
- package/dist/containers/Tenant/Preview/Preview.js +50 -12
- package/dist/containers/Tenant/Preview/Preview.scss +45 -3
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +85 -0
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +94 -0
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +291 -264
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +47 -18
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +132 -32
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +47 -11
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +89 -20
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +60 -6
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +10 -23
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +15 -7
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +7 -3
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +28 -17
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +7 -7
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +1 -11
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.js +37 -17
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.scss +33 -12
- package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.scss +17 -0
- package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.tsx +125 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +5 -4
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.scss +6 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +53 -34
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.scss +1 -22
- package/dist/containers/Tenant/Tenant.scss +3 -32
- package/dist/containers/Tenant/Tenant.tsx +161 -0
- package/dist/containers/Tenant/TenantPages.tsx +48 -0
- package/dist/containers/Tenant/utils/ToggleButton.scss +26 -0
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +126 -0
- package/dist/containers/Tenants/Tenants.js +41 -55
- package/dist/containers/Tenants/Tenants.scss +4 -17
- package/dist/containers/UserSettings/UserSettings.tsx +0 -2
- package/dist/containers/Vdisk/Vdisk.scss +6 -4
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +1 -1
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +5 -5
- package/dist/{routes.js → routes.ts} +14 -4
- package/dist/store/reducers/clusterNodes.js +1 -1
- package/dist/store/reducers/fullscreen.ts +31 -0
- package/dist/store/reducers/header.ts +23 -0
- package/dist/store/reducers/hotKeys.js +1 -1
- package/dist/store/reducers/index.js +6 -0
- package/dist/store/reducers/saveQuery.ts +33 -0
- package/dist/store/reducers/schema.js +14 -0
- package/dist/store/reducers/shardsWorkload.js +1 -1
- package/dist/store/state-url-mapping.js +1 -1
- package/dist/store/utils.js +2 -6
- package/dist/styles/mixins.scss +49 -34
- package/dist/utils/autofetcher.ts +51 -0
- package/dist/utils/constants.js +25 -7
- package/dist/utils/createToast.tsx +23 -0
- package/dist/utils/getNodesColumns.js +25 -28
- package/dist/utils/index.js +6 -2
- package/package.json +8 -4
- package/dist/components/SplitPane/SplitPane.js +0 -368
- package/dist/components/TenantOverview/TenantOverview.js +0 -148
- package/dist/containers/Cluster/Cluster.js +0 -168
- package/dist/containers/Header/Header.js +0 -88
- package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +0 -81
- package/dist/containers/Tenant/Compute/Compute.scss +0 -6
- package/dist/containers/Tenant/Healthcheck/Healthcheck.js +0 -116
- package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +0 -64
- package/dist/containers/Tenant/Schema/Info/Info.js +0 -84
- package/dist/containers/Tenant/Schema/Info/Info.scss +0 -3
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +0 -439
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +0 -90
- package/dist/containers/Tenant/Schema/SchemaPages.js +0 -56
- package/dist/containers/Tenant/Tenant.js +0 -199
- package/dist/containers/Tenant/TenantPages.js +0 -35
@@ -5,35 +5,30 @@ import {connect} from 'react-redux';
|
|
5
5
|
import _ from 'lodash';
|
6
6
|
|
7
7
|
import DataTable from '@yandex-cloud/react-data-table';
|
8
|
-
import {Loader,
|
8
|
+
import {Loader, TextInput, Button} from '@yandex-cloud/uikit';
|
9
9
|
|
10
10
|
import EntityStatus from '../../components/EntityStatus/EntityStatus';
|
11
11
|
import PoolsGraph from '../../components/PoolsGraph/PoolsGraph';
|
12
12
|
import TabletsStatistic from '../../components/TabletsStatistic/TabletsStatistic';
|
13
13
|
import ProblemFilter, {problemFilterType} from '../../components/ProblemFilter/ProblemFilter';
|
14
|
-
import {AutoFetcher} from '
|
14
|
+
import {AutoFetcher} from '../../utils/autofetcher';
|
15
15
|
|
16
|
-
import routes, {createHref} from '../../routes';
|
17
|
-
import {formatCPU,
|
16
|
+
import routes, {CLUSTER_PAGES, createHref} from '../../routes';
|
17
|
+
import {formatCPU, formatBytesToGigabyte} from '../../utils';
|
18
18
|
import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
|
19
19
|
import {withSearch} from '../../HOCS';
|
20
|
-
import {ALL} from '../../utils/constants';
|
20
|
+
import {ALL, DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
21
21
|
import {getTenantsInfo} from '../../store/reducers/tenants';
|
22
22
|
import {changeFilter} from '../../store/reducers/settings';
|
23
|
+
import {setHeader} from '../../store/reducers/header';
|
24
|
+
|
23
25
|
import {clusterName} from '../../store';
|
24
|
-
import {
|
26
|
+
import {TenantTabsGroups, TENANT_GENERAL_TABS, TENANT_INFO_TABS} from '../Tenant/TenantPages';
|
25
27
|
|
26
28
|
import './Tenants.scss';
|
27
29
|
|
28
30
|
const b = cn('tenants');
|
29
31
|
|
30
|
-
const tableSettings = {
|
31
|
-
displayIndices: false,
|
32
|
-
stickyHead: DataTable.MOVING,
|
33
|
-
syncHeadOnResize: true,
|
34
|
-
dynamicRender: true,
|
35
|
-
};
|
36
|
-
|
37
32
|
class Tenants extends React.Component {
|
38
33
|
static renderLoader() {
|
39
34
|
return (
|
@@ -53,6 +48,7 @@ class Tenants extends React.Component {
|
|
53
48
|
hideTooltip: PropTypes.func,
|
54
49
|
searchQuery: PropTypes.string,
|
55
50
|
handleSearchQuery: PropTypes.func,
|
51
|
+
setHeader: PropTypes.func,
|
56
52
|
filter: problemFilterType,
|
57
53
|
changeFilter: PropTypes.func,
|
58
54
|
cluster: PropTypes.object,
|
@@ -74,42 +70,35 @@ class Tenants extends React.Component {
|
|
74
70
|
});
|
75
71
|
}
|
76
72
|
|
77
|
-
state = {
|
78
|
-
formatValues: false,
|
79
|
-
};
|
80
|
-
|
81
73
|
componentDidMount() {
|
82
74
|
this.autofetcher = new AutoFetcher();
|
83
75
|
this.props.getTenantsInfo(clusterName);
|
84
76
|
this.autofetcher.fetch(() => this.props.getTenantsInfo(clusterName));
|
77
|
+
this.props.setHeader([
|
78
|
+
{
|
79
|
+
text: CLUSTER_PAGES.tenants.title,
|
80
|
+
link: createHref(routes.cluster, {activeTab: CLUSTER_PAGES.tenants.id}),
|
81
|
+
},
|
82
|
+
]);
|
85
83
|
}
|
86
84
|
|
87
85
|
componentWillUnmount() {
|
88
86
|
this.autofetcher.stop();
|
89
87
|
}
|
90
88
|
|
91
|
-
handleFormatChange = () => {
|
92
|
-
this.setState({formatValues: !this.state.formatValues});
|
93
|
-
};
|
94
|
-
|
95
89
|
renderControls() {
|
96
90
|
const {searchQuery, handleSearchQuery, filter, changeFilter} = this.props;
|
97
|
-
const {formatValues} = this.state;
|
98
91
|
|
99
92
|
return (
|
100
93
|
<div className={b('controls')}>
|
101
|
-
<
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<ProblemFilter value={filter} onChange={changeFilter} />
|
110
|
-
</div>
|
111
|
-
|
112
|
-
<Switch onUpdate={this.handleFormatChange} checked={formatValues} content="raw" />
|
94
|
+
<TextInput
|
95
|
+
className={b('search')}
|
96
|
+
placeholder="Database name"
|
97
|
+
text={searchQuery}
|
98
|
+
onUpdate={handleSearchQuery}
|
99
|
+
hasClear
|
100
|
+
/>
|
101
|
+
<ProblemFilter value={filter} onChange={changeFilter} />
|
113
102
|
</div>
|
114
103
|
);
|
115
104
|
}
|
@@ -131,7 +120,6 @@ class Tenants extends React.Component {
|
|
131
120
|
handleSearchQuery,
|
132
121
|
additionalTenantsInfo = {},
|
133
122
|
} = this.props;
|
134
|
-
const {formatValues} = this.state;
|
135
123
|
|
136
124
|
const filteredTenantsBySearch = tenants.filter(
|
137
125
|
(item) =>
|
@@ -146,25 +134,25 @@ class Tenants extends React.Component {
|
|
146
134
|
name: 'Name',
|
147
135
|
header: 'Database',
|
148
136
|
render: ({value, row}) => {
|
137
|
+
const backend = row.MonitoringEndpoint ?? row.backend;
|
149
138
|
const tenantBackend = additionalTenantsInfo.tenantBackend
|
150
|
-
? additionalTenantsInfo.tenantBackend(
|
139
|
+
? additionalTenantsInfo.tenantBackend(backend)
|
151
140
|
: undefined;
|
141
|
+
const isExternalLink = Boolean(backend);
|
152
142
|
return (
|
153
143
|
<React.Fragment>
|
154
144
|
<EntityStatus
|
155
|
-
externalLink={
|
145
|
+
externalLink={isExternalLink}
|
156
146
|
className={b('name')}
|
157
147
|
name={value || 'unknown database'}
|
158
148
|
status={row.Overall}
|
159
149
|
hasClipboardButton
|
160
|
-
path={createHref(
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
},
|
167
|
-
)}
|
150
|
+
path={createHref(routes.tenant, undefined, {
|
151
|
+
name: value,
|
152
|
+
backend: tenantBackend,
|
153
|
+
[TenantTabsGroups.info]: TENANT_INFO_TABS[0].id,
|
154
|
+
[TenantTabsGroups.general]: TENANT_GENERAL_TABS[0].id,
|
155
|
+
})}
|
168
156
|
/>
|
169
157
|
{additionalTenantsInfo.name && additionalTenantsInfo.name(value, row)}
|
170
158
|
</React.Fragment>
|
@@ -244,8 +232,7 @@ class Tenants extends React.Component {
|
|
244
232
|
const memory = MemoryUsed ?? Metrics.Memory;
|
245
233
|
return isNaN(Number(memory)) ? 0 : Number(memory);
|
246
234
|
},
|
247
|
-
render: ({value}) =>
|
248
|
-
value ? (formatValues ? formatNumber(value) : formatBytes(value)) : '—',
|
235
|
+
render: ({value}) => (value ? formatBytesToGigabyte(value) : '—'),
|
249
236
|
align: DataTable.RIGHT,
|
250
237
|
defaultOrder: DataTable.DESCENDING,
|
251
238
|
},
|
@@ -262,8 +249,7 @@ class Tenants extends React.Component {
|
|
262
249
|
const storage = StorageAllocatedSize ?? Metrics.Storage;
|
263
250
|
return isNaN(Number(storage)) ? 0 : Number(storage);
|
264
251
|
},
|
265
|
-
render: ({value}) =>
|
266
|
-
value ? (formatValues ? formatNumber(value) : formatBytes(value)) : '—',
|
252
|
+
render: ({value}) => (value ? formatBytesToGigabyte(value) : '—'),
|
267
253
|
align: DataTable.RIGHT,
|
268
254
|
defaultOrder: DataTable.DESCENDING,
|
269
255
|
},
|
@@ -298,7 +284,7 @@ class Tenants extends React.Component {
|
|
298
284
|
name: 'Tablets',
|
299
285
|
header: 'Tablets States',
|
300
286
|
sortable: false,
|
301
|
-
width:
|
287
|
+
width: 430,
|
302
288
|
render: ({value, row}) =>
|
303
289
|
value ? (
|
304
290
|
<TabletsStatistic path={row.Name} tablets={value} nodeIds={row.NodeIds} />
|
@@ -308,9 +294,7 @@ class Tenants extends React.Component {
|
|
308
294
|
},
|
309
295
|
];
|
310
296
|
|
311
|
-
if (filteredTenants.length === 0 && filter
|
312
|
-
return <div className="error"> no tenants data</div>;
|
313
|
-
} else if (filteredTenants.length === 0) {
|
297
|
+
if (filteredTenants.length === 0 && filter !== ALL) {
|
314
298
|
return <div className="no-problem" />;
|
315
299
|
}
|
316
300
|
|
@@ -318,11 +302,12 @@ class Tenants extends React.Component {
|
|
318
302
|
<div className={b('table-wrapper')}>
|
319
303
|
<div className={b('table-content')}>
|
320
304
|
<DataTable
|
321
|
-
theme="
|
305
|
+
theme="yandex-cloud"
|
322
306
|
data={filteredTenants}
|
323
307
|
columns={columns}
|
324
|
-
settings={
|
308
|
+
settings={DEFAULT_TABLE_SETTINGS}
|
325
309
|
dynamicRender={true}
|
310
|
+
emptyDataMessage="No such tenants"
|
326
311
|
/>
|
327
312
|
</div>
|
328
313
|
</div>
|
@@ -370,6 +355,7 @@ const mapDispatchToProps = {
|
|
370
355
|
hideTooltip,
|
371
356
|
showTooltip,
|
372
357
|
changeFilter,
|
358
|
+
setHeader,
|
373
359
|
};
|
374
360
|
|
375
361
|
export default withSearch(connect(mapStateToProps, mapDispatchToProps)(Tenants));
|
@@ -1,8 +1,8 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.tenants {
|
4
|
-
@include flex-container();
|
5
4
|
overflow: auto;
|
5
|
+
@include flex-container();
|
6
6
|
|
7
7
|
&__format-label {
|
8
8
|
margin-right: 15px;
|
@@ -17,8 +17,7 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
&__search {
|
20
|
-
|
21
|
-
margin: 0 15px 0 0;
|
20
|
+
@include search();
|
22
21
|
}
|
23
22
|
|
24
23
|
&__tablets {
|
@@ -30,30 +29,18 @@
|
|
30
29
|
}
|
31
30
|
|
32
31
|
&__controls {
|
33
|
-
|
34
|
-
justify-content: space-between;
|
35
|
-
margin: 17px 0;
|
36
|
-
}
|
37
|
-
|
38
|
-
&__controls-left {
|
39
|
-
display: flex;
|
40
|
-
align-items: center;
|
41
|
-
|
42
|
-
& > * {
|
43
|
-
margin-right: 25px;
|
44
|
-
}
|
32
|
+
@include controls();
|
45
33
|
}
|
46
34
|
|
47
35
|
&__table-wrapper {
|
48
|
-
@include flex-container();
|
49
36
|
overflow: auto;
|
37
|
+
@include flex-container();
|
50
38
|
}
|
51
39
|
|
52
40
|
&__table-content {
|
53
41
|
@include freeze-nth-column(1);
|
54
42
|
|
55
43
|
@include table-styles;
|
56
|
-
@include table-sticky-styles;
|
57
44
|
}
|
58
45
|
|
59
46
|
&__type-value {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.vdisk {
|
4
|
-
@include container-fluid();
|
5
4
|
padding: 20px;
|
5
|
+
@include container-fluid();
|
6
6
|
|
7
7
|
.info-viewer__items {
|
8
8
|
grid-template-columns: max-content;
|
@@ -18,11 +18,12 @@
|
|
18
18
|
}
|
19
19
|
|
20
20
|
&__title {
|
21
|
+
margin-right: 16px;
|
22
|
+
|
21
23
|
font-size: var(--yc-text-body2-font-size);
|
22
|
-
line-height: var(--yc-text-body2-line-height);
|
23
24
|
font-weight: 500;
|
25
|
+
line-height: var(--yc-text-body2-line-height);
|
24
26
|
text-transform: uppercase;
|
25
|
-
margin-right: 16px;
|
26
27
|
}
|
27
28
|
|
28
29
|
&__section {
|
@@ -34,7 +35,8 @@
|
|
34
35
|
}
|
35
36
|
|
36
37
|
&__link {
|
37
|
-
color: var(--yc-color-base-special);
|
38
38
|
text-decoration: none;
|
39
|
+
|
40
|
+
color: var(--yc-color-base-special);
|
39
41
|
}
|
40
42
|
}
|
@@ -11,7 +11,7 @@ import InfoViewer from '../../components/InfoViewer/InfoViewer';
|
|
11
11
|
import EntityStatus from '../../components/EntityStatus/EntityStatus';
|
12
12
|
import ProgressViewer from '../../components/ProgressViewer/ProgressViewer';
|
13
13
|
import PoolsGraph from '../../components/PoolsGraph/PoolsGraph';
|
14
|
-
import {AutoFetcher} from '
|
14
|
+
import {AutoFetcher} from '../../utils/autofetcher';
|
15
15
|
|
16
16
|
import {getVdiskInfo, clearStore as clearStoreVDisk} from '../../store/reducers/vdisk';
|
17
17
|
import {getPdiskInfo, clearStore as clearStorePDisk} from '../../store/reducers/pdisk';
|
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
.vdisk-pdisk-node {
|
4
4
|
display: grid;
|
5
|
-
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
6
5
|
grid-gap: 20px;
|
7
6
|
|
7
|
+
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
8
|
+
|
8
9
|
padding: 20px;
|
10
|
+
@include container-fluid();
|
9
11
|
|
10
12
|
.info-viewer__items {
|
11
13
|
grid-template-columns: max-content;
|
@@ -25,11 +27,10 @@
|
|
25
27
|
&__title {
|
26
28
|
margin-right: 16px;
|
27
29
|
|
28
|
-
text-transform: uppercase;
|
29
|
-
|
30
30
|
font-size: var(--yc-text-body2-font-size);
|
31
31
|
font-weight: 500;
|
32
32
|
line-height: var(--yc-text-body2-line-height);
|
33
|
+
text-transform: uppercase;
|
33
34
|
}
|
34
35
|
|
35
36
|
&__section {
|
@@ -47,8 +48,8 @@
|
|
47
48
|
}
|
48
49
|
&__loader {
|
49
50
|
display: flex;
|
50
|
-
align-items: center;
|
51
51
|
justify-content: center;
|
52
|
+
align-items: center;
|
52
53
|
|
53
54
|
width: 100%;
|
54
55
|
margin-top: 50px;
|
@@ -56,5 +57,4 @@
|
|
56
57
|
.info-viewer__row {
|
57
58
|
align-items: flex-end;
|
58
59
|
}
|
59
|
-
@include container-fluid();
|
60
60
|
}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import qs from 'qs';
|
2
2
|
import {compile} from 'path-to-regexp';
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
4
|
+
//@ts-ignore
|
4
5
|
import {backend, clusterName, webVersion} from './store';
|
5
6
|
|
6
7
|
const routes = {
|
7
|
-
viewer: '/viewer',
|
8
8
|
cluster: '/cluster/:activeTab?',
|
9
|
-
tenant: '/tenant
|
10
|
-
tenantInfo: '/tenantInfo',
|
9
|
+
tenant: '/tenant',
|
11
10
|
node: '/node/:id/:activeTab?',
|
12
11
|
pdisk: '/pdisk/:id',
|
13
12
|
group: '/group/:id',
|
@@ -19,7 +18,18 @@ const routes = {
|
|
19
18
|
clusterPage: '/clusters/:name',
|
20
19
|
};
|
21
20
|
|
22
|
-
export
|
21
|
+
export const CLUSTER_PAGES = {
|
22
|
+
tenants: {id: 'tenants', name: 'Databases', title: 'Database list'},
|
23
|
+
nodes: {id: 'nodes', name: 'Nodes', title: 'Nodes'},
|
24
|
+
storage: {id: 'storage', name: 'Storage', title: 'Storage'},
|
25
|
+
cluster: {id: 'cluster', name: 'Cluster', title: 'Cluster'},
|
26
|
+
};
|
27
|
+
|
28
|
+
export function createHref(
|
29
|
+
route: string,
|
30
|
+
params?: object,
|
31
|
+
query: Record<string | number, string | number> = {},
|
32
|
+
) {
|
23
33
|
let extendedQuery = query;
|
24
34
|
|
25
35
|
const isBackendInQuery = Boolean(query.backend);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
const ENABLE_FULLSCREEN_MODE = 'ENABLE_FULLSCREEN_MODE';
|
2
|
+
const DISABLE_FULLSCREEN_MODE = 'DISABLE_FULLSCREEN_MODE';
|
3
|
+
|
4
|
+
const initialState = false;
|
5
|
+
|
6
|
+
const fullscreen = function (
|
7
|
+
state = initialState,
|
8
|
+
action: ReturnType<typeof enableFullscreen> | ReturnType<typeof disableFullscreen>,
|
9
|
+
) {
|
10
|
+
switch (action.type) {
|
11
|
+
case DISABLE_FULLSCREEN_MODE:
|
12
|
+
return false;
|
13
|
+
case ENABLE_FULLSCREEN_MODE:
|
14
|
+
return true;
|
15
|
+
default:
|
16
|
+
return state;
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
export function enableFullscreen() {
|
21
|
+
return {
|
22
|
+
type: ENABLE_FULLSCREEN_MODE,
|
23
|
+
} as const;
|
24
|
+
}
|
25
|
+
export function disableFullscreen() {
|
26
|
+
return {
|
27
|
+
type: DISABLE_FULLSCREEN_MODE,
|
28
|
+
} as const;
|
29
|
+
}
|
30
|
+
|
31
|
+
export default fullscreen;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
const SET_HEADER = 'SET_HEADER';
|
2
|
+
|
3
|
+
export type HeaderItemType = {text: string; link: string};
|
4
|
+
|
5
|
+
const initialState: HeaderItemType[] = [];
|
6
|
+
|
7
|
+
const header = function (state = initialState, action: ReturnType<typeof setHeader>) {
|
8
|
+
switch (action.type) {
|
9
|
+
case SET_HEADER:
|
10
|
+
return action.data;
|
11
|
+
default:
|
12
|
+
return state;
|
13
|
+
}
|
14
|
+
};
|
15
|
+
|
16
|
+
export function setHeader(headerItems: HeaderItemType[]) {
|
17
|
+
return {
|
18
|
+
type: SET_HEADER,
|
19
|
+
data: headerItems,
|
20
|
+
} as const;
|
21
|
+
}
|
22
|
+
|
23
|
+
export default header;
|
@@ -2,7 +2,7 @@ import {createRequestActionTypes, createApiRequest} from '../utils';
|
|
2
2
|
import '../../services/api';
|
3
3
|
|
4
4
|
const FETCH_HOT_KEYS = createRequestActionTypes('hot_keys', 'FETCH_HOT_KEYS');
|
5
|
-
const SET_HOT_KEYS_OPTIONS =
|
5
|
+
const SET_HOT_KEYS_OPTIONS = 'hot_keys/SET_HOT_KEYS_OPTIONS';
|
6
6
|
|
7
7
|
const initialState = {loading: true, data: {}, wasLoaded: false};
|
8
8
|
|
@@ -32,6 +32,9 @@ import shardsWorkload from './shardsWorkload';
|
|
32
32
|
import hotKeys from './hotKeys';
|
33
33
|
import olapStats from './olapStats';
|
34
34
|
import authentication from './authentication';
|
35
|
+
import header from './header';
|
36
|
+
import saveQuery from './saveQuery';
|
37
|
+
import fullscreen from './fullscreen';
|
35
38
|
|
36
39
|
function singleClusterMode(state = true) {
|
37
40
|
return state;
|
@@ -71,6 +74,9 @@ export const rootReducer = {
|
|
71
74
|
shardsWorkload,
|
72
75
|
hotKeys,
|
73
76
|
authentication,
|
77
|
+
header,
|
78
|
+
saveQuery,
|
79
|
+
fullscreen,
|
74
80
|
};
|
75
81
|
|
76
82
|
export default combineReducers({
|
@@ -0,0 +1,33 @@
|
|
1
|
+
const SET_QUERY_NAME_TO_EDIT = 'SET_QUERY_NAME_TO_EDIT';
|
2
|
+
const CLEAR_QUERY_NAME_TO_EDIT = 'CLEAR_QUERY_NAME_TO_EDIT';
|
3
|
+
|
4
|
+
const initialState = null;
|
5
|
+
|
6
|
+
const saveQuery = function (
|
7
|
+
state = initialState,
|
8
|
+
action: ReturnType<typeof setQueryNameToEdit> | ReturnType<typeof clearQueryNameToEdit>,
|
9
|
+
) {
|
10
|
+
switch (action.type) {
|
11
|
+
case SET_QUERY_NAME_TO_EDIT:
|
12
|
+
return action.data;
|
13
|
+
case CLEAR_QUERY_NAME_TO_EDIT:
|
14
|
+
return null;
|
15
|
+
|
16
|
+
default:
|
17
|
+
return state;
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
export function setQueryNameToEdit(name: string) {
|
22
|
+
return {
|
23
|
+
type: SET_QUERY_NAME_TO_EDIT,
|
24
|
+
data: name,
|
25
|
+
} as const;
|
26
|
+
}
|
27
|
+
export function clearQueryNameToEdit() {
|
28
|
+
return {
|
29
|
+
type: CLEAR_QUERY_NAME_TO_EDIT,
|
30
|
+
} as const;
|
31
|
+
}
|
32
|
+
|
33
|
+
export default saveQuery;
|
@@ -3,6 +3,7 @@ import '../../services/api';
|
|
3
3
|
|
4
4
|
const FETCH_SCHEMA = createRequestActionTypes('schema', 'FETCH_SCHEMA');
|
5
5
|
const SET_SCHEMA = 'schema/SET_SCHEMA';
|
6
|
+
const SET_SHOW_PREVIEW = 'schema/SET_SHOW_PREVIEW';
|
6
7
|
const ENABLE_AUTOREFRESH = 'schema/ENABLE_AUTOREFRESH';
|
7
8
|
const DISABLE_AUTOREFRESH = 'schema/DISABLE_AUTOREFRESH';
|
8
9
|
|
@@ -12,6 +13,7 @@ export const initialState = {
|
|
12
13
|
data: {},
|
13
14
|
currentSchemaPath: undefined,
|
14
15
|
autorefresh: false,
|
16
|
+
showPreview: false,
|
15
17
|
};
|
16
18
|
|
17
19
|
const schema = function z(state = initialState, action) {
|
@@ -64,6 +66,12 @@ const schema = function z(state = initialState, action) {
|
|
64
66
|
autorefresh: false,
|
65
67
|
};
|
66
68
|
}
|
69
|
+
case SET_SHOW_PREVIEW: {
|
70
|
+
return {
|
71
|
+
...state,
|
72
|
+
showPreview: action.data,
|
73
|
+
};
|
74
|
+
}
|
67
75
|
default:
|
68
76
|
return state;
|
69
77
|
}
|
@@ -92,4 +100,10 @@ export function disableAutorefresh() {
|
|
92
100
|
type: DISABLE_AUTOREFRESH,
|
93
101
|
};
|
94
102
|
}
|
103
|
+
export function setShowPreview(value) {
|
104
|
+
return {
|
105
|
+
type: SET_SHOW_PREVIEW,
|
106
|
+
data: value,
|
107
|
+
};
|
108
|
+
}
|
95
109
|
export default schema;
|
@@ -2,7 +2,7 @@ import {createRequestActionTypes, createApiRequest} from '../utils';
|
|
2
2
|
import '../../services/api';
|
3
3
|
|
4
4
|
const SEND_SHARD_QUERY = createRequestActionTypes('query', 'SEND_SHARD_QUERY');
|
5
|
-
const SET_SHARD_QUERY_OPTIONS =
|
5
|
+
const SET_SHARD_QUERY_OPTIONS = 'query/SET_SHARD_QUERY_OPTIONS';
|
6
6
|
|
7
7
|
const initialState = {
|
8
8
|
loading: false,
|
package/dist/store/utils.js
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import createToast from '../utils/createToast';
|
2
2
|
import {SET_UNAUTHENTICATED} from './reducers/authentication';
|
3
3
|
|
4
4
|
export const nop = (result) => result;
|
5
5
|
|
6
|
-
const toaster = new Toaster();
|
7
|
-
|
8
6
|
export function createRequestActionTypes(prefix, type) {
|
9
7
|
return {
|
10
8
|
REQUEST: `${prefix}/${type}_REQUEST`,
|
@@ -35,13 +33,11 @@ export function createApiRequest({actions, request, dataHandler = nop}) {
|
|
35
33
|
type: SET_UNAUTHENTICATED.SUCCESS,
|
36
34
|
});
|
37
35
|
} else if (error && error.status && error.statusText) {
|
38
|
-
|
36
|
+
createToast({
|
39
37
|
name: 'Request failure',
|
40
38
|
title: 'Request failure',
|
41
39
|
type: 'error',
|
42
40
|
content: `${error.status} ${error.statusText}`,
|
43
|
-
isClosable: true,
|
44
|
-
allowAutoHiding: false,
|
45
41
|
});
|
46
42
|
}
|
47
43
|
dispatch({
|