@riil-frontend/component-topology 11.0.33 → 11.0.35
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/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/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- 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/BackgroundView/index.module.scss +2 -1
- 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 +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- 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 +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- 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 +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- 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 +37 -41
- 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 +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- 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.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 +251 -289
- 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/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/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/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- 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/BackgroundView/index.module.scss +2 -1
- 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 +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- 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 +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- 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 +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- 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 +37 -41
- 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 +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- 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.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 +252 -290
- 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/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 +4 -3
@@ -1,10 +1,10 @@
|
|
1
|
-
import _Message from "@alifd/next/es/message";
|
2
1
|
import _Loading from "@alifd/next/es/loading";
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
4
|
-
import
|
3
|
+
import _Message from "@alifd/next/es/message";
|
5
4
|
import _Tag from "@alifd/next/es/tag";
|
6
5
|
import _Button from "@alifd/next/es/button";
|
7
6
|
import _Icon from "@alifd/next/es/icon";
|
7
|
+
import _Dialog from "@alifd/next/es/dialog";
|
8
8
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
10
10
|
import React, { useEffect, useState } from 'react';
|
@@ -16,61 +16,56 @@ import { getImageSize } from "../../../utils/imageUtil";
|
|
16
16
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
17
17
|
|
18
18
|
function List(props) {
|
19
|
+
var _remove;
|
20
|
+
|
19
21
|
var selected = props.selected,
|
20
22
|
onSelect = props.onSelect,
|
21
23
|
dataSource = props.dataSource,
|
22
24
|
onRemove = props.onRemove;
|
23
25
|
|
24
26
|
function remove(_x, _x2) {
|
25
|
-
return _remove.
|
26
|
-
}
|
27
|
-
|
28
|
-
function _remove() {
|
29
|
-
_remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e, id) {
|
27
|
+
return (_remove = _remove || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e, id) {
|
30
28
|
var canDelete;
|
31
29
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
32
|
-
while (1) {
|
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
|
-
return _context.stop();
|
69
|
-
}
|
30
|
+
while (1) switch (_context.prev = _context.next) {
|
31
|
+
case 0:
|
32
|
+
e.stopPropagation();
|
33
|
+
_context.next = 3;
|
34
|
+
return api.canDeleteBackground(id);
|
35
|
+
|
36
|
+
case 3:
|
37
|
+
canDelete = _context.sent;
|
38
|
+
|
39
|
+
// console.log('canDelete', canDelete);
|
40
|
+
if (canDelete) {
|
41
|
+
_Dialog.confirm({
|
42
|
+
title: '删除',
|
43
|
+
messageProps: {
|
44
|
+
type: 'warning'
|
45
|
+
},
|
46
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
47
|
+
onOk: function onOk() {
|
48
|
+
return onRemove(id);
|
49
|
+
}
|
50
|
+
});
|
51
|
+
} else {
|
52
|
+
_Dialog.confirm({
|
53
|
+
title: '提示',
|
54
|
+
messageProps: {
|
55
|
+
type: 'warning'
|
56
|
+
},
|
57
|
+
content: '此背景被占用,不能删除。',
|
58
|
+
footerActions: ['ok'],
|
59
|
+
onOk: function onOk() {}
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
case 5:
|
64
|
+
case "end":
|
65
|
+
return _context.stop();
|
70
66
|
}
|
71
67
|
}, _callee);
|
72
|
-
}));
|
73
|
-
return _remove.apply(this, arguments);
|
68
|
+
}))).apply(this, arguments);
|
74
69
|
}
|
75
70
|
|
76
71
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -102,6 +97,8 @@ function List(props) {
|
|
102
97
|
}
|
103
98
|
|
104
99
|
export default function BackgroundView(props) {
|
100
|
+
var _getBackground, _removeBg, _ref, _ref2;
|
101
|
+
|
105
102
|
var topo = props.topo;
|
106
103
|
|
107
104
|
var _topo$store$useModel = topo.store.useModel('background'),
|
@@ -127,161 +124,135 @@ export default function BackgroundView(props) {
|
|
127
124
|
}, []);
|
128
125
|
|
129
126
|
function getBackground() {
|
130
|
-
return _getBackground.
|
131
|
-
}
|
132
|
-
|
133
|
-
function _getBackground() {
|
134
|
-
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
127
|
+
return (_getBackground = _getBackground || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
135
128
|
var res;
|
136
|
-
return _regeneratorRuntime.wrap(function
|
137
|
-
while (1) {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
return _context4.stop();
|
150
|
-
}
|
129
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
130
|
+
while (1) switch (_context2.prev = _context2.next) {
|
131
|
+
case 0:
|
132
|
+
_context2.next = 2;
|
133
|
+
return api.getBackgroundList();
|
134
|
+
|
135
|
+
case 2:
|
136
|
+
res = _context2.sent;
|
137
|
+
setBgList(res);
|
138
|
+
|
139
|
+
case 4:
|
140
|
+
case "end":
|
141
|
+
return _context2.stop();
|
151
142
|
}
|
152
|
-
},
|
153
|
-
}));
|
154
|
-
return _getBackground.apply(this, arguments);
|
143
|
+
}, _callee2);
|
144
|
+
}))).apply(this, arguments);
|
155
145
|
}
|
156
146
|
|
157
147
|
function removeBg(_x3) {
|
158
|
-
return _removeBg.
|
159
|
-
} // 同步拓扑图展示
|
160
|
-
|
161
|
-
|
162
|
-
function _removeBg() {
|
163
|
-
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
|
148
|
+
return (_removeBg = _removeBg || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
164
149
|
var res;
|
165
|
-
return _regeneratorRuntime.wrap(function
|
166
|
-
while (1) {
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
return api.deleteBackground(id);
|
150
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
151
|
+
while (1) switch (_context3.prev = _context3.next) {
|
152
|
+
case 0:
|
153
|
+
_context3.next = 2;
|
154
|
+
return api.deleteBackground(id);
|
171
155
|
|
172
|
-
|
173
|
-
|
156
|
+
case 2:
|
157
|
+
res = _context3.sent;
|
174
158
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
159
|
+
if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
|
160
|
+
_context3.next = 9;
|
161
|
+
break;
|
162
|
+
}
|
179
163
|
|
180
|
-
|
181
|
-
|
182
|
-
|
164
|
+
topo.historyManager.setDisabled(true, '删除背景');
|
165
|
+
_context3.next = 7;
|
166
|
+
return reset();
|
183
167
|
|
184
|
-
|
185
|
-
|
186
|
-
|
168
|
+
case 7:
|
169
|
+
setHtTopoBackground(null);
|
170
|
+
topo.historyManager.setDisabled(false, '删除背景');
|
187
171
|
|
188
|
-
|
189
|
-
|
172
|
+
case 9:
|
173
|
+
getBackground();
|
190
174
|
|
191
|
-
|
175
|
+
_Message.success('删除成功');
|
192
176
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
}
|
177
|
+
case 11:
|
178
|
+
case "end":
|
179
|
+
return _context3.stop();
|
197
180
|
}
|
198
|
-
},
|
199
|
-
}));
|
200
|
-
|
201
|
-
|
181
|
+
}, _callee3);
|
182
|
+
}))).apply(this, arguments);
|
183
|
+
} // 同步拓扑图展示
|
184
|
+
|
202
185
|
|
203
186
|
function setHtTopoBackground(imgUrl, width, height) {
|
204
187
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, width, height);
|
205
188
|
}
|
206
189
|
|
207
|
-
var handleSelect =
|
208
|
-
|
190
|
+
var handleSelect = function handleSelect(_x4) {
|
191
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(currentBg) {
|
209
192
|
var imgUrl, size;
|
210
|
-
return _regeneratorRuntime.wrap(function
|
211
|
-
while (1) {
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
_context2.next = 19;
|
216
|
-
break;
|
217
|
-
}
|
218
|
-
|
219
|
-
setLoadingBackground(true);
|
220
|
-
topo.historyManager.beginTransaction();
|
221
|
-
imgUrl = getBackgroundImageUrl(currentBg);
|
222
|
-
_context2.prev = 4;
|
223
|
-
_context2.next = 7;
|
224
|
-
return getImageSize(imgUrl);
|
225
|
-
|
226
|
-
case 7:
|
227
|
-
size = _context2.sent;
|
228
|
-
rlog.debug('获取图片大小', size);
|
229
|
-
_context2.next = 11;
|
230
|
-
return setBackground(_extends({}, currentBg, size));
|
231
|
-
|
232
|
-
case 11:
|
233
|
-
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
234
|
-
_context2.next = 17;
|
193
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
194
|
+
while (1) switch (_context4.prev = _context4.next) {
|
195
|
+
case 0:
|
196
|
+
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
197
|
+
_context4.next = 19;
|
235
198
|
break;
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
199
|
+
}
|
200
|
+
|
201
|
+
setLoadingBackground(true);
|
202
|
+
topo.historyManager.beginTransaction();
|
203
|
+
imgUrl = getBackgroundImageUrl(currentBg);
|
204
|
+
_context4.prev = 4;
|
205
|
+
_context4.next = 7;
|
206
|
+
return getImageSize(imgUrl);
|
207
|
+
|
208
|
+
case 7:
|
209
|
+
size = _context4.sent;
|
210
|
+
rlog.debug('获取图片大小', size);
|
211
|
+
_context4.next = 11;
|
212
|
+
return setBackground(_extends({}, currentBg, size));
|
213
|
+
|
214
|
+
case 11:
|
215
|
+
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
216
|
+
_context4.next = 17;
|
217
|
+
break;
|
218
|
+
|
219
|
+
case 14:
|
220
|
+
_context4.prev = 14;
|
221
|
+
_context4.t0 = _context4["catch"](4);
|
222
|
+
rlog.error('设置背景失败', _context4.t0);
|
223
|
+
|
224
|
+
case 17:
|
225
|
+
topo.historyManager.endTransaction();
|
226
|
+
setLoadingBackground(false);
|
227
|
+
|
228
|
+
case 19:
|
229
|
+
case "end":
|
230
|
+
return _context4.stop();
|
250
231
|
}
|
251
|
-
},
|
252
|
-
}));
|
232
|
+
}, _callee4, null, [[4, 14]]);
|
233
|
+
}))).apply(this, arguments);
|
234
|
+
};
|
253
235
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
setHtTopoBackground(null);
|
271
|
-
topo.historyManager.endTransaction();
|
272
|
-
|
273
|
-
case 5:
|
274
|
-
case "end":
|
275
|
-
return _context3.stop();
|
276
|
-
}
|
236
|
+
var resetDefault = function resetDefault() {
|
237
|
+
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
238
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
239
|
+
while (1) switch (_context5.prev = _context5.next) {
|
240
|
+
case 0:
|
241
|
+
topo.historyManager.beginTransaction();
|
242
|
+
_context5.next = 3;
|
243
|
+
return reset();
|
244
|
+
|
245
|
+
case 3:
|
246
|
+
setHtTopoBackground(null);
|
247
|
+
topo.historyManager.endTransaction();
|
248
|
+
|
249
|
+
case 5:
|
250
|
+
case "end":
|
251
|
+
return _context5.stop();
|
277
252
|
}
|
278
|
-
},
|
279
|
-
}));
|
280
|
-
|
281
|
-
return function resetDefault() {
|
282
|
-
return _ref2.apply(this, arguments);
|
283
|
-
};
|
284
|
-
}();
|
253
|
+
}, _callee5);
|
254
|
+
}))).apply(this, arguments);
|
255
|
+
};
|
285
256
|
|
286
257
|
return /*#__PURE__*/React.createElement("div", {
|
287
258
|
className: styles['background-view']
|
@@ -10,6 +10,8 @@ import _ from 'lodash';
|
|
10
10
|
import { SPECIAL_CHARACTER_FORM_ITEM_VALIDATE_PROPS } from "../../../../utils/SpecialCharacterValidateUtil";
|
11
11
|
var FormItem = _Form.Item;
|
12
12
|
export default function RenameDialog(props) {
|
13
|
+
var _ref;
|
14
|
+
|
13
15
|
var topo = props.topo;
|
14
16
|
var store = topo.store;
|
15
17
|
|
@@ -36,45 +38,39 @@ export default function RenameDialog(props) {
|
|
36
38
|
});
|
37
39
|
}, [name]);
|
38
40
|
|
39
|
-
var submit =
|
40
|
-
|
41
|
+
var submit = function submit() {
|
42
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
41
43
|
var _yield$field$validate, errors, values;
|
42
44
|
|
43
45
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
44
|
-
while (1) {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
return field.validatePromise();
|
49
|
-
|
50
|
-
case 2:
|
51
|
-
_yield$field$validate = _context.sent;
|
52
|
-
errors = _yield$field$validate.errors;
|
53
|
-
values = _yield$field$validate.values;
|
46
|
+
while (1) switch (_context.prev = _context.next) {
|
47
|
+
case 0:
|
48
|
+
_context.next = 2;
|
49
|
+
return field.validatePromise();
|
54
50
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
case 2:
|
52
|
+
_yield$field$validate = _context.sent;
|
53
|
+
errors = _yield$field$validate.errors;
|
54
|
+
values = _yield$field$validate.values;
|
59
55
|
|
56
|
+
if (errors) {
|
60
57
|
_context.next = 8;
|
61
|
-
|
62
|
-
|
63
|
-
name: values.name
|
64
|
-
});
|
58
|
+
break;
|
59
|
+
}
|
65
60
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
61
|
+
_context.next = 8;
|
62
|
+
return dispatchers.renameIcon({
|
63
|
+
id: icon.id,
|
64
|
+
name: values.name
|
65
|
+
});
|
66
|
+
|
67
|
+
case 8:
|
68
|
+
case "end":
|
69
|
+
return _context.stop();
|
70
70
|
}
|
71
71
|
}, _callee);
|
72
|
-
}));
|
73
|
-
|
74
|
-
return function submit() {
|
75
|
-
return _ref.apply(this, arguments);
|
76
|
-
};
|
77
|
-
}();
|
72
|
+
}))).apply(this, arguments);
|
73
|
+
};
|
78
74
|
|
79
75
|
var renameIconForm = visible && /*#__PURE__*/React.createElement(_Form, {
|
80
76
|
field: field
|
@@ -10,6 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
import React from 'react';
|
11
11
|
import topoServer from '@riil-frontend/component-topology-common/es/services/topo/index';
|
12
12
|
import _ from 'lodash';
|
13
|
+
import { getToken } from '@riil-frontend/utils';
|
13
14
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
14
15
|
import { validateSpecialCharacter } from "../../../../utils/SpecialCharacterValidateUtil";
|
15
16
|
import "./UploadIconDialog.scss";
|
@@ -178,39 +179,37 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
178
179
|
_this.handleSuccess = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
179
180
|
var files, dispatchers;
|
180
181
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
181
|
-
while (1) {
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
return _context.stop();
|
213
|
-
}
|
182
|
+
while (1) switch (_context.prev = _context.next) {
|
183
|
+
case 0:
|
184
|
+
files = _this.state.files;
|
185
|
+
|
186
|
+
_Message.show({
|
187
|
+
type: 'success',
|
188
|
+
title: '图片上传成功'
|
189
|
+
});
|
190
|
+
|
191
|
+
_this.setState({
|
192
|
+
uploading: false
|
193
|
+
});
|
194
|
+
|
195
|
+
dispatchers = _this.props.dispatchers;
|
196
|
+
_context.next = 6;
|
197
|
+
return dispatchers.uploadSuccess({
|
198
|
+
type: _this.props.type,
|
199
|
+
data: files.map(function (file) {
|
200
|
+
return {
|
201
|
+
id: file.response.result,
|
202
|
+
name: getFileName(file)
|
203
|
+
};
|
204
|
+
})
|
205
|
+
});
|
206
|
+
|
207
|
+
case 6:
|
208
|
+
_this.resetState();
|
209
|
+
|
210
|
+
case 7:
|
211
|
+
case "end":
|
212
|
+
return _context.stop();
|
214
213
|
}
|
215
214
|
}, _callee);
|
216
215
|
}));
|
@@ -288,7 +287,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
288
287
|
disabled: uploading,
|
289
288
|
action: UPLOAD_ICON_URL,
|
290
289
|
headers: {
|
291
|
-
Authorization:
|
290
|
+
Authorization: getToken()
|
292
291
|
},
|
293
292
|
accept: ".jpg,.jpeg,.png,.svg",
|
294
293
|
autoUpload: false,
|
@@ -1,37 +1,33 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
|
3
|
+
var _svgToShape;
|
4
|
+
|
2
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
6
|
var ht = window.ht;
|
4
7
|
var FileReader = window.FileReader;
|
5
8
|
export default function svgToShape(_x) {
|
6
|
-
return _svgToShape.
|
7
|
-
}
|
8
|
-
|
9
|
-
function _svgToShape() {
|
10
|
-
_svgToShape = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
9
|
+
return (_svgToShape = _svgToShape || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
11
10
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
12
|
-
while (1) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var reader = new FileReader();
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
12
|
+
case 0:
|
13
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
14
|
+
var reader = new FileReader();
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
reader.onload = function () {
|
17
|
+
resolve(ht.Default.svgToShape(this.result).output);
|
18
|
+
};
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
reader.onerror = function () {
|
21
|
+
reject();
|
22
|
+
};
|
25
23
|
|
26
|
-
|
27
|
-
|
24
|
+
reader.readAsText(file);
|
25
|
+
}));
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
27
|
+
case 1:
|
28
|
+
case "end":
|
29
|
+
return _context.stop();
|
33
30
|
}
|
34
31
|
}, _callee);
|
35
|
-
}));
|
36
|
-
return _svgToShape.apply(this, arguments);
|
32
|
+
}))).apply(this, arguments);
|
37
33
|
}
|