@ytsaurus/ui 1.13.0 → 1.13.1
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/build/cjs/ui/rum/constants.d.ts +5 -1
- package/build/cjs/ui/rum/constants.js +5 -2
- package/build/cjs/ui/rum/constants.js.map +1 -1
- package/build/cjs/ui/rum/rum-counter.js +1 -1
- package/build/cjs/ui/rum/rum-counter.js.map +1 -1
- package/build/cjs/ui/store/actions/system/masters.d.ts +7 -5
- package/build/cjs/ui/store/actions/system/masters.js +305 -235
- package/build/cjs/ui/store/actions/system/masters.js.map +1 -1
- package/build/cjs/ui/store/reducers/system/masters.d.ts +2 -2
- package/build/cjs/ui/store/reducers/system/masters.js.map +1 -1
- package/build/cjs/ui/store/selectors/system/masters.d.ts +1 -1
- package/build/cjs/ui/store/selectors/system/masters.js.map +1 -1
- package/build/esm/ui/rum/constants.d.ts +5 -1
- package/build/esm/ui/rum/constants.js +5 -2
- package/build/esm/ui/rum/constants.js.map +1 -1
- package/build/esm/ui/rum/rum-counter.js +1 -1
- package/build/esm/ui/rum/rum-counter.js.map +1 -1
- package/build/esm/ui/store/actions/system/masters.d.ts +7 -5
- package/build/esm/ui/store/actions/system/masters.js +303 -233
- package/build/esm/ui/store/actions/system/masters.js.map +1 -1
- package/build/esm/ui/store/reducers/system/masters.d.ts +2 -2
- package/build/esm/ui/store/reducers/system/masters.js.map +1 -1
- package/build/esm/ui/store/selectors/system/masters.d.ts +1 -1
- package/build/esm/ui/store/selectors/system/masters.js.map +1 -1
- package/dist/public/build/assets-manifest.json +4 -4
- package/dist/public/build/js/main.4eb01db4.js +3 -0
- package/dist/public/build/js/{main.9d592639.js.map → main.4eb01db4.js.map} +1 -1
- package/dist/public/build/manifest.json +2 -2
- package/package.json +2 -2
- package/dist/public/build/js/main.9d592639.js +0 -3
- /package/dist/public/build/js/{main.9d592639.js.LICENSE.txt → main.4eb01db4.js.LICENSE.txt} +0 -0
@@ -1,192 +1,234 @@
|
|
1
|
-
import _sortBy from "lodash/sortBy";
|
2
|
-
import _each from "lodash/each";
|
3
1
|
import _reduce from "lodash/reduce";
|
4
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
5
2
|
import _keys from "lodash/keys";
|
6
3
|
import _map from "lodash/map";
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
7
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
8
6
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
7
|
+
import _sortBy from "lodash/sortBy";
|
8
|
+
import _each from "lodash/each";
|
9
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
9
11
|
import ypath from '../../../common/thor/ypath';
|
10
12
|
import { Toaster } from '@gravity-ui/uikit';
|
11
13
|
import createActionTypes from '../../../constants/utils';
|
12
14
|
import { isRetryFutile } from '../../../utils/index';
|
13
15
|
import { getBatchError, showErrorPopup } from '../../../utils/utils';
|
14
|
-
import
|
16
|
+
import { YTErrors } from '../../../rum/constants';
|
15
17
|
import { YTApiId, ytApiV3Id } from '../../../rum/rum-wrap-api';
|
16
18
|
import { USE_SUPRESS_SYNC } from '../../../../shared/constants';
|
17
19
|
export var FETCH_MASTER_CONFIG = createActionTypes('MASTER_CONFIG');
|
18
20
|
export var FETCH_MASTER_DATA = createActionTypes('MASTER_DATA');
|
19
21
|
var toaster = new Toaster();
|
22
|
+
var NODE_DOES_NOT_EXIST = YTErrors.NODE_DOES_NOT_EXIST;
|
20
23
|
function loadMastersConfig() {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
26
|
-
}, USE_SUPRESS_SYNC)
|
27
|
-
}, {
|
28
|
-
command: 'get',
|
29
|
-
parameters: _objectSpread({
|
30
|
-
path: '//sys/@cell_tag'
|
31
|
-
}, USE_SUPRESS_SYNC)
|
32
|
-
}, {
|
33
|
-
command: 'get',
|
34
|
-
parameters: _objectSpread({
|
35
|
-
path: '//sys/secondary_masters',
|
36
|
-
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
37
|
-
}, USE_SUPRESS_SYNC)
|
38
|
-
}, {
|
39
|
-
command: 'get',
|
40
|
-
parameters: _objectSpread({
|
41
|
-
path: '//sys/timestamp_providers',
|
42
|
-
attributes: ['annotations', 'native_cell_tag', 'maintenance', 'maintenance_message']
|
43
|
-
}, USE_SUPRESS_SYNC)
|
44
|
-
}, {
|
45
|
-
command: 'get',
|
46
|
-
parameters: _objectSpread({
|
47
|
-
path: '//sys/discovery_servers',
|
48
|
-
attributes: ['annotations', 'native_cell_tag']
|
49
|
-
}, USE_SUPRESS_SYNC)
|
50
|
-
}, {
|
51
|
-
command: 'get',
|
52
|
-
parameters: _objectSpread({
|
53
|
-
path: '//sys/queue_agents/instances',
|
54
|
-
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
55
|
-
}, USE_SUPRESS_SYNC)
|
56
|
-
}];
|
57
|
-
return ytApiV3Id.executeBatch(YTApiId.systemMastersConfig, {
|
58
|
-
requests: requests
|
59
|
-
}).then(function (_ref) {
|
24
|
+
return _loadMastersConfig.apply(this, arguments);
|
25
|
+
}
|
26
|
+
function _loadMastersConfig() {
|
27
|
+
_loadMastersConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
60
28
|
var _timestampProvidersRe, _queueAgentsResult$er;
|
61
|
-
var
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
return {
|
98
|
-
|
99
|
-
|
100
|
-
|
29
|
+
var requests, _yield$ytApiV3Id$exec, _yield$ytApiV3Id$exec2, primaryMasterResult, secondaryMastersResult, timestampProvidersResult, discoveryServersResult, queueAgentsResult, batchError, error, queueAgentsError, _ref3, timestamp_path, _ref4, primary_path, tag_cell_requests, _yield$ytApiV3Id$exec3, _yield$ytApiV3Id$exec4, primaryMasterCellTag, timestampProviderCellTag, primaryMaster, secondaryMasters, timestampProviders, mainResult, discoveryRequests, queueAgentsStateRequests, discoveryServersStatuses, queueAgentsStatuses, results, discoveryResults, queueAgentsStateResults;
|
30
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
31
|
+
while (1) switch (_context2.prev = _context2.next) {
|
32
|
+
case 0:
|
33
|
+
requests = [{
|
34
|
+
command: 'get',
|
35
|
+
parameters: _objectSpread({
|
36
|
+
path: '//sys/primary_masters',
|
37
|
+
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
38
|
+
}, USE_SUPRESS_SYNC)
|
39
|
+
}, {
|
40
|
+
command: 'get',
|
41
|
+
parameters: _objectSpread({
|
42
|
+
path: '//sys/secondary_masters',
|
43
|
+
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
44
|
+
}, USE_SUPRESS_SYNC)
|
45
|
+
}, {
|
46
|
+
command: 'get',
|
47
|
+
parameters: _objectSpread({
|
48
|
+
path: '//sys/timestamp_providers',
|
49
|
+
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
50
|
+
}, USE_SUPRESS_SYNC)
|
51
|
+
}, {
|
52
|
+
command: 'get',
|
53
|
+
parameters: _objectSpread({
|
54
|
+
path: '//sys/discovery_servers',
|
55
|
+
attributes: ['annotations', 'native_cell_tag']
|
56
|
+
}, USE_SUPRESS_SYNC)
|
57
|
+
}, {
|
58
|
+
command: 'get',
|
59
|
+
parameters: _objectSpread({
|
60
|
+
path: '//sys/queue_agents/instances',
|
61
|
+
attributes: ['annotations', 'maintenance', 'maintenance_message']
|
62
|
+
}, USE_SUPRESS_SYNC)
|
63
|
+
}];
|
64
|
+
_context2.next = 3;
|
65
|
+
return ytApiV3Id.executeBatch(YTApiId.systemMastersConfig, {
|
66
|
+
requests: requests
|
67
|
+
});
|
68
|
+
case 3:
|
69
|
+
_yield$ytApiV3Id$exec = _context2.sent;
|
70
|
+
_yield$ytApiV3Id$exec2 = _slicedToArray(_yield$ytApiV3Id$exec, 5);
|
71
|
+
primaryMasterResult = _yield$ytApiV3Id$exec2[0];
|
72
|
+
secondaryMastersResult = _yield$ytApiV3Id$exec2[1];
|
73
|
+
timestampProvidersResult = _yield$ytApiV3Id$exec2[2];
|
74
|
+
discoveryServersResult = _yield$ytApiV3Id$exec2[3];
|
75
|
+
queueAgentsResult = _yield$ytApiV3Id$exec2[4];
|
76
|
+
batchError = getBatchError([primaryMasterResult, secondaryMastersResult], "Masters' details cannot be loaded");
|
77
|
+
if (!batchError) {
|
78
|
+
_context2.next = 13;
|
79
|
+
break;
|
80
|
+
}
|
81
|
+
throw batchError;
|
82
|
+
case 13:
|
83
|
+
error = getBatchError([timestampProvidersResult], 'Timestamp providers cannot be loaded');
|
84
|
+
if (!(error && ((_timestampProvidersRe = timestampProvidersResult.error) === null || _timestampProvidersRe === void 0 ? void 0 : _timestampProvidersRe.code) !== NODE_DOES_NOT_EXIST)) {
|
85
|
+
_context2.next = 16;
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
throw error;
|
89
|
+
case 16:
|
90
|
+
queueAgentsError = getBatchError([queueAgentsResult], 'Queue agents cannot be loaded');
|
91
|
+
if (!(queueAgentsError && ((_queueAgentsResult$er = queueAgentsResult.error) === null || _queueAgentsResult$er === void 0 ? void 0 : _queueAgentsResult$er.code) !== NODE_DOES_NOT_EXIST)) {
|
92
|
+
_context2.next = 19;
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
throw queueAgentsError;
|
96
|
+
case 19:
|
97
|
+
_ref3 = _toConsumableArray(Object.keys(ypath.getValue(timestampProvidersResult.output))), timestamp_path = _ref3[0];
|
98
|
+
_ref4 = _toConsumableArray(Object.keys(ypath.getValue(primaryMasterResult.output))), primary_path = _ref4[0];
|
99
|
+
tag_cell_requests = [{
|
100
|
+
command: 'get',
|
101
|
+
parameters: _objectSpread({
|
102
|
+
path: "//sys/primary_masters/".concat(primary_path, "/orchid/config/primary_master/cell_id")
|
103
|
+
}, USE_SUPRESS_SYNC)
|
104
|
+
}, {
|
105
|
+
command: 'get',
|
106
|
+
parameters: _objectSpread({
|
107
|
+
path: "//sys/timestamp_providers/".concat(timestamp_path, "/orchid/config/clock_cell")
|
108
|
+
}, USE_SUPRESS_SYNC)
|
109
|
+
}];
|
110
|
+
_context2.next = 24;
|
111
|
+
return ytApiV3Id.executeBatch(YTApiId.systemMastersConfig, {
|
112
|
+
requests: [].concat(tag_cell_requests)
|
113
|
+
});
|
114
|
+
case 24:
|
115
|
+
_yield$ytApiV3Id$exec3 = _context2.sent;
|
116
|
+
_yield$ytApiV3Id$exec4 = _slicedToArray(_yield$ytApiV3Id$exec3, 2);
|
117
|
+
primaryMasterCellTag = _yield$ytApiV3Id$exec4[0];
|
118
|
+
timestampProviderCellTag = _yield$ytApiV3Id$exec4[1];
|
119
|
+
primaryMaster = primaryMasterResult.output;
|
120
|
+
secondaryMasters = secondaryMastersResult.output;
|
121
|
+
timestampProviders = !timestampProvidersResult.output ? {} : {
|
122
|
+
addresses: _map(ypath.getValue(timestampProvidersResult.output), function (value, address) {
|
123
|
+
return {
|
124
|
+
host: address,
|
125
|
+
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
126
|
+
attributes: ypath.getValue(value, '/@')
|
127
|
+
};
|
128
|
+
}),
|
129
|
+
cellTag: getCellIdTag(ypath.getValue(timestampProviderCellTag.output).cell_id)
|
130
|
+
};
|
131
|
+
mainResult = {
|
132
|
+
primaryMaster: {
|
133
|
+
addresses: _map(_keys(primaryMaster), function (address) {
|
134
|
+
var value = primaryMaster[address];
|
135
|
+
return {
|
136
|
+
host: address,
|
137
|
+
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
138
|
+
attributes: ypath.getValue(value, '/@')
|
139
|
+
};
|
140
|
+
}),
|
141
|
+
cellTag: getCellIdTag(primaryMasterCellTag.output)
|
142
|
+
},
|
143
|
+
secondaryMasters: _map(secondaryMasters, function (addresses, cellTag) {
|
144
|
+
return {
|
145
|
+
addresses: _map(_keys(addresses), function (address) {
|
146
|
+
var value = secondaryMasters[cellTag][address];
|
147
|
+
return {
|
148
|
+
host: address,
|
149
|
+
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
150
|
+
attributes: ypath.getValue(value, '/@')
|
151
|
+
};
|
152
|
+
}),
|
153
|
+
cellTag: Number(cellTag)
|
154
|
+
};
|
155
|
+
}),
|
156
|
+
timestampProviders: timestampProviders,
|
157
|
+
discoveryServers: {},
|
158
|
+
queueAgents: {}
|
101
159
|
};
|
102
|
-
|
103
|
-
cellTag: primaryCellTag
|
104
|
-
},
|
105
|
-
secondaryMasters: _map(secondaryMasters, function (addresses, cellTag) {
|
106
|
-
return {
|
107
|
-
addresses: _map(_keys(addresses), function (address) {
|
108
|
-
var value = secondaryMasters[cellTag][address];
|
160
|
+
discoveryRequests = _map(ypath.getValue(discoveryServersResult.output), function (_v, address) {
|
109
161
|
return {
|
110
|
-
|
111
|
-
|
112
|
-
|
162
|
+
command: 'get',
|
163
|
+
parameters: _objectSpread({
|
164
|
+
path: "//sys/discovery_servers/".concat(address, "/orchid/discovery_server")
|
165
|
+
}, USE_SUPRESS_SYNC),
|
166
|
+
address: address
|
113
167
|
};
|
114
|
-
})
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
mainResult.queueAgents = queueAgentsResult.output ? {
|
179
|
-
addresses: _map(ypath.getValue(queueAgentsResult.output), function (value, address) {
|
180
|
-
return {
|
181
|
-
host: address,
|
182
|
-
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
183
|
-
attributes: ypath.getValue(value, '/@'),
|
184
|
-
state: queueAgentsStatuses[address]
|
185
|
-
};
|
186
|
-
})
|
187
|
-
} : {};
|
188
|
-
return mainResult;
|
189
|
-
});
|
168
|
+
});
|
169
|
+
queueAgentsStateRequests = _map(ypath.getValue(queueAgentsResult.output), function (_v, address) {
|
170
|
+
return {
|
171
|
+
command: 'get',
|
172
|
+
parameters: _objectSpread({
|
173
|
+
path: "//sys/queue_agents/instances/".concat(address, "/orchid/cypress_synchronizer/active")
|
174
|
+
}, USE_SUPRESS_SYNC),
|
175
|
+
address: address
|
176
|
+
};
|
177
|
+
});
|
178
|
+
discoveryServersStatuses = {};
|
179
|
+
queueAgentsStatuses = {};
|
180
|
+
_context2.prev = 36;
|
181
|
+
_context2.next = 39;
|
182
|
+
return ytApiV3Id.executeBatch(YTApiId.systemMastersConfigDiscoveryServer, {
|
183
|
+
requests: [].concat(_toConsumableArray(discoveryRequests), _toConsumableArray(queueAgentsStateRequests))
|
184
|
+
});
|
185
|
+
case 39:
|
186
|
+
results = _context2.sent;
|
187
|
+
discoveryResults = results.slice(0, discoveryRequests.length);
|
188
|
+
queueAgentsStateResults = results.slice(discoveryRequests.length, queueAgentsStateRequests.length);
|
189
|
+
discoveryServersStatuses = _reduce(discoveryResults, function (acc, item, key) {
|
190
|
+
acc[discoveryRequests[key].address] = item !== null && item !== void 0 && item.error ? 'offline' : 'online';
|
191
|
+
return acc;
|
192
|
+
}, {});
|
193
|
+
queueAgentsStatuses = _reduce(queueAgentsStateResults, function (acc, item, key) {
|
194
|
+
acc[queueAgentsStateRequests[key].address] = typeof item.output !== 'undefined' ? item.output ? 'active' : 'standby' : 'offline';
|
195
|
+
return acc;
|
196
|
+
}, {});
|
197
|
+
_context2.next = 48;
|
198
|
+
break;
|
199
|
+
case 46:
|
200
|
+
_context2.prev = 46;
|
201
|
+
_context2.t0 = _context2["catch"](36);
|
202
|
+
case 48:
|
203
|
+
mainResult.discoveryServers = discoveryServersResult.output ? {
|
204
|
+
addresses: _map(ypath.getValue(discoveryServersResult.output), function (value, address) {
|
205
|
+
return {
|
206
|
+
host: address,
|
207
|
+
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
208
|
+
attributes: ypath.getValue(value, '/@'),
|
209
|
+
state: discoveryServersStatuses[address]
|
210
|
+
};
|
211
|
+
}),
|
212
|
+
cellTag: ypath.getValue(discoveryServersResult.output, '/@native_cell_tag')
|
213
|
+
} : {};
|
214
|
+
mainResult.queueAgents = queueAgentsResult.output ? {
|
215
|
+
addresses: _map(ypath.getValue(queueAgentsResult.output), function (value, address) {
|
216
|
+
return {
|
217
|
+
host: address,
|
218
|
+
physicalHost: ypath.getValue(value, '/@annotations/physical_host'),
|
219
|
+
attributes: ypath.getValue(value, '/@'),
|
220
|
+
state: queueAgentsStatuses[address]
|
221
|
+
};
|
222
|
+
})
|
223
|
+
} : {};
|
224
|
+
return _context2.abrupt("return", mainResult);
|
225
|
+
case 51:
|
226
|
+
case "end":
|
227
|
+
return _context2.stop();
|
228
|
+
}
|
229
|
+
}, _callee2, null, [[36, 46]]);
|
230
|
+
}));
|
231
|
+
return _loadMastersConfig.apply(this, arguments);
|
190
232
|
}
|
191
233
|
function loadHydra(requests, masterInfo, type, masterEntry) {
|
192
234
|
var addresses = masterEntry.addresses,
|
@@ -206,8 +248,8 @@ function loadHydra(requests, masterInfo, type, masterEntry) {
|
|
206
248
|
}
|
207
249
|
_each(_sortBy(addresses, function (address) {
|
208
250
|
return address.host;
|
209
|
-
}), function (
|
210
|
-
var host =
|
251
|
+
}), function (_ref) {
|
252
|
+
var host = _ref.host;
|
211
253
|
masterInfo.push({
|
212
254
|
host: host,
|
213
255
|
type: type,
|
@@ -216,72 +258,100 @@ function loadHydra(requests, masterInfo, type, masterEntry) {
|
|
216
258
|
requests.push({
|
217
259
|
command: 'get',
|
218
260
|
parameters: _objectSpread({
|
219
|
-
path: cypressPath + '/' + host + hydraPath
|
220
|
-
timeout: 5000
|
261
|
+
path: cypressPath + '/' + host + hydraPath
|
221
262
|
}, USE_SUPRESS_SYNC)
|
222
263
|
});
|
223
264
|
});
|
224
265
|
}
|
225
266
|
export function loadMasters() {
|
226
|
-
return function (
|
227
|
-
dispatch
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
267
|
+
return /*#__PURE__*/function () {
|
268
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch) {
|
269
|
+
var config, masterDataRequests, masterInfo, data, _response, _data, code, message;
|
270
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
271
|
+
while (1) switch (_context.prev = _context.next) {
|
272
|
+
case 0:
|
273
|
+
dispatch({
|
274
|
+
type: FETCH_MASTER_CONFIG.REQUEST
|
275
|
+
});
|
276
|
+
_context.prev = 1;
|
277
|
+
_context.next = 4;
|
278
|
+
return loadMastersConfig();
|
279
|
+
case 4:
|
280
|
+
config = _context.sent;
|
281
|
+
dispatch({
|
282
|
+
type: FETCH_MASTER_CONFIG.SUCCESS,
|
283
|
+
data: config
|
284
|
+
});
|
285
|
+
dispatch({
|
286
|
+
type: FETCH_MASTER_DATA.REQUEST
|
287
|
+
});
|
288
|
+
masterDataRequests = [];
|
289
|
+
masterInfo = [];
|
290
|
+
loadHydra(masterDataRequests, masterInfo, 'primary', config.primaryMaster);
|
291
|
+
_each(config.secondaryMasters, function (currentConfig) {
|
292
|
+
loadHydra(masterDataRequests, masterInfo, 'secondary', currentConfig);
|
293
|
+
});
|
294
|
+
loadHydra(masterDataRequests, masterInfo, 'providers', config.timestampProviders);
|
295
|
+
loadHydra(masterDataRequests, masterInfo, 'discovery', config.discoveryServers);
|
296
|
+
_context.next = 15;
|
297
|
+
return ytApiV3Id.executeBatch(YTApiId.systemMasters, {
|
298
|
+
requests: masterDataRequests
|
299
|
+
});
|
300
|
+
case 15:
|
301
|
+
data = _context.sent;
|
302
|
+
dispatch({
|
303
|
+
type: FETCH_MASTER_DATA.SUCCESS,
|
304
|
+
data: {
|
305
|
+
masterInfo: masterInfo,
|
306
|
+
data: data
|
307
|
+
}
|
308
|
+
});
|
309
|
+
_context.next = 27;
|
310
|
+
break;
|
311
|
+
case 19:
|
312
|
+
_context.prev = 19;
|
313
|
+
_context.t0 = _context["catch"](1);
|
314
|
+
dispatch({
|
315
|
+
type: FETCH_MASTER_DATA.FAILURE,
|
316
|
+
data: _context.t0
|
317
|
+
});
|
318
|
+
_data = (_context.t0 === null || _context.t0 === void 0 || (_response = _context.t0.response) === null || _response === void 0 ? void 0 : _response.data) || _context.t0;
|
319
|
+
code = _data.code, message = _data.message;
|
320
|
+
toaster.add({
|
321
|
+
name: 'load/system/masters',
|
322
|
+
autoHiding: false,
|
323
|
+
type: 'error',
|
324
|
+
content: "[code ".concat(code, "] ").concat(message),
|
325
|
+
title: 'Could not load Masters',
|
326
|
+
actions: [{
|
327
|
+
label: ' view',
|
328
|
+
onClick: function onClick() {
|
329
|
+
return showErrorPopup(_context.t0);
|
330
|
+
}
|
331
|
+
}]
|
332
|
+
});
|
333
|
+
if (!isRetryFutile(_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.code)) {
|
334
|
+
_context.next = 27;
|
335
|
+
break;
|
336
|
+
}
|
337
|
+
return _context.abrupt("return", {
|
338
|
+
isRetryFutile: true
|
339
|
+
});
|
340
|
+
case 27:
|
341
|
+
case "end":
|
342
|
+
return _context.stop();
|
343
|
+
}
|
344
|
+
}, _callee, null, [[1, 19]]);
|
345
|
+
}));
|
346
|
+
return function (_x) {
|
347
|
+
return _ref2.apply(this, arguments);
|
348
|
+
};
|
349
|
+
}();
|
350
|
+
}
|
351
|
+
function getCellIdTag(uuid) {
|
352
|
+
var _uuid$split = uuid.split('-'),
|
353
|
+
_uuid$split2 = _slicedToArray(_uuid$split, 3),
|
354
|
+
third = _uuid$split2[2];
|
355
|
+
return Number("0x".concat(third.substring(0, third.length - 4)));
|
286
356
|
}
|
287
357
|
// #sourceMappingURL=masters.js.map
|