@riil-frontend/component-topology 11.0.32 → 11.0.34
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.css +1 -1
- package/build/index.js +8 -8
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -35
- package/es/core/hooks/useTopoEdit.js +16 -21
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/services/topo/basic.js +143 -7
- package/es/core/store/models/topoBizMod.js +0 -34
- package/es/networkTopo/services/topo/basic.js +10 -77
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +6 -38
- package/lib/core/hooks/useTopoEdit.js +16 -21
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/services/topo/basic.js +147 -8
- package/lib/core/store/models/topoBizMod.js +0 -34
- package/lib/networkTopo/services/topo/basic.js +10 -80
- package/package.json +7 -4
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +0 -102
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +0 -15
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +0 -118
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +0 -23
@@ -1,102 +0,0 @@
|
|
1
|
-
import _Button from "@alifd/next/es/button";
|
2
|
-
import _Input from "@alifd/next/es/input";
|
3
|
-
import _Form from "@alifd/next/es/form";
|
4
|
-
import React, { useState, useEffect } from "react";
|
5
|
-
import { isUniqueIp } from "../../../../../../../networkTopo/utils/exitLinkUtil";
|
6
|
-
var FormItem = _Form.Item;
|
7
|
-
/**
|
8
|
-
* @return {React.ReactNode | null}
|
9
|
-
*/
|
10
|
-
|
11
|
-
export default function BindIpInput(props) {
|
12
|
-
var _values$attrObjectBi;
|
13
|
-
|
14
|
-
var nodeElement = props.nodeElement,
|
15
|
-
topo = props.topo,
|
16
|
-
topoEditApi = props.topoEditApi,
|
17
|
-
values = props.values,
|
18
|
-
onChange = props.onChange,
|
19
|
-
fieldItem = props.fieldItem; // const currentResId = node.tag;
|
20
|
-
// console.log(
|
21
|
-
// "nodeElement, topo, topoEditApi, node",
|
22
|
-
// nodeElement,
|
23
|
-
// topo,
|
24
|
-
// topoEditApi,
|
25
|
-
// values
|
26
|
-
// );
|
27
|
-
|
28
|
-
var _useState = useState(""),
|
29
|
-
error = _useState[0],
|
30
|
-
setError = _useState[1];
|
31
|
-
|
32
|
-
var _useState2 = useState((_values$attrObjectBi = values["attrObject.bindIp"]) !== null && _values$attrObjectBi !== void 0 ? _values$attrObjectBi : ""),
|
33
|
-
txtValue = _useState2[0],
|
34
|
-
setTxtValue = _useState2[1];
|
35
|
-
|
36
|
-
var saveIp = function saveIp(v) {
|
37
|
-
fieldItem.validate(function (errors, vals) {
|
38
|
-
if (errors) {
|
39
|
-
console.error("saveIp-error", errors, vals);
|
40
|
-
} else {
|
41
|
-
setError("");
|
42
|
-
onChange(txtValue);
|
43
|
-
topoEditApi.relateNodeIp(txtValue, nodeElement);
|
44
|
-
}
|
45
|
-
});
|
46
|
-
};
|
47
|
-
|
48
|
-
useEffect(function () {
|
49
|
-
fieldItem.reset();
|
50
|
-
setTxtValue(values["attrObject.bindIp"]);
|
51
|
-
}, [values]);
|
52
|
-
|
53
|
-
var inputChange = function inputChange(v) {
|
54
|
-
setTxtValue(v); // onChange(v);
|
55
|
-
}; // 图片节点验证ip唯一性
|
56
|
-
|
57
|
-
|
58
|
-
var checkIp = function checkIp(rule, value, callback) {
|
59
|
-
var dm = topo.getDataModel();
|
60
|
-
var isUnique = isUniqueIp(dm, value, nodeElement); // console.log("checkIp", isUnique);
|
61
|
-
|
62
|
-
if (!isUnique) {
|
63
|
-
return callback("ip不能重复");
|
64
|
-
} else {
|
65
|
-
return callback();
|
66
|
-
}
|
67
|
-
};
|
68
|
-
|
69
|
-
return /*#__PURE__*/React.createElement("div", {
|
70
|
-
style: {
|
71
|
-
display: "flex",
|
72
|
-
width: "100%"
|
73
|
-
}
|
74
|
-
}, /*#__PURE__*/React.createElement(FormItem, {
|
75
|
-
label: "\u5173\u8054IP",
|
76
|
-
pattern: /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/,
|
77
|
-
patternTrigger: "onBlur",
|
78
|
-
patternMessage: "IP\u5730\u5740\u683C\u5F0F\u4E0D\u6B63\u786E",
|
79
|
-
validator: checkIp,
|
80
|
-
style: {
|
81
|
-
width: "100%"
|
82
|
-
}
|
83
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
84
|
-
placeholder: "\u8BF7\u8F93\u5165IP\u5730\u5740",
|
85
|
-
name: "attrObject.bindIp",
|
86
|
-
state: error,
|
87
|
-
value: txtValue,
|
88
|
-
maxLength: 128,
|
89
|
-
onChange: inputChange,
|
90
|
-
style: {
|
91
|
-
width: 200
|
92
|
-
}
|
93
|
-
})), /*#__PURE__*/React.createElement(_Button, {
|
94
|
-
type: "primary",
|
95
|
-
text: true,
|
96
|
-
onClick: saveIp,
|
97
|
-
style: {
|
98
|
-
marginLeft: 8,
|
99
|
-
marginTop: 27
|
100
|
-
}
|
101
|
-
}, "\u4FDD\u5B58"));
|
102
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
function PlatformDisplay(props) {
|
4
|
-
var topo = props.topo,
|
5
|
-
node = props.node;
|
6
|
-
var data = topo.dataModel.useDataById(node.getTag());
|
7
|
-
|
8
|
-
if (!data) {
|
9
|
-
return '';
|
10
|
-
}
|
11
|
-
|
12
|
-
return data.level === '0' ? data.sourceName : '本级平台';
|
13
|
-
}
|
14
|
-
|
15
|
-
export default PlatformDisplay;
|
@@ -1,118 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
exports.__esModule = true;
|
6
|
-
exports["default"] = BindIpInput;
|
7
|
-
|
8
|
-
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
9
|
-
|
10
|
-
var _input = _interopRequireDefault(require("@alifd/next/lib/input"));
|
11
|
-
|
12
|
-
var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
|
13
|
-
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
15
|
-
|
16
|
-
var _exitLinkUtil = require("../../../../../../../networkTopo/utils/exitLinkUtil");
|
17
|
-
|
18
|
-
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); }
|
19
|
-
|
20
|
-
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; }
|
21
|
-
|
22
|
-
var FormItem = _form["default"].Item;
|
23
|
-
/**
|
24
|
-
* @return {React.ReactNode | null}
|
25
|
-
*/
|
26
|
-
|
27
|
-
function BindIpInput(props) {
|
28
|
-
var _values$attrObjectBi;
|
29
|
-
|
30
|
-
var nodeElement = props.nodeElement,
|
31
|
-
topo = props.topo,
|
32
|
-
topoEditApi = props.topoEditApi,
|
33
|
-
values = props.values,
|
34
|
-
onChange = props.onChange,
|
35
|
-
fieldItem = props.fieldItem; // const currentResId = node.tag;
|
36
|
-
// console.log(
|
37
|
-
// "nodeElement, topo, topoEditApi, node",
|
38
|
-
// nodeElement,
|
39
|
-
// topo,
|
40
|
-
// topoEditApi,
|
41
|
-
// values
|
42
|
-
// );
|
43
|
-
|
44
|
-
var _useState = (0, _react.useState)(""),
|
45
|
-
error = _useState[0],
|
46
|
-
setError = _useState[1];
|
47
|
-
|
48
|
-
var _useState2 = (0, _react.useState)((_values$attrObjectBi = values["attrObject.bindIp"]) !== null && _values$attrObjectBi !== void 0 ? _values$attrObjectBi : ""),
|
49
|
-
txtValue = _useState2[0],
|
50
|
-
setTxtValue = _useState2[1];
|
51
|
-
|
52
|
-
var saveIp = function saveIp(v) {
|
53
|
-
fieldItem.validate(function (errors, vals) {
|
54
|
-
if (errors) {
|
55
|
-
console.error("saveIp-error", errors, vals);
|
56
|
-
} else {
|
57
|
-
setError("");
|
58
|
-
onChange(txtValue);
|
59
|
-
topoEditApi.relateNodeIp(txtValue, nodeElement);
|
60
|
-
}
|
61
|
-
});
|
62
|
-
};
|
63
|
-
|
64
|
-
(0, _react.useEffect)(function () {
|
65
|
-
fieldItem.reset();
|
66
|
-
setTxtValue(values["attrObject.bindIp"]);
|
67
|
-
}, [values]);
|
68
|
-
|
69
|
-
var inputChange = function inputChange(v) {
|
70
|
-
setTxtValue(v); // onChange(v);
|
71
|
-
}; // 图片节点验证ip唯一性
|
72
|
-
|
73
|
-
|
74
|
-
var checkIp = function checkIp(rule, value, callback) {
|
75
|
-
var dm = topo.getDataModel();
|
76
|
-
var isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, value, nodeElement); // console.log("checkIp", isUnique);
|
77
|
-
|
78
|
-
if (!isUnique) {
|
79
|
-
return callback("ip不能重复");
|
80
|
-
} else {
|
81
|
-
return callback();
|
82
|
-
}
|
83
|
-
};
|
84
|
-
|
85
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
86
|
-
style: {
|
87
|
-
display: "flex",
|
88
|
-
width: "100%"
|
89
|
-
}
|
90
|
-
}, /*#__PURE__*/_react["default"].createElement(FormItem, {
|
91
|
-
label: "\u5173\u8054IP",
|
92
|
-
pattern: /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/,
|
93
|
-
patternTrigger: "onBlur",
|
94
|
-
patternMessage: "IP\u5730\u5740\u683C\u5F0F\u4E0D\u6B63\u786E",
|
95
|
-
validator: checkIp,
|
96
|
-
style: {
|
97
|
-
width: "100%"
|
98
|
-
}
|
99
|
-
}, /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
100
|
-
placeholder: "\u8BF7\u8F93\u5165IP\u5730\u5740",
|
101
|
-
name: "attrObject.bindIp",
|
102
|
-
state: error,
|
103
|
-
value: txtValue,
|
104
|
-
maxLength: 128,
|
105
|
-
onChange: inputChange,
|
106
|
-
style: {
|
107
|
-
width: 200
|
108
|
-
}
|
109
|
-
})), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
110
|
-
type: "primary",
|
111
|
-
text: true,
|
112
|
-
onClick: saveIp,
|
113
|
-
style: {
|
114
|
-
marginLeft: 8,
|
115
|
-
marginTop: 27
|
116
|
-
}
|
117
|
-
}, "\u4FDD\u5B58"));
|
118
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
exports.__esModule = true;
|
6
|
-
exports["default"] = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
function PlatformDisplay(props) {
|
11
|
-
var topo = props.topo,
|
12
|
-
node = props.node;
|
13
|
-
var data = topo.dataModel.useDataById(node.getTag());
|
14
|
-
|
15
|
-
if (!data) {
|
16
|
-
return '';
|
17
|
-
}
|
18
|
-
|
19
|
-
return data.level === '0' ? data.sourceName : '本级平台';
|
20
|
-
}
|
21
|
-
|
22
|
-
var _default = PlatformDisplay;
|
23
|
-
exports["default"] = _default;
|