@riil-frontend/component-topology 3.5.0-a.9 → 3.5.2
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +12 -12
- package/es/components/index.module.scss +3 -114
- package/es/core/components/AlarmListPanel/index.js +7 -12
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -5
- package/es/core/components/DisplaySettingDrawer/NodeTag.js +10 -5
- package/es/core/components/DisplaySettingDrawer/NodeTip.js +10 -5
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
- package/es/core/components/TopoView/topoView.js +1 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -140
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +18 -17
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +62 -18
- package/es/core/models/Alarm.js +206 -120
- package/es/core/models/DataModel.js +15 -1
- package/es/core/models/TopoApp.js +4 -6
- package/es/core/models/cache/CiTyeCache.js +4 -0
- package/es/core/models/utils/linkUtils.js +87 -42
- package/es/core/services/index.js +28 -0
- package/es/core/utils/saveSerialize.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +31 -28
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +44 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +39 -26
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +0 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +143 -0
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +37 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +11 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +21 -13
- package/es/hooks/useGraphAlarmDisplay.js +3 -4
- package/es/hooks/useManageStatus.js +1 -1
- package/es/hooks/useTopoEdit.js +200 -144
- package/es/hooks/useTopoEventListener.js +13 -6
- package/es/index.js +3 -2
- package/es/models/topoConfig.js +0 -1
- package/es/models/topoMod.js +15 -10
- package/es/topoCenter/components/Topo404.js +3 -1
- package/es/topoCenter/components/TopoNoPermission.js +3 -1
- package/es/topoCenter/components/TopoView.js +77 -32
- package/es/topoCenter/components/Topology.js +2 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +10 -0
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -20
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +12 -6
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +84 -43
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -34
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -19
- package/es/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +157 -0
- package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
- package/es/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
- package/es/topoCenter/utils/resourcePermissionUtil.js +18 -12
- package/es/utils/topoData.js +15 -13
- package/lib/components/index.module.scss +3 -114
- package/lib/core/components/AlarmListPanel/index.js +7 -12
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +9 -5
- package/lib/core/components/DisplaySettingDrawer/NodeTag.js +11 -5
- package/lib/core/components/DisplaySettingDrawer/NodeTip.js +12 -5
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
- package/lib/core/components/TopoView/topoView.js +1 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -151
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -16
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +66 -20
- package/lib/core/models/Alarm.js +206 -121
- package/lib/core/models/DataModel.js +15 -1
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/cache/CiTyeCache.js +4 -0
- package/lib/core/models/utils/linkUtils.js +92 -43
- package/lib/core/services/index.js +29 -0
- package/lib/core/utils/saveSerialize.js +43 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +29 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +45 -43
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +38 -24
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +155 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +47 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +11 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +22 -15
- package/lib/hooks/useGraphAlarmDisplay.js +3 -5
- package/lib/hooks/useManageStatus.js +1 -1
- package/lib/hooks/useTopoEdit.js +197 -141
- package/lib/hooks/useTopoEventListener.js +13 -6
- package/lib/index.js +5 -0
- package/lib/models/topoConfig.js +0 -1
- package/lib/models/topoMod.js +15 -10
- package/lib/topoCenter/components/Topo404.js +4 -1
- package/lib/topoCenter/components/TopoNoPermission.js +4 -1
- package/lib/topoCenter/components/TopoView.js +78 -33
- package/lib/topoCenter/components/Topology.js +3 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +22 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -21
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +13 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +87 -42
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -37
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -18
- package/lib/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +183 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
- package/lib/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
- package/lib/topoCenter/utils/resourcePermissionUtil.js +20 -12
- package/lib/utils/topoData.js +15 -13
- package/package.json +5 -5
|
@@ -1,15 +1,59 @@
|
|
|
1
1
|
import _Box from "@alifd/next/es/box";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _Dialog from "@alifd/next/es/dialog";
|
|
4
3
|
import _Button from "@alifd/next/es/button";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import classnames from "classnames";
|
|
8
8
|
import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
|
9
9
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { useEffect } from "react";
|
|
10
12
|
export default function TopoEditorTitleBar(props) {
|
|
11
13
|
var topo = props.topo,
|
|
12
14
|
topoEditApi = props.topoEditApi;
|
|
15
|
+
var store = topo.store;
|
|
16
|
+
|
|
17
|
+
var _store$useModel = store.useModel("topoEdit"),
|
|
18
|
+
topoEditState = _store$useModel[0],
|
|
19
|
+
topoEditDispatchers = _store$useModel[1];
|
|
20
|
+
|
|
21
|
+
var saving = topoEditState.saving;
|
|
22
|
+
|
|
23
|
+
var _useState = useState(false),
|
|
24
|
+
exitFlag = _useState[0],
|
|
25
|
+
setExitFlag = _useState[1];
|
|
26
|
+
|
|
27
|
+
var saveAndExit = /*#__PURE__*/function () {
|
|
28
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
29
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30
|
+
while (1) {
|
|
31
|
+
switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
_context.next = 2;
|
|
34
|
+
return topo.save();
|
|
35
|
+
|
|
36
|
+
case 2:
|
|
37
|
+
setExitFlag(true);
|
|
38
|
+
|
|
39
|
+
case 3:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, _callee);
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return function saveAndExit() {
|
|
48
|
+
return _ref.apply(this, arguments);
|
|
49
|
+
};
|
|
50
|
+
}();
|
|
51
|
+
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (!saving && exitFlag) {
|
|
54
|
+
topo.exitEditMode();
|
|
55
|
+
}
|
|
56
|
+
}, [exitFlag, saving]);
|
|
13
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
58
|
className: classnames(styles.titlebar, styles.titlebarEditMode)
|
|
15
59
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -30,6 +74,7 @@ export default function TopoEditorTitleBar(props) {
|
|
|
30
74
|
}, "\u6DFB\u52A0\u8D44\u6E90"), /*#__PURE__*/React.createElement(_Button, {
|
|
31
75
|
className: styles.button,
|
|
32
76
|
onClick: function onClick() {
|
|
77
|
+
setExitFlag(false);
|
|
33
78
|
topo.save();
|
|
34
79
|
}
|
|
35
80
|
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
|
|
@@ -39,19 +84,19 @@ export default function TopoEditorTitleBar(props) {
|
|
|
39
84
|
title: "提示",
|
|
40
85
|
content: "若直接退出,图上修改的内容将不会保存!",
|
|
41
86
|
onOk: function () {
|
|
42
|
-
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
43
|
-
return _regeneratorRuntime.wrap(function
|
|
87
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
88
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
44
89
|
while (1) {
|
|
45
|
-
switch (
|
|
90
|
+
switch (_context2.prev = _context2.next) {
|
|
46
91
|
case 0:
|
|
47
|
-
|
|
92
|
+
saveAndExit();
|
|
48
93
|
|
|
49
94
|
case 1:
|
|
50
95
|
case "end":
|
|
51
|
-
return
|
|
96
|
+
return _context2.stop();
|
|
52
97
|
}
|
|
53
98
|
}
|
|
54
|
-
},
|
|
99
|
+
}, _callee2);
|
|
55
100
|
}));
|
|
56
101
|
|
|
57
102
|
function onOk() {
|
|
@@ -61,23 +106,19 @@ export default function TopoEditorTitleBar(props) {
|
|
|
61
106
|
return onOk;
|
|
62
107
|
}(),
|
|
63
108
|
onCancel: function () {
|
|
64
|
-
var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
65
|
-
return _regeneratorRuntime.wrap(function
|
|
109
|
+
var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
110
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
66
111
|
while (1) {
|
|
67
|
-
switch (
|
|
112
|
+
switch (_context3.prev = _context3.next) {
|
|
68
113
|
case 0:
|
|
69
|
-
_context2.next = 2;
|
|
70
|
-
return topo.save();
|
|
71
|
-
|
|
72
|
-
case 2:
|
|
73
114
|
topo.exitEditMode();
|
|
74
115
|
|
|
75
|
-
case
|
|
116
|
+
case 1:
|
|
76
117
|
case "end":
|
|
77
|
-
return
|
|
118
|
+
return _context3.stop();
|
|
78
119
|
}
|
|
79
120
|
}
|
|
80
|
-
},
|
|
121
|
+
}, _callee3);
|
|
81
122
|
}));
|
|
82
123
|
|
|
83
124
|
function onCancel() {
|
|
@@ -87,7 +128,10 @@ export default function TopoEditorTitleBar(props) {
|
|
|
87
128
|
return onCancel;
|
|
88
129
|
}(),
|
|
89
130
|
cancelProps: {
|
|
90
|
-
children:
|
|
131
|
+
children: "退出"
|
|
132
|
+
},
|
|
133
|
+
okProps: {
|
|
134
|
+
children: "保存并退出"
|
|
91
135
|
}
|
|
92
136
|
});
|
|
93
137
|
}
|