ydb-embedded-ui 4.0.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +28 -0
- package/dist/components/ClusterInfo/ClusterInfo.tsx +3 -3
- package/dist/components/LabelWithPopover/LabelWithPopover.tsx +10 -4
- package/dist/{containers/Nodes/NodesTable.scss → components/NodeHostWrapper/NodeHostWrapper.scss} +4 -6
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +60 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.scss +1 -1
- package/dist/containers/App/App.scss +7 -4
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +1 -11
- package/dist/containers/Header/Header.tsx +1 -1
- package/dist/containers/Nodes/getNodesColumns.tsx +7 -46
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +3 -12
- package/dist/containers/Storage/StorageNodes/StorageNodes.scss +0 -24
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +2 -39
- package/dist/containers/Storage/VDisk/VDisk.tsx +4 -11
- package/dist/containers/Storage/VDiskPopup/VDiskPopup.tsx +13 -16
- package/dist/containers/Storage/utils/types.ts +2 -1
- package/dist/containers/Tablet/Tablet.scss +4 -0
- package/dist/containers/Tablet/TabletTable/TabletTable.tsx +28 -6
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +4 -3
- package/dist/containers/Tenant/QueryEditor/Issues/Issues.scss +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditorControls/OldQueryEditorControls.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditorControls/QueryEditorControls.tsx +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +12 -0
- package/dist/containers/Tenants/Tenants.js +1 -1
- package/dist/containers/UserSettings/UserSettings.tsx +19 -17
- package/dist/services/api.ts +383 -0
- package/dist/store/reducers/{cluster.js → cluster/cluster.ts} +9 -14
- package/dist/store/reducers/cluster/types.ts +13 -0
- package/dist/store/reducers/executeTopQueries.ts +2 -2
- package/dist/store/reducers/index.ts +5 -4
- package/dist/store/reducers/node.js +5 -1
- package/dist/store/reducers/nodesList.ts +2 -7
- package/dist/store/reducers/settings.js +1 -14
- package/dist/store/reducers/storage.js +12 -0
- package/dist/store/reducers/tablet.ts +16 -2
- package/dist/store/reducers/{tenants.js → tenants/tenants.ts} +14 -9
- package/dist/store/reducers/tenants/types.ts +17 -0
- package/dist/store/utils.ts +3 -2
- package/dist/types/api/acl.ts +25 -0
- package/dist/types/api/cluster.ts +3 -0
- package/dist/types/api/compute.ts +5 -3
- package/dist/types/api/netInfo.ts +48 -0
- package/dist/types/api/nodes.ts +5 -3
- package/dist/types/api/pdisk.ts +11 -2
- package/dist/types/api/storage.ts +5 -3
- package/dist/types/api/tenant.ts +18 -3
- package/dist/types/api/vdisk.ts +10 -2
- package/dist/types/api/whoami.ts +19 -0
- package/dist/types/store/tablet.ts +1 -0
- package/dist/types/window.d.ts +5 -0
- package/dist/utils/createToast.tsx +2 -2
- package/dist/utils/hooks/useTypedSelector.ts +2 -2
- package/dist/utils/nodes.ts +14 -1
- package/package.json +4 -4
- package/dist/services/api.d.ts +0 -87
- package/dist/services/api.js +0 -278
package/dist/services/api.js
DELETED
@@ -1,278 +0,0 @@
|
|
1
|
-
import AxiosWrapper from '@gravity-ui/axios-wrapper';
|
2
|
-
|
3
|
-
import {backend as BACKEND} from '../store';
|
4
|
-
|
5
|
-
const config = {withCredentials: !window.custom_backend};
|
6
|
-
|
7
|
-
const {settingsApi} = window.web_version ? window.systemSettings : {};
|
8
|
-
|
9
|
-
export class YdbEmbeddedAPI extends AxiosWrapper {
|
10
|
-
getPath(path) {
|
11
|
-
return `${BACKEND}${path}`;
|
12
|
-
}
|
13
|
-
getClusterInfo() {
|
14
|
-
return this.get(this.getPath('/viewer/json/cluster'), {tablets: true});
|
15
|
-
}
|
16
|
-
getNodeInfo(id) {
|
17
|
-
return this.get(this.getPath('/viewer/json/sysinfo?enums=true'), {
|
18
|
-
node_id: id,
|
19
|
-
});
|
20
|
-
}
|
21
|
-
getTenants() {
|
22
|
-
return this.get(this.getPath('/viewer/json/tenantinfo'), {
|
23
|
-
tablets: 1,
|
24
|
-
storage: 1,
|
25
|
-
});
|
26
|
-
}
|
27
|
-
getTenantInfo({path}) {
|
28
|
-
return this.get(this.getPath('/viewer/json/tenantinfo'), {
|
29
|
-
path,
|
30
|
-
tablets: true,
|
31
|
-
storage: true,
|
32
|
-
});
|
33
|
-
}
|
34
|
-
getNodes({tenant, filter, storage, type = 'any', tablets = true}, {concurrentId} = {}) {
|
35
|
-
return this.get(
|
36
|
-
this.getPath('/viewer/json/nodes?enums=true'),
|
37
|
-
{
|
38
|
-
tenant,
|
39
|
-
with: filter,
|
40
|
-
storage,
|
41
|
-
type,
|
42
|
-
tablets,
|
43
|
-
},
|
44
|
-
{
|
45
|
-
concurrentId,
|
46
|
-
},
|
47
|
-
);
|
48
|
-
}
|
49
|
-
getCompute(path) {
|
50
|
-
return this.get(this.getPath('/viewer/json/compute?enums=true'), {path});
|
51
|
-
}
|
52
|
-
getStorageInfo({tenant, filter, nodeId}, {concurrentId} = {}) {
|
53
|
-
return this.get(
|
54
|
-
this.getPath(`/viewer/json/storage?enums=true`),
|
55
|
-
{
|
56
|
-
tenant,
|
57
|
-
node_id: nodeId,
|
58
|
-
with: filter,
|
59
|
-
},
|
60
|
-
{
|
61
|
-
concurrentId,
|
62
|
-
},
|
63
|
-
);
|
64
|
-
}
|
65
|
-
getPdiskInfo(nodeId, pdiskId) {
|
66
|
-
return this.get(this.getPath('/viewer/json/pdiskinfo?enums=true'), {
|
67
|
-
filter: `(NodeId=${nodeId}${pdiskId ? `;PDiskId=${pdiskId}` : ''})`,
|
68
|
-
});
|
69
|
-
}
|
70
|
-
getVdiskInfo({vdiskId, pdiskId, nodeId}) {
|
71
|
-
return this.get(this.getPath('/viewer/json/vdiskinfo?enums=true'), {
|
72
|
-
filter: `(VDiskId=${vdiskId ?? ''};PDiskId=${pdiskId ?? ''};NodeId=${nodeId ?? ''})`,
|
73
|
-
});
|
74
|
-
}
|
75
|
-
getGroupInfo(groupId) {
|
76
|
-
return this.get(this.getPath('/viewer/json/storage?enums=true'), {
|
77
|
-
group_id: groupId,
|
78
|
-
});
|
79
|
-
}
|
80
|
-
getHostInfo() {
|
81
|
-
return this.get(this.getPath('/viewer/json/sysinfo?node_id=.&enums=true'));
|
82
|
-
}
|
83
|
-
getTabletsInfo({nodes = [], path}) {
|
84
|
-
const filter = nodes.length > 0 && `(NodeId=[${nodes.join(',')}])`;
|
85
|
-
return this.get(this.getPath('/viewer/json/tabletinfo'), {
|
86
|
-
filter,
|
87
|
-
path,
|
88
|
-
enums: true,
|
89
|
-
});
|
90
|
-
}
|
91
|
-
getSchema({path}, {concurrentId} = {}) {
|
92
|
-
return this.get(
|
93
|
-
this.getPath('/viewer/json/describe'),
|
94
|
-
{
|
95
|
-
path,
|
96
|
-
enums: true,
|
97
|
-
backup: false,
|
98
|
-
private: true,
|
99
|
-
partition_config: true,
|
100
|
-
partition_stats: true,
|
101
|
-
partitioning_info: true,
|
102
|
-
subs: 1,
|
103
|
-
},
|
104
|
-
{concurrentId: concurrentId || `getSchema|${path}`},
|
105
|
-
);
|
106
|
-
}
|
107
|
-
getDescribe({path}, {concurrentId} = {}) {
|
108
|
-
return this.get(
|
109
|
-
this.getPath('/viewer/json/describe'),
|
110
|
-
{
|
111
|
-
path,
|
112
|
-
enums: true,
|
113
|
-
partition_stats: true,
|
114
|
-
subs: 0,
|
115
|
-
},
|
116
|
-
{concurrentId: concurrentId || `getDescribe|${path}`},
|
117
|
-
);
|
118
|
-
}
|
119
|
-
getSchemaAcl({path}) {
|
120
|
-
return this.get(
|
121
|
-
this.getPath('/viewer/json/acl'),
|
122
|
-
{
|
123
|
-
path,
|
124
|
-
},
|
125
|
-
{concurrentId: `getSchemaAcl|${path}`},
|
126
|
-
);
|
127
|
-
}
|
128
|
-
getHeatmapData({path}) {
|
129
|
-
return this.get(this.getPath('/viewer/json/describe'), {
|
130
|
-
path,
|
131
|
-
enums: true,
|
132
|
-
backup: false,
|
133
|
-
children: false,
|
134
|
-
partition_config: false,
|
135
|
-
partition_stats: true,
|
136
|
-
});
|
137
|
-
}
|
138
|
-
getNetwork(path) {
|
139
|
-
return this.get(this.getPath('/viewer/json/netinfo'), {
|
140
|
-
enums: true,
|
141
|
-
path,
|
142
|
-
});
|
143
|
-
}
|
144
|
-
getTopic({path}, {concurrentId} = {}) {
|
145
|
-
return this.get(
|
146
|
-
this.getPath('/viewer/json/describe_topic'),
|
147
|
-
{
|
148
|
-
enums: true,
|
149
|
-
include_stats: true,
|
150
|
-
path,
|
151
|
-
},
|
152
|
-
{concurrentId: concurrentId || 'getTopic'},
|
153
|
-
);
|
154
|
-
}
|
155
|
-
getConsumer({path, consumer}, {concurrentId} = {}) {
|
156
|
-
return this.get(
|
157
|
-
this.getPath('/viewer/json/describe_consumer'),
|
158
|
-
{
|
159
|
-
enums: true,
|
160
|
-
include_stats: true,
|
161
|
-
path,
|
162
|
-
consumer,
|
163
|
-
},
|
164
|
-
{concurrentId: concurrentId || 'getConsumer'},
|
165
|
-
);
|
166
|
-
}
|
167
|
-
getPoolInfo(poolName) {
|
168
|
-
return this.get(this.getPath('/viewer/json/storage'), {
|
169
|
-
pool: poolName,
|
170
|
-
enums: true,
|
171
|
-
});
|
172
|
-
}
|
173
|
-
getTablet({id}) {
|
174
|
-
return this.get(this.getPath(`/viewer/json/tabletinfo?filter=(TabletId=${id})`), {
|
175
|
-
enums: true,
|
176
|
-
});
|
177
|
-
}
|
178
|
-
getTabletHistory({id}) {
|
179
|
-
return this.get(this.getPath(`/viewer/json/tabletinfo?filter=(TabletId=${id})`), {
|
180
|
-
enums: true,
|
181
|
-
merge: false,
|
182
|
-
});
|
183
|
-
}
|
184
|
-
getNodesList() {
|
185
|
-
return this.get(this.getPath('/viewer/json/nodelist'), {enums: true});
|
186
|
-
}
|
187
|
-
getTenantsList() {
|
188
|
-
return this.get(this.getPath('/viewer/json/tenants'), {
|
189
|
-
enums: true,
|
190
|
-
state: 0,
|
191
|
-
});
|
192
|
-
}
|
193
|
-
sendQuery({query, database, action, stats, schema}, {concurrentId} = {}) {
|
194
|
-
return this.post(
|
195
|
-
this.getPath(`/viewer/json/query${schema ? `?schema=${schema}` : ''}`),
|
196
|
-
{
|
197
|
-
query,
|
198
|
-
database,
|
199
|
-
action,
|
200
|
-
stats,
|
201
|
-
timeout: 600000,
|
202
|
-
},
|
203
|
-
null,
|
204
|
-
{
|
205
|
-
concurrentId,
|
206
|
-
timeout: 9 * 60 * 1000,
|
207
|
-
},
|
208
|
-
);
|
209
|
-
}
|
210
|
-
getExplainQuery(query, database, action = 'explain') {
|
211
|
-
return this.post(this.getPath('/viewer/json/query'), {
|
212
|
-
query,
|
213
|
-
database,
|
214
|
-
action,
|
215
|
-
timeout: 600000,
|
216
|
-
});
|
217
|
-
}
|
218
|
-
getExplainQueryAst(query, database) {
|
219
|
-
return this.post(this.getPath('/viewer/json/query'), {
|
220
|
-
query,
|
221
|
-
database,
|
222
|
-
action: 'explain-ast',
|
223
|
-
timeout: 600000,
|
224
|
-
});
|
225
|
-
}
|
226
|
-
getHotKeys(path, enableSampling) {
|
227
|
-
return this.get(this.getPath('/viewer/json/hotkeys'), {
|
228
|
-
path,
|
229
|
-
enable_sampling: enableSampling,
|
230
|
-
});
|
231
|
-
}
|
232
|
-
getHealthcheckInfo(database) {
|
233
|
-
return this.get(this.getPath('/viewer/json/healthcheck'), {
|
234
|
-
tenant: database,
|
235
|
-
});
|
236
|
-
}
|
237
|
-
killTablet(id) {
|
238
|
-
return this.get(this.getPath(`/tablets?KillTabletID=${id}`));
|
239
|
-
}
|
240
|
-
stopTablet(id, hiveId) {
|
241
|
-
return this.get(
|
242
|
-
this.getPath(`/tablets/app?TabletID=${hiveId}&page=StopTablet&tablet=${id}`),
|
243
|
-
);
|
244
|
-
}
|
245
|
-
resumeTablet(id, hiveId) {
|
246
|
-
return this.get(
|
247
|
-
this.getPath(`/tablets/app?TabletID=${hiveId}&page=ResumeTablet&tablet=${id}`),
|
248
|
-
);
|
249
|
-
}
|
250
|
-
getTabletDescribe(tenantId) {
|
251
|
-
return this.get(this.getPath('/viewer/json/describe'), {
|
252
|
-
schemeshard_id: tenantId?.SchemeShard,
|
253
|
-
path_id: tenantId?.PathId,
|
254
|
-
});
|
255
|
-
}
|
256
|
-
postSetting(name, value) {
|
257
|
-
return this.request({
|
258
|
-
method: 'PATCH',
|
259
|
-
url: settingsApi,
|
260
|
-
data: {[name]: value},
|
261
|
-
});
|
262
|
-
}
|
263
|
-
authenticate(user, password) {
|
264
|
-
return this.post(this.getPath('/login'), {
|
265
|
-
user,
|
266
|
-
password,
|
267
|
-
});
|
268
|
-
}
|
269
|
-
logout() {
|
270
|
-
return this.post(this.getPath('/logout'), {});
|
271
|
-
}
|
272
|
-
whoami() {
|
273
|
-
return this.get(this.getPath('/viewer/json/whoami'));
|
274
|
-
}
|
275
|
-
}
|
276
|
-
|
277
|
-
const api = new YdbEmbeddedAPI({config: config});
|
278
|
-
window.api = api;
|