@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +57 -34
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- 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/copyElementUtil.js +171 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- 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 +9 -11
- package/es/core/services/cmdb.js +20 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- 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 +18 -20
- package/es/core/utils/metricUtil.js +5 -0
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- 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 +52 -54
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- 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/copyElementUtil.js +182 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- 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 +10 -12
- package/lib/core/services/cmdb.js +22 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- 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 +22 -24
- package/lib/core/utils/metricUtil.js +5 -0
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- 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 +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +5 -3
@@ -55,44 +55,42 @@ function List(props) {
|
|
55
55
|
_remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
|
56
56
|
var canDelete;
|
57
57
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
58
|
-
while (1) {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
return _context.stop();
|
95
|
-
}
|
58
|
+
while (1) switch (_context.prev = _context.next) {
|
59
|
+
case 0:
|
60
|
+
e.stopPropagation();
|
61
|
+
_context.next = 3;
|
62
|
+
return _background["default"].canDeleteBackground(id);
|
63
|
+
|
64
|
+
case 3:
|
65
|
+
canDelete = _context.sent;
|
66
|
+
|
67
|
+
// console.log('canDelete', canDelete);
|
68
|
+
if (canDelete) {
|
69
|
+
_dialog["default"].confirm({
|
70
|
+
title: '删除',
|
71
|
+
messageProps: {
|
72
|
+
type: 'warning'
|
73
|
+
},
|
74
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
75
|
+
onOk: function onOk() {
|
76
|
+
return onRemove(id);
|
77
|
+
}
|
78
|
+
});
|
79
|
+
} else {
|
80
|
+
_dialog["default"].confirm({
|
81
|
+
title: '提示',
|
82
|
+
messageProps: {
|
83
|
+
type: 'warning'
|
84
|
+
},
|
85
|
+
content: '此背景被占用,不能删除。',
|
86
|
+
footerActions: ['ok'],
|
87
|
+
onOk: function onOk() {}
|
88
|
+
});
|
89
|
+
}
|
90
|
+
|
91
|
+
case 5:
|
92
|
+
case "end":
|
93
|
+
return _context.stop();
|
96
94
|
}
|
97
95
|
}, _callee);
|
98
96
|
}));
|
@@ -160,20 +158,18 @@ function BackgroundView(props) {
|
|
160
158
|
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
161
159
|
var res;
|
162
160
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
163
|
-
while (1) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
return _context4.stop();
|
176
|
-
}
|
161
|
+
while (1) switch (_context4.prev = _context4.next) {
|
162
|
+
case 0:
|
163
|
+
_context4.next = 2;
|
164
|
+
return _background["default"].getBackgroundList();
|
165
|
+
|
166
|
+
case 2:
|
167
|
+
res = _context4.sent;
|
168
|
+
setBgList(res);
|
169
|
+
|
170
|
+
case 4:
|
171
|
+
case "end":
|
172
|
+
return _context4.stop();
|
177
173
|
}
|
178
174
|
}, _callee4);
|
179
175
|
}));
|
@@ -189,37 +185,35 @@ function BackgroundView(props) {
|
|
189
185
|
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
|
190
186
|
var res;
|
191
187
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
192
|
-
while (1) {
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
return _background["default"].deleteBackground(id);
|
188
|
+
while (1) switch (_context5.prev = _context5.next) {
|
189
|
+
case 0:
|
190
|
+
_context5.next = 2;
|
191
|
+
return _background["default"].deleteBackground(id);
|
197
192
|
|
198
|
-
|
199
|
-
|
193
|
+
case 2:
|
194
|
+
res = _context5.sent;
|
200
195
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
196
|
+
if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
|
197
|
+
_context5.next = 9;
|
198
|
+
break;
|
199
|
+
}
|
205
200
|
|
206
|
-
|
207
|
-
|
208
|
-
|
201
|
+
topo.historyManager.setDisabled(true, '删除背景');
|
202
|
+
_context5.next = 7;
|
203
|
+
return reset();
|
209
204
|
|
210
|
-
|
211
|
-
|
212
|
-
|
205
|
+
case 7:
|
206
|
+
setHtTopoBackground(null);
|
207
|
+
topo.historyManager.setDisabled(false, '删除背景');
|
213
208
|
|
214
|
-
|
215
|
-
|
209
|
+
case 9:
|
210
|
+
getBackground();
|
216
211
|
|
217
|
-
|
212
|
+
_message["default"].success('删除成功');
|
218
213
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
}
|
214
|
+
case 11:
|
215
|
+
case "end":
|
216
|
+
return _context5.stop();
|
223
217
|
}
|
224
218
|
}, _callee5);
|
225
219
|
}));
|
@@ -234,48 +228,46 @@ function BackgroundView(props) {
|
|
234
228
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(currentBg) {
|
235
229
|
var imgUrl, size;
|
236
230
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
237
|
-
while (1) {
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
_context2.next = 19;
|
242
|
-
break;
|
243
|
-
}
|
244
|
-
|
245
|
-
setLoadingBackground(true);
|
246
|
-
topo.historyManager.beginTransaction();
|
247
|
-
imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
|
248
|
-
_context2.prev = 4;
|
249
|
-
_context2.next = 7;
|
250
|
-
return (0, _imageUtil.getImageSize)(imgUrl);
|
251
|
-
|
252
|
-
case 7:
|
253
|
-
size = _context2.sent;
|
254
|
-
|
255
|
-
_rlog["default"].debug('获取图片大小', size);
|
256
|
-
|
257
|
-
_context2.next = 11;
|
258
|
-
return setBackground((0, _extends2["default"])({}, currentBg, size));
|
259
|
-
|
260
|
-
case 11:
|
261
|
-
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
262
|
-
_context2.next = 17;
|
231
|
+
while (1) switch (_context2.prev = _context2.next) {
|
232
|
+
case 0:
|
233
|
+
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
234
|
+
_context2.next = 19;
|
263
235
|
break;
|
236
|
+
}
|
237
|
+
|
238
|
+
setLoadingBackground(true);
|
239
|
+
topo.historyManager.beginTransaction();
|
240
|
+
imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
|
241
|
+
_context2.prev = 4;
|
242
|
+
_context2.next = 7;
|
243
|
+
return (0, _imageUtil.getImageSize)(imgUrl);
|
244
|
+
|
245
|
+
case 7:
|
246
|
+
size = _context2.sent;
|
247
|
+
|
248
|
+
_rlog["default"].debug('获取图片大小', size);
|
249
|
+
|
250
|
+
_context2.next = 11;
|
251
|
+
return setBackground((0, _extends2["default"])({}, currentBg, size));
|
252
|
+
|
253
|
+
case 11:
|
254
|
+
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
255
|
+
_context2.next = 17;
|
256
|
+
break;
|
264
257
|
|
265
|
-
|
266
|
-
|
267
|
-
|
258
|
+
case 14:
|
259
|
+
_context2.prev = 14;
|
260
|
+
_context2.t0 = _context2["catch"](4);
|
268
261
|
|
269
|
-
|
262
|
+
_rlog["default"].error('设置背景失败', _context2.t0);
|
270
263
|
|
271
|
-
|
272
|
-
|
273
|
-
|
264
|
+
case 17:
|
265
|
+
topo.historyManager.endTransaction();
|
266
|
+
setLoadingBackground(false);
|
274
267
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
}
|
268
|
+
case 19:
|
269
|
+
case "end":
|
270
|
+
return _context2.stop();
|
279
271
|
}
|
280
272
|
}, _callee2, null, [[4, 14]]);
|
281
273
|
}));
|
@@ -288,21 +280,19 @@ function BackgroundView(props) {
|
|
288
280
|
var resetDefault = /*#__PURE__*/function () {
|
289
281
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
290
282
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
291
|
-
while (1) {
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
return _context3.stop();
|
305
|
-
}
|
283
|
+
while (1) switch (_context3.prev = _context3.next) {
|
284
|
+
case 0:
|
285
|
+
topo.historyManager.beginTransaction();
|
286
|
+
_context3.next = 3;
|
287
|
+
return reset();
|
288
|
+
|
289
|
+
case 3:
|
290
|
+
setHtTopoBackground(null);
|
291
|
+
topo.historyManager.endTransaction();
|
292
|
+
|
293
|
+
case 5:
|
294
|
+
case "end":
|
295
|
+
return _context3.stop();
|
306
296
|
}
|
307
297
|
}, _callee3);
|
308
298
|
}));
|
@@ -63,32 +63,30 @@ function RenameDialog(props) {
|
|
63
63
|
var _yield$field$validate, errors, values;
|
64
64
|
|
65
65
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
66
|
-
while (1) {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
return field.validatePromise();
|
71
|
-
|
72
|
-
case 2:
|
73
|
-
_yield$field$validate = _context.sent;
|
74
|
-
errors = _yield$field$validate.errors;
|
75
|
-
values = _yield$field$validate.values;
|
76
|
-
|
77
|
-
if (errors) {
|
78
|
-
_context.next = 8;
|
79
|
-
break;
|
80
|
-
}
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
67
|
+
case 0:
|
68
|
+
_context.next = 2;
|
69
|
+
return field.validatePromise();
|
81
70
|
|
71
|
+
case 2:
|
72
|
+
_yield$field$validate = _context.sent;
|
73
|
+
errors = _yield$field$validate.errors;
|
74
|
+
values = _yield$field$validate.values;
|
75
|
+
|
76
|
+
if (errors) {
|
82
77
|
_context.next = 8;
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
|
81
|
+
_context.next = 8;
|
82
|
+
return dispatchers.renameIcon({
|
83
|
+
id: icon.id,
|
84
|
+
name: values.name
|
85
|
+
});
|
86
|
+
|
87
|
+
case 8:
|
88
|
+
case "end":
|
89
|
+
return _context.stop();
|
92
90
|
}
|
93
91
|
}, _callee);
|
94
92
|
}));
|
@@ -29,6 +29,8 @@ var _index = _interopRequireDefault(require("@riil-frontend/component-topology-c
|
|
29
29
|
|
30
30
|
var _lodash = _interopRequireDefault(require("lodash"));
|
31
31
|
|
32
|
+
var _utils = require("@riil-frontend/utils");
|
33
|
+
|
32
34
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
33
35
|
|
34
36
|
var _SpecialCharacterValidateUtil = require("../../../../utils/SpecialCharacterValidateUtil");
|
@@ -201,39 +203,37 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
201
203
|
_this.handleSuccess = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
202
204
|
var files, dispatchers;
|
203
205
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
204
|
-
while (1) {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
return _context.stop();
|
236
|
-
}
|
206
|
+
while (1) switch (_context.prev = _context.next) {
|
207
|
+
case 0:
|
208
|
+
files = _this.state.files;
|
209
|
+
|
210
|
+
_message["default"].show({
|
211
|
+
type: 'success',
|
212
|
+
title: '图片上传成功'
|
213
|
+
});
|
214
|
+
|
215
|
+
_this.setState({
|
216
|
+
uploading: false
|
217
|
+
});
|
218
|
+
|
219
|
+
dispatchers = _this.props.dispatchers;
|
220
|
+
_context.next = 6;
|
221
|
+
return dispatchers.uploadSuccess({
|
222
|
+
type: _this.props.type,
|
223
|
+
data: files.map(function (file) {
|
224
|
+
return {
|
225
|
+
id: file.response.result,
|
226
|
+
name: getFileName(file)
|
227
|
+
};
|
228
|
+
})
|
229
|
+
});
|
230
|
+
|
231
|
+
case 6:
|
232
|
+
_this.resetState();
|
233
|
+
|
234
|
+
case 7:
|
235
|
+
case "end":
|
236
|
+
return _context.stop();
|
237
237
|
}
|
238
238
|
}, _callee);
|
239
239
|
}));
|
@@ -311,7 +311,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
311
311
|
disabled: uploading,
|
312
312
|
action: UPLOAD_ICON_URL,
|
313
313
|
headers: {
|
314
|
-
Authorization:
|
314
|
+
Authorization: (0, _utils.getToken)()
|
315
315
|
},
|
316
316
|
accept: ".jpg,.jpeg,.png,.svg",
|
317
317
|
autoUpload: false,
|
@@ -19,27 +19,25 @@ function svgToShape(_x) {
|
|
19
19
|
function _svgToShape() {
|
20
20
|
_svgToShape = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
21
21
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
22
|
-
while (1) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
return _context.stop();
|
42
|
-
}
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
23
|
+
case 0:
|
24
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
25
|
+
var reader = new FileReader();
|
26
|
+
|
27
|
+
reader.onload = function () {
|
28
|
+
resolve(ht.Default.svgToShape(this.result).output);
|
29
|
+
};
|
30
|
+
|
31
|
+
reader.onerror = function () {
|
32
|
+
reject();
|
33
|
+
};
|
34
|
+
|
35
|
+
reader.readAsText(file);
|
36
|
+
}));
|
37
|
+
|
38
|
+
case 1:
|
39
|
+
case "end":
|
40
|
+
return _context.stop();
|
43
41
|
}
|
44
42
|
}, _callee);
|
45
43
|
}));
|
@@ -26,16 +26,14 @@ var GroupAddResourceDrawer = function GroupAddResourceDrawer(props) {
|
|
26
26
|
var onOk = /*#__PURE__*/function () {
|
27
27
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
28
28
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
29
|
-
while (1) {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return _context.stop();
|
38
|
-
}
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
30
|
+
case 0:
|
31
|
+
_context.next = 2;
|
32
|
+
return topoEdit.addGroupResources(group, selected);
|
33
|
+
|
34
|
+
case 2:
|
35
|
+
case "end":
|
36
|
+
return _context.stop();
|
39
37
|
}
|
40
38
|
}, _callee);
|
41
39
|
}));
|
@@ -32,30 +32,28 @@ function useCanvasThemeConfig(props) {
|
|
32
32
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(themeName) {
|
33
33
|
var themeConfig;
|
34
34
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
35
|
-
while (1) {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
return _context.stop();
|
58
|
-
}
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
36
|
+
case 0:
|
37
|
+
themeConfig = _themes["default"].find(function (item) {
|
38
|
+
return item.name === themeName;
|
39
|
+
});
|
40
|
+
topo.historyManager.beginTransaction();
|
41
|
+
_context.next = 4;
|
42
|
+
return displayConfigDispatchers.update({
|
43
|
+
canvasTheme: themeName
|
44
|
+
});
|
45
|
+
|
46
|
+
case 4:
|
47
|
+
_context.next = 6;
|
48
|
+
return setGlobalTagTheme(themeConfig);
|
49
|
+
|
50
|
+
case 6:
|
51
|
+
setElementsTheme(themeConfig);
|
52
|
+
topo.historyManager.endTransaction();
|
53
|
+
|
54
|
+
case 8:
|
55
|
+
case "end":
|
56
|
+
return _context.stop();
|
59
57
|
}
|
60
58
|
}, _callee);
|
61
59
|
}));
|
@@ -75,23 +73,21 @@ function useCanvasThemeConfig(props) {
|
|
75
73
|
var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle;
|
76
74
|
|
77
75
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
78
|
-
while (1) {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
return _context2.stop();
|
94
|
-
}
|
76
|
+
while (1) switch (_context2.prev = _context2.next) {
|
77
|
+
case 0:
|
78
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(themeConfig.globalNodeLabelStyle);
|
79
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(themeConfig.globalEdgeTagStyle); // 更新默认配置
|
80
|
+
|
81
|
+
_topo$store$getModelS = topo.store.getModelState('displayConfig'), nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle, defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
|
82
|
+
_context2.next = 5;
|
83
|
+
return displayConfigDispatchers.update({
|
84
|
+
nodeLabelStyle: (0, _extends2["default"])({}, nodeLabelStyle, themeConfig.globalNodeLabelStyle),
|
85
|
+
defaultEdgeLabelStyle: (0, _extends2["default"])({}, defaultEdgeLabelStyle, themeConfig.globalEdgeTagStyle)
|
86
|
+
});
|
87
|
+
|
88
|
+
case 5:
|
89
|
+
case "end":
|
90
|
+
return _context2.stop();
|
95
91
|
}
|
96
92
|
}, _callee2);
|
97
93
|
}));
|