@riil-frontend/component-topology 11.0.35 → 12.0.0-dev.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 +2 -2
- package/build/2.js +1 -1
- package/build/index.js +45 -29
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +8 -6
- package/es/components/ResourceList/ResourceSelect.js +8 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/es/core/editor/components/BackgroundView/index.js +73 -54
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- package/es/core/editor/utils/copyElementUtil.js +174 -0
- package/es/core/hooks/useCiAttributeChange.js +6 -3
- package/es/core/hooks/usePolling.js +21 -13
- package/es/core/hooks/useResourceConfig.js +37 -21
- package/es/core/hooks/useTopoEdit.js +202 -139
- package/es/core/models/Alarm.js +104 -38
- package/es/core/models/AttributeMetricDisplay.js +36 -14
- package/es/core/models/TopoApp.js +197 -75
- package/es/core/models/TopoGraphView.js +20 -10
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/es/core/models/cache/CiCache.js +12 -6
- package/es/core/models/cache/CiTypeCache.js +20 -10
- package/es/core/models/cache/DictCache.js +10 -6
- package/es/core/models/graph/Background.js +9 -6
- package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/es/core/models/topoData.js +7 -5
- package/es/core/models/utils/linkUtils.js +8 -5
- package/es/core/services/cmdb/metric.js +7 -5
- package/es/core/services/cmdb.js +9 -5
- package/es/core/services/index.js +23 -9
- package/es/core/services/topo/tagtip.js +7 -5
- package/es/core/store/models/customIcon.js +11 -6
- package/es/core/utils/imageUtil.js +7 -5
- package/es/core/utils/metricUtil.js +13 -1
- package/es/core/utils/saveSerialize.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/es/networkTopo/components/Link/hook.js +21 -14
- package/es/networkTopo/components/Link/index.js +32 -18
- package/es/networkTopo/components/Link/setting.js +8 -6
- package/es/networkTopo/getTopoData.js +23 -10
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/es/networkTopo/models/TopoCenter.js +24 -10
- package/es/networkTopo/services/cmdb.js +333 -233
- package/es/networkTopo/services/mdc.js +24 -15
- package/es/networkTopo/services/metric.js +16 -11
- package/es/networkTopo/services/model.js +412 -283
- package/es/networkTopo/utils/exportData.js +7 -5
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -0
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +8 -6
- package/lib/components/ResourceList/ResourceSelect.js +8 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/lib/core/editor/components/BackgroundView/index.js +74 -55
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- package/lib/core/editor/utils/copyElementUtil.js +187 -0
- package/lib/core/hooks/useCiAttributeChange.js +6 -3
- package/lib/core/hooks/usePolling.js +21 -13
- package/lib/core/hooks/useResourceConfig.js +37 -21
- package/lib/core/hooks/useTopoEdit.js +202 -139
- package/lib/core/models/Alarm.js +104 -38
- package/lib/core/models/AttributeMetricDisplay.js +36 -14
- package/lib/core/models/TopoApp.js +197 -75
- package/lib/core/models/TopoGraphView.js +20 -10
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/lib/core/models/cache/CiCache.js +12 -6
- package/lib/core/models/cache/CiTypeCache.js +20 -10
- package/lib/core/models/cache/DictCache.js +10 -6
- package/lib/core/models/graph/Background.js +9 -6
- package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/lib/core/models/topoData.js +7 -4
- package/lib/core/models/utils/linkUtils.js +8 -4
- package/lib/core/services/cmdb/metric.js +7 -4
- package/lib/core/services/cmdb.js +9 -4
- package/lib/core/services/index.js +21 -8
- package/lib/core/services/topo/tagtip.js +7 -4
- package/lib/core/store/models/customIcon.js +11 -6
- package/lib/core/utils/imageUtil.js +7 -4
- package/lib/core/utils/metricUtil.js +13 -1
- package/lib/core/utils/saveSerialize.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/lib/networkTopo/components/Link/hook.js +23 -15
- package/lib/networkTopo/components/Link/index.js +32 -18
- package/lib/networkTopo/components/Link/setting.js +8 -6
- package/lib/networkTopo/getTopoData.js +23 -10
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/lib/networkTopo/models/TopoCenter.js +24 -10
- package/lib/networkTopo/services/cmdb.js +336 -235
- package/lib/networkTopo/services/mdc.js +24 -14
- package/lib/networkTopo/services/metric.js +16 -10
- package/lib/networkTopo/services/model.js +414 -284
- package/lib/networkTopo/utils/exportData.js +7 -4
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +3 -2
@@ -15,10 +15,12 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
15
15
|
|
16
16
|
var _clusterUtil = require("../../utils/clusterUtil");
|
17
17
|
|
18
|
-
var _ref;
|
19
|
-
|
20
18
|
function _default(_x) {
|
21
|
-
return
|
19
|
+
return _ref.apply(this, arguments);
|
20
|
+
}
|
21
|
+
|
22
|
+
function _ref() {
|
23
|
+
_ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topo) {
|
22
24
|
var _topo$store$getModelS, nodes, links, linkGroups, clusters, params, fileData, fileName, blob, elink;
|
23
25
|
|
24
26
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -83,5 +85,6 @@ function _default(_x) {
|
|
83
85
|
return _context.stop();
|
84
86
|
}
|
85
87
|
}, _callee);
|
86
|
-
}))
|
88
|
+
}));
|
89
|
+
return _ref.apply(this, arguments);
|
87
90
|
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.clipboard = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
function writeText(_x) {
|
13
|
+
return _writeText.apply(this, arguments);
|
14
|
+
}
|
15
|
+
|
16
|
+
function _writeText() {
|
17
|
+
_writeText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(text) {
|
18
|
+
var success, textArea;
|
19
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
21
|
+
case 0:
|
22
|
+
success = false;
|
23
|
+
_context.prev = 1;
|
24
|
+
|
25
|
+
if (!navigator.clipboard) {
|
26
|
+
_context.next = 5;
|
27
|
+
break;
|
28
|
+
}
|
29
|
+
|
30
|
+
_context.next = 5;
|
31
|
+
return navigator.clipboard.writeText(text);
|
32
|
+
|
33
|
+
case 5:
|
34
|
+
success = true;
|
35
|
+
_context.next = 10;
|
36
|
+
break;
|
37
|
+
|
38
|
+
case 8:
|
39
|
+
_context.prev = 8;
|
40
|
+
_context.t0 = _context["catch"](1);
|
41
|
+
|
42
|
+
case 10:
|
43
|
+
if (!success) {
|
44
|
+
// 创建text area
|
45
|
+
textArea = document.createElement('textarea');
|
46
|
+
textArea.value = text; // 使text area不在viewport,同时设置不可见
|
47
|
+
|
48
|
+
document.body.appendChild(textArea);
|
49
|
+
textArea.focus();
|
50
|
+
textArea.select();
|
51
|
+
document.execCommand('copy');
|
52
|
+
textArea.remove();
|
53
|
+
}
|
54
|
+
|
55
|
+
case 11:
|
56
|
+
case "end":
|
57
|
+
return _context.stop();
|
58
|
+
}
|
59
|
+
}, _callee, null, [[1, 8]]);
|
60
|
+
}));
|
61
|
+
return _writeText.apply(this, arguments);
|
62
|
+
}
|
63
|
+
|
64
|
+
function readText() {
|
65
|
+
return _readText.apply(this, arguments);
|
66
|
+
}
|
67
|
+
|
68
|
+
function _readText() {
|
69
|
+
_readText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
70
|
+
var text, textareaElement, _text;
|
71
|
+
|
72
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
73
|
+
while (1) switch (_context2.prev = _context2.next) {
|
74
|
+
case 0:
|
75
|
+
if (!navigator.clipboard) {
|
76
|
+
_context2.next = 7;
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
|
80
|
+
_context2.next = 3;
|
81
|
+
return navigator.clipboard.readText();
|
82
|
+
|
83
|
+
case 3:
|
84
|
+
text = _context2.sent;
|
85
|
+
return _context2.abrupt("return", text);
|
86
|
+
|
87
|
+
case 7:
|
88
|
+
textareaElement = document.createElement('textarea');
|
89
|
+
document.body.appendChild(textareaElement);
|
90
|
+
textareaElement.innerText = '';
|
91
|
+
textareaElement.focus();
|
92
|
+
textareaElement.select();
|
93
|
+
document.execCommand('paste');
|
94
|
+
_text = textareaElement.innerText; // 从该元素中读取内容
|
95
|
+
|
96
|
+
document.body.removeChild(textareaElement); // 移除元素
|
97
|
+
|
98
|
+
return _context2.abrupt("return", _text);
|
99
|
+
|
100
|
+
case 16:
|
101
|
+
case "end":
|
102
|
+
return _context2.stop();
|
103
|
+
}
|
104
|
+
}, _callee2);
|
105
|
+
}));
|
106
|
+
return _readText.apply(this, arguments);
|
107
|
+
}
|
108
|
+
|
109
|
+
var clipboard = {
|
110
|
+
readText: readText,
|
111
|
+
writeText: writeText
|
112
|
+
};
|
113
|
+
exports.clipboard = clipboard;
|
@@ -10,7 +10,9 @@ exports.isResourceElement = isResourceElement;
|
|
10
10
|
exports.isResourceNodeElement = isResourceNodeElement;
|
11
11
|
exports.isText = isText;
|
12
12
|
|
13
|
-
var
|
13
|
+
var _htElementUtils = _interopRequireWildcard(require("./htElementUtils"));
|
14
|
+
|
15
|
+
var htElementUtils = _htElementUtils;
|
14
16
|
|
15
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
16
18
|
|
@@ -45,7 +47,7 @@ function isResourceNodeElement(element) {
|
|
45
47
|
}
|
46
48
|
|
47
49
|
var getAllEdgeResourceIds = function getAllEdgeResourceIds(dm) {
|
48
|
-
return (0,
|
50
|
+
return (0, _htElementUtils.getEdges)(dm).filter(function (node) {
|
49
51
|
return !!node.getTag();
|
50
52
|
}).map(function (node) {
|
51
53
|
return node.getTag();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "
|
3
|
+
"version": "12.0.0-dev.2",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -43,6 +43,7 @@
|
|
43
43
|
"@ahooksjs/use-tree-plugin": "^0.2.1",
|
44
44
|
"@alifd/biz-anchor": "^1.1.7",
|
45
45
|
"color": "^4.2.3",
|
46
|
+
"hotkeys-js": "^3.12.0",
|
46
47
|
"@ice/store": "^1.4.2",
|
47
48
|
"@riil-frontend/component-topo-icon-select": "^1.0.17",
|
48
49
|
"@riil-frontend/component-topology-utils": "^2.1.0",
|
@@ -122,6 +123,6 @@
|
|
122
123
|
"access": "public"
|
123
124
|
},
|
124
125
|
"license": "MIT",
|
125
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.2/build/index.html",
|
126
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
127
128
|
}
|