@riil-frontend/component-topology 5.0.0-alpha.9 → 5.0.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.css +1 -1
- package/build/index.js +20 -20
- package/es/common/components/ColorPicker/ColorPicker.js +5 -3
- package/es/components/BatchAttrMetric/setting.js +3 -5
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +5 -1
- package/es/core/components/DisplaySettingDrawer/demo/Demo.js +63 -0
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +9 -48
- package/es/core/components/TopoView/TopoView.module.scss +1 -1
- package/es/core/components/TopoView/topoView.js +31 -22
- package/es/core/editor/components/BackgroundView/index.js +74 -35
- package/es/core/editor/components/settings/common/LineType/index.js +7 -1
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +3 -3
- package/es/core/editor/components/settings/common/text/TextStyle.js +21 -6
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +12 -1
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +13 -3
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +34 -6
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +30 -1
- package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +4 -1
- package/es/core/editor/components/titlebar/widgets/DebugTools.js +29 -0
- package/es/core/hooks/useAlarm.js +18 -0
- package/es/core/hooks/useGraphAlarmDisplay.js +25 -3
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useRouterAdapter.js +7 -1
- package/es/core/hooks/useTopoEdit.js +220 -163
- package/es/core/models/AttributeMetricDisplay.js +31 -73
- package/es/core/models/HistoryManager.js +100 -50
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +10 -44
- package/es/core/models/cache/DictCache.js +2 -1
- package/es/core/models/graph/Background.js +31 -14
- package/es/core/models/tagstips/ElementTagTipConfig.js +46 -12
- package/es/core/models/tagstips/utils.js +1 -1
- package/es/core/models/topoData.js +7 -3
- package/es/core/models/utils/linkUtils.js +18 -0
- package/es/core/store/models/topoAlarm.js +5 -1
- package/es/core/store/models/topoMod.js +6 -31
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -249
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +218 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +23 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +62 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +188 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +18 -0
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +11 -1
- package/es/networkTopo/components/TopoView.js +2 -1
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +164 -225
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +4 -0
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +104 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +17 -7
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +59 -0
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/es/networkTopo/getTopoData.js +11 -14
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/index.js +6 -4
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoCenter.js +5 -2
- package/es/networkTopo/store/topoTreeMod.js +84 -43
- package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +135 -0
- package/es/networkTopo/utils/resourcePermissionUtil.js +10 -6
- package/es/style.js +2 -1
- package/es/utils/ResourceConfigUtil.js +79 -39
- package/es/utils/clusterUtil.js +1 -1
- package/es/utils/htElementUtils.js +0 -1
- package/es/utils/topoData.js +24 -63
- package/es/utils/tree.js +1 -3
- package/lib/common/components/ColorPicker/ColorPicker.js +6 -3
- package/lib/components/BatchAttrMetric/setting.js +3 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +6 -1
- package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +71 -0
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +8 -48
- package/lib/core/components/TopoView/TopoView.module.scss +1 -1
- package/lib/core/components/TopoView/topoView.js +26 -17
- package/lib/core/editor/components/BackgroundView/index.js +75 -35
- package/lib/core/editor/components/settings/common/LineType/index.js +7 -1
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -4
- package/lib/core/editor/components/settings/common/text/TextStyle.js +23 -7
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +13 -1
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +17 -3
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +36 -6
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +32 -1
- package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -1
- package/lib/core/editor/components/titlebar/widgets/DebugTools.js +38 -0
- package/lib/core/hooks/useAlarm.js +19 -0
- package/lib/core/hooks/useGraphAlarmDisplay.js +27 -3
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useRouterAdapter.js +8 -1
- package/lib/core/hooks/useTopoEdit.js +219 -162
- package/lib/core/models/AttributeMetricDisplay.js +31 -73
- package/lib/core/models/HistoryManager.js +105 -51
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +12 -44
- package/lib/core/models/cache/DictCache.js +4 -1
- package/lib/core/models/graph/Background.js +36 -16
- package/lib/core/models/tagstips/ElementTagTipConfig.js +49 -12
- package/lib/core/models/tagstips/utils.js +1 -1
- package/lib/core/models/topoData.js +7 -3
- package/lib/core/models/utils/linkUtils.js +22 -0
- package/lib/core/store/models/topoAlarm.js +5 -1
- package/lib/core/store/models/topoMod.js +7 -32
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -261
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +245 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -42
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +36 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +45 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +77 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +214 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +28 -0
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +10 -0
- package/lib/networkTopo/components/TopoView.js +3 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +160 -223
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +12 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +120 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +19 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +76 -0
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/lib/networkTopo/getTopoData.js +10 -13
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +2 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/lib/networkTopo/models/TopoCenter.js +2 -2
- package/lib/networkTopo/services/index.js +6 -4
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoCenter.js +5 -2
- package/lib/networkTopo/store/topoTreeMod.js +84 -43
- package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +137 -0
- package/lib/networkTopo/utils/resourcePermissionUtil.js +11 -6
- package/lib/style.js +2 -1
- package/lib/utils/ResourceConfigUtil.js +78 -37
- package/lib/utils/clusterUtil.js +1 -1
- package/lib/utils/htElementUtils.js +0 -1
- package/lib/utils/topoData.js +25 -64
- package/lib/utils/tree.js +1 -3
- package/package.json +3 -2
|
@@ -53,12 +53,12 @@ function saveTopo(_x) {
|
|
|
53
53
|
|
|
54
54
|
function _saveTopo() {
|
|
55
55
|
_saveTopo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
|
56
|
-
var topoId, template, layout, backgroundId,
|
|
56
|
+
var topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
|
57
57
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
58
58
|
while (1) {
|
|
59
59
|
switch (_context.prev = _context.next) {
|
|
60
60
|
case 0:
|
|
61
|
-
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId,
|
|
61
|
+
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
|
62
62
|
|
|
63
63
|
_rlog["default"].debug("saveTopo", data); // 保存布局
|
|
64
64
|
|
|
@@ -112,7 +112,11 @@ function _saveTopo() {
|
|
|
112
112
|
_rlog["default"].debug("saveTopo-groupInfo", groupInfo);
|
|
113
113
|
|
|
114
114
|
_context.next = 15;
|
|
115
|
-
return _topo["default"].bindResourceToTopo(topoId,
|
|
115
|
+
return _topo["default"].bindResourceToTopo(topoId, {
|
|
116
|
+
groups: groupInfo,
|
|
117
|
+
exportLinkIdList: exportLinkIdList,
|
|
118
|
+
relateTopoIdList: relateTopoIdList
|
|
119
|
+
});
|
|
116
120
|
|
|
117
121
|
case 15:
|
|
118
122
|
if (!serialize) {
|
|
@@ -7,6 +7,8 @@ exports.buildTopoLinkData = buildTopoLinkData;
|
|
|
7
7
|
exports.getInterfaceObject = void 0;
|
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
|
9
9
|
exports.isAggLink = isAggLink;
|
|
10
|
+
exports.isCrucialLink = isCrucialLink;
|
|
11
|
+
exports.isExitLink = isExitLink;
|
|
10
12
|
exports.mergeLinksData = mergeLinksData;
|
|
11
13
|
|
|
12
14
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
@@ -31,6 +33,26 @@ var _services = require("../../services");
|
|
|
31
33
|
// displayName: "聚合接口",
|
|
32
34
|
// },
|
|
33
35
|
// };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 是否关键链路
|
|
39
|
+
* @param {*} link
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
function isCrucialLink(link) {
|
|
43
|
+
return !!link.attributes['network_link.is_crucial'];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 是否出口链路
|
|
47
|
+
* @param {*} link
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
function isExitLink(link) {
|
|
53
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['network_link.destination_device_id']);
|
|
54
|
+
}
|
|
55
|
+
|
|
34
56
|
function isAggLink(link) {
|
|
35
57
|
return link.attributes["network_link.connect_type"] === "agg";
|
|
36
58
|
}
|
|
@@ -34,6 +34,9 @@ function _default(topo) {
|
|
|
34
34
|
alarmDatas: [],
|
|
35
35
|
alarmPanelIsOpen: false,
|
|
36
36
|
risks: [],
|
|
37
|
+
// 风险
|
|
38
|
+
// 关联拓扑最高告警级别
|
|
39
|
+
relateTopoAlarm: {},
|
|
37
40
|
currentTopoId: undefined
|
|
38
41
|
},
|
|
39
42
|
// 定义改变该模型状态的纯函数
|
|
@@ -57,7 +60,8 @@ function _default(topo) {
|
|
|
57
60
|
alarmDoc: {},
|
|
58
61
|
alarmList: [],
|
|
59
62
|
alarmRecord: [],
|
|
60
|
-
risks: []
|
|
63
|
+
risks: [],
|
|
64
|
+
relateTopoAlarm: {}
|
|
61
65
|
});
|
|
62
66
|
|
|
63
67
|
return _context.abrupt("return", "resetAlarmDoc Over");
|
|
@@ -79,16 +79,16 @@ function _default(topoApp) {
|
|
|
79
79
|
params = {};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
_rlog["default"].debug("topoMod.init 初始化...", {
|
|
83
|
-
params: params,
|
|
84
|
-
rootState: rootState
|
|
85
|
-
});
|
|
86
|
-
|
|
87
82
|
topoModState = rootState.topoMod; // 处理URL参数
|
|
88
83
|
|
|
89
84
|
type = params.type || "view";
|
|
90
85
|
id = params.id || topoModState.topoId || "";
|
|
91
86
|
|
|
87
|
+
_rlog["default"].debug("topoMod.init \u521D\u59CB\u5316(" + id + ")...", {
|
|
88
|
+
params: params,
|
|
89
|
+
rootState: rootState
|
|
90
|
+
});
|
|
91
|
+
|
|
92
92
|
_this.update({
|
|
93
93
|
viewState: type,
|
|
94
94
|
currentTopo: id ? {
|
|
@@ -447,7 +447,7 @@ function _default(topoApp) {
|
|
|
447
447
|
_rlog["default"].debug("topoMod.initTopoData 查询数据完成", topoId, linkTo, result);
|
|
448
448
|
|
|
449
449
|
_context6.next = 41;
|
|
450
|
-
return Promise.all([topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(result)), dispatch.customIcon.loadCustomIcons()
|
|
450
|
+
return Promise.all([topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(result)), dispatch.customIcon.loadCustomIcons(), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
|
|
451
451
|
]);
|
|
452
452
|
|
|
453
453
|
case 41:
|
|
@@ -642,31 +642,6 @@ function _default(topoApp) {
|
|
|
642
642
|
|
|
643
643
|
|
|
644
644
|
case 10:
|
|
645
|
-
if (!topoPermission) {
|
|
646
|
-
_context11.next = 19;
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
_context11.next = 13;
|
|
651
|
-
return dispatch.functionAuth.checkAuth('createTopo');
|
|
652
|
-
|
|
653
|
-
case 13:
|
|
654
|
-
if (!_context11.sent) {
|
|
655
|
-
_context11.next = 17;
|
|
656
|
-
break;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
_context11.t1 = 'delete';
|
|
660
|
-
_context11.next = 18;
|
|
661
|
-
break;
|
|
662
|
-
|
|
663
|
-
case 17:
|
|
664
|
-
_context11.t1 = 'read';
|
|
665
|
-
|
|
666
|
-
case 18:
|
|
667
|
-
topoPermission = _context11.t1;
|
|
668
|
-
|
|
669
|
-
case 19:
|
|
670
645
|
if (update !== false) {
|
|
671
646
|
_this8.update({
|
|
672
647
|
topoPermission: topoPermission
|
|
@@ -675,7 +650,7 @@ function _default(topoApp) {
|
|
|
675
650
|
|
|
676
651
|
return _context11.abrupt("return", topoPermission);
|
|
677
652
|
|
|
678
|
-
case
|
|
653
|
+
case 12:
|
|
679
654
|
case "end":
|
|
680
655
|
return _context11.stop();
|
|
681
656
|
}
|
|
@@ -3,283 +3,73 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports["default"] =
|
|
7
|
-
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
|
|
10
|
-
var _drawer = _interopRequireDefault(require("@alifd/next/lib/drawer"));
|
|
6
|
+
exports["default"] = ResourceDetail;
|
|
11
7
|
|
|
12
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
9
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _componentTopologyGraph = require("@riil-frontend/component-topology-graph");
|
|
17
|
-
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
11
|
|
|
22
12
|
var _FullheightTab = _interopRequireDefault(require("../../../../../components/FullheightTab"));
|
|
23
13
|
|
|
24
|
-
var _overview = _interopRequireDefault(require("../../../../services/overview"));
|
|
25
|
-
|
|
26
14
|
var _ClusterMemberTable = _interopRequireDefault(require("./components/ClusterMemberTable"));
|
|
27
15
|
|
|
28
|
-
var _DrawerTitle = _interopRequireDefault(require("./components/DrawerTitle"));
|
|
29
|
-
|
|
30
16
|
var _ResourceOverview = _interopRequireDefault(require("./components/ResourceOverview"));
|
|
31
17
|
|
|
32
18
|
var _WebConsoleContainer = _interopRequireDefault(require("./components/WebConsole/WebConsoleContainer"));
|
|
33
19
|
|
|
34
20
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
35
21
|
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
// 基本信息
|
|
41
22
|
function ResourceDetail(props) {
|
|
42
|
-
var
|
|
43
|
-
canShow = props.canShow;
|
|
44
|
-
|
|
45
|
-
var _topo$store$useModel = topo.store.useModel('topoBaseInfoOverview'),
|
|
46
|
-
topoState = _topo$store$useModel[0],
|
|
47
|
-
topoDispatchers = _topo$store$useModel[1];
|
|
48
|
-
|
|
49
|
-
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
|
50
|
-
topoId = _topo$store$useModelS.topoId,
|
|
51
|
-
topoModData = _topo$store$useModelS.data;
|
|
52
|
-
|
|
53
|
-
var _topo$store$useModelS2 = topo.store.useModelState("lock"),
|
|
54
|
-
lock = _topo$store$useModelS2.lock;
|
|
55
|
-
|
|
56
|
-
var _useState = (0, _react.useState)(false),
|
|
57
|
-
visible = _useState[0],
|
|
58
|
-
setVisible = _useState[1];
|
|
59
|
-
|
|
60
|
-
var _useState2 = (0, _react.useState)({
|
|
61
|
-
id: '',
|
|
62
|
-
name: '',
|
|
63
|
-
type: '',
|
|
64
|
-
// 类型: node、link
|
|
65
|
-
ciType: '',
|
|
66
|
-
ciName: ''
|
|
67
|
-
}),
|
|
68
|
-
activeData = _useState2[0],
|
|
69
|
-
setActiveData = _useState2[1];
|
|
70
|
-
|
|
71
|
-
var _useState3 = (0, _react.useState)(''),
|
|
72
|
-
userId = _useState3[0],
|
|
73
|
-
setUserId = _useState3[1];
|
|
74
|
-
|
|
75
|
-
var resourceData = topo.dataModel.useDataById(activeData.id);
|
|
76
|
-
(0, _react.useEffect)(function () {
|
|
77
|
-
var notifier = topo.view.topoClient.notifier;
|
|
78
|
-
notifier.on(_componentTopologyGraph.TopoEvent.EVENT_DOUBLE_CLICK, openOverview);
|
|
79
|
-
notifier.on('topo_element_click', changeOverview);
|
|
80
|
-
return function () {
|
|
81
|
-
notifier.off(_componentTopologyGraph.TopoEvent.EVENT_DOUBLE_CLICK, openOverview);
|
|
82
|
-
notifier.off('topo_element_click', changeOverview); // 清除数据
|
|
83
|
-
|
|
84
|
-
topoDispatchers.update({
|
|
85
|
-
id: '',
|
|
86
|
-
metricCodes: []
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
}, [lock]); // 解决切换拓扑图隐藏概览
|
|
90
|
-
|
|
91
|
-
(0, _react.useEffect)(function () {
|
|
92
|
-
setVisible(false); // TODO 其他数据重置
|
|
93
|
-
}, [topoId]);
|
|
94
|
-
|
|
95
|
-
function getUser() {
|
|
96
|
-
return _getUser.apply(this, arguments);
|
|
97
|
-
} // select切换
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
function _getUser() {
|
|
101
|
-
_getUser = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
102
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
103
|
-
while (1) {
|
|
104
|
-
switch (_context2.prev = _context2.next) {
|
|
105
|
-
case 0:
|
|
106
|
-
setUserId(function (prev) {
|
|
107
|
-
console.log('获取用户id', prev); // 如果已经获取过,就不再重新获取
|
|
108
|
-
|
|
109
|
-
if (!prev) {
|
|
110
|
-
(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
111
|
-
var res;
|
|
112
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
113
|
-
while (1) {
|
|
114
|
-
switch (_context.prev = _context.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
_context.next = 2;
|
|
117
|
-
return _overview["default"].getUserId();
|
|
118
|
-
|
|
119
|
-
case 2:
|
|
120
|
-
res = _context.sent;
|
|
121
|
-
setUserId((res === null || res === void 0 ? void 0 : res.user_id) || '');
|
|
122
|
-
|
|
123
|
-
case 4:
|
|
124
|
-
case "end":
|
|
125
|
-
return _context.stop();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}, _callee);
|
|
129
|
-
}))();
|
|
130
|
-
}
|
|
23
|
+
var _topo$viewProps, _topo$viewProps$topoC;
|
|
131
24
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
25
|
+
var topo = props.topo,
|
|
26
|
+
userId = props.userId,
|
|
27
|
+
activeData = props.activeData,
|
|
28
|
+
resourceData = props.resourceData; // {/* <Tab.Item title="操作" key="2">操作</Tab.Item>
|
|
29
|
+
// <Tab.Item title="网络信息表" key="3">网络信息表</Tab.Item>
|
|
30
|
+
// <Tab.Item title="Web工作台" key="4">Web工作台</Tab.Item> */}
|
|
31
|
+
|
|
32
|
+
var tabBodys = [{
|
|
33
|
+
title: '资源概览',
|
|
34
|
+
content: /*#__PURE__*/_react["default"].createElement(_ResourceOverview["default"], (0, _extends2["default"])({}, props, activeData, {
|
|
35
|
+
userId: userId
|
|
36
|
+
}))
|
|
37
|
+
}, {
|
|
38
|
+
title: '集群成员',
|
|
39
|
+
content: /*#__PURE__*/_react["default"].createElement(_ClusterMemberTable["default"], {
|
|
40
|
+
data: resourceData,
|
|
41
|
+
topo: topo
|
|
42
|
+
}),
|
|
43
|
+
visible: !!resourceData.cluster
|
|
44
|
+
}, {
|
|
45
|
+
title: 'Web工作台',
|
|
46
|
+
content: /*#__PURE__*/_react["default"].createElement(_WebConsoleContainer["default"], {
|
|
47
|
+
data: resourceData,
|
|
48
|
+
topo: topo
|
|
49
|
+
}),
|
|
50
|
+
visible: activeData.type === 'node' && !!((_topo$viewProps = topo.viewProps) !== null && _topo$viewProps !== void 0 && (_topo$viewProps$topoC = _topo$viewProps.topoContext) !== null && _topo$viewProps$topoC !== void 0 && _topo$viewProps$topoC.isNetworkTopo)
|
|
51
|
+
}].filter(function (item) {
|
|
52
|
+
return item.visible !== false;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (tabBodys.length === 1) {
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_ResourceOverview["default"], (0, _extends2["default"])({}, props, activeData, {
|
|
57
|
+
userId: userId,
|
|
58
|
+
style: {
|
|
59
|
+
overflowY: 'auto',
|
|
60
|
+
height: '100%'
|
|
61
|
+
}
|
|
141
62
|
}));
|
|
142
|
-
return _getUser.apply(this, arguments);
|
|
143
63
|
}
|
|
144
64
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
function openOverviewByHtElement(element) {
|
|
158
|
-
openOverview(element.getAttrObject());
|
|
159
|
-
} // 双击打开
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
function openOverview(data) {
|
|
163
|
-
if (lock) {
|
|
164
|
-
init(data, 'doubleClick');
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function init(data, targetType) {
|
|
169
|
-
console.log('初始化基本信息', data, targetType);
|
|
170
|
-
var id = data.id,
|
|
171
|
-
name = data.name,
|
|
172
|
-
type = data.type,
|
|
173
|
-
ciType = data.ciType,
|
|
174
|
-
ciName = data.ciName; // 仅展示资源和链路的概览
|
|
175
|
-
|
|
176
|
-
var resourceData = topo.dataModel.getDataById(id);
|
|
177
|
-
|
|
178
|
-
if (!resourceData) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var operation = resourceData.operation,
|
|
183
|
-
permission = resourceData.permission;
|
|
184
|
-
if ( // 没有权限不显示
|
|
185
|
-
!operation && !(permission !== null && permission !== void 0 && permission.readable) || // 没有citype不显示
|
|
186
|
-
!ciType) return;
|
|
187
|
-
var htElement = topo.getDataModel().getDataByTag(id);
|
|
188
|
-
|
|
189
|
-
if (!canShow(htElement)) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
setActiveData({
|
|
194
|
-
id: id,
|
|
195
|
-
name: name,
|
|
196
|
-
type: {
|
|
197
|
-
linkGroup: 'link',
|
|
198
|
-
group: 'node'
|
|
199
|
-
}[type] || type,
|
|
200
|
-
ciType: ciType,
|
|
201
|
-
ciName: ciName
|
|
202
|
-
}); // 显示隐藏
|
|
203
|
-
|
|
204
|
-
targetType === 'doubleClick' && setVisible(true); // userId
|
|
205
|
-
|
|
206
|
-
getUser();
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
var renderContent = function renderContent() {
|
|
210
|
-
var _topo$viewProps, _topo$viewProps$viewe, _topo$viewProps$viewe2;
|
|
211
|
-
|
|
212
|
-
// {/* <Tab.Item title="操作" key="2">操作</Tab.Item>
|
|
213
|
-
// <Tab.Item title="网络信息表" key="3">网络信息表</Tab.Item>
|
|
214
|
-
// <Tab.Item title="Web工作台" key="4">Web工作台</Tab.Item> */}
|
|
215
|
-
var tabBodys = [{
|
|
216
|
-
title: '资源概览',
|
|
217
|
-
content: /*#__PURE__*/_react["default"].createElement(_ResourceOverview["default"], (0, _extends2["default"])({}, props, activeData, {
|
|
218
|
-
userId: userId
|
|
219
|
-
}))
|
|
220
|
-
}, {
|
|
221
|
-
title: '集群成员',
|
|
222
|
-
content: /*#__PURE__*/_react["default"].createElement(_ClusterMemberTable["default"], {
|
|
223
|
-
data: resourceData,
|
|
224
|
-
topo: topo
|
|
225
|
-
}),
|
|
226
|
-
visible: resourceData.cluster
|
|
227
|
-
}, {
|
|
228
|
-
title: 'Web工作台',
|
|
229
|
-
content: /*#__PURE__*/_react["default"].createElement(_WebConsoleContainer["default"], {
|
|
230
|
-
data: resourceData,
|
|
231
|
-
topo: topo
|
|
232
|
-
}),
|
|
233
|
-
visible: (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$viewe = _topo$viewProps.viewerProps) === null || _topo$viewProps$viewe === void 0 ? void 0 : (_topo$viewProps$viewe2 = _topo$viewProps$viewe.topoContext) === null || _topo$viewProps$viewe2 === void 0 ? void 0 : _topo$viewProps$viewe2.isNetworkTopo
|
|
234
|
-
}].filter(function (item) {
|
|
235
|
-
return item.visible !== false;
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
if (tabBodys.length === 1) {
|
|
239
|
-
return /*#__PURE__*/_react["default"].createElement(_ResourceOverview["default"], (0, _extends2["default"])({}, props, activeData, {
|
|
240
|
-
userId: userId,
|
|
241
|
-
style: {
|
|
242
|
-
overflowY: 'auto',
|
|
243
|
-
height: '100%'
|
|
244
|
-
}
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
249
|
-
className: _indexModule["default"].tabContainer
|
|
250
|
-
}, /*#__PURE__*/_react["default"].createElement(_FullheightTab["default"], {
|
|
251
|
-
className: _indexModule["default"].tab
|
|
252
|
-
}, tabBodys.map(function (item, key) {
|
|
253
|
-
return /*#__PURE__*/_react["default"].createElement(_FullheightTab["default"].Item, {
|
|
254
|
-
title: item.title,
|
|
255
|
-
key: item.title
|
|
256
|
-
}, item.content);
|
|
257
|
-
})));
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_drawer["default"], {
|
|
261
|
-
className: _indexModule["default"].baseInfo,
|
|
262
|
-
closeMode: ['close', 'esc'],
|
|
263
|
-
visible: visible,
|
|
264
|
-
title: /*#__PURE__*/_react["default"].createElement(_DrawerTitle["default"], (0, _extends2["default"])({}, activeData, {
|
|
265
|
-
topo: topo,
|
|
266
|
-
onChange: onChangeActive
|
|
267
|
-
})),
|
|
268
|
-
width: 580,
|
|
269
|
-
hasMask: false,
|
|
270
|
-
onClose: function onClose() {
|
|
271
|
-
return setVisible(false);
|
|
272
|
-
}
|
|
273
|
-
}, visible && resourceData && renderContent()));
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
ResourceDetail.propTypes = {
|
|
277
|
-
canShow: _propTypes["default"].func
|
|
278
|
-
};
|
|
279
|
-
ResourceDetail.defaultProps = {
|
|
280
|
-
canShow: function canShow(htElement) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
var _default = ResourceDetail;
|
|
285
|
-
exports["default"] = _default;
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
|
+
className: _indexModule["default"].tabContainer
|
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement(_FullheightTab["default"], {
|
|
68
|
+
className: _indexModule["default"].tab
|
|
69
|
+
}, tabBodys.map(function (item, key) {
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(_FullheightTab["default"].Item, {
|
|
71
|
+
title: item.title,
|
|
72
|
+
key: item.title
|
|
73
|
+
}, item.content);
|
|
74
|
+
})));
|
|
75
|
+
}
|