@riil-frontend/component-topology 2.15.31 → 2.15.32
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 +22 -22
- package/es/core/editor/components/settings/PropertyView.js +18 -7
- package/es/core/editor/components/settings/Settings.js +2 -4
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +21 -8
- package/lib/core/editor/components/settings/PropertyView.js +19 -7
- package/lib/core/editor/components/settings/Settings.js +3 -5
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +21 -8
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Settings from "./Settings";
|
|
3
|
+
import styles from "./Settings.module.scss";
|
|
3
4
|
export default function PropertyView(props) {
|
|
4
5
|
var topo = props.topo,
|
|
5
6
|
editorProps = props.editorProps;
|
|
@@ -16,11 +17,21 @@ export default function PropertyView(props) {
|
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
var renderContent = function renderContent() {
|
|
21
|
+
if (!topoId || !topoShowType) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(Settings, {
|
|
26
|
+
topo: topo,
|
|
27
|
+
topoShowType: topoShowType,
|
|
28
|
+
topoEditApi: topo.topoEdit,
|
|
29
|
+
selection: selection,
|
|
30
|
+
editorProps: editorProps
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: styles.settingsPanel
|
|
36
|
+
}, renderContent());
|
|
26
37
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import styles from "./Settings.module.scss";
|
|
4
3
|
import { isEdge, isGroup, isLayer, isNode, isText } from "../../../../utils/htElementDataUtil";
|
|
5
4
|
import propertyPanelMap from "./propertyViews";
|
|
6
5
|
import useSettingRuntimeState from "./useSettingRuntimeState";
|
|
6
|
+
import styles from "./Settings.module.scss";
|
|
7
7
|
|
|
8
8
|
function getElementType(selection) {
|
|
9
9
|
var selectionElement = selection[0];
|
|
@@ -124,8 +124,6 @@ export default function Settings(props) {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
return /*#__PURE__*/React.createElement("div", {
|
|
127
|
-
className: styles.settingsPanel
|
|
128
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
129
127
|
className: styles.settings
|
|
130
128
|
}, /*#__PURE__*/React.createElement(PropertyView, {
|
|
131
129
|
type: elementType,
|
|
@@ -138,5 +136,5 @@ export default function Settings(props) {
|
|
|
138
136
|
onChange: updateElementProperty,
|
|
139
137
|
editorProps: editorProps,
|
|
140
138
|
settingRuntimeState: settingRuntimeState
|
|
141
|
-
}))
|
|
139
|
+
}));
|
|
142
140
|
}
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.32" === 'string' ? "2.15.32" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -17,7 +17,20 @@ import service from "../../../../../../services/overview";
|
|
|
17
17
|
import alarmService from "../../../../../../services/alarm";
|
|
18
18
|
import DictCache from "../../../../../../models/cache/DictCache";
|
|
19
19
|
import { queryCisByIds } from "../../../../../../services";
|
|
20
|
-
import styles from "./index.module.scss"; //
|
|
20
|
+
import styles from "./index.module.scss"; // url 处理,UICBB 的地址需截取前缀
|
|
21
|
+
|
|
22
|
+
function formatUrl(url) {
|
|
23
|
+
var _window, _window$location;
|
|
24
|
+
|
|
25
|
+
var prefix = '/default/pagecenter';
|
|
26
|
+
|
|
27
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
|
28
|
+
return url.split(prefix)[1];
|
|
29
|
+
} else {
|
|
30
|
+
return url;
|
|
31
|
+
}
|
|
32
|
+
} // 基本信息
|
|
33
|
+
|
|
21
34
|
|
|
22
35
|
function BaseInfoRender(type, data) {
|
|
23
36
|
var _itemCols$type;
|
|
@@ -39,7 +52,7 @@ function BaseInfoRender(type, data) {
|
|
|
39
52
|
title: display_name
|
|
40
53
|
}, valueData ? /*#__PURE__*/React.createElement(Link, {
|
|
41
54
|
className: styles.link,
|
|
42
|
-
to: link
|
|
55
|
+
to: formatUrl(link)
|
|
43
56
|
}, display_name) : '-'));
|
|
44
57
|
}
|
|
45
58
|
}, {
|
|
@@ -388,7 +401,7 @@ export default function ResourceOverview(props) {
|
|
|
388
401
|
resource: modelAttributeMap['display_name'] ? {
|
|
389
402
|
display_name: attributeMap.display_name,
|
|
390
403
|
// 资源名称/显示名称
|
|
391
|
-
link: "/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
404
|
+
link: "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
392
405
|
|
|
393
406
|
} : false,
|
|
394
407
|
ipv4_address: modelAttributeMap['ipv4_address'] ? attributeMap.ipv4_address : false,
|
|
@@ -408,7 +421,7 @@ export default function ResourceOverview(props) {
|
|
|
408
421
|
icon: 'gaojing-3',
|
|
409
422
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
|
410
423
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
|
411
|
-
link: "/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
|
424
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
|
412
425
|
time: item.createTime,
|
|
413
426
|
status: item.status,
|
|
414
427
|
params: [{
|
|
@@ -621,7 +634,7 @@ export default function ResourceOverview(props) {
|
|
|
621
634
|
className: styles["alarm-color-icon"] + " " + record.className
|
|
622
635
|
}), /*#__PURE__*/React.createElement(Link, {
|
|
623
636
|
className: styles.link,
|
|
624
|
-
to: record.link
|
|
637
|
+
to: formatUrl(record.link)
|
|
625
638
|
}, value));
|
|
626
639
|
}
|
|
627
640
|
}, {
|
|
@@ -665,7 +678,7 @@ export default function ResourceOverview(props) {
|
|
|
665
678
|
|
|
666
679
|
function _alarmRiskOperation() {
|
|
667
680
|
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(type, params) {
|
|
668
|
-
var res, _topo$ciTyeCache$getC, modelMetrics, topModelMetrics;
|
|
681
|
+
var res, _topo$ciTyeCache$getC, modelMetrics, ciName, modelAttributeMap, domain, topModelMetrics;
|
|
669
682
|
|
|
670
683
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
671
684
|
while (1) {
|
|
@@ -685,9 +698,9 @@ export default function ResourceOverview(props) {
|
|
|
685
698
|
_Message.success('受理成功');
|
|
686
699
|
|
|
687
700
|
if (isAppTopo) {
|
|
688
|
-
_topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType), modelMetrics = _topo$ciTyeCache$getC.metrics;
|
|
701
|
+
_topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType), modelMetrics = _topo$ciTyeCache$getC.metrics, ciName = _topo$ciTyeCache$getC.displayName, modelAttributeMap = _topo$ciTyeCache$getC.attributeMap, domain = _topo$ciTyeCache$getC.domain;
|
|
689
702
|
topModelMetrics = modelMetrics.slice(0, 6);
|
|
690
|
-
initAppTopo(topModelMetrics);
|
|
703
|
+
initAppTopo(topModelMetrics, modelAttributeMap, ciName, domain);
|
|
691
704
|
} else {
|
|
692
705
|
getAlarmRiskData(id);
|
|
693
706
|
}
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _Settings = _interopRequireDefault(require("./Settings"));
|
|
11
11
|
|
|
12
|
+
var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
|
|
13
|
+
|
|
12
14
|
function PropertyView(props) {
|
|
13
15
|
var topo = props.topo,
|
|
14
16
|
editorProps = props.editorProps;
|
|
@@ -25,11 +27,21 @@ function PropertyView(props) {
|
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
var renderContent = function renderContent() {
|
|
31
|
+
if (!topoId || !topoShowType) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react["default"].createElement(_Settings["default"], {
|
|
36
|
+
topo: topo,
|
|
37
|
+
topoShowType: topoShowType,
|
|
38
|
+
topoEditApi: topo.topoEdit,
|
|
39
|
+
selection: selection,
|
|
40
|
+
editorProps: editorProps
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
45
|
+
className: _SettingsModule["default"].settingsPanel
|
|
46
|
+
}, renderContent());
|
|
35
47
|
}
|
|
@@ -9,14 +9,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
|
|
13
|
-
|
|
14
12
|
var _htElementDataUtil = require("../../../../utils/htElementDataUtil");
|
|
15
13
|
|
|
16
14
|
var _propertyViews = _interopRequireDefault(require("./propertyViews"));
|
|
17
15
|
|
|
18
16
|
var _useSettingRuntimeState = _interopRequireDefault(require("./useSettingRuntimeState"));
|
|
19
17
|
|
|
18
|
+
var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
|
|
19
|
+
|
|
20
20
|
function getElementType(selection) {
|
|
21
21
|
var selectionElement = selection[0];
|
|
22
22
|
var selectionSize = selection.length;
|
|
@@ -134,8 +134,6 @@ function Settings(props) {
|
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
137
|
-
className: _SettingsModule["default"].settingsPanel
|
|
138
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
137
|
className: _SettingsModule["default"].settings
|
|
140
138
|
}, /*#__PURE__*/_react["default"].createElement(PropertyView, {
|
|
141
139
|
type: elementType,
|
|
@@ -148,5 +146,5 @@ function Settings(props) {
|
|
|
148
146
|
onChange: updateElementProperty,
|
|
149
147
|
editorProps: editorProps,
|
|
150
148
|
settingRuntimeState: settingRuntimeState
|
|
151
|
-
}))
|
|
149
|
+
}));
|
|
152
150
|
}
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.32" === 'string' ? "2.15.32" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -49,7 +49,20 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
49
49
|
|
|
50
50
|
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; }
|
|
51
51
|
|
|
52
|
-
//
|
|
52
|
+
// url 处理,UICBB 的地址需截取前缀
|
|
53
|
+
function formatUrl(url) {
|
|
54
|
+
var _window, _window$location;
|
|
55
|
+
|
|
56
|
+
var prefix = '/default/pagecenter';
|
|
57
|
+
|
|
58
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
|
59
|
+
return url.split(prefix)[1];
|
|
60
|
+
} else {
|
|
61
|
+
return url;
|
|
62
|
+
}
|
|
63
|
+
} // 基本信息
|
|
64
|
+
|
|
65
|
+
|
|
53
66
|
function BaseInfoRender(type, data) {
|
|
54
67
|
var _itemCols$type;
|
|
55
68
|
|
|
@@ -70,7 +83,7 @@ function BaseInfoRender(type, data) {
|
|
|
70
83
|
title: display_name
|
|
71
84
|
}, valueData ? /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
|
72
85
|
className: _indexModule["default"].link,
|
|
73
|
-
to: link
|
|
86
|
+
to: formatUrl(link)
|
|
74
87
|
}, display_name) : '-'));
|
|
75
88
|
}
|
|
76
89
|
}, {
|
|
@@ -419,7 +432,7 @@ function ResourceOverview(props) {
|
|
|
419
432
|
resource: modelAttributeMap['display_name'] ? {
|
|
420
433
|
display_name: attributeMap.display_name,
|
|
421
434
|
// 资源名称/显示名称
|
|
422
|
-
link: "/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
435
|
+
link: "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
423
436
|
|
|
424
437
|
} : false,
|
|
425
438
|
ipv4_address: modelAttributeMap['ipv4_address'] ? attributeMap.ipv4_address : false,
|
|
@@ -439,7 +452,7 @@ function ResourceOverview(props) {
|
|
|
439
452
|
icon: 'gaojing-3',
|
|
440
453
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
|
441
454
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
|
442
|
-
link: "/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
|
455
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
|
443
456
|
time: item.createTime,
|
|
444
457
|
status: item.status,
|
|
445
458
|
params: [{
|
|
@@ -652,7 +665,7 @@ function ResourceOverview(props) {
|
|
|
652
665
|
className: _indexModule["default"]["alarm-color-icon"] + " " + record.className
|
|
653
666
|
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
|
654
667
|
className: _indexModule["default"].link,
|
|
655
|
-
to: record.link
|
|
668
|
+
to: formatUrl(record.link)
|
|
656
669
|
}, value));
|
|
657
670
|
}
|
|
658
671
|
}, {
|
|
@@ -696,7 +709,7 @@ function ResourceOverview(props) {
|
|
|
696
709
|
|
|
697
710
|
function _alarmRiskOperation() {
|
|
698
711
|
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(type, params) {
|
|
699
|
-
var res, _topo$ciTyeCache$getC, modelMetrics, topModelMetrics;
|
|
712
|
+
var res, _topo$ciTyeCache$getC, modelMetrics, ciName, modelAttributeMap, domain, topModelMetrics;
|
|
700
713
|
|
|
701
714
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
702
715
|
while (1) {
|
|
@@ -716,9 +729,9 @@ function ResourceOverview(props) {
|
|
|
716
729
|
_message["default"].success('受理成功');
|
|
717
730
|
|
|
718
731
|
if (isAppTopo) {
|
|
719
|
-
_topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType), modelMetrics = _topo$ciTyeCache$getC.metrics;
|
|
732
|
+
_topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType), modelMetrics = _topo$ciTyeCache$getC.metrics, ciName = _topo$ciTyeCache$getC.displayName, modelAttributeMap = _topo$ciTyeCache$getC.attributeMap, domain = _topo$ciTyeCache$getC.domain;
|
|
720
733
|
topModelMetrics = modelMetrics.slice(0, 6);
|
|
721
|
-
initAppTopo(topModelMetrics);
|
|
734
|
+
initAppTopo(topModelMetrics, modelAttributeMap, ciName, domain);
|
|
722
735
|
} else {
|
|
723
736
|
getAlarmRiskData(id);
|
|
724
737
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.32",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
114
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.32/build/index.html",
|
|
115
115
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
116
116
|
}
|