@riil-frontend/component-topology 9.0.7 → 9.0.8
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/index.js +8 -8
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/NetworkBaseInfo.js +23 -14
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/NetworkBaseInfo.js +26 -15
- package/package.json +2 -2
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "9.0.
|
27
|
+
var version = typeof "9.0.8" === 'string' ? "9.0.8" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -3,7 +3,7 @@ import _Switch from "@alifd/next/es/switch";
|
|
3
3
|
import React, { useState } from 'react';
|
4
4
|
import BaseInfoBlock from "./BaseInfoBlock";
|
5
5
|
import Configurator from "./components/Configurator";
|
6
|
-
import {
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog'; // 基本信息
|
7
7
|
|
8
8
|
export default function NetworkBaseInfo(props) {
|
9
9
|
var loading = props.loading,
|
@@ -24,13 +24,15 @@ export default function NetworkBaseInfo(props) {
|
|
24
24
|
type = data.type,
|
25
25
|
name = data.name;
|
26
26
|
var edge = topo.dataModel.getDataById(id);
|
27
|
-
var targetNode = topo.dataModel.getDataById(edge.target);
|
28
|
-
var sourceNode = topo.dataModel.getDataById(edge.source);
|
29
27
|
|
30
28
|
var _useState = useState(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']),
|
31
29
|
defaultChecked = _useState[0],
|
32
30
|
setDefaultChecked = _useState[1];
|
33
31
|
|
32
|
+
function isExitLink(link) {
|
33
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
34
|
+
}
|
35
|
+
|
34
36
|
var onChanges = function onChanges(checked) {
|
35
37
|
var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked, setDefaultChecked);
|
36
38
|
};
|
@@ -43,20 +45,27 @@ export default function NetworkBaseInfo(props) {
|
|
43
45
|
});
|
44
46
|
};
|
45
47
|
|
46
|
-
var
|
48
|
+
var crucialLinkField = null;
|
47
49
|
|
48
|
-
if (
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
if (edge) {
|
51
|
+
var targetNode = topo.dataModel.getDataById(edge.target);
|
52
|
+
var sourceNode = topo.dataModel.getDataById(edge.source);
|
53
|
+
rlog.debug(isExitLink(edge), sourceNode, targetNode, '111111111111111111111');
|
54
|
+
var updateCrucialPermission = sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable);
|
55
|
+
|
56
|
+
if (updateCrucialPermission) {
|
57
|
+
crucialLinkField = {
|
58
|
+
contentTitle: topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial'] ? '是' : '否',
|
59
|
+
dataIndex: 'isCrucial',
|
60
|
+
disabledHide: false,
|
61
|
+
hidden: false,
|
62
|
+
title: '是否关键',
|
63
|
+
value: creatCruialSwitch()
|
64
|
+
};
|
65
|
+
}
|
57
66
|
}
|
58
67
|
|
59
|
-
var newBaseInfo = [].concat(baseInfo, [
|
68
|
+
var newBaseInfo = crucialLinkField ? [].concat(baseInfo, [crucialLinkField]) : baseInfo;
|
60
69
|
return /*#__PURE__*/React.createElement(BaseInfoBlock, _extends({}, resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.baseInfoProps, {
|
61
70
|
loading: loading,
|
62
71
|
data: data,
|
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "9.0.
|
59
|
+
var version = typeof "9.0.8" === 'string' ? "9.0.8" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -15,7 +15,7 @@ var _BaseInfoBlock = _interopRequireDefault(require("./BaseInfoBlock"));
|
|
15
15
|
|
16
16
|
var _Configurator = _interopRequireDefault(require("./components/Configurator"));
|
17
17
|
|
18
|
-
var
|
18
|
+
var _rlog = require("@riil-frontend/component-topology-utils/lib/rlog");
|
19
19
|
|
20
20
|
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); }
|
21
21
|
|
@@ -41,13 +41,15 @@ function NetworkBaseInfo(props) {
|
|
41
41
|
type = data.type,
|
42
42
|
name = data.name;
|
43
43
|
var edge = topo.dataModel.getDataById(id);
|
44
|
-
var targetNode = topo.dataModel.getDataById(edge.target);
|
45
|
-
var sourceNode = topo.dataModel.getDataById(edge.source);
|
46
44
|
|
47
45
|
var _useState = (0, _react.useState)(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']),
|
48
46
|
defaultChecked = _useState[0],
|
49
47
|
setDefaultChecked = _useState[1];
|
50
48
|
|
49
|
+
function isExitLink(link) {
|
50
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
51
|
+
}
|
52
|
+
|
51
53
|
var onChanges = function onChanges(checked) {
|
52
54
|
var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked, setDefaultChecked);
|
53
55
|
};
|
@@ -60,20 +62,29 @@ function NetworkBaseInfo(props) {
|
|
60
62
|
});
|
61
63
|
};
|
62
64
|
|
63
|
-
var
|
64
|
-
|
65
|
-
if (
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
65
|
+
var crucialLinkField = null;
|
66
|
+
|
67
|
+
if (edge) {
|
68
|
+
var targetNode = topo.dataModel.getDataById(edge.target);
|
69
|
+
var sourceNode = topo.dataModel.getDataById(edge.source);
|
70
|
+
|
71
|
+
_rlog.rlog.debug(isExitLink(edge), sourceNode, targetNode, '111111111111111111111');
|
72
|
+
|
73
|
+
var updateCrucialPermission = sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable);
|
74
|
+
|
75
|
+
if (updateCrucialPermission) {
|
76
|
+
crucialLinkField = {
|
77
|
+
contentTitle: topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial'] ? '是' : '否',
|
78
|
+
dataIndex: 'isCrucial',
|
79
|
+
disabledHide: false,
|
80
|
+
hidden: false,
|
81
|
+
title: '是否关键',
|
82
|
+
value: creatCruialSwitch()
|
83
|
+
};
|
84
|
+
}
|
74
85
|
}
|
75
86
|
|
76
|
-
var newBaseInfo = [].concat(baseInfo, [
|
87
|
+
var newBaseInfo = crucialLinkField ? [].concat(baseInfo, [crucialLinkField]) : baseInfo;
|
77
88
|
return /*#__PURE__*/_react["default"].createElement(_BaseInfoBlock["default"], (0, _extends2["default"])({}, resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.baseInfoProps, {
|
78
89
|
loading: loading,
|
79
90
|
data: data,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "9.0.
|
3
|
+
"version": "9.0.8",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.8/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|