@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
@@ -29,44 +29,42 @@ function List(props) {
|
|
29
29
|
_remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e, id) {
|
30
30
|
var canDelete;
|
31
31
|
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
|
-
}
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
e.stopPropagation();
|
35
|
+
_context.next = 3;
|
36
|
+
return api.canDeleteBackground(id);
|
37
|
+
|
38
|
+
case 3:
|
39
|
+
canDelete = _context.sent;
|
40
|
+
|
41
|
+
// console.log('canDelete', canDelete);
|
42
|
+
if (canDelete) {
|
43
|
+
_Dialog.confirm({
|
44
|
+
title: '删除',
|
45
|
+
messageProps: {
|
46
|
+
type: 'warning'
|
47
|
+
},
|
48
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
49
|
+
onOk: function onOk() {
|
50
|
+
return onRemove(id);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
} else {
|
54
|
+
_Dialog.confirm({
|
55
|
+
title: '提示',
|
56
|
+
messageProps: {
|
57
|
+
type: 'warning'
|
58
|
+
},
|
59
|
+
content: '此背景被占用,不能删除。',
|
60
|
+
footerActions: ['ok'],
|
61
|
+
onOk: function onOk() {}
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
case 5:
|
66
|
+
case "end":
|
67
|
+
return _context.stop();
|
70
68
|
}
|
71
69
|
}, _callee);
|
72
70
|
}));
|
@@ -134,20 +132,18 @@ export default function BackgroundView(props) {
|
|
134
132
|
_getBackground = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
135
133
|
var res;
|
136
134
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
137
|
-
while (1) {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
return _context4.stop();
|
150
|
-
}
|
135
|
+
while (1) switch (_context4.prev = _context4.next) {
|
136
|
+
case 0:
|
137
|
+
_context4.next = 2;
|
138
|
+
return api.getBackgroundList();
|
139
|
+
|
140
|
+
case 2:
|
141
|
+
res = _context4.sent;
|
142
|
+
setBgList(res);
|
143
|
+
|
144
|
+
case 4:
|
145
|
+
case "end":
|
146
|
+
return _context4.stop();
|
151
147
|
}
|
152
148
|
}, _callee4);
|
153
149
|
}));
|
@@ -163,37 +159,35 @@ export default function BackgroundView(props) {
|
|
163
159
|
_removeBg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
|
164
160
|
var res;
|
165
161
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
166
|
-
while (1) {
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
return api.deleteBackground(id);
|
162
|
+
while (1) switch (_context5.prev = _context5.next) {
|
163
|
+
case 0:
|
164
|
+
_context5.next = 2;
|
165
|
+
return api.deleteBackground(id);
|
171
166
|
|
172
|
-
|
173
|
-
|
167
|
+
case 2:
|
168
|
+
res = _context5.sent;
|
174
169
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
170
|
+
if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
|
171
|
+
_context5.next = 9;
|
172
|
+
break;
|
173
|
+
}
|
179
174
|
|
180
|
-
|
181
|
-
|
182
|
-
|
175
|
+
topo.historyManager.setDisabled(true, '删除背景');
|
176
|
+
_context5.next = 7;
|
177
|
+
return reset();
|
183
178
|
|
184
|
-
|
185
|
-
|
186
|
-
|
179
|
+
case 7:
|
180
|
+
setHtTopoBackground(null);
|
181
|
+
topo.historyManager.setDisabled(false, '删除背景');
|
187
182
|
|
188
|
-
|
189
|
-
|
183
|
+
case 9:
|
184
|
+
getBackground();
|
190
185
|
|
191
|
-
|
186
|
+
_Message.success('删除成功');
|
192
187
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
}
|
188
|
+
case 11:
|
189
|
+
case "end":
|
190
|
+
return _context5.stop();
|
197
191
|
}
|
198
192
|
}, _callee5);
|
199
193
|
}));
|
@@ -208,45 +202,43 @@ export default function BackgroundView(props) {
|
|
208
202
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(currentBg) {
|
209
203
|
var imgUrl, size;
|
210
204
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
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;
|
205
|
+
while (1) switch (_context2.prev = _context2.next) {
|
206
|
+
case 0:
|
207
|
+
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
208
|
+
_context2.next = 19;
|
235
209
|
break;
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
210
|
+
}
|
211
|
+
|
212
|
+
setLoadingBackground(true);
|
213
|
+
topo.historyManager.beginTransaction();
|
214
|
+
imgUrl = getBackgroundImageUrl(currentBg);
|
215
|
+
_context2.prev = 4;
|
216
|
+
_context2.next = 7;
|
217
|
+
return getImageSize(imgUrl);
|
218
|
+
|
219
|
+
case 7:
|
220
|
+
size = _context2.sent;
|
221
|
+
rlog.debug('获取图片大小', size);
|
222
|
+
_context2.next = 11;
|
223
|
+
return setBackground(_extends({}, currentBg, size));
|
224
|
+
|
225
|
+
case 11:
|
226
|
+
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
227
|
+
_context2.next = 17;
|
228
|
+
break;
|
229
|
+
|
230
|
+
case 14:
|
231
|
+
_context2.prev = 14;
|
232
|
+
_context2.t0 = _context2["catch"](4);
|
233
|
+
rlog.error('设置背景失败', _context2.t0);
|
234
|
+
|
235
|
+
case 17:
|
236
|
+
topo.historyManager.endTransaction();
|
237
|
+
setLoadingBackground(false);
|
238
|
+
|
239
|
+
case 19:
|
240
|
+
case "end":
|
241
|
+
return _context2.stop();
|
250
242
|
}
|
251
243
|
}, _callee2, null, [[4, 14]]);
|
252
244
|
}));
|
@@ -259,21 +251,19 @@ export default function BackgroundView(props) {
|
|
259
251
|
var resetDefault = /*#__PURE__*/function () {
|
260
252
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
261
253
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
262
|
-
while (1) {
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
return _context3.stop();
|
276
|
-
}
|
254
|
+
while (1) switch (_context3.prev = _context3.next) {
|
255
|
+
case 0:
|
256
|
+
topo.historyManager.beginTransaction();
|
257
|
+
_context3.next = 3;
|
258
|
+
return reset();
|
259
|
+
|
260
|
+
case 3:
|
261
|
+
setHtTopoBackground(null);
|
262
|
+
topo.historyManager.endTransaction();
|
263
|
+
|
264
|
+
case 5:
|
265
|
+
case "end":
|
266
|
+
return _context3.stop();
|
277
267
|
}
|
278
268
|
}, _callee3);
|
279
269
|
}));
|
@@ -41,32 +41,30 @@ export default function RenameDialog(props) {
|
|
41
41
|
var _yield$field$validate, errors, values;
|
42
42
|
|
43
43
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
44
|
-
while (1) {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
return field.validatePromise();
|
44
|
+
while (1) switch (_context.prev = _context.next) {
|
45
|
+
case 0:
|
46
|
+
_context.next = 2;
|
47
|
+
return field.validatePromise();
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
if (errors) {
|
56
|
-
_context.next = 8;
|
57
|
-
break;
|
58
|
-
}
|
49
|
+
case 2:
|
50
|
+
_yield$field$validate = _context.sent;
|
51
|
+
errors = _yield$field$validate.errors;
|
52
|
+
values = _yield$field$validate.values;
|
59
53
|
|
54
|
+
if (errors) {
|
60
55
|
_context.next = 8;
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
break;
|
57
|
+
}
|
58
|
+
|
59
|
+
_context.next = 8;
|
60
|
+
return dispatchers.renameIcon({
|
61
|
+
id: icon.id,
|
62
|
+
name: values.name
|
63
|
+
});
|
65
64
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
}
|
65
|
+
case 8:
|
66
|
+
case "end":
|
67
|
+
return _context.stop();
|
70
68
|
}
|
71
69
|
}, _callee);
|
72
70
|
}));
|
@@ -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,
|
@@ -9,27 +9,25 @@ export default function svgToShape(_x) {
|
|
9
9
|
function _svgToShape() {
|
10
10
|
_svgToShape = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
11
11
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
12
|
-
while (1) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var reader = new FileReader();
|
12
|
+
while (1) switch (_context.prev = _context.next) {
|
13
|
+
case 0:
|
14
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
15
|
+
var reader = new FileReader();
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
reader.onload = function () {
|
18
|
+
resolve(ht.Default.svgToShape(this.result).output);
|
19
|
+
};
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
reader.onerror = function () {
|
22
|
+
reject();
|
23
|
+
};
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
reader.readAsText(file);
|
26
|
+
}));
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
28
|
+
case 1:
|
29
|
+
case "end":
|
30
|
+
return _context.stop();
|
33
31
|
}
|
34
32
|
}, _callee);
|
35
33
|
}));
|
@@ -12,16 +12,14 @@ var GroupAddResourceDrawer = function GroupAddResourceDrawer(props) {
|
|
12
12
|
var onOk = /*#__PURE__*/function () {
|
13
13
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
14
14
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
15
|
-
while (1) {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
return topoEdit.addGroupResources(group, selected);
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
16
|
+
case 0:
|
17
|
+
_context.next = 2;
|
18
|
+
return topoEdit.addGroupResources(group, selected);
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
20
|
+
case 2:
|
21
|
+
case "end":
|
22
|
+
return _context.stop();
|
25
23
|
}
|
26
24
|
}, _callee);
|
27
25
|
}));
|
@@ -19,30 +19,28 @@ function useCanvasThemeConfig(props) {
|
|
19
19
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(themeName) {
|
20
20
|
var themeConfig;
|
21
21
|
return _regeneratorRuntime.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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
return _context.stop();
|
45
|
-
}
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
23
|
+
case 0:
|
24
|
+
themeConfig = THEMES.find(function (item) {
|
25
|
+
return item.name === themeName;
|
26
|
+
});
|
27
|
+
topo.historyManager.beginTransaction();
|
28
|
+
_context.next = 4;
|
29
|
+
return displayConfigDispatchers.update({
|
30
|
+
canvasTheme: themeName
|
31
|
+
});
|
32
|
+
|
33
|
+
case 4:
|
34
|
+
_context.next = 6;
|
35
|
+
return setGlobalTagTheme(themeConfig);
|
36
|
+
|
37
|
+
case 6:
|
38
|
+
setElementsTheme(themeConfig);
|
39
|
+
topo.historyManager.endTransaction();
|
40
|
+
|
41
|
+
case 8:
|
42
|
+
case "end":
|
43
|
+
return _context.stop();
|
46
44
|
}
|
47
45
|
}, _callee);
|
48
46
|
}));
|
@@ -62,23 +60,21 @@ function useCanvasThemeConfig(props) {
|
|
62
60
|
var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle;
|
63
61
|
|
64
62
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
65
|
-
while (1) {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
return _context2.stop();
|
81
|
-
}
|
63
|
+
while (1) switch (_context2.prev = _context2.next) {
|
64
|
+
case 0:
|
65
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(themeConfig.globalNodeLabelStyle);
|
66
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(themeConfig.globalEdgeTagStyle); // 更新默认配置
|
67
|
+
|
68
|
+
_topo$store$getModelS = topo.store.getModelState('displayConfig'), nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle, defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
|
69
|
+
_context2.next = 5;
|
70
|
+
return displayConfigDispatchers.update({
|
71
|
+
nodeLabelStyle: _extends({}, nodeLabelStyle, themeConfig.globalNodeLabelStyle),
|
72
|
+
defaultEdgeLabelStyle: _extends({}, defaultEdgeLabelStyle, themeConfig.globalEdgeTagStyle)
|
73
|
+
});
|
74
|
+
|
75
|
+
case 5:
|
76
|
+
case "end":
|
77
|
+
return _context2.stop();
|
82
78
|
}
|
83
79
|
}, _callee2);
|
84
80
|
}));
|