@riil-frontend/component-topology 2.15.43 → 2.15.46
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/index.css +1 -1
- package/build/index.js +22 -22
- package/es/components/Drawer/index.js +8 -2
- package/es/components/TagImageSelect/index.js +3 -1
- package/es/components/TagSelect/index.js +3 -3
- package/es/components/TemplateButton/index.module.scss +1 -0
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/es/core/common/icons/icon.js +1 -1
- package/es/core/common/icons/useIcons.js +1 -1
- package/es/core/components/TopoView/topoView.js +8 -18
- package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/es/core/editor/components/BackgroundView/index.js +80 -44
- package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/es/core/editor/components/EditorPlugin.js +2 -2
- package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/es/core/models/TopoApp.js +9 -5
- package/es/core/services/background.js +26 -1
- package/es/core/store/coreModels.js +32 -26
- package/es/core/store/createStore.js +1 -1
- package/es/core/test/Test.js +3 -1
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/es/createTopo.js +1 -1
- package/es/hooks/useAlarm.js +3 -6
- package/es/hooks/useResourceConfig.js +1 -1
- package/es/hooks/useTopoEdit.js +4 -8
- package/es/models/{iconManage.js → customIcon.js} +1 -1
- package/es/models/topoBizMod.js +22 -52
- package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
- package/es/models/topoMod.js +32 -69
- package/es/{components → topoCenter/components}/Link/form.js +0 -0
- package/es/{components → topoCenter/components}/Link/hook.js +0 -0
- package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/es/{components → topoCenter/components}/Link/setting.js +0 -0
- package/es/topoCenter/components/TopoView.js +16 -3
- package/es/topoCenter/components/Topology.js +0 -5
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/es/{models → topoCenter/store}/linkManager.js +0 -0
- package/lib/components/Drawer/index.js +7 -2
- package/lib/components/TagImageSelect/index.js +3 -1
- package/lib/components/TagSelect/index.js +3 -3
- package/lib/components/TemplateButton/index.module.scss +1 -0
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/lib/core/common/icons/icon.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -1
- package/lib/core/components/TopoView/topoView.js +9 -20
- package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/lib/core/editor/components/BackgroundView/index.js +80 -44
- package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/lib/core/editor/components/EditorPlugin.js +2 -2
- package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/lib/core/models/TopoApp.js +9 -5
- package/lib/core/services/background.js +26 -1
- package/lib/core/store/coreModels.js +35 -26
- package/lib/core/store/createStore.js +2 -2
- package/lib/core/test/Test.js +3 -1
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/lib/createTopo.js +1 -1
- package/lib/hooks/useAlarm.js +3 -6
- package/lib/hooks/useResourceConfig.js +1 -1
- package/lib/hooks/useTopoEdit.js +4 -8
- package/lib/models/{iconManage.js → customIcon.js} +1 -1
- package/lib/models/topoBizMod.js +22 -52
- package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
- package/lib/models/topoMod.js +32 -69
- package/lib/{components → topoCenter/components}/Link/form.js +0 -0
- package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
- package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
- package/lib/topoCenter/components/TopoView.js +19 -3
- package/lib/topoCenter/components/Topology.js +0 -7
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/lib/{models → topoCenter/store}/linkManager.js +0 -0
- package/package.json +2 -2
- package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
- package/es/core/store/getStoreModels.js +0 -40
- package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
- package/lib/core/store/getStoreModels.js +0 -67
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.46" === 'string' ? "2.15.46" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -103,6 +103,10 @@ var Topo = /*#__PURE__*/function () {
|
|
|
103
103
|
|
|
104
104
|
this.test = new _Test["default"](this);
|
|
105
105
|
this.uid = _topoFactory["default"].add(options.name, this);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
_proto.destroy = function destroy() {
|
|
109
|
+
_topoFactory["default"].remove(this.uid);
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* TODO 移除
|
|
@@ -123,7 +127,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
123
127
|
return topoDispatchers.exit();
|
|
124
128
|
|
|
125
129
|
case 3:
|
|
126
|
-
|
|
130
|
+
this.destroy();
|
|
127
131
|
|
|
128
132
|
case 4:
|
|
129
133
|
case "end":
|
|
@@ -572,7 +576,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
572
576
|
|
|
573
577
|
case 7:
|
|
574
578
|
(0, _edgeUtil.updateEdgeExpanded)(this);
|
|
575
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
579
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
576
580
|
editDispatchers.switchToEditMode();
|
|
577
581
|
|
|
578
582
|
if (this.options.onSwitchToEditMode) {
|
|
@@ -580,7 +584,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
580
584
|
} // 加载自定义上传的图标
|
|
581
585
|
|
|
582
586
|
|
|
583
|
-
iconManageDispatchers = this.store.getModelDispatchers('
|
|
587
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
|
584
588
|
iconManageDispatchers.loadEditorIcons();
|
|
585
589
|
|
|
586
590
|
case 13:
|
|
@@ -609,7 +613,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
609
613
|
return this.view.switchToViewMode();
|
|
610
614
|
|
|
611
615
|
case 2:
|
|
612
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
616
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
613
617
|
editDispatchers.switchToViewMode(this.id);
|
|
614
618
|
|
|
615
619
|
if (this.options.onSwitchToViewMode) {
|
|
@@ -117,6 +117,31 @@ var _default = {
|
|
|
117
117
|
/**
|
|
118
118
|
* 背景图导出
|
|
119
119
|
*/
|
|
120
|
-
EXPORT_BG_ZIP: EXPORT_BG_ZIP
|
|
120
|
+
EXPORT_BG_ZIP: EXPORT_BG_ZIP,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 校验背景图是否被占用
|
|
124
|
+
* @param {*} params id
|
|
125
|
+
*/
|
|
126
|
+
canDeleteBackground: function canDeleteBackground(id) {
|
|
127
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
128
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
129
|
+
while (1) {
|
|
130
|
+
switch (_context4.prev = _context4.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
_context4.next = 2;
|
|
133
|
+
return (0, _request.getRequest)()("/topo/v1/api/background/" + id);
|
|
134
|
+
|
|
135
|
+
case 2:
|
|
136
|
+
return _context4.abrupt("return", _context4.sent);
|
|
137
|
+
|
|
138
|
+
case 3:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context4.stop();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, _callee4);
|
|
144
|
+
}))();
|
|
145
|
+
}
|
|
121
146
|
};
|
|
122
147
|
exports["default"] = _default;
|
|
@@ -5,51 +5,60 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
var _topoMod = _interopRequireDefault(require("
|
|
8
|
+
var _topoMod = _interopRequireDefault(require("../../models/topoMod"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _customIcon = _interopRequireDefault(require("../../models/customIcon"));
|
|
11
11
|
|
|
12
|
-
var _ciModel = _interopRequireDefault(require("
|
|
12
|
+
var _ciModel = _interopRequireDefault(require("../../models/ciModel"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _selection = _interopRequireDefault(require("../../models/selection"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _topoBizMod = _interopRequireDefault(require("../../models/topoBizMod"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _topoConfig = _interopRequireDefault(require("../../models/topoConfig"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _topoEdit = _interopRequireDefault(require("../../models/topoEdit"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _topoView = _interopRequireDefault(require("../../models/topoView"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _topoAlarm = _interopRequireDefault(require("../../models/topoAlarm"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _topoGraphView = _interopRequireDefault(require("../../models/topoGraphView"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _background = _interopRequireDefault(require("../../models/background"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _displayConfig = _interopRequireDefault(require("../../models/displayConfig"));
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _resourceWebControllUrlSetting = _interopRequireDefault(require("../../models/resourceWebControllUrlSetting"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _topoBaseInfoOverview = _interopRequireDefault(require("../../models/topoBaseInfoOverview"));
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _topoCenter = _interopRequireDefault(require("../../topoCenter/store/topoCenter"));
|
|
37
|
+
|
|
38
|
+
var _functionAuth = _interopRequireDefault(require("../../topoCenter/store/functionAuth"));
|
|
39
|
+
|
|
40
|
+
var _topoLinkMod = _interopRequireDefault(require("../../topoCenter/store/topoLinkMod"));
|
|
41
|
+
|
|
42
|
+
var _topoTreeMod = _interopRequireDefault(require("../../topoCenter/store/topoTreeMod"));
|
|
37
43
|
|
|
38
44
|
var _default = {
|
|
39
45
|
topoMod: _topoMod["default"],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
functionAuth: _functionAuth["default"],
|
|
43
|
-
linkDynamicStyle: _linkDynamicStyle["default"],
|
|
44
|
-
linkDynamicStyleConfig: _linkDynamicStyleConfig["default"],
|
|
45
|
-
permissionSetting: _permissionSetting["default"],
|
|
46
|
+
customIcon: _customIcon["default"],
|
|
47
|
+
selection: _selection["default"],
|
|
46
48
|
resourceWebControllUrlSetting: _resourceWebControllUrlSetting["default"],
|
|
47
49
|
topoBizMod: _topoBizMod["default"],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
topoConfig: _topoConfig["default"],
|
|
51
|
+
topoLinkMod: _topoLinkMod["default"],
|
|
52
|
+
topoView: _topoView["default"],
|
|
53
|
+
background: _background["default"],
|
|
54
|
+
topoGraphView: _topoGraphView["default"],
|
|
55
|
+
topoAlarm: _topoAlarm["default"],
|
|
56
|
+
displayConfig: _displayConfig["default"],
|
|
57
|
+
topoBaseInfoOverview: _topoBaseInfoOverview["default"],
|
|
58
|
+
ciModel: _ciModel["default"],
|
|
59
|
+
functionAuth: _functionAuth["default"],
|
|
51
60
|
topoEdit: _topoEdit["default"],
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
topoCenter: _topoCenter["default"],
|
|
62
|
+
topoTreeMod: _topoTreeMod["default"]
|
|
54
63
|
};
|
|
55
64
|
exports["default"] = _default;
|
|
@@ -9,14 +9,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _store = require("@ice/store");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _coreModels = _interopRequireDefault(require("./coreModels"));
|
|
13
13
|
|
|
14
14
|
function _default(engine, extModels) {
|
|
15
15
|
if (extModels === void 0) {
|
|
16
16
|
extModels = {};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
var models = (0, _extends2["default"])({},
|
|
19
|
+
var models = (0, _extends2["default"])({}, _coreModels["default"], extModels);
|
|
20
20
|
Object.keys(models).forEach(function (name) {
|
|
21
21
|
var model = models[name];
|
|
22
22
|
|
package/lib/core/test/Test.js
CHANGED
|
@@ -13,9 +13,11 @@ var Test = /*#__PURE__*/function () {
|
|
|
13
13
|
var _proto = Test.prototype;
|
|
14
14
|
|
|
15
15
|
_proto.init = function init() {
|
|
16
|
+
var _this = this;
|
|
17
|
+
|
|
16
18
|
this.iconManage = {
|
|
17
19
|
openUpload: function openUpload(type) {
|
|
18
|
-
topo.store.getModelDispatchers('
|
|
20
|
+
_this.topo.store.getModelDispatchers('customIcon').open({
|
|
19
21
|
type: type || 'node'
|
|
20
22
|
});
|
|
21
23
|
}
|
|
@@ -11,70 +11,71 @@ function buildNodeContextmenu(topoApp) {
|
|
|
11
11
|
return {
|
|
12
12
|
enable: true,
|
|
13
13
|
items: [// {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
label: 'Web控制台',
|
|
23
|
-
icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
24
|
-
visible:
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
items: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
14
|
+
// label: '概览',
|
|
15
|
+
// id: 'Resource.detail',
|
|
16
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_overview.svg',
|
|
17
|
+
// visible: (data) => {
|
|
18
|
+
// return isResource(data) && !!data.operation;
|
|
19
|
+
// }
|
|
20
|
+
// },
|
|
21
|
+
// {
|
|
22
|
+
// label: 'Web控制台',
|
|
23
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
24
|
+
// visible: (data) => {
|
|
25
|
+
// return isResource(data) && !!data.operation;
|
|
26
|
+
// },
|
|
27
|
+
// items: [
|
|
28
|
+
// {
|
|
29
|
+
// label: '访问',
|
|
30
|
+
// id: 'Resource.WebConsole.open',
|
|
31
|
+
// disable: (data) => {
|
|
32
|
+
// const {resourceWebControllUrl} = topoApp.pluginManager.pluginMap;
|
|
33
|
+
// return !resourceWebControllUrl.getResourceUrl(data.id)
|
|
34
|
+
// },
|
|
35
|
+
// },
|
|
36
|
+
// { label: '设置', id: 'Resource.WebConsole.setting' },
|
|
37
|
+
// ]
|
|
38
|
+
// },
|
|
39
|
+
// {
|
|
40
|
+
// label: '资源操作',
|
|
41
|
+
// id: 'Resource.Operate',
|
|
42
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_operands.svg',
|
|
43
|
+
// visible: (data) => {
|
|
44
|
+
// if (!isResource(data)) {
|
|
45
|
+
// return false;
|
|
46
|
+
// }
|
|
47
|
+
// const {ciType} = data;
|
|
48
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
49
|
+
// if (!ciMeta) {
|
|
50
|
+
// return false;
|
|
51
|
+
// }
|
|
52
|
+
// const {domain} = ciMeta;
|
|
53
|
+
// // 是否有该页签,与资源详情保持一致
|
|
54
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
55
|
+
// return !!data.operation && hasTab;
|
|
56
|
+
// }
|
|
57
|
+
// },
|
|
58
|
+
// {
|
|
59
|
+
// label: 'Syslog',
|
|
60
|
+
// id: 'Resource.Syslog',
|
|
61
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_syslog.svg',
|
|
62
|
+
// visible: (data) => {
|
|
63
|
+
// if (!isResource(data)) {
|
|
64
|
+
// return false;
|
|
65
|
+
// }
|
|
66
|
+
// const {ciType} = data;
|
|
67
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
68
|
+
// if (!ciMeta) {
|
|
69
|
+
// return false;
|
|
70
|
+
// }
|
|
71
|
+
// const {domain} = ciMeta;
|
|
72
|
+
// // 是否有该页签,与资源详情保持一致
|
|
73
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
74
|
+
// return !!data.operation && hasTab;
|
|
75
|
+
// }
|
|
76
|
+
// },
|
|
77
|
+
// { label: '打开属性设置', id: 'openSet' },
|
|
78
|
+
// { label: '打开全局属性设置', id: 'openAllSet' },
|
|
78
79
|
]
|
|
79
80
|
};
|
|
80
81
|
}
|
package/lib/createTopo.js
CHANGED
|
@@ -8,7 +8,7 @@ exports["default"] = void 0;
|
|
|
8
8
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
|
|
11
|
-
var _createTopoApp = require("./core/
|
|
11
|
+
var _createTopoApp = require("./core/createTopoApp");
|
|
12
12
|
|
|
13
13
|
var _createMenuCommands = _interopRequireDefault(require("./contextmenu/createMenuCommands"));
|
|
14
14
|
|
package/lib/hooks/useAlarm.js
CHANGED
|
@@ -39,9 +39,7 @@ function useAlarm(options) {
|
|
|
39
39
|
|
|
40
40
|
var _store$useModel2 = store.useModel("topoBizMod"),
|
|
41
41
|
bizState = _store$useModel2[0],
|
|
42
|
-
bizDispatchers = _store$useModel2[1];
|
|
43
|
-
|
|
44
|
-
var linkDynamicStyleDispatcher = store.getModel("linkDynamicStyle")[1]; // rlog.debug(
|
|
42
|
+
bizDispatchers = _store$useModel2[1]; // rlog.debug(
|
|
45
43
|
// "useAlarm.useEffect 获取初始化告警----------init",
|
|
46
44
|
// topo,
|
|
47
45
|
// allData,
|
|
@@ -76,6 +74,7 @@ function useAlarm(options) {
|
|
|
76
74
|
// };
|
|
77
75
|
// }, [alarmIsOpened]);
|
|
78
76
|
|
|
77
|
+
|
|
79
78
|
function getAlarmByEE(_x) {
|
|
80
79
|
return _getAlarmByEE.apply(this, arguments);
|
|
81
80
|
}
|
|
@@ -127,9 +126,7 @@ function useAlarm(options) {
|
|
|
127
126
|
_rlog["default"].debug("useAlarm.getAlarmByEE 推送告警到ht", alarmList, bizState);
|
|
128
127
|
|
|
129
128
|
if (alarmIsOpened) {
|
|
130
|
-
topo.loadAlarm(alarmList);
|
|
131
|
-
|
|
132
|
-
linkDynamicStyleDispatcher.execute();
|
|
129
|
+
topo.loadAlarm(alarmList);
|
|
133
130
|
}
|
|
134
131
|
|
|
135
132
|
case 12:
|
|
@@ -24,7 +24,7 @@ var _htElementUtils = require("../utils/htElementUtils");
|
|
|
24
24
|
function _default(props) {
|
|
25
25
|
var topo = props.topo;
|
|
26
26
|
var store = topo.store;
|
|
27
|
-
var editDispatchers = store.useModelDispatchers('
|
|
27
|
+
var editDispatchers = store.useModelDispatchers('topoConfig');
|
|
28
28
|
|
|
29
29
|
var loadConfig = /*#__PURE__*/function () {
|
|
30
30
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
package/lib/hooks/useTopoEdit.js
CHANGED
|
@@ -59,7 +59,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
59
59
|
topoEditState = _store$useModel[0],
|
|
60
60
|
topoEditDispatchers = _store$useModel[1];
|
|
61
61
|
|
|
62
|
-
var _store$useModel2 = store.useModel('
|
|
62
|
+
var _store$useModel2 = store.useModel('topoConfig'),
|
|
63
63
|
editState = _store$useModel2[0],
|
|
64
64
|
editDispatchers = _store$useModel2[1];
|
|
65
65
|
|
|
@@ -128,9 +128,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
if (!isLayerTopo && config.layers.length) {
|
|
131
|
-
topoDispatchers.
|
|
132
|
-
type: _template.TPL_TREE
|
|
133
|
-
});
|
|
131
|
+
topoDispatchers.setTopoType(_template.TPL_TREE);
|
|
134
132
|
} // 更新配置
|
|
135
133
|
|
|
136
134
|
|
|
@@ -150,9 +148,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
150
148
|
|
|
151
149
|
|
|
152
150
|
if (!config.layers.length) {
|
|
153
|
-
topoDispatchers.
|
|
154
|
-
type: _template.TPL_BLANK
|
|
155
|
-
});
|
|
151
|
+
topoDispatchers.setTopoType(_template.TPL_BLANK);
|
|
156
152
|
} // 更新配置
|
|
157
153
|
|
|
158
154
|
|
|
@@ -957,7 +953,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
957
953
|
}
|
|
958
954
|
};
|
|
959
955
|
|
|
960
|
-
var effectsState = store.useModelEffectsState('
|
|
956
|
+
var effectsState = store.useModelEffectsState('topoConfig');
|
|
961
957
|
var topoLoading = effectsState.getTopoByConditions.isLoading;
|
|
962
958
|
return {
|
|
963
959
|
resourceConfig: resourceConfig,
|
|
@@ -177,7 +177,7 @@ function _default(engine) {
|
|
|
177
177
|
_this3.update({
|
|
178
178
|
visible: false,
|
|
179
179
|
icons: {
|
|
180
|
-
node: [].concat(rootState.
|
|
180
|
+
node: [].concat(rootState.customIcon.icons.node, data.map(addIconUrlData)),
|
|
181
181
|
container: []
|
|
182
182
|
}
|
|
183
183
|
});
|
package/lib/models/topoBizMod.js
CHANGED
|
@@ -83,105 +83,75 @@ function _default(engine) {
|
|
|
83
83
|
}, _callee);
|
|
84
84
|
}))();
|
|
85
85
|
},
|
|
86
|
-
getCiInfo: function getCiInfo(conditions, state) {
|
|
87
|
-
var _this2 = this;
|
|
88
|
-
|
|
89
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
90
|
-
var result;
|
|
91
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
92
|
-
while (1) {
|
|
93
|
-
switch (_context2.prev = _context2.next) {
|
|
94
|
-
case 0:
|
|
95
|
-
_context2.next = 2;
|
|
96
|
-
return (0, _model.getCiMeta)(conditions);
|
|
97
|
-
|
|
98
|
-
case 2:
|
|
99
|
-
result = _context2.sent;
|
|
100
|
-
|
|
101
|
-
// rlog.debug('getCiInfo', result);
|
|
102
|
-
_this2.update({
|
|
103
|
-
// alarmList: result.datas,
|
|
104
|
-
currentCiInfo: result // drawerAlarmPageInfo,
|
|
105
|
-
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
case 4:
|
|
109
|
-
case "end":
|
|
110
|
-
return _context2.stop();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, _callee2);
|
|
114
|
-
}))();
|
|
115
|
-
},
|
|
116
86
|
// 根据ci的id获取属性的值
|
|
117
87
|
getCiArrByIds: function getCiArrByIds(conditions, state) {
|
|
118
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
88
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
119
89
|
var resIdsList, result;
|
|
120
|
-
return _regenerator["default"].wrap(function
|
|
90
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
121
91
|
while (1) {
|
|
122
|
-
switch (
|
|
92
|
+
switch (_context2.prev = _context2.next) {
|
|
123
93
|
case 0:
|
|
124
94
|
resIdsList = state.topoBizMod.resAndMetrics.resIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList);
|
|
125
95
|
// const ciIds = encodeURIComponent(resIdsList);
|
|
126
96
|
|
|
127
|
-
|
|
128
|
-
|
|
97
|
+
_context2.prev = 1;
|
|
98
|
+
_context2.next = 4;
|
|
129
99
|
return _topo["default"].getBatchCiArr({
|
|
130
100
|
ids: resIdsList
|
|
131
101
|
});
|
|
132
102
|
|
|
133
103
|
case 4:
|
|
134
|
-
result =
|
|
135
|
-
return
|
|
104
|
+
result = _context2.sent;
|
|
105
|
+
return _context2.abrupt("return", result.content);
|
|
136
106
|
|
|
137
107
|
case 8:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return
|
|
108
|
+
_context2.prev = 8;
|
|
109
|
+
_context2.t0 = _context2["catch"](1);
|
|
110
|
+
return _context2.abrupt("return", null);
|
|
141
111
|
|
|
142
112
|
case 11:
|
|
143
113
|
case "end":
|
|
144
|
-
return
|
|
114
|
+
return _context2.stop();
|
|
145
115
|
}
|
|
146
116
|
}
|
|
147
|
-
},
|
|
117
|
+
}, _callee2, null, [[1, 8]]);
|
|
148
118
|
}))();
|
|
149
119
|
},
|
|
150
120
|
// 初始化,统一获取指标和属性
|
|
151
121
|
getCiBizByIds: function getCiBizByIds(conditions, state) {
|
|
152
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
122
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
153
123
|
var _conditions$ciIds, _conditions$codes;
|
|
154
124
|
|
|
155
125
|
var _state$topoBizMod$res, resIdsList, metrics, ciIds, codes, metricResult, arrResult;
|
|
156
126
|
|
|
157
|
-
return _regenerator["default"].wrap(function
|
|
127
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
158
128
|
while (1) {
|
|
159
|
-
switch (
|
|
129
|
+
switch (_context3.prev = _context3.next) {
|
|
160
130
|
case 0:
|
|
161
131
|
_state$topoBizMod$res = state.topoBizMod.resAndMetrics, resIdsList = _state$topoBizMod$res.resIdsList, metrics = _state$topoBizMod$res.metrics;
|
|
162
132
|
ciIds = encodeURIComponent((_conditions$ciIds = conditions === null || conditions === void 0 ? void 0 : conditions.ciIds) !== null && _conditions$ciIds !== void 0 ? _conditions$ciIds : resIdsList);
|
|
163
133
|
codes = encodeURIComponent((_conditions$codes = conditions === null || conditions === void 0 ? void 0 : conditions.codes) !== null && _conditions$codes !== void 0 ? _conditions$codes : metrics);
|
|
164
|
-
|
|
134
|
+
_context3.next = 5;
|
|
165
135
|
return (0, _metric.getLatestMetrics)(ciIds, codes);
|
|
166
136
|
|
|
167
137
|
case 5:
|
|
168
|
-
metricResult =
|
|
169
|
-
|
|
138
|
+
metricResult = _context3.sent;
|
|
139
|
+
_context3.next = 8;
|
|
170
140
|
return _topo["default"].getBatchCiArr(ciIds);
|
|
171
141
|
|
|
172
142
|
case 8:
|
|
173
|
-
arrResult =
|
|
174
|
-
return
|
|
143
|
+
arrResult = _context3.sent;
|
|
144
|
+
return _context3.abrupt("return", {
|
|
175
145
|
metricResult: metricResult,
|
|
176
146
|
arrResult: arrResult
|
|
177
147
|
});
|
|
178
148
|
|
|
179
149
|
case 10:
|
|
180
150
|
case "end":
|
|
181
|
-
return
|
|
151
|
+
return _context3.stop();
|
|
182
152
|
}
|
|
183
153
|
}
|
|
184
|
-
},
|
|
154
|
+
}, _callee3);
|
|
185
155
|
}))();
|
|
186
156
|
},
|
|
187
157
|
|
|
@@ -33,6 +33,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* 拓扑配置
|
|
38
|
+
*/
|
|
36
39
|
var newGroupWithUUID = function newGroupWithUUID(group) {
|
|
37
40
|
if (group === void 0) {
|
|
38
41
|
group = _template.DEFAULT_GROUP;
|
|
@@ -266,7 +269,7 @@ function _default(topoApp) {
|
|
|
266
269
|
while (1) {
|
|
267
270
|
switch (_context2.prev = _context2.next) {
|
|
268
271
|
case 0:
|
|
269
|
-
editState = rootState.
|
|
272
|
+
editState = rootState.topoConfig;
|
|
270
273
|
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
|
271
274
|
query = {
|
|
272
275
|
id: rootState.topoMod.topoId,
|
|
@@ -355,7 +358,7 @@ function _default(topoApp) {
|
|
|
355
358
|
_rlog["default"].debug("getTopoByConditions--------", data, groupInfo);
|
|
356
359
|
|
|
357
360
|
_context4.next = 13;
|
|
358
|
-
return Promise.all([topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), dispatch.
|
|
361
|
+
return Promise.all([topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), dispatch.customIcon.loadCustomIcons()]);
|
|
359
362
|
|
|
360
363
|
case 13:
|
|
361
364
|
_yield$Promise$all = _context4.sent;
|
|
@@ -423,7 +426,7 @@ function _default(topoApp) {
|
|
|
423
426
|
var _this5 = this;
|
|
424
427
|
|
|
425
428
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
426
|
-
var _state$
|
|
429
|
+
var _state$topoConfig$vie;
|
|
427
430
|
|
|
428
431
|
var currentBackground;
|
|
429
432
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
@@ -433,7 +436,7 @@ function _default(topoApp) {
|
|
|
433
436
|
currentBackground = topoApp.store.getModelState('background').current;
|
|
434
437
|
_context6.next = 3;
|
|
435
438
|
return (0, _topoData2.saveTopo)((0, _extends2["default"])({}, data, {
|
|
436
|
-
viewGroupId: (_state$
|
|
439
|
+
viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
|
|
437
440
|
template: state.topoMod.type,
|
|
438
441
|
// 背景图
|
|
439
442
|
backgroundId: currentBackground ? currentBackground.id : null
|