@riil-frontend/component-topology 10.0.58 → 10.0.59
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/IndexSettingDrawer/index.js +6 -5
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +110 -122
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +539 -638
- package/es/core/models/Alarm.js +311 -394
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +287 -454
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +70 -84
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +11 -13
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +28 -32
- package/es/core/store/models/topoConfig.js +217 -233
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +379 -401
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index copy.js +104 -126
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +274 -314
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/linkDynamicStyle.js +102 -108
- package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/es/networkTopo/store/linkManager.js +4 -6
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/IndexSettingDrawer/index.js +6 -5
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +108 -120
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +530 -629
- package/lib/core/models/Alarm.js +308 -391
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +287 -454
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +71 -85
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +13 -15
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +34 -38
- package/lib/core/store/models/topoConfig.js +224 -240
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +381 -403
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index copy.js +105 -127
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +277 -317
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/lib/networkTopo/store/linkManager.js +4 -6
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +3 -3
@@ -1,6 +1,8 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
export default function () {
|
4
|
+
var _ref, _ref2, _ref3, _ref4;
|
5
|
+
|
4
6
|
var a = {
|
5
7
|
nodeTag: {
|
6
8
|
name: 'nodeTag',
|
@@ -21,123 +23,99 @@ export default function () {
|
|
21
23
|
* 获取节点
|
22
24
|
*/
|
23
25
|
|
24
|
-
var getNodeCiTypes =
|
25
|
-
|
26
|
+
var getNodeCiTypes = function getNodeCiTypes() {
|
27
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
26
28
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
27
|
-
while (1) {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}]);
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
30
|
+
case 0:
|
31
|
+
return _context.abrupt("return", [{
|
32
|
+
typeCode: 'switch',
|
33
|
+
typeName: '交换机'
|
34
|
+
}]);
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
36
|
+
case 1:
|
37
|
+
case "end":
|
38
|
+
return _context.stop();
|
39
39
|
}
|
40
40
|
}, _callee);
|
41
|
-
}));
|
42
|
-
|
43
|
-
return function getNodeCiTypes() {
|
44
|
-
return _ref.apply(this, arguments);
|
45
|
-
};
|
46
|
-
}();
|
41
|
+
}))).apply(this, arguments);
|
42
|
+
};
|
47
43
|
|
48
|
-
var getNodeBasicCiTypeOptions =
|
49
|
-
|
44
|
+
var getNodeBasicCiTypeOptions = function getNodeBasicCiTypeOptions() {
|
45
|
+
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
50
46
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
51
|
-
while (1) {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}]);
|
47
|
+
while (1) switch (_context2.prev = _context2.next) {
|
48
|
+
case 0:
|
49
|
+
return _context2.abrupt("return", [{
|
50
|
+
typeCode: 'switch',
|
51
|
+
typeName: '',
|
52
|
+
options: [{
|
53
|
+
value: 'typeCode',
|
54
|
+
label: '资源类型'
|
55
|
+
} // 属性
|
56
|
+
// 指标
|
57
|
+
]
|
58
|
+
}]);
|
64
59
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
60
|
+
case 1:
|
61
|
+
case "end":
|
62
|
+
return _context2.stop();
|
69
63
|
}
|
70
64
|
}, _callee2);
|
71
|
-
}));
|
72
|
-
|
73
|
-
return function getNodeBasicCiTypeOptions() {
|
74
|
-
return _ref2.apply(this, arguments);
|
75
|
-
};
|
76
|
-
}();
|
65
|
+
}))).apply(this, arguments);
|
66
|
+
};
|
77
67
|
|
78
|
-
var getNodeTagCiTypeOptions =
|
79
|
-
|
68
|
+
var getNodeTagCiTypeOptions = function getNodeTagCiTypeOptions() {
|
69
|
+
return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
80
70
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
81
|
-
while (1) {
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
}]);
|
71
|
+
while (1) switch (_context3.prev = _context3.next) {
|
72
|
+
case 0:
|
73
|
+
return _context3.abrupt("return", [{
|
74
|
+
typeCode: 'switch',
|
75
|
+
typeName: '',
|
76
|
+
options: [{
|
77
|
+
value: 'graph:name',
|
78
|
+
label: '图片名称'
|
79
|
+
}, {
|
80
|
+
value: 'typeCode',
|
81
|
+
label: '资源类型'
|
82
|
+
} // 属性
|
83
|
+
// 指标
|
84
|
+
]
|
85
|
+
}]);
|
97
86
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}
|
87
|
+
case 1:
|
88
|
+
case "end":
|
89
|
+
return _context3.stop();
|
102
90
|
}
|
103
91
|
}, _callee3);
|
104
|
-
}));
|
105
|
-
|
106
|
-
return function getNodeTagCiTypeOptions() {
|
107
|
-
return _ref3.apply(this, arguments);
|
108
|
-
};
|
109
|
-
}();
|
92
|
+
}))).apply(this, arguments);
|
93
|
+
};
|
110
94
|
|
111
|
-
var getNodeTipCiTypeOptions =
|
112
|
-
|
95
|
+
var getNodeTipCiTypeOptions = function getNodeTipCiTypeOptions() {
|
96
|
+
return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
113
97
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
114
|
-
while (1) {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}]);
|
98
|
+
while (1) switch (_context4.prev = _context4.next) {
|
99
|
+
case 0:
|
100
|
+
return _context4.abrupt("return", [{
|
101
|
+
typeCode: 'switch',
|
102
|
+
typeName: '',
|
103
|
+
options: [{
|
104
|
+
value: 'graph:name',
|
105
|
+
label: '图片名称'
|
106
|
+
}, {
|
107
|
+
value: 'typeCode',
|
108
|
+
label: '资源类型'
|
109
|
+
} // 属性
|
110
|
+
// 指标
|
111
|
+
]
|
112
|
+
}]);
|
130
113
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
114
|
+
case 1:
|
115
|
+
case "end":
|
116
|
+
return _context4.stop();
|
135
117
|
}
|
136
118
|
}, _callee4);
|
137
|
-
}));
|
138
|
-
|
139
|
-
return function getNodeTipCiTypeOptions() {
|
140
|
-
return _ref4.apply(this, arguments);
|
141
|
-
};
|
142
|
-
}();
|
119
|
+
}))).apply(this, arguments);
|
120
|
+
};
|
143
121
|
}
|
@@ -3,139 +3,123 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
5
|
export default (function (props) {
|
6
|
+
var _ref, _ref2, _ref3;
|
7
|
+
|
6
8
|
var topo = props.topo,
|
7
9
|
displaySettingProps = props.displaySettingProps,
|
8
10
|
settingRef = props.settingRef,
|
9
11
|
isEditor = props.isEditor;
|
10
12
|
|
11
|
-
var handleViewerSave =
|
12
|
-
|
13
|
+
var handleViewerSave = function handleViewerSave() {
|
14
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
13
15
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
14
16
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
15
|
-
while (1) {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
return _context.stop();
|
48
|
-
}
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
18
|
+
case 0:
|
19
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
20
|
+
// 保存配置
|
21
|
+
|
22
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
23
|
+
displayConfig = _extends({}, prevDisplayConfig, values);
|
24
|
+
_context.next = 5;
|
25
|
+
return topoService.saveTopoSettings(topo.id, {
|
26
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
27
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
28
|
+
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
29
|
+
});
|
30
|
+
|
31
|
+
case 5:
|
32
|
+
// 刷新指标配置
|
33
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
34
|
+
_context.next = 8;
|
35
|
+
return displayConfigDispatchers.update(displayConfig);
|
36
|
+
|
37
|
+
case 8:
|
38
|
+
// 更新节点名称显示隐藏
|
39
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
40
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
41
|
+
|
42
|
+
if (extraOnOk) {
|
43
|
+
extraOnOk(displayConfig);
|
44
|
+
}
|
45
|
+
|
46
|
+
case 11:
|
47
|
+
case "end":
|
48
|
+
return _context.stop();
|
49
49
|
}
|
50
50
|
}, _callee);
|
51
|
-
}));
|
52
|
-
|
53
|
-
return function handleViewerSave() {
|
54
|
-
return _ref.apply(this, arguments);
|
55
|
-
};
|
56
|
-
}();
|
51
|
+
}))).apply(this, arguments);
|
52
|
+
};
|
57
53
|
|
58
|
-
var handleEditorSave =
|
59
|
-
|
54
|
+
var handleEditorSave = function handleEditorSave() {
|
55
|
+
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
60
56
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
61
57
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
62
|
-
while (1) {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
|
71
|
-
|
72
|
-
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
73
|
-
_context2.next = 7;
|
74
|
-
return displayConfigDispatchers.update(displayConfig);
|
75
|
-
|
76
|
-
case 7:
|
77
|
-
// 更新节点名称显示隐藏
|
78
|
-
topo.attributeMetricDisplay.updateNodesNameVisible();
|
79
|
-
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
80
|
-
|
81
|
-
if (!extraOnOk) {
|
82
|
-
_context2.next = 12;
|
83
|
-
break;
|
84
|
-
}
|
58
|
+
while (1) switch (_context2.prev = _context2.next) {
|
59
|
+
case 0:
|
60
|
+
topo.historyManager.beginTransaction();
|
61
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
62
|
+
// 保存配置
|
63
|
+
|
64
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
65
|
+
displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
|
85
66
|
|
67
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
68
|
+
_context2.next = 7;
|
69
|
+
return displayConfigDispatchers.update(displayConfig);
|
70
|
+
|
71
|
+
case 7:
|
72
|
+
// 更新节点名称显示隐藏
|
73
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
74
|
+
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
75
|
+
|
76
|
+
if (!extraOnOk) {
|
86
77
|
_context2.next = 12;
|
87
|
-
|
78
|
+
break;
|
79
|
+
}
|
88
80
|
|
89
|
-
|
90
|
-
|
81
|
+
_context2.next = 12;
|
82
|
+
return extraOnOk(displayConfig);
|
91
83
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
84
|
+
case 12:
|
85
|
+
topo.historyManager.endTransaction();
|
86
|
+
|
87
|
+
case 13:
|
88
|
+
case "end":
|
89
|
+
return _context2.stop();
|
96
90
|
}
|
97
91
|
}, _callee2);
|
98
|
-
}));
|
99
|
-
|
100
|
-
return function handleEditorSave() {
|
101
|
-
return _ref2.apply(this, arguments);
|
102
|
-
};
|
103
|
-
}();
|
92
|
+
}))).apply(this, arguments);
|
93
|
+
};
|
104
94
|
|
105
|
-
var save =
|
106
|
-
|
95
|
+
var save = function save() {
|
96
|
+
return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
107
97
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
108
|
-
while (1) {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
_context3.next = 5;
|
113
|
-
break;
|
114
|
-
}
|
115
|
-
|
116
|
-
_context3.next = 3;
|
117
|
-
return handleViewerSave();
|
118
|
-
|
119
|
-
case 3:
|
120
|
-
_context3.next = 7;
|
98
|
+
while (1) switch (_context3.prev = _context3.next) {
|
99
|
+
case 0:
|
100
|
+
if (isEditor) {
|
101
|
+
_context3.next = 5;
|
121
102
|
break;
|
103
|
+
}
|
104
|
+
|
105
|
+
_context3.next = 3;
|
106
|
+
return handleViewerSave();
|
122
107
|
|
123
|
-
|
124
|
-
|
125
|
-
|
108
|
+
case 3:
|
109
|
+
_context3.next = 7;
|
110
|
+
break;
|
126
111
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
112
|
+
case 5:
|
113
|
+
_context3.next = 7;
|
114
|
+
return handleEditorSave();
|
115
|
+
|
116
|
+
case 7:
|
117
|
+
case "end":
|
118
|
+
return _context3.stop();
|
131
119
|
}
|
132
120
|
}, _callee3);
|
133
|
-
}));
|
134
|
-
|
135
|
-
return function save() {
|
136
|
-
return _ref3.apply(this, arguments);
|
137
|
-
};
|
138
|
-
}();
|
121
|
+
}))).apply(this, arguments);
|
122
|
+
};
|
139
123
|
|
140
124
|
return {
|
141
125
|
save: save
|
@@ -8,10 +8,11 @@ export default function TitleWidget(props) {
|
|
8
8
|
topoState = _store$useModel[0],
|
9
9
|
topoDispatchers = _store$useModel[1];
|
10
10
|
|
11
|
-
var _topoState$currentTop = topoState.currentTopo
|
12
|
-
|
13
|
-
|
14
|
-
topoName = _topoState$
|
11
|
+
var _topoState$currentTop = topoState.currentTopo,
|
12
|
+
_topoState$currentTop2 = _topoState$currentTop === void 0 ? {} : _topoState$currentTop,
|
13
|
+
topoId = _topoState$currentTop2.id,
|
14
|
+
topoName = _topoState$currentTop2.name;
|
15
|
+
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
16
17
|
className: styles.title
|
17
18
|
}, topoName);
|
@@ -9,6 +9,7 @@ import _ConfigProvider from "@alifd/next/es/config-provider";
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
10
10
|
import React from 'react';
|
11
11
|
import _ from 'lodash';
|
12
|
+
import { getToken } from '@riil-frontend/utils';
|
12
13
|
import styles from "./index.module.scss";
|
13
14
|
var config = _ConfigProvider.config;
|
14
15
|
|
@@ -142,28 +143,26 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
142
143
|
_this.handleSuccess = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
143
144
|
var onSuccess;
|
144
145
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
145
|
-
while (1) {
|
146
|
-
|
147
|
-
|
148
|
-
onSuccess = _this.props.onSuccess;
|
146
|
+
while (1) switch (_context.prev = _context.next) {
|
147
|
+
case 0:
|
148
|
+
onSuccess = _this.props.onSuccess;
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
_Message.show({
|
151
|
+
type: 'success',
|
152
|
+
title: '背景图上传成功'
|
153
|
+
});
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
|
155
|
+
_this.setState({
|
156
|
+
uploading: false
|
157
|
+
});
|
158
158
|
|
159
|
-
|
159
|
+
_this.resetState();
|
160
160
|
|
161
|
-
|
161
|
+
onSuccess();
|
162
162
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
}
|
163
|
+
case 5:
|
164
|
+
case "end":
|
165
|
+
return _context.stop();
|
167
166
|
}
|
168
167
|
}, _callee);
|
169
168
|
}));
|
@@ -219,7 +218,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
219
218
|
value: files,
|
220
219
|
action: "/topo/v1/api/background/upload/" + this.props.type,
|
221
220
|
headers: {
|
222
|
-
Authorization:
|
221
|
+
Authorization: getToken()
|
223
222
|
},
|
224
223
|
accept: ".png",
|
225
224
|
autoUpload: false,
|