@next-core/brick-kit 2.90.1 → 2.91.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/index.bundle.js +203 -212
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +300 -309
- package/dist/index.esm.js.map +1 -1
- package/dist/types/EasyopsEmpty/EasyopsEmpty.d.ts.map +1 -1
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/internal/checkPermissions.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.91.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.91.1...@next-core/brick-kit@2.91.2) (2021-12-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add icons field ([7415b3f](https://github.com/easyops-cn/next-core/commit/7415b3ffaafe109c3bd555878a1d5ab2cd117183))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.91.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.91.0...@next-core/brick-kit@2.91.1) (2021-12-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* fix page tracker ([dbf1d00](https://github.com/easyops-cn/next-core/commit/dbf1d003cd2e60ad18471e403c5dc9c9690b30fa))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [2.91.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.90.2...@next-core/brick-kit@2.91.0) (2021-12-03)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* support isAdmin ([f160156](https://github.com/easyops-cn/next-core/commit/f1601567b59c9f4a27aa130dc3e2e327c84c35db))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [2.90.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.90.1...@next-core/brick-kit@2.90.2) (2021-12-01)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* remove flags ([ed7f66b](https://github.com/easyops-cn/next-core/commit/ed7f66b40c5be427171ec5fc8817eee64c499f60))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
## [2.90.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.90.0...@next-core/brick-kit@2.90.1) (2021-11-29)
|
|
7
51
|
|
|
8
52
|
**Note:** Version bump only for package @next-core/brick-kit
|
package/dist/index.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('history'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('lodash'), require('@next-core/brick-utils'), require('@next-core/brick-http'), require('i18next'), require('moment'), require('@next-core/pipes'), require('@next-core/easyops-analytics'), require('js-yaml'), require('antd'), require('@ant-design/icons'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/defineProperty', 'react', 'lodash', '@next-core/brick-utils', '@next-core/brick-http', 'i18next', 'moment', '@next-core/pipes', '@next-core/easyops-analytics', 'js-yaml', 'antd', '@ant-design/icons', 'react-i18next', '@babel/runtime/helpers/esm/extends', '@next-core/illustrations', '@babel/runtime/helpers/decorate'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$
|
|
5
|
-
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$1, global.React, global.lodash, global.brickUtils, global.brickHttp, global.i18next, global.moment, global.pipes, global.easyopsAnalytics, global.yaml, global.antd, global.icons, global.reactI18next, global._extends$1, global.illustrations, global._decorate));
|
|
5
|
+
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$1, React, lodash, brickUtils, brickHttp, i18next, moment, pipes, easyopsAnalytics, yaml, antd, icons, reactI18next, _extends$1, illustrations, _decorate) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
28
28
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
29
29
|
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator$4);
|
|
30
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty$
|
|
30
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty$1);
|
|
31
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
32
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
33
|
var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
|
|
34
34
|
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
35
35
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
36
36
|
var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
|
|
37
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends$
|
|
37
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends$1);
|
|
38
38
|
var _decorate__default = /*#__PURE__*/_interopDefaultLegacy(_decorate);
|
|
39
39
|
|
|
40
40
|
class BaseBar {
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
function _defineProperty
|
|
429
|
+
function _defineProperty(obj, key, value) {
|
|
430
430
|
if (key in obj) {
|
|
431
431
|
Object.defineProperty(obj, key, {
|
|
432
432
|
value: value,
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
return obj;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
function ownKeys
|
|
444
|
+
function ownKeys(object, enumerableOnly) {
|
|
445
445
|
var keys = Object.keys(object);
|
|
446
446
|
|
|
447
447
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -455,18 +455,18 @@
|
|
|
455
455
|
return keys;
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
function _objectSpread2
|
|
458
|
+
function _objectSpread2(target) {
|
|
459
459
|
for (var i = 1; i < arguments.length; i++) {
|
|
460
460
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
461
461
|
|
|
462
462
|
if (i % 2) {
|
|
463
|
-
ownKeys
|
|
464
|
-
_defineProperty
|
|
463
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
464
|
+
_defineProperty(target, key, source[key]);
|
|
465
465
|
});
|
|
466
466
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
467
467
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
468
468
|
} else {
|
|
469
|
-
ownKeys
|
|
469
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
470
470
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
471
471
|
});
|
|
472
472
|
}
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
var _ref = _asyncToGenerator$3(function* (objectId, instanceId, params, options) {
|
|
485
485
|
return (
|
|
486
486
|
/**! @contract easyops.api.cmdb.instance.GetDetail */
|
|
487
|
-
(yield brickHttp.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(objectId, "/instance/").concat(instanceId), _objectSpread2
|
|
487
|
+
(yield brickHttp.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(objectId, "/instance/").concat(instanceId), _objectSpread2(_objectSpread2({}, options), {}, {
|
|
488
488
|
params
|
|
489
489
|
}))).data
|
|
490
490
|
);
|
|
@@ -1260,6 +1260,54 @@
|
|
|
1260
1260
|
};
|
|
1261
1261
|
}();
|
|
1262
1262
|
|
|
1263
|
+
var auth = {};
|
|
1264
|
+
/** @internal */
|
|
1265
|
+
|
|
1266
|
+
function authenticate(newAuth) {
|
|
1267
|
+
Object.assign(auth, {
|
|
1268
|
+
org: newAuth.org,
|
|
1269
|
+
username: newAuth.username,
|
|
1270
|
+
userInstanceId: newAuth.userInstanceId,
|
|
1271
|
+
loginFrom: newAuth.loginFrom,
|
|
1272
|
+
accessRule: newAuth.accessRule,
|
|
1273
|
+
isAdmin: newAuth.isAdmin
|
|
1274
|
+
}); // re-init analytics to set user_id
|
|
1275
|
+
|
|
1276
|
+
if (easyopsAnalytics.userAnalytics.initialized) {
|
|
1277
|
+
easyopsAnalytics.userAnalytics.setUserId(newAuth.userInstanceId);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* 获取当前登录认证信息。
|
|
1282
|
+
*
|
|
1283
|
+
* @returns 当前登录认证信息。
|
|
1284
|
+
*/
|
|
1285
|
+
|
|
1286
|
+
function getAuth() {
|
|
1287
|
+
return _objectSpread__default["default"]({}, auth);
|
|
1288
|
+
}
|
|
1289
|
+
/** @internal */
|
|
1290
|
+
|
|
1291
|
+
function logout() {
|
|
1292
|
+
auth.org = undefined;
|
|
1293
|
+
auth.username = undefined;
|
|
1294
|
+
auth.userInstanceId = undefined;
|
|
1295
|
+
auth.accessRule = undefined;
|
|
1296
|
+
auth.isAdmin = undefined;
|
|
1297
|
+
resetPermissionPreChecks(); // re-init analytics to clear user_id
|
|
1298
|
+
|
|
1299
|
+
easyopsAnalytics.userAnalytics.setUserId();
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* 查看当前是否已登录。
|
|
1303
|
+
*
|
|
1304
|
+
* @returns 当前是否已登录。
|
|
1305
|
+
*/
|
|
1306
|
+
|
|
1307
|
+
function isLoggedIn() {
|
|
1308
|
+
return auth.username !== undefined;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1263
1311
|
var permissionMap = new Map();
|
|
1264
1312
|
function preCheckPermissions(_x) {
|
|
1265
1313
|
return _preCheckPermissions.apply(this, arguments);
|
|
@@ -1316,6 +1364,10 @@
|
|
|
1316
1364
|
}
|
|
1317
1365
|
|
|
1318
1366
|
function checkPermissions() {
|
|
1367
|
+
if (getAuth().isAdmin) {
|
|
1368
|
+
return true;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1319
1371
|
for (var _len = arguments.length, actions = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1320
1372
|
actions[_key] = arguments[_key];
|
|
1321
1373
|
}
|
|
@@ -5828,55 +5880,6 @@
|
|
|
5828
5880
|
};
|
|
5829
5881
|
}
|
|
5830
5882
|
|
|
5831
|
-
function _defineProperty(obj, key, value) {
|
|
5832
|
-
if (key in obj) {
|
|
5833
|
-
Object.defineProperty(obj, key, {
|
|
5834
|
-
value: value,
|
|
5835
|
-
enumerable: true,
|
|
5836
|
-
configurable: true,
|
|
5837
|
-
writable: true
|
|
5838
|
-
});
|
|
5839
|
-
} else {
|
|
5840
|
-
obj[key] = value;
|
|
5841
|
-
}
|
|
5842
|
-
|
|
5843
|
-
return obj;
|
|
5844
|
-
}
|
|
5845
|
-
|
|
5846
|
-
function ownKeys(object, enumerableOnly) {
|
|
5847
|
-
var keys = Object.keys(object);
|
|
5848
|
-
|
|
5849
|
-
if (Object.getOwnPropertySymbols) {
|
|
5850
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
5851
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
5852
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
5853
|
-
});
|
|
5854
|
-
keys.push.apply(keys, symbols);
|
|
5855
|
-
}
|
|
5856
|
-
|
|
5857
|
-
return keys;
|
|
5858
|
-
}
|
|
5859
|
-
|
|
5860
|
-
function _objectSpread2(target) {
|
|
5861
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
5862
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
5863
|
-
|
|
5864
|
-
if (i % 2) {
|
|
5865
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
5866
|
-
_defineProperty(target, key, source[key]);
|
|
5867
|
-
});
|
|
5868
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
5869
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5870
|
-
} else {
|
|
5871
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
5872
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5873
|
-
});
|
|
5874
|
-
}
|
|
5875
|
-
}
|
|
5876
|
-
|
|
5877
|
-
return target;
|
|
5878
|
-
}
|
|
5879
|
-
|
|
5880
5883
|
var checkLogin = /*#__PURE__*/function () {
|
|
5881
5884
|
var _ref2 = _asyncToGenerator$1(function* (options) {
|
|
5882
5885
|
return (yield brickHttp.http.get("api/auth/login", options)).data;
|
|
@@ -5887,30 +5890,6 @@
|
|
|
5887
5890
|
};
|
|
5888
5891
|
}();
|
|
5889
5892
|
|
|
5890
|
-
var bootstrap = /*#__PURE__*/function () {
|
|
5891
|
-
var _ref3 = _asyncToGenerator$1(function* (params, options) {
|
|
5892
|
-
return (yield brickHttp.http.get("api/auth/bootstrap", _objectSpread2(_objectSpread2({}, options), {}, {
|
|
5893
|
-
params
|
|
5894
|
-
}))).data;
|
|
5895
|
-
});
|
|
5896
|
-
|
|
5897
|
-
return function bootstrap(_x4, _x5) {
|
|
5898
|
-
return _ref3.apply(this, arguments);
|
|
5899
|
-
};
|
|
5900
|
-
}();
|
|
5901
|
-
|
|
5902
|
-
var getAppStoryboard = /*#__PURE__*/function () {
|
|
5903
|
-
var _ref4 = _asyncToGenerator$1(function* (appId, params, options) {
|
|
5904
|
-
return (yield brickHttp.http.get("api/auth/bootstrap/".concat(appId), _objectSpread2(_objectSpread2({}, options), {}, {
|
|
5905
|
-
params
|
|
5906
|
-
}))).data;
|
|
5907
|
-
});
|
|
5908
|
-
|
|
5909
|
-
return function getAppStoryboard(_x6, _x7, _x8) {
|
|
5910
|
-
return _ref4.apply(this, arguments);
|
|
5911
|
-
};
|
|
5912
|
-
}();
|
|
5913
|
-
|
|
5914
5893
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5915
5894
|
try {
|
|
5916
5895
|
var info = gen[key](arg);
|
|
@@ -5965,52 +5944,6 @@
|
|
|
5965
5944
|
};
|
|
5966
5945
|
}();
|
|
5967
5946
|
|
|
5968
|
-
var auth = {};
|
|
5969
|
-
/** @internal */
|
|
5970
|
-
|
|
5971
|
-
function authenticate(newAuth) {
|
|
5972
|
-
Object.assign(auth, {
|
|
5973
|
-
org: newAuth.org,
|
|
5974
|
-
username: newAuth.username,
|
|
5975
|
-
userInstanceId: newAuth.userInstanceId,
|
|
5976
|
-
loginFrom: newAuth.loginFrom,
|
|
5977
|
-
accessRule: newAuth.accessRule
|
|
5978
|
-
}); // re-init analytics to set user_id
|
|
5979
|
-
|
|
5980
|
-
if (easyopsAnalytics.userAnalytics.initialized) {
|
|
5981
|
-
easyopsAnalytics.userAnalytics.setUserId(newAuth.userInstanceId);
|
|
5982
|
-
}
|
|
5983
|
-
}
|
|
5984
|
-
/**
|
|
5985
|
-
* 获取当前登录认证信息。
|
|
5986
|
-
*
|
|
5987
|
-
* @returns 当前登录认证信息。
|
|
5988
|
-
*/
|
|
5989
|
-
|
|
5990
|
-
function getAuth() {
|
|
5991
|
-
return _objectSpread__default["default"]({}, auth);
|
|
5992
|
-
}
|
|
5993
|
-
/** @internal */
|
|
5994
|
-
|
|
5995
|
-
function logout() {
|
|
5996
|
-
auth.org = undefined;
|
|
5997
|
-
auth.username = undefined;
|
|
5998
|
-
auth.userInstanceId = undefined;
|
|
5999
|
-
auth.accessRule = undefined;
|
|
6000
|
-
resetPermissionPreChecks(); // re-init analytics to clear user_id
|
|
6001
|
-
|
|
6002
|
-
easyopsAnalytics.userAnalytics.setUserId();
|
|
6003
|
-
}
|
|
6004
|
-
/**
|
|
6005
|
-
* 查看当前是否已登录。
|
|
6006
|
-
*
|
|
6007
|
-
* @returns 当前是否已登录。
|
|
6008
|
-
*/
|
|
6009
|
-
|
|
6010
|
-
function isLoggedIn() {
|
|
6011
|
-
return auth.username !== undefined;
|
|
6012
|
-
}
|
|
6013
|
-
|
|
6014
5947
|
/**
|
|
6015
5948
|
* Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
|
|
6016
5949
|
*
|
|
@@ -6336,17 +6269,12 @@
|
|
|
6336
6269
|
var _this3 = this;
|
|
6337
6270
|
|
|
6338
6271
|
return _asyncToGenerator__default["default"](function* () {
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
|
|
6272
|
+
var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
|
|
6273
|
+
appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons",
|
|
6342
6274
|
ignoreTemplateFields: "templates",
|
|
6343
6275
|
ignoreBrickFields: "bricks,processors,providers,editors"
|
|
6344
6276
|
}, params), {
|
|
6345
6277
|
interceptorParams
|
|
6346
|
-
}) : bootstrap(_objectSpread__default["default"]({
|
|
6347
|
-
brief: true
|
|
6348
|
-
}, params), {
|
|
6349
|
-
interceptorParams
|
|
6350
6278
|
});
|
|
6351
6279
|
|
|
6352
6280
|
var bootstrapResponse = _objectSpread__default["default"]({
|
|
@@ -6393,12 +6321,11 @@
|
|
|
6393
6321
|
$$fulfilled: true
|
|
6394
6322
|
});
|
|
6395
6323
|
} else {
|
|
6396
|
-
/* istanbul ignore next */
|
|
6397
6324
|
var {
|
|
6398
6325
|
routes,
|
|
6399
6326
|
meta,
|
|
6400
6327
|
app
|
|
6401
|
-
} = yield
|
|
6328
|
+
} = yield BootstrapV2Api_getAppStoryboardV2(storyboard.app.id, {});
|
|
6402
6329
|
Object.assign(storyboard, {
|
|
6403
6330
|
routes,
|
|
6404
6331
|
meta,
|
|
@@ -7986,7 +7913,8 @@
|
|
|
7986
7913
|
username: auth.username,
|
|
7987
7914
|
userInstanceId: auth.userInstanceId,
|
|
7988
7915
|
loginFrom: auth.loginFrom,
|
|
7989
|
-
accessRule: auth.accessRule
|
|
7916
|
+
accessRule: auth.accessRule,
|
|
7917
|
+
isAdmin: auth.isAdmin
|
|
7990
7918
|
}, getRuntimeMisc()),
|
|
7991
7919
|
flags: this.kernel.getFeatureFlags(),
|
|
7992
7920
|
segues: this.segues,
|
|
@@ -8396,7 +8324,7 @@
|
|
|
8396
8324
|
|
|
8397
8325
|
preCheckPermissions(container, context) {
|
|
8398
8326
|
return _asyncToGenerator__default["default"](function* () {
|
|
8399
|
-
if (isLoggedIn() && container.permissionsPreCheck && Array.isArray(container.permissionsPreCheck)) {
|
|
8327
|
+
if (isLoggedIn() && !getAuth().isAdmin && container.permissionsPreCheck && Array.isArray(container.permissionsPreCheck)) {
|
|
8400
8328
|
var usedActions = computeRealValue(container.permissionsPreCheck, context, true);
|
|
8401
8329
|
yield validatePermissions(usedActions);
|
|
8402
8330
|
}
|
|
@@ -9359,6 +9287,8 @@
|
|
|
9359
9287
|
var _this3 = this;
|
|
9360
9288
|
|
|
9361
9289
|
return _asyncToGenerator__default["default"](function* () {
|
|
9290
|
+
var _apiAnalyzer$getInsta;
|
|
9291
|
+
|
|
9362
9292
|
_this3.state = "initial";
|
|
9363
9293
|
_this3.renderId = lodash.uniqueId("render-id-");
|
|
9364
9294
|
resetAllInjected();
|
|
@@ -9369,7 +9299,10 @@
|
|
|
9369
9299
|
}
|
|
9370
9300
|
|
|
9371
9301
|
var history = getHistory();
|
|
9372
|
-
history.unblock();
|
|
9302
|
+
history.unblock(); // Create the page tracker before page load.
|
|
9303
|
+
// And the API Analyzer maybe disabled.
|
|
9304
|
+
|
|
9305
|
+
var pageTracker = (_apiAnalyzer$getInsta = easyopsAnalytics.apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.pageTracker();
|
|
9373
9306
|
var locationContext = _this3.locationContext = new LocationContext(_this3.kernel, location);
|
|
9374
9307
|
var storyboard = locationContext.matchStoryboard(_this3.kernel.bootstrapData.storyboards);
|
|
9375
9308
|
|
|
@@ -9380,7 +9313,7 @@
|
|
|
9380
9313
|
|
|
9381
9314
|
brickUtils.restoreDynamicTemplates(storyboard); // 预加载权限信息
|
|
9382
9315
|
|
|
9383
|
-
if (isLoggedIn()) {
|
|
9316
|
+
if (isLoggedIn() && !getAuth().isAdmin) {
|
|
9384
9317
|
yield preCheckPermissions(storyboard);
|
|
9385
9318
|
} // 如果找到匹配的 storyboard,那么根据路由匹配得到的 sub-storyboard 加载它的依赖库。
|
|
9386
9319
|
|
|
@@ -9565,8 +9498,6 @@
|
|
|
9565
9498
|
});
|
|
9566
9499
|
|
|
9567
9500
|
if (main.length > 0 || portal.length > 0) {
|
|
9568
|
-
var _apiAnalyzer$getInsta;
|
|
9569
|
-
|
|
9570
9501
|
main.length > 0 && mountTree(main, mountPoints.main);
|
|
9571
9502
|
portal.length > 0 && mountTree(portal, mountPoints.portal);
|
|
9572
9503
|
afterMountTree(mountPoints.main);
|
|
@@ -9585,9 +9516,8 @@
|
|
|
9585
9516
|
// See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
|
|
9586
9517
|
|
|
9587
9518
|
|
|
9588
|
-
window.scrollTo(0, 0);
|
|
9589
|
-
|
|
9590
|
-
(_apiAnalyzer$getInsta = easyopsAnalytics.apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.pageTracker()(locationContext.getCurrentMatch().path); // analytics page_view event
|
|
9519
|
+
window.scrollTo(0, 0);
|
|
9520
|
+
pageTracker === null || pageTracker === void 0 ? void 0 : pageTracker(locationContext.getCurrentMatch().path); // analytics page_view event
|
|
9591
9521
|
|
|
9592
9522
|
easyopsAnalytics.userAnalytics.event("page_view", _objectSpread__default["default"]({
|
|
9593
9523
|
micro_app_id: _this3.kernel.currentApp.id,
|
|
@@ -10884,92 +10814,153 @@
|
|
|
10884
10814
|
};
|
|
10885
10815
|
var defaultLocale = localeValues;
|
|
10886
10816
|
|
|
10887
|
-
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
10888
|
-
|
|
10889
|
-
var _ref$1 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
10890
|
-
fill: "none"
|
|
10891
|
-
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
10892
|
-
d: "M61.108 51.8H15.892a2.8 2.8 0 0 0-1.941.782L5.6 60.615V74.2a5.6 5.6 0 0 0 5.6 5.6h54.6a5.6 5.6 0 0 0 5.6-5.6V60.615l-8.35-8.033a2.8 2.8 0 0 0-1.942-.782z",
|
|
10893
|
-
fill: "#C4C4C4"
|
|
10894
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10895
|
-
d: "M16.8 19.6h43.4a2.8 2.8 0 0 1 2.8 2.8v44.8a2.8 2.8 0 0 1-2.8 2.8H16.8a2.8 2.8 0 0 1-2.8-2.8V22.4a2.8 2.8 0 0 1 2.8-2.8z",
|
|
10896
|
-
fill: "#F7F7F7"
|
|
10897
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10898
|
-
d: "M23.8 26.6h29.4a2.8 2.8 0 0 1 2.8 2.8v9.8a2.8 2.8 0 0 1-2.8 2.8H23.8a2.8 2.8 0 0 1-2.8-2.8v-9.8a2.8 2.8 0 0 1 2.8-2.8zm0 26.6h22.4a1.4 1.4 0 0 1 0 2.8H23.8a1.4 1.4 0 0 1 0-2.8zm0-7h29.4a1.4 1.4 0 0 1 0 2.8H23.8a1.4 1.4 0 0 1 0-2.8z",
|
|
10899
|
-
fill: "#E5E5E5"
|
|
10900
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10901
|
-
d: "M82.6 42a.7.7 0 0 1 .7.7v1.399l1.4.001a.7.7 0 0 1 0 1.4l-1.4-.001V46.9a.7.7 0 0 1-1.4 0v-1.401l-1.4.001a.7.7 0 0 1 0-1.4l1.4-.001V42.7a.7.7 0 0 1 .7-.7z",
|
|
10902
|
-
fill: "#CDCDCD"
|
|
10903
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10904
|
-
d: "M2.1 30.8c.29 0 .525.235.525.525l-.001.874.876.001a.7.7 0 0 1 0 1.4h-.876l.001.875a.525.525 0 1 1-1.05 0l-.001-.875H.7a.7.7 0 0 1 0-1.4l.874-.001.001-.874c0-.29.235-.525.525-.525zm6.3 49l-.17-.005A2.8 2.8 0 0 1 5.6 77V60.2h12.393l.175-.006c3.802-.04 7.95 5.943 19.61 6.19l.022-.002.022.002c10.856.218 15.009-5.902 19.558-6.175l.227-.009H71.4V77a2.8 2.8 0 0 1-2.63 2.795l-.17.005H8.4z",
|
|
10905
|
-
fill: "#E5E5E5"
|
|
10906
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10907
|
-
d: "M21 3.356S24.518 2.509 25.516 0c1.438 2.057 2.18 2.947 3.884 3.338-2.321.692-3.33 1.468-4.123 3.662-.912-2.584-1.741-2.919-4.277-3.644",
|
|
10908
|
-
fill: "#F5F5F5"
|
|
10909
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10910
|
-
d: "M63 10.125S72.382 7.923 75.044 1.4c3.834 5.35 5.81 7.663 10.356 8.68-6.19 1.797-8.878 3.816-10.995 9.52-2.43-6.72-4.643-7.59-11.405-9.475",
|
|
10911
|
-
fill: "#E5E5E5"
|
|
10912
|
-
}));
|
|
10913
|
-
|
|
10914
|
-
function SvgEmptyGreyImage(props) {
|
|
10915
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
10916
|
-
width: 86,
|
|
10917
|
-
height: 80,
|
|
10918
|
-
viewBox: "0 0 86 80",
|
|
10919
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10920
|
-
}, props), _ref$1);
|
|
10921
|
-
}
|
|
10922
|
-
|
|
10923
10817
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10924
10818
|
|
|
10925
|
-
var _ref = /*#__PURE__*/React__namespace.createElement("
|
|
10926
|
-
|
|
10819
|
+
var _ref = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
|
|
10820
|
+
x1: "5.718%",
|
|
10821
|
+
y1: "4.311%",
|
|
10822
|
+
x2: "83.05%",
|
|
10823
|
+
y2: "88.915%",
|
|
10824
|
+
id: "empty-image_svg__a"
|
|
10825
|
+
}, /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10826
|
+
stopColor: "#D4D8E4",
|
|
10827
|
+
offset: "0%"
|
|
10828
|
+
}), /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10829
|
+
stopColor: "#A9B0C4",
|
|
10830
|
+
offset: "100%"
|
|
10831
|
+
})), /*#__PURE__*/React__namespace.createElement("linearGradient", {
|
|
10832
|
+
x1: "0%",
|
|
10833
|
+
y1: "11.08%",
|
|
10834
|
+
x2: "80.548%",
|
|
10835
|
+
y2: "107.704%",
|
|
10836
|
+
id: "empty-image_svg__d"
|
|
10837
|
+
}, /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10838
|
+
stopColor: "#C2C7DA",
|
|
10839
|
+
offset: "0%"
|
|
10840
|
+
}), /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10841
|
+
stopColor: "#8F96B3",
|
|
10842
|
+
offset: "100%"
|
|
10843
|
+
})), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10844
|
+
d: "M34 36h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-8a4 4 0 0 1-4-4v-8a4 4 0 0 1 4-4z",
|
|
10845
|
+
id: "empty-image_svg__c"
|
|
10846
|
+
}), /*#__PURE__*/React__namespace.createElement("filter", {
|
|
10847
|
+
x: "-37.5%",
|
|
10848
|
+
y: "-31.3%",
|
|
10849
|
+
width: "187.5%",
|
|
10850
|
+
height: "187.5%",
|
|
10851
|
+
filterUnits: "objectBoundingBox",
|
|
10852
|
+
id: "empty-image_svg__b"
|
|
10853
|
+
}, /*#__PURE__*/React__namespace.createElement("feOffset", {
|
|
10854
|
+
dx: 1,
|
|
10855
|
+
dy: 2,
|
|
10856
|
+
in: "SourceAlpha",
|
|
10857
|
+
result: "shadowOffsetOuter1"
|
|
10858
|
+
}), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
|
|
10859
|
+
stdDeviation: 2,
|
|
10860
|
+
in: "shadowOffsetOuter1",
|
|
10861
|
+
result: "shadowBlurOuter1"
|
|
10862
|
+
}), /*#__PURE__*/React__namespace.createElement("feComposite", {
|
|
10863
|
+
in: "shadowBlurOuter1",
|
|
10864
|
+
in2: "SourceAlpha",
|
|
10865
|
+
operator: "out",
|
|
10866
|
+
result: "shadowBlurOuter1"
|
|
10867
|
+
}), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
|
|
10868
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
|
|
10869
|
+
in: "shadowBlurOuter1"
|
|
10870
|
+
})), /*#__PURE__*/React__namespace.createElement("linearGradient", {
|
|
10871
|
+
x1: "41.823%",
|
|
10872
|
+
y1: "24.795%",
|
|
10873
|
+
x2: "8.813%",
|
|
10874
|
+
y2: "86.427%",
|
|
10875
|
+
id: "empty-image_svg__g"
|
|
10876
|
+
}, /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10877
|
+
stopColor: "#CCD0DD",
|
|
10878
|
+
offset: "0%"
|
|
10879
|
+
}), /*#__PURE__*/React__namespace.createElement("stop", {
|
|
10880
|
+
stopColor: "#9DA3B9",
|
|
10881
|
+
offset: "100%"
|
|
10882
|
+
})), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10883
|
+
d: "M59 19a4 4 0 0 1 4 4v7.314L51.686 19H59z",
|
|
10884
|
+
id: "empty-image_svg__f"
|
|
10885
|
+
}), /*#__PURE__*/React__namespace.createElement("filter", {
|
|
10886
|
+
x: "-61.9%",
|
|
10887
|
+
y: "-79.5%",
|
|
10888
|
+
width: "223.7%",
|
|
10889
|
+
height: "223.7%",
|
|
10890
|
+
filterUnits: "objectBoundingBox",
|
|
10891
|
+
id: "empty-image_svg__e"
|
|
10892
|
+
}, /*#__PURE__*/React__namespace.createElement("feOffset", {
|
|
10893
|
+
dy: -2,
|
|
10894
|
+
in: "SourceAlpha",
|
|
10895
|
+
result: "shadowOffsetOuter1"
|
|
10896
|
+
}), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
|
|
10897
|
+
stdDeviation: 2,
|
|
10898
|
+
in: "shadowOffsetOuter1",
|
|
10899
|
+
result: "shadowBlurOuter1"
|
|
10900
|
+
}), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
|
|
10901
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
|
|
10902
|
+
in: "shadowBlurOuter1"
|
|
10903
|
+
})));
|
|
10904
|
+
|
|
10905
|
+
var _ref2 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
10906
|
+
fill: "none",
|
|
10907
|
+
fillRule: "evenodd"
|
|
10927
10908
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
10928
|
-
d: "
|
|
10929
|
-
|
|
10930
|
-
fill: "#FDFDFD"
|
|
10931
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10932
|
-
d: "M16.8 19.6h43.4a2.8 2.8 0 0 1 2.8 2.8v44.8a2.8 2.8 0 0 1-2.8 2.8H16.8a2.8 2.8 0 0 1-2.8-2.8V22.4a2.8 2.8 0 0 1 2.8-2.8z",
|
|
10933
|
-
stroke: "#EEE",
|
|
10934
|
-
fill: "#F7F7F7"
|
|
10935
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10936
|
-
d: "M23.8 26.6h29.4a2.8 2.8 0 0 1 2.8 2.8v9.8a2.8 2.8 0 0 1-2.8 2.8H23.8a2.8 2.8 0 0 1-2.8-2.8v-9.8a2.8 2.8 0 0 1 2.8-2.8zm0 26.6h22.4a1.4 1.4 0 0 1 0 2.8H23.8a1.4 1.4 0 0 1 0-2.8zm0-7h29.4a1.4 1.4 0 0 1 0 2.8H23.8a1.4 1.4 0 0 1 0-2.8z",
|
|
10937
|
-
fill: "#E5E5E5"
|
|
10909
|
+
d: "M61.108 51.8H15.892a2.8 2.8 0 0 0-1.941.782L5.6 60.615V74.2a5.6 5.6 0 0 0 5.6 5.6h54.6a5.6 5.6 0 0 0 5.6-5.6V60.615l-8.35-8.033a2.8 2.8 0 0 0-1.942-.782z",
|
|
10910
|
+
fill: "#A6AAC3"
|
|
10938
10911
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10939
|
-
d: "
|
|
10940
|
-
fill: "#
|
|
10912
|
+
d: "M51.686 19L63 30.314V66.2a2.8 2.8 0 0 1-2.8 2.8H16.8a2.8 2.8 0 0 1-2.8-2.8V25a6 6 0 0 1 6-6h31.686z",
|
|
10913
|
+
fill: "url(#empty-image_svg__a)"
|
|
10914
|
+
}), /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("use", {
|
|
10915
|
+
fill: "#000",
|
|
10916
|
+
filter: "url(#empty-image_svg__b)",
|
|
10917
|
+
xlinkHref: "#empty-image_svg__c"
|
|
10941
10918
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10942
|
-
|
|
10943
|
-
|
|
10919
|
+
stroke: "#FFF",
|
|
10920
|
+
d: "M42 36.5c.966 0 1.841.392 2.475 1.025A3.489 3.489 0 0 1 45.5 40h0v8c0 .966-.392 1.841-1.025 2.475A3.489 3.489 0 0 1 42 51.5h0-8a3.489 3.489 0 0 1-2.475-1.025A3.489 3.489 0 0 1 30.5 48h0v-8c0-.966.392-1.841 1.025-2.475A3.489 3.489 0 0 1 34 36.5h0z",
|
|
10921
|
+
strokeLinejoin: "square",
|
|
10922
|
+
fill: "url(#empty-image_svg__d)"
|
|
10923
|
+
})), /*#__PURE__*/React__namespace.createElement("g", {
|
|
10924
|
+
transform: "rotate(180 57.343 24.657)"
|
|
10925
|
+
}, /*#__PURE__*/React__namespace.createElement("use", {
|
|
10926
|
+
fill: "#000",
|
|
10927
|
+
filter: "url(#empty-image_svg__e)",
|
|
10928
|
+
xlinkHref: "#empty-image_svg__f"
|
|
10929
|
+
}), /*#__PURE__*/React__namespace.createElement("use", {
|
|
10930
|
+
fill: "url(#empty-image_svg__g)",
|
|
10931
|
+
xlinkHref: "#empty-image_svg__f"
|
|
10932
|
+
})), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10933
|
+
d: "M82.6 42a.7.7 0 0 1 .7.7v1.399l1.4.001a.7.7 0 0 1 0 1.4l-1.4-.001V46.9a.7.7 0 0 1-1.4 0v-1.401l-1.4.001a.7.7 0 0 1 0-1.4l1.4-.001V42.7a.7.7 0 0 1 .7-.7zM2.1 30.8c.29 0 .525.235.525.525l-.001.874.876.001a.7.7 0 0 1 0 1.4h-.876l.001.875a.525.525 0 1 1-1.05 0l-.001-.875H.7a.7.7 0 0 1 0-1.4l.874-.001.001-.874c0-.29.235-.525.525-.525z",
|
|
10934
|
+
fill: "#D6D8E4",
|
|
10935
|
+
opacity: 0.3
|
|
10944
10936
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10945
|
-
d: "
|
|
10946
|
-
|
|
10947
|
-
fill: "#F7F5F5"
|
|
10937
|
+
d: "M8.4 79.8l-.17-.005A2.8 2.8 0 0 1 5.6 77V60.2h12.393l.175-.006c3.802-.04 7.95 5.943 19.61 6.19l.022-.002.022.002c10.856.218 15.009-5.902 19.558-6.175l.227-.009H71.4V77a2.8 2.8 0 0 1-2.63 2.795l-.17.005H8.4z",
|
|
10938
|
+
fill: "#D6D8E4"
|
|
10948
10939
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10949
10940
|
d: "M21 3.356S24.518 2.509 25.516 0c1.438 2.057 2.18 2.947 3.884 3.338-2.321.692-3.33 1.468-4.123 3.662-.912-2.584-1.741-2.919-4.277-3.644",
|
|
10950
|
-
fill: "#
|
|
10941
|
+
fill: "#D6D8E4",
|
|
10942
|
+
opacity: 0.5
|
|
10951
10943
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
10952
10944
|
d: "M63 10.125S72.382 7.923 75.044 1.4c3.834 5.35 5.81 7.663 10.356 8.68-6.19 1.797-8.878 3.816-10.995 9.52-2.43-6.72-4.643-7.59-11.405-9.475",
|
|
10953
|
-
fill: "#
|
|
10945
|
+
fill: "#D6D8E4",
|
|
10946
|
+
opacity: 0.8
|
|
10954
10947
|
}));
|
|
10955
10948
|
|
|
10956
|
-
function
|
|
10949
|
+
function SvgEmptyImage(props) {
|
|
10957
10950
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
10958
10951
|
width: 86,
|
|
10959
10952
|
height: 80,
|
|
10960
10953
|
viewBox: "0 0 86 80",
|
|
10961
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10962
|
-
|
|
10954
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10955
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
10956
|
+
}, props), _ref, _ref2);
|
|
10963
10957
|
}
|
|
10964
10958
|
|
|
10965
10959
|
/**
|
|
10966
10960
|
* 用于展示空数据的 React 组件。
|
|
10967
10961
|
*/
|
|
10968
10962
|
function EasyopsEmpty(props) {
|
|
10969
|
-
var
|
|
10970
|
-
|
|
10971
|
-
var background = (_props$background = props.background) !== null && _props$background !== void 0 ? _props$background : "white";
|
|
10972
|
-
var emptyImage = background === "white" ? SvgEmptyGreyImage : SvgEmptyLightGreyImage;
|
|
10963
|
+
var emptyImage = SvgEmptyImage;
|
|
10973
10964
|
var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
|
|
10974
10965
|
var image = props.illustration ? illustration : /*#__PURE__*/React__default["default"].createElement(emptyImage);
|
|
10975
10966
|
return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|