@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
@@ -27,6 +27,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
28
28
|
var _lodash = _interopRequireDefault(require("lodash"));
|
29
29
|
|
30
|
+
var _utils = require("@riil-frontend/utils");
|
31
|
+
|
30
32
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
31
33
|
|
32
34
|
var config = _configProvider["default"].config;
|
@@ -161,28 +163,26 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
161
163
|
_this.handleSuccess = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
162
164
|
var onSuccess;
|
163
165
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
164
|
-
while (1) {
|
165
|
-
|
166
|
-
|
167
|
-
onSuccess = _this.props.onSuccess;
|
166
|
+
while (1) switch (_context.prev = _context.next) {
|
167
|
+
case 0:
|
168
|
+
onSuccess = _this.props.onSuccess;
|
168
169
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
170
|
+
_message["default"].show({
|
171
|
+
type: 'success',
|
172
|
+
title: '背景图上传成功'
|
173
|
+
});
|
173
174
|
|
174
|
-
|
175
|
-
|
176
|
-
|
175
|
+
_this.setState({
|
176
|
+
uploading: false
|
177
|
+
});
|
177
178
|
|
178
|
-
|
179
|
+
_this.resetState();
|
179
180
|
|
180
|
-
|
181
|
+
onSuccess();
|
181
182
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
}
|
183
|
+
case 5:
|
184
|
+
case "end":
|
185
|
+
return _context.stop();
|
186
186
|
}
|
187
187
|
}, _callee);
|
188
188
|
}));
|
@@ -238,7 +238,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
238
238
|
value: files,
|
239
239
|
action: "/topo/v1/api/background/upload/" + this.props.type,
|
240
240
|
headers: {
|
241
|
-
Authorization:
|
241
|
+
Authorization: (0, _utils.getToken)()
|
242
242
|
},
|
243
243
|
accept: ".png",
|
244
244
|
autoUpload: false,
|
@@ -7,13 +7,11 @@ exports["default"] = BackgroundView;
|
|
7
7
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
9
|
|
10
|
-
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
11
|
-
|
12
10
|
var _loading = _interopRequireDefault(require("@alifd/next/lib/loading"));
|
13
11
|
|
14
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
15
13
|
|
16
|
-
var
|
14
|
+
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
17
15
|
|
18
16
|
var _tag = _interopRequireDefault(require("@alifd/next/lib/tag"));
|
19
17
|
|
@@ -21,6 +19,8 @@ var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
|
21
19
|
|
22
20
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
23
21
|
|
22
|
+
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
|
23
|
+
|
24
24
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
25
25
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
@@ -42,61 +42,56 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
42
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
43
43
|
|
44
44
|
function List(props) {
|
45
|
+
var _remove;
|
46
|
+
|
45
47
|
var selected = props.selected,
|
46
48
|
onSelect = props.onSelect,
|
47
49
|
dataSource = props.dataSource,
|
48
50
|
onRemove = props.onRemove;
|
49
51
|
|
50
52
|
function remove(_x, _x2) {
|
51
|
-
return _remove.
|
52
|
-
}
|
53
|
-
|
54
|
-
function _remove() {
|
55
|
-
_remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
|
53
|
+
return (_remove = _remove || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
|
56
54
|
var canDelete;
|
57
55
|
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
|
-
}
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
e.stopPropagation();
|
59
|
+
_context.next = 3;
|
60
|
+
return _background["default"].canDeleteBackground(id);
|
61
|
+
|
62
|
+
case 3:
|
63
|
+
canDelete = _context.sent;
|
64
|
+
|
65
|
+
// console.log('canDelete', canDelete);
|
66
|
+
if (canDelete) {
|
67
|
+
_dialog["default"].confirm({
|
68
|
+
title: '删除',
|
69
|
+
messageProps: {
|
70
|
+
type: 'warning'
|
71
|
+
},
|
72
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
73
|
+
onOk: function onOk() {
|
74
|
+
return onRemove(id);
|
75
|
+
}
|
76
|
+
});
|
77
|
+
} else {
|
78
|
+
_dialog["default"].confirm({
|
79
|
+
title: '提示',
|
80
|
+
messageProps: {
|
81
|
+
type: 'warning'
|
82
|
+
},
|
83
|
+
content: '此背景被占用,不能删除。',
|
84
|
+
footerActions: ['ok'],
|
85
|
+
onOk: function onOk() {}
|
86
|
+
});
|
87
|
+
}
|
88
|
+
|
89
|
+
case 5:
|
90
|
+
case "end":
|
91
|
+
return _context.stop();
|
96
92
|
}
|
97
93
|
}, _callee);
|
98
|
-
}));
|
99
|
-
return _remove.apply(this, arguments);
|
94
|
+
}))).apply(this, arguments);
|
100
95
|
}
|
101
96
|
|
102
97
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -128,6 +123,8 @@ function List(props) {
|
|
128
123
|
}
|
129
124
|
|
130
125
|
function BackgroundView(props) {
|
126
|
+
var _getBackground, _removeBg, _ref, _ref2;
|
127
|
+
|
131
128
|
var topo = props.topo;
|
132
129
|
|
133
130
|
var _topo$store$useModel = topo.store.useModel('background'),
|
@@ -153,164 +150,138 @@ function BackgroundView(props) {
|
|
153
150
|
}, []);
|
154
151
|
|
155
152
|
function getBackground() {
|
156
|
-
return _getBackground
|
157
|
-
}
|
158
|
-
|
159
|
-
function _getBackground() {
|
160
|
-
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
153
|
+
return (_getBackground = _getBackground || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
161
154
|
var res;
|
162
|
-
return _regenerator["default"].wrap(function
|
163
|
-
while (1) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
return _context4.stop();
|
176
|
-
}
|
155
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
156
|
+
while (1) switch (_context2.prev = _context2.next) {
|
157
|
+
case 0:
|
158
|
+
_context2.next = 2;
|
159
|
+
return _background["default"].getBackgroundList();
|
160
|
+
|
161
|
+
case 2:
|
162
|
+
res = _context2.sent;
|
163
|
+
setBgList(res);
|
164
|
+
|
165
|
+
case 4:
|
166
|
+
case "end":
|
167
|
+
return _context2.stop();
|
177
168
|
}
|
178
|
-
},
|
179
|
-
}));
|
180
|
-
return _getBackground.apply(this, arguments);
|
169
|
+
}, _callee2);
|
170
|
+
}))).apply(this, arguments);
|
181
171
|
}
|
182
172
|
|
183
173
|
function removeBg(_x3) {
|
184
|
-
return _removeBg
|
185
|
-
} // 同步拓扑图展示
|
186
|
-
|
187
|
-
|
188
|
-
function _removeBg() {
|
189
|
-
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
|
174
|
+
return (_removeBg = _removeBg || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
|
190
175
|
var res;
|
191
|
-
return _regenerator["default"].wrap(function
|
192
|
-
while (1) {
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
return _background["default"].deleteBackground(id);
|
176
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
177
|
+
while (1) switch (_context3.prev = _context3.next) {
|
178
|
+
case 0:
|
179
|
+
_context3.next = 2;
|
180
|
+
return _background["default"].deleteBackground(id);
|
197
181
|
|
198
|
-
|
199
|
-
|
182
|
+
case 2:
|
183
|
+
res = _context3.sent;
|
200
184
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
185
|
+
if (!(id === (current === null || current === void 0 ? void 0 : current.id))) {
|
186
|
+
_context3.next = 9;
|
187
|
+
break;
|
188
|
+
}
|
205
189
|
|
206
|
-
|
207
|
-
|
208
|
-
|
190
|
+
topo.historyManager.setDisabled(true, '删除背景');
|
191
|
+
_context3.next = 7;
|
192
|
+
return reset();
|
209
193
|
|
210
|
-
|
211
|
-
|
212
|
-
|
194
|
+
case 7:
|
195
|
+
setHtTopoBackground(null);
|
196
|
+
topo.historyManager.setDisabled(false, '删除背景');
|
213
197
|
|
214
|
-
|
215
|
-
|
198
|
+
case 9:
|
199
|
+
getBackground();
|
216
200
|
|
217
|
-
|
201
|
+
_message["default"].success('删除成功');
|
218
202
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
}
|
203
|
+
case 11:
|
204
|
+
case "end":
|
205
|
+
return _context3.stop();
|
223
206
|
}
|
224
|
-
},
|
225
|
-
}));
|
226
|
-
|
227
|
-
|
207
|
+
}, _callee3);
|
208
|
+
}))).apply(this, arguments);
|
209
|
+
} // 同步拓扑图展示
|
210
|
+
|
228
211
|
|
229
212
|
function setHtTopoBackground(imgUrl, width, height) {
|
230
213
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, width, height);
|
231
214
|
}
|
232
215
|
|
233
|
-
var handleSelect =
|
234
|
-
|
216
|
+
var handleSelect = function handleSelect(_x4) {
|
217
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(currentBg) {
|
235
218
|
var imgUrl, size;
|
236
|
-
return _regenerator["default"].wrap(function
|
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;
|
219
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
220
|
+
while (1) switch (_context4.prev = _context4.next) {
|
221
|
+
case 0:
|
222
|
+
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
223
|
+
_context4.next = 19;
|
263
224
|
break;
|
225
|
+
}
|
264
226
|
|
265
|
-
|
266
|
-
|
267
|
-
|
227
|
+
setLoadingBackground(true);
|
228
|
+
topo.historyManager.beginTransaction();
|
229
|
+
imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
|
230
|
+
_context4.prev = 4;
|
231
|
+
_context4.next = 7;
|
232
|
+
return (0, _imageUtil.getImageSize)(imgUrl);
|
268
233
|
|
269
|
-
|
234
|
+
case 7:
|
235
|
+
size = _context4.sent;
|
270
236
|
|
271
|
-
|
272
|
-
topo.historyManager.endTransaction();
|
273
|
-
setLoadingBackground(false);
|
237
|
+
_rlog["default"].debug('获取图片大小', size);
|
274
238
|
|
275
|
-
|
276
|
-
|
277
|
-
return _context2.stop();
|
278
|
-
}
|
279
|
-
}
|
280
|
-
}, _callee2, null, [[4, 14]]);
|
281
|
-
}));
|
239
|
+
_context4.next = 11;
|
240
|
+
return setBackground((0, _extends2["default"])({}, currentBg, size));
|
282
241
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
242
|
+
case 11:
|
243
|
+
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
244
|
+
_context4.next = 17;
|
245
|
+
break;
|
287
246
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
case 5:
|
303
|
-
case "end":
|
304
|
-
return _context3.stop();
|
305
|
-
}
|
247
|
+
case 14:
|
248
|
+
_context4.prev = 14;
|
249
|
+
_context4.t0 = _context4["catch"](4);
|
250
|
+
|
251
|
+
_rlog["default"].error('设置背景失败', _context4.t0);
|
252
|
+
|
253
|
+
case 17:
|
254
|
+
topo.historyManager.endTransaction();
|
255
|
+
setLoadingBackground(false);
|
256
|
+
|
257
|
+
case 19:
|
258
|
+
case "end":
|
259
|
+
return _context4.stop();
|
306
260
|
}
|
307
|
-
},
|
308
|
-
}));
|
261
|
+
}, _callee4, null, [[4, 14]]);
|
262
|
+
}))).apply(this, arguments);
|
263
|
+
};
|
309
264
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
265
|
+
var resetDefault = function resetDefault() {
|
266
|
+
return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
267
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
268
|
+
while (1) switch (_context5.prev = _context5.next) {
|
269
|
+
case 0:
|
270
|
+
topo.historyManager.beginTransaction();
|
271
|
+
_context5.next = 3;
|
272
|
+
return reset();
|
273
|
+
|
274
|
+
case 3:
|
275
|
+
setHtTopoBackground(null);
|
276
|
+
topo.historyManager.endTransaction();
|
277
|
+
|
278
|
+
case 5:
|
279
|
+
case "end":
|
280
|
+
return _context5.stop();
|
281
|
+
}
|
282
|
+
}, _callee5);
|
283
|
+
}))).apply(this, arguments);
|
284
|
+
};
|
314
285
|
|
315
286
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
316
287
|
className: _indexModule["default"]['background-view']
|
@@ -32,6 +32,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
32
32
|
var FormItem = _form["default"].Item;
|
33
33
|
|
34
34
|
function RenameDialog(props) {
|
35
|
+
var _ref;
|
36
|
+
|
35
37
|
var topo = props.topo;
|
36
38
|
var store = topo.store;
|
37
39
|
|
@@ -58,45 +60,39 @@ function RenameDialog(props) {
|
|
58
60
|
});
|
59
61
|
}, [name]);
|
60
62
|
|
61
|
-
var submit =
|
62
|
-
|
63
|
+
var submit = function submit() {
|
64
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
63
65
|
var _yield$field$validate, errors, values;
|
64
66
|
|
65
67
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
66
|
-
while (1) {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
values = _yield$field$validate.values;
|
76
|
-
|
77
|
-
if (errors) {
|
78
|
-
_context.next = 8;
|
79
|
-
break;
|
80
|
-
}
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
69
|
+
case 0:
|
70
|
+
_context.next = 2;
|
71
|
+
return field.validatePromise();
|
72
|
+
|
73
|
+
case 2:
|
74
|
+
_yield$field$validate = _context.sent;
|
75
|
+
errors = _yield$field$validate.errors;
|
76
|
+
values = _yield$field$validate.values;
|
81
77
|
|
78
|
+
if (errors) {
|
82
79
|
_context.next = 8;
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
|
83
|
+
_context.next = 8;
|
84
|
+
return dispatchers.renameIcon({
|
85
|
+
id: icon.id,
|
86
|
+
name: values.name
|
87
|
+
});
|
88
|
+
|
89
|
+
case 8:
|
90
|
+
case "end":
|
91
|
+
return _context.stop();
|
92
92
|
}
|
93
93
|
}, _callee);
|
94
|
-
}));
|
95
|
-
|
96
|
-
return function submit() {
|
97
|
-
return _ref.apply(this, arguments);
|
98
|
-
};
|
99
|
-
}();
|
94
|
+
}))).apply(this, arguments);
|
95
|
+
};
|
100
96
|
|
101
97
|
var renameIconForm = visible && /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
102
98
|
field: field
|
@@ -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,
|