@riil-frontend/component-topology 11.0.29 → 11.0.30
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 +4 -2
- package/build/index.js +50 -35
- package/es/common/components/ColorPicker/ColorPicker.js +18 -9
- package/es/common/components/ResourceTable/ResourceTable.js +9 -6
- package/es/common/plugins/useSelectionPlugin.js +23 -14
- package/es/components/BatchAttrMetric/constant.js +2 -2
- package/es/components/BatchAttrMetric/index.js +17 -10
- package/es/components/BatchAttrMetric/setting.js +52 -30
- package/es/components/BatchAttrMetric/utils.js +4 -2
- package/es/components/BooleanRadio.js +7 -5
- package/es/components/ColorPanel/components/ColorBlock/index.js +4 -3
- package/es/components/ColorPanel/components/FontColorRange/index.js +13 -9
- package/es/components/ColorPanel/index.js +40 -18
- package/es/components/Drawer/Drawer.js +18 -14
- package/es/components/FormTable/index.js +18 -13
- package/es/components/FullheightTab/FullheightTab.js +2 -0
- package/es/components/LayoutDirectionSelect/LayoutDirectionSelect.js +3 -6
- package/es/components/LayoutSelect/LayoutSelect.js +3 -6
- package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +4 -4
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +20 -15
- package/es/components/MultiResourceDrawer/Content.js +22 -12
- package/es/components/MultiResourceDrawer/Dynamic.js +4 -2
- package/es/components/MultiResourceDrawer/ResourceCard/index.js +6 -4
- package/es/components/MultiResourceDrawer/ResourceSelect.js +4 -2
- package/es/components/MultiResourceDrawer/Static.js +4 -2
- package/es/components/MultiResourceDrawer/index.js +16 -8
- package/es/components/ResourceList/ResourceSelect.js +44 -27
- package/es/components/ResourceList/ResourceSelectConnect.js +7 -3
- package/es/components/ResourceSelect/ResourceSelectDrawer.js +11 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -14
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +8 -4
- package/es/components/SingleResourceDrawer/SelectDrawer.js +15 -6
- package/es/components/SingleResourceDrawer/SingleResourceDrawer.js +14 -7
- package/es/components/TagImageSelect/index.js +11 -8
- package/es/components/TagSelect/index.js +12 -8
- package/es/components/TemplateButton/Icon.js +7 -5
- package/es/components/TemplateButton/index.js +9 -6
- package/es/components/VerticalIconTab/VerticalIconTab.js +11 -7
- package/es/components/collapse/Collapse.js +8 -4
- package/es/components/collapse/Panel.js +17 -7
- package/es/constants/ResourceInfoDisplay.js +6 -6
- package/es/constants/ResourceTypeLimit.js +11 -20
- package/es/contextmenu/createMenuCommands.js +8 -7
- package/es/core/common/contextmenu/mergeContextmenu.js +2 -2
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +2 -0
- package/es/core/common/hooks/useHtElement.js +2 -1
- package/es/core/common/hooks/useHtElements.js +6 -5
- package/es/core/common/icons/icon.js +18 -17
- package/es/core/common/icons/useIcons.js +4 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +13 -4
- package/es/core/components/AlarmListPanel/hooks/useAlarmList.js +7 -2
- package/es/core/components/AlarmListPanel/index.js +4 -2
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +17 -11
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -13
- package/es/core/components/DisplaySettingDrawer/EdgeFlow.js +3 -1
- package/es/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +3 -1
- package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +25 -14
- package/es/core/components/DisplaySettingDrawer/LinkTag.js +3 -3
- package/es/core/components/DisplaySettingDrawer/NodeTag.js +1 -1
- package/es/core/components/DisplaySettingDrawer/NodeTip.js +1 -1
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +32 -25
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.js +7 -3
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +9 -6
- package/es/core/components/DisplaySettingDrawer/demo/Demo.js +3 -4
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +33 -10
- package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +5 -3
- package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +2 -0
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +12 -7
- package/es/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +25 -7
- package/es/core/components/TopoView/GraphViewPanel.js +15 -10
- package/es/core/components/TopoView/topoView.js +62 -38
- package/es/core/components/titlebar/TitleBar.js +12 -4
- package/es/core/components/titlebar/widgets/TitleWidget.js +4 -2
- package/es/core/createTopoApp.js +1 -1
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +53 -21
- package/es/core/editor/components/BackgroundView/index.js +65 -24
- package/es/core/editor/components/BottomFloatTool/HelpIcon.js +15 -8
- package/es/core/editor/components/CustomIconPlugin/CustomIconPlugin.js +2 -5
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +19 -7
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +67 -24
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialogWrapper.js +5 -3
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +8 -3
- package/es/core/editor/components/EditorPlugin.js +8 -4
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +12 -6
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/index.js +6 -6
- package/es/core/editor/components/Sidebar/Sidebar.js +17 -8
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +7 -5
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +30 -14
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +7 -7
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -2
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +2 -2
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +10 -7
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +10 -7
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +7 -7
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +12 -4
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +8 -7
- package/es/core/editor/components/Toolbar/EditorToolbar.js +7 -2
- package/es/core/editor/components/Toolbar/Toolbar.js +2 -0
- package/es/core/editor/components/Toolbar/buttons.js +15 -30
- package/es/core/editor/components/Toolbar/components/Tooltip.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +11 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +13 -7
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +42 -19
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundUtil.js +29 -9
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +7 -3
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +7 -3
- package/es/core/editor/components/Toolbar/widgets/Divider.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -6
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +27 -13
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +17 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +6 -5
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +27 -14
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -24
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +7 -4
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +10 -8
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +27 -16
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +6 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +8 -4
- package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +23 -9
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +23 -9
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +6 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +14 -10
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +12 -9
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +16 -12
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +7 -5
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +9 -6
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +46 -27
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +33 -20
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +18 -12
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +25 -16
- package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +5 -1
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +11 -6
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +9 -5
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +18 -9
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +10 -5
- package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +11 -5
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +9 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +6 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +15 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +10 -5
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +13 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +17 -7
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +6 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +22 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +7 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +32 -13
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +2 -0
- package/es/core/editor/components/plugins/AddElementThemePlugin.js +2 -0
- package/es/core/editor/components/plugins/CorePlugin.js +5 -3
- package/es/core/editor/components/plugins/SaveLoading.js +4 -2
- package/es/core/editor/components/settings/CloseablePanel.js +5 -3
- package/es/core/editor/components/settings/PropertyView.js +17 -7
- package/es/core/editor/components/settings/Settings.js +13 -7
- package/es/core/editor/components/settings/common/AddResourceButton.js +2 -0
- package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +14 -11
- package/es/core/editor/components/settings/common/AlignSetting/index.js +11 -5
- package/es/core/editor/components/settings/common/GroupNodeList/ResourceList.js +10 -2
- package/es/core/editor/components/settings/common/LayoutSettings.js +15 -12
- package/es/core/editor/components/settings/common/LineType/index.js +2 -0
- package/es/core/editor/components/settings/common/NameInput.js +3 -1
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +28 -9
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +20 -12
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +21 -10
- package/es/core/editor/components/settings/common/tab/TabView.js +2 -0
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -1
- package/es/core/editor/components/settings/common/text/TextStyle.js +7 -2
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +6 -2
- package/es/core/editor/components/settings/core/PropertyViewManager.js +19 -0
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +2 -0
- package/es/core/editor/components/settings/core/getPropertyViewType.js +4 -0
- package/es/core/editor/components/settings/core/updateElementProperty.js +1 -0
- package/es/core/editor/components/settings/propertyViews/PropertyViewFactory.js +1 -0
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +9 -3
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +8 -2
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +11 -3
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +13 -5
- package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +2 -0
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +10 -4
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +9 -3
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupAddResourceButton.js +4 -2
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +8 -7
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupRelateData/GroupRelateData.js +10 -4
- package/es/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +4 -4
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +12 -11
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +3 -3
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +3 -3
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +11 -7
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +19 -17
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +5 -3
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupIconSelect.js +4 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +15 -6
- package/es/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +6 -4
- package/es/core/editor/components/settings/propertyViews/index.js +2 -0
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +7 -3
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -7
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +6 -4
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +4 -2
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +2 -2
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +6 -4
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +6 -6
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +6 -6
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +16 -9
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +18 -16
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -2
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +35 -13
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +11 -7
- package/es/core/editor/components/settings/propertyViews/node/NodeIconSelect.js +6 -4
- package/es/core/editor/components/settings/propertyViews/node/NodeIconSelectTest.js +2 -2
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +9 -7
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +12 -7
- package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +11 -6
- package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +11 -3
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +14 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +23 -18
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +17 -8
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +29 -19
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +10 -7
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +5 -1
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +17 -5
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -5
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +3 -5
- package/es/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +11 -5
- package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +7 -6
- package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +7 -2
- package/es/core/editor/components/settings/propertyViews/view/ViewLineTypeSetting.js +3 -0
- package/es/core/editor/components/settings/propertyViews/view/ViewPropertyView.js +3 -3
- package/es/core/editor/components/settings/propertyViews/view/ViewPropertyViewV2.js +3 -3
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundConfig.js +4 -3
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +12 -4
- package/es/core/editor/components/settings/useSettingRuntimeState.js +6 -2
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +26 -12
- package/es/core/editor/components/titlebar/widgets/DebugTools.js +4 -1
- package/es/core/editor/config/themes.js +7 -8
- package/es/core/editor/contextmenu/buildContextmenu.js +1 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +10 -7
- package/es/core/editor/hooks/useLayerAddResource.js +6 -4
- package/es/core/editor/hooks/useNewElementTheme.js +14 -7
- package/es/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +3 -2
- package/es/core/editor/store/background.js +8 -4
- package/es/core/editor/store/historyManager.js +1 -0
- package/es/core/editor/store/topoEdit.js +4 -3
- package/es/core/editor/utils/edgeTypeStyleUtil.js +15 -9
- package/es/core/editor/utils/themeUtil.js +3 -0
- package/es/core/event/topoEventListener.js +2 -0
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +7 -3
- package/es/core/hooks/useAlarm.js +24 -12
- package/es/core/hooks/useCanvasTheme.js +10 -9
- package/es/core/hooks/useCanvasThemeConfig.js +4 -2
- package/es/core/hooks/useCiAttributeChange.js +10 -3
- package/es/core/hooks/useEventData.js +4 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +27 -11
- package/es/core/hooks/useGroupAddResource.js +5 -2
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +61 -33
- package/es/core/hooks/useResourceConfig.js +57 -22
- package/es/core/hooks/useRouterAdapter.js +4 -2
- package/es/core/hooks/useSelection.js +4 -1
- package/es/core/hooks/useTopoEdit.js +261 -112
- package/es/core/hooks/useTopoEventListener.js +1 -1
- package/es/core/hooks/useTopoFullscreen.js +8 -7
- package/es/core/models/Alarm.js +139 -50
- package/es/core/models/AttributeMetricDisplay.js +166 -89
- package/es/core/models/DataModel.js +37 -4
- package/es/core/models/EdgeGroup.js +7 -2
- package/es/core/models/GraphDataModel.js +7 -0
- package/es/core/models/HistoryManager.js +52 -21
- package/es/core/models/PluginManager.js +9 -0
- package/es/core/models/SelectionModel.js +36 -11
- package/es/core/models/TopoApp.js +178 -74
- package/es/core/models/TopoGraphView.js +30 -8
- package/es/core/models/TopoViewer.js +5 -1
- package/es/core/models/attributeFormatter/formatter/ciTypeAttrTransform.js +3 -2
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +8 -6
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +5 -2
- package/es/core/models/attributeFormatter/index.js +8 -1
- package/es/core/models/cache/CiCache.js +17 -4
- package/es/core/models/cache/CiTypeCache.js +35 -8
- package/es/core/models/cache/DictCache.js +19 -4
- package/es/core/models/common/ContextMenu.js +9 -0
- package/es/core/models/graph/Background.js +16 -3
- package/es/core/models/plugins/index.js +1 -3
- package/es/core/models/plugins/resourceWebControllUrl.js +39 -9
- package/es/core/models/tagstips/ElementTagTipConfig.js +55 -16
- package/es/core/models/tagstips/utils.js +4 -4
- package/es/core/models/topoData.js +24 -8
- package/es/core/models/topoFactory.js +6 -0
- package/es/core/models/utils/linkUtils.js +35 -24
- package/es/core/models/utils/nodeNameVisibleUtil.js +25 -16
- package/es/core/services/alarm.js +5 -3
- package/es/core/services/background.js +24 -9
- package/es/core/services/cmdb/metric.js +5 -3
- package/es/core/services/cmdb.js +6 -3
- package/es/core/services/index.js +18 -7
- package/es/core/services/overview.js +58 -25
- package/es/core/services/topo/basic.js +5 -3
- package/es/core/services/topo/tagtip.js +6 -3
- package/es/core/store/coreModels.js +2 -4
- package/es/core/store/createStore.js +3 -0
- package/es/core/store/models/ciModel.js +16 -5
- package/es/core/store/models/customIcon.js +55 -19
- package/es/core/store/models/displayConfig.js +11 -5
- package/es/core/store/models/selection.js +5 -4
- package/es/core/store/models/topoAlarm.js +42 -10
- package/es/core/store/models/topoBaseInfoOverview.js +5 -4
- package/es/core/store/models/topoBizMod.js +14 -5
- package/es/core/store/models/topoConfig.js +85 -39
- package/es/core/store/models/topoGraphView.js +7 -5
- package/es/core/store/models/topoMod.js +111 -38
- package/es/core/store/models/viewer/lock.js +1 -0
- package/es/core/store/models/viewer/resourceDetail.js +5 -2
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -0
- package/es/core/test/Test.js +13 -10
- package/es/core/upgrade/v140UpgradeSerializeNodeImageSize.js +5 -0
- package/es/core/utils/backgroundUtil.js +7 -5
- package/es/core/utils/edgeUtil.js +11 -4
- package/es/core/utils/graphLinkUtil.js +8 -5
- package/es/core/utils/imageUtil.js +9 -3
- package/es/core/utils/metricUtil.js +1 -1
- package/es/core/utils/resourceUtil.js +3 -3
- package/es/core/utils/saveSerialize.js +6 -3
- package/es/core/utils/showGraphManageStatusUtil.js +18 -14
- package/es/core/utils/showMessage.js +2 -0
- package/es/core/viewer/components/plugins/ElementDetailDrawer/components/DetailDrawer.js +2 -0
- package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +59 -32
- package/es/core/viewer/components/plugins/ResourceDetail/DefaultDetailContent.js +14 -8
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +11 -6
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +12 -9
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +7 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +22 -10
- package/es/core/viewer/components/plugins/ResourceDetail/components/DrawerTitle.js +16 -7
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +23 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +10 -10
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BlockBox.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -10
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/NetworkBaseInfo.js +27 -19
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +200 -90
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +29 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/SingleResourceStrategyLink.js +6 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +70 -33
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +27 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +4 -8
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +18 -14
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +62 -23
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +37 -24
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +43 -22
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/useCiAttrAndMetricData.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleContainer.js +4 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +15 -8
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +24 -10
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +12 -5
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +16 -7
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -6
- package/es/core/viewer/components/plugins/ViewerPlugin.js +1 -1
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -3
- package/es/core/viewer/components/titlebar/TopoViewerTitleBar.js +4 -4
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +6 -2
- package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +16 -14
- package/es/core/viewer/components/titlebar/widgets/EditButton.js +8 -4
- package/es/core/viewer/components/titlebar/widgets/MoreButtonMenu.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +18 -14
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +5 -1
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +17 -9
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +10 -7
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +5 -5
- package/es/core/viewer/contextmenu/buildLinkContextmenu.js +1 -2
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +2 -8
- package/es/createTopo.js +1 -2
- package/es/mock/mock.js +4 -6
- package/es/networkTopo/components/Link/form.js +41 -25
- package/es/networkTopo/components/Link/hook.js +86 -48
- package/es/networkTopo/components/Link/index.js +63 -33
- package/es/networkTopo/components/Link/setting.js +65 -45
- package/es/networkTopo/components/TopoView.js +20 -14
- package/es/networkTopo/getTopoData.js +37 -21
- package/es/networkTopo/hooks/useEdgeExpand.js +3 -2
- package/es/networkTopo/hooks/useGroupResources.js +4 -2
- package/es/networkTopo/hooks/useLinkDynamicStyle.js +4 -2
- package/es/networkTopo/hooks/viewer/useEdgeFlow.js +7 -6
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +23 -8
- package/es/networkTopo/models/EdgeGroupTagTipBuilder.js +10 -2
- package/es/networkTopo/models/ExtElementTagTipBuilder.js +5 -0
- package/es/networkTopo/models/IpNodeTagsTipsBuilder.js +11 -2
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +49 -28
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +51 -41
- package/es/networkTopo/models/TopoCenter.js +26 -8
- package/es/networkTopo/services/alert.js +10 -5
- package/es/networkTopo/services/authorization.js +25 -11
- package/es/networkTopo/services/cmdb.js +165 -80
- package/es/networkTopo/services/funcAuth.js +5 -3
- package/es/networkTopo/services/link.js +34 -11
- package/es/networkTopo/services/mdc.js +17 -10
- package/es/networkTopo/services/metric.js +12 -6
- package/es/networkTopo/services/model.js +223 -92
- package/es/networkTopo/services/risk.js +5 -3
- package/es/networkTopo/services/topo/auth.js +13 -7
- package/es/networkTopo/services/topo/basic.js +137 -57
- package/es/networkTopo/services/topo/blacklist.js +11 -5
- package/es/networkTopo/services/topo/ciInfo.js +13 -5
- package/es/networkTopo/services/topo/icon.js +24 -11
- package/es/networkTopo/services/topo/networkLink.js +11 -5
- package/es/networkTopo/services/topo/relation.js +5 -3
- package/es/networkTopo/services/topo/resourceWebUrl.js +17 -7
- package/es/networkTopo/store/functionAuth.js +16 -7
- package/es/networkTopo/store/topoCenter.js +53 -18
- package/es/networkTopo/store/topoLinkMod.js +4 -3
- package/es/networkTopo/store/topoTreeMod.js +71 -19
- package/es/networkTopo/utils/SortResourcesUtil.js +3 -1
- package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +7 -4
- package/es/networkTopo/utils/edgeGroupTagUtil.js +15 -8
- package/es/networkTopo/utils/exitLinkUtil.js +54 -38
- package/es/networkTopo/utils/exportData.js +16 -10
- package/es/networkTopo/utils/linPermissionUtil.js +2 -4
- package/es/networkTopo/utils/resourcePermissionUtil.js +6 -4
- package/es/networkTopo/utils/storage.js +3 -2
- package/es/networkTopo/viewer/components/TopologyViewer.js +4 -3
- package/es/networkTopo/viewer/index.js +1 -2
- package/es/utils/ResourceConfigUtil.js +23 -18
- package/es/utils/SpecialCharacterValidateUtil.js +1 -0
- package/es/utils/ciType.js +5 -1
- package/es/utils/clusterUtil.js +20 -15
- package/es/utils/format.js +26 -12
- package/es/utils/htElementUtils.js +51 -25
- package/es/utils/template.js +7 -6
- package/es/utils/topoData.js +64 -52
- package/es/utils/topoMocks.js +4 -3
- package/es/utils/tree.js +33 -14
- package/es/utils/treeUtil.js +1 -0
- package/lib/common/components/ColorPicker/ColorPicker.js +30 -9
- package/lib/common/components/ColorPicker/index.js +3 -0
- package/lib/common/components/ResourceTable/ResourceTable.js +18 -6
- package/lib/common/plugins/useSelectionPlugin.js +24 -13
- package/lib/components/BatchAttrMetric/SelectTable.js +3 -0
- package/lib/components/BatchAttrMetric/constant.js +2 -2
- package/lib/components/BatchAttrMetric/index.js +27 -9
- package/lib/components/BatchAttrMetric/setting.js +72 -30
- package/lib/components/BatchAttrMetric/utils.js +9 -1
- package/lib/components/BooleanRadio.js +15 -5
- package/lib/components/ColorPanel/components/ColorBlock/index.js +8 -2
- package/lib/components/ColorPanel/components/FontColorRange/index.js +19 -9
- package/lib/components/ColorPanel/index.js +50 -17
- package/lib/components/Drawer/Drawer.js +25 -14
- package/lib/components/Drawer/index.js +3 -0
- package/lib/components/FormTable/index.js +32 -13
- package/lib/components/FullheightTab/FullheightTab.js +7 -0
- package/lib/components/FullheightTab/index.js +3 -0
- package/lib/components/LayoutDirectionSelect/Item.js +9 -0
- package/lib/components/LayoutDirectionSelect/LayoutDirectionSelect.js +13 -5
- package/lib/components/LayoutDirectionSelect/index.js +3 -0
- package/lib/components/LayoutSelect/LayoutSelect.js +12 -5
- package/lib/components/LayoutSelect/index.js +3 -0
- package/lib/components/Link.js +7 -0
- package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +11 -4
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +27 -15
- package/lib/components/ModelAttrSelectDrawer/index.js +3 -0
- package/lib/components/MultiResourceDrawer/Content.js +31 -11
- package/lib/components/MultiResourceDrawer/Dynamic.js +10 -2
- package/lib/components/MultiResourceDrawer/ResourceCard/index.js +11 -4
- package/lib/components/MultiResourceDrawer/ResourceSelect.js +10 -2
- package/lib/components/MultiResourceDrawer/Static.js +10 -2
- package/lib/components/MultiResourceDrawer/index.js +23 -8
- package/lib/components/NetworkTopoResourceSelectDrawer/NetworkTopoResourceSelectDrawer.js +6 -0
- package/lib/components/NetworkTopoResourceSelectDrawer/index.js +3 -0
- package/lib/components/ResourceList/ResourceSelect.js +64 -27
- package/lib/components/ResourceList/ResourceSelectConnect.js +17 -3
- package/lib/components/ResourceList/index.js +3 -0
- package/lib/components/ResourceSelect/ResourceSelectDrawer.js +21 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +39 -13
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +15 -4
- package/lib/components/ResourceSelectDrawer/index.js +3 -0
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +23 -6
- package/lib/components/SingleResourceDrawer/SingleResourceDrawer.js +22 -6
- package/lib/components/SingleResourceDrawer/index.js +3 -0
- package/lib/components/TagImageSelect/index.js +18 -8
- package/lib/components/TagSelect/index.js +22 -8
- package/lib/components/TemplateButton/Icon.js +10 -5
- package/lib/components/TemplateButton/assets/index.js +5 -0
- package/lib/components/TemplateButton/index.js +16 -6
- package/lib/components/VerticalIconTab/VerticalIconTab.js +23 -6
- package/lib/components/VerticalIconTab/index.js +3 -0
- package/lib/components/collapse/Collapse.js +16 -4
- package/lib/components/collapse/Panel.js +33 -7
- package/lib/components/collapse/index.js +3 -0
- package/lib/constants/ResourceInfoDisplay.js +6 -6
- package/lib/constants/ResourceTypeLimit.js +20 -20
- package/lib/contextmenu/createMenuCommands.js +11 -6
- package/lib/core/common/contextmenu/mergeContextmenu.js +6 -2
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +5 -0
- package/lib/core/common/hooks/useHtElement.js +4 -1
- package/lib/core/common/hooks/useHtElements.js +8 -5
- package/lib/core/common/icons/icon.js +36 -16
- package/lib/core/common/icons/useIcons.js +10 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +22 -4
- package/lib/core/components/AlarmListPanel/constants/uicbb.js +1 -0
- package/lib/core/components/AlarmListPanel/hooks/useAlarmList.js +9 -2
- package/lib/core/components/AlarmListPanel/index.js +18 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +34 -10
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +38 -13
- package/lib/core/components/DisplaySettingDrawer/EdgeFlow.js +8 -1
- package/lib/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +8 -1
- package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +38 -14
- package/lib/core/components/DisplaySettingDrawer/LinkTag.js +10 -1
- package/lib/core/components/DisplaySettingDrawer/NodeTag.js +10 -1
- package/lib/core/components/DisplaySettingDrawer/NodeTip.js +10 -1
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +46 -24
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.js +14 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +21 -5
- package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +6 -4
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +39 -10
- package/lib/core/components/DisplaySettingDrawer/index.js +3 -0
- package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +11 -3
- package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +5 -0
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +22 -6
- package/lib/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +27 -6
- package/lib/core/components/TopoAppProvider.js +5 -0
- package/lib/core/components/TopoView/GraphViewPanel.js +24 -10
- package/lib/core/components/TopoView/index.js +3 -0
- package/lib/core/components/TopoView/topoView.js +97 -35
- package/lib/core/components/buildProvider.js +5 -0
- package/lib/core/components/titlebar/TitleBar.js +21 -4
- package/lib/core/components/titlebar/index.js +17 -0
- package/lib/core/components/titlebar/widgets/TitleWidget.js +9 -2
- package/lib/core/createTopoApp.js +5 -0
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +69 -21
- package/lib/core/editor/components/BackgroundView/index.js +87 -24
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +25 -8
- package/lib/core/editor/components/CustomIconPlugin/CustomIconPlugin.js +10 -5
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +35 -7
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +87 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialogWrapper.js +11 -3
- package/lib/core/editor/components/CustomIconPlugin/index.js +3 -0
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +13 -3
- package/lib/core/editor/components/EditorPlugin.js +23 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +19 -6
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/index.js +11 -5
- package/lib/core/editor/components/Sidebar/Sidebar.js +26 -8
- package/lib/core/editor/components/Sidebar/panes.js +7 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +4 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +3 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +15 -5
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +38 -14
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +3 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +12 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +8 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +9 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +17 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +17 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +12 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +3 -0
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +13 -6
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +17 -2
- package/lib/core/editor/components/Toolbar/Toolbar.js +5 -0
- package/lib/core/editor/components/Toolbar/buttons.js +35 -30
- package/lib/core/editor/components/Toolbar/components/Tooltip.js +8 -2
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +21 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +21 -7
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +52 -19
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundUtil.js +37 -9
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +3 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -3
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -3
- package/lib/core/editor/components/Toolbar/widgets/Divider.js +5 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +12 -6
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +36 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +3 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +28 -10
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +16 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +3 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +37 -13
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +57 -24
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +15 -4
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +18 -8
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +39 -16
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +10 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +10 -3
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +32 -9
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +31 -9
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +12 -2
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +23 -10
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +19 -9
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +26 -13
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +10 -5
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +6 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +16 -6
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +55 -28
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +44 -20
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +10 -2
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +26 -12
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +3 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +4 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +33 -13
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +3 -0
- package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +12 -1
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +20 -6
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +11 -2
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +11 -1
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +17 -5
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +16 -5
- package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +8 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +17 -5
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +14 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +14 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +24 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +24 -5
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +21 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +26 -7
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +14 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +30 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +14 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +36 -13
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +7 -0
- package/lib/core/editor/components/plugins/AddElementThemePlugin.js +5 -0
- package/lib/core/editor/components/plugins/CorePlugin.js +9 -3
- package/lib/core/editor/components/plugins/SaveLoading.js +11 -2
- package/lib/core/editor/components/settings/CloseablePanel.js +12 -3
- package/lib/core/editor/components/settings/PropertyView.js +27 -7
- package/lib/core/editor/components/settings/Settings.js +20 -7
- package/lib/core/editor/components/settings/common/AddResourceButton.js +7 -0
- package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +25 -11
- package/lib/core/editor/components/settings/common/AlignSetting/index.js +18 -5
- package/lib/core/editor/components/settings/common/GroupNodeList/ResourceList.js +18 -2
- package/lib/core/editor/components/settings/common/LayoutSettings.js +24 -12
- package/lib/core/editor/components/settings/common/LineType/index.js +7 -0
- package/lib/core/editor/components/settings/common/NameInput.js +11 -1
- package/lib/core/editor/components/settings/common/NodeAlignType.js +8 -0
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +42 -9
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -12
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +29 -10
- package/lib/core/editor/components/settings/common/SizeInput/index.js +3 -0
- package/lib/core/editor/components/settings/common/tab/TabView.js +6 -0
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +18 -1
- package/lib/core/editor/components/settings/common/text/TextStyle.js +19 -2
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +8 -2
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +23 -0
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +5 -0
- package/lib/core/editor/components/settings/core/getPropertyViewType.js +5 -0
- package/lib/core/editor/components/settings/core/updateElementProperty.js +3 -0
- package/lib/core/editor/components/settings/propertyViews/PropertyViewFactory.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +20 -3
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +19 -2
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +19 -3
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +29 -5
- package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -0
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +16 -4
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +19 -3
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupAddResourceButton.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +14 -7
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupRelateData/GroupRelateData.js +20 -4
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +10 -4
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +17 -11
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +11 -3
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +13 -3
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +27 -7
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +29 -15
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -3
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupIconSelect.js +11 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +31 -6
- package/lib/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +19 -4
- package/lib/core/editor/components/settings/propertyViews/group/hooks/useGroup.js +4 -0
- package/lib/core/editor/components/settings/propertyViews/index.js +10 -0
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +18 -3
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +20 -7
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +13 -4
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +8 -2
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +9 -1
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +14 -4
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +13 -6
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +14 -6
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +31 -7
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +35 -16
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +7 -2
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +44 -13
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +7 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +25 -7
- package/lib/core/editor/components/settings/propertyViews/node/NodeIconSelect.js +11 -3
- package/lib/core/editor/components/settings/propertyViews/node/NodeIconSelectTest.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +17 -8
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +22 -7
- package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +19 -6
- package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +19 -3
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +26 -6
- package/lib/core/editor/components/settings/propertyViews/node/Setting/index.js +3 -0
- package/lib/core/editor/components/settings/propertyViews/node/TopoTreeSelect.js +8 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +32 -18
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +25 -7
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +47 -19
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +19 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +7 -1
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +29 -5
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -5
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -3
- package/lib/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +15 -4
- package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +12 -5
- package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +17 -2
- package/lib/core/editor/components/settings/propertyViews/view/ViewLineTypeSetting.js +8 -0
- package/lib/core/editor/components/settings/propertyViews/view/ViewPropertyView.js +19 -3
- package/lib/core/editor/components/settings/propertyViews/view/ViewPropertyViewV2.js +11 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundConfig.js +6 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +19 -4
- package/lib/core/editor/components/settings/useSettingRuntimeState.js +10 -2
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +42 -12
- package/lib/core/editor/components/titlebar/widgets/DebugTools.js +8 -1
- package/lib/core/editor/components/titlebar/widgets/SaveButton.js +5 -0
- package/lib/core/editor/config/themes.js +10 -8
- package/lib/core/editor/contextmenu/buildContextmenu.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +14 -7
- package/lib/core/editor/hooks/useLayerAddResource.js +8 -4
- package/lib/core/editor/hooks/useNewElementTheme.js +20 -7
- package/lib/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +6 -1
- package/lib/core/editor/store/background.js +16 -6
- package/lib/core/editor/store/historyManager.js +6 -1
- package/lib/core/editor/store/topoEdit.js +13 -5
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +22 -9
- package/lib/core/editor/utils/themeUtil.js +6 -0
- package/lib/core/event/topoEventListener.js +3 -0
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +11 -3
- package/lib/core/hooks/useAlarm.js +33 -11
- package/lib/core/hooks/useCanvasTheme.js +16 -9
- package/lib/core/hooks/useCanvasThemeConfig.js +8 -2
- package/lib/core/hooks/useCiAttributeChange.js +14 -3
- package/lib/core/hooks/useEventData.js +7 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +34 -11
- package/lib/core/hooks/useGroupAddResource.js +7 -2
- package/lib/core/hooks/useManageStatus.js +6 -1
- package/lib/core/hooks/usePolling.js +74 -32
- package/lib/core/hooks/useResourceConfig.js +66 -22
- package/lib/core/hooks/useRouterAdapter.js +6 -1
- package/lib/core/hooks/useSelection.js +5 -1
- package/lib/core/hooks/useTopoEdit.js +301 -112
- package/lib/core/hooks/useTopoEventListener.js +4 -1
- package/lib/core/hooks/useTopoFullscreen.js +12 -7
- package/lib/core/index.js +2 -0
- package/lib/core/models/Alarm.js +159 -49
- package/lib/core/models/AttributeMetricDisplay.js +173 -89
- package/lib/core/models/DataModel.js +39 -4
- package/lib/core/models/EdgeGroup.js +8 -2
- package/lib/core/models/GraphDataModel.js +8 -0
- package/lib/core/models/HistoryManager.js +64 -21
- package/lib/core/models/PluginManager.js +11 -0
- package/lib/core/models/SelectionModel.js +44 -11
- package/lib/core/models/TopoApp.js +204 -72
- package/lib/core/models/TopoGraphView.js +35 -7
- package/lib/core/models/TopoViewer.js +7 -0
- package/lib/core/models/attributeFormatter/formatter/attributeTransform.js +3 -0
- package/lib/core/models/attributeFormatter/formatter/ciTypeAttrTransform.js +4 -2
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +10 -6
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +8 -2
- package/lib/core/models/attributeFormatter/formatter/metricTransform.js +3 -0
- package/lib/core/models/attributeFormatter/index.js +14 -0
- package/lib/core/models/cache/CiCache.js +22 -3
- package/lib/core/models/cache/CiTypeCache.js +43 -7
- package/lib/core/models/cache/DictCache.js +29 -3
- package/lib/core/models/common/ContextMenu.js +10 -0
- package/lib/core/models/graph/Background.js +19 -3
- package/lib/core/models/plugins/index.js +1 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +47 -9
- package/lib/core/models/tagstips/ElementTagTipConfig.js +64 -15
- package/lib/core/models/tagstips/utils.js +9 -3
- package/lib/core/models/topoData.js +36 -8
- package/lib/core/models/topoFactory.js +6 -0
- package/lib/core/models/utils/getRelationDetailByIds.js +1 -0
- package/lib/core/models/utils/linkUtils.js +48 -19
- package/lib/core/models/utils/nodeNameVisibleUtil.js +30 -15
- package/lib/core/services/alarm.js +14 -3
- package/lib/core/services/background.js +29 -9
- package/lib/core/services/cmdb/metric.js +10 -3
- package/lib/core/services/cmdb.js +12 -3
- package/lib/core/services/index.js +24 -7
- package/lib/core/services/overview.js +63 -23
- package/lib/core/services/topo/basic.js +11 -3
- package/lib/core/services/topo/index.js +6 -0
- package/lib/core/services/topo/tagtip.js +11 -3
- package/lib/core/store/coreModels.js +16 -0
- package/lib/core/store/createStore.js +7 -0
- package/lib/core/store/models/ciModel.js +23 -5
- package/lib/core/store/models/customIcon.js +72 -21
- package/lib/core/store/models/displayConfig.js +21 -7
- package/lib/core/store/models/selection.js +13 -6
- package/lib/core/store/models/topoAlarm.js +52 -12
- package/lib/core/store/models/topoBaseInfoOverview.js +14 -6
- package/lib/core/store/models/topoBizMod.js +22 -5
- package/lib/core/store/models/topoConfig.js +109 -41
- package/lib/core/store/models/topoGraphView.js +16 -7
- package/lib/core/store/models/topoMod.js +131 -36
- package/lib/core/store/models/viewer/lock.js +4 -0
- package/lib/core/store/models/viewer/resourceDetail.js +8 -2
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +5 -0
- package/lib/core/test/Test.js +14 -10
- package/lib/core/upgrade/v140UpgradeSerializeNodeImageSize.js +6 -0
- package/lib/core/utils/backgroundUtil.js +9 -5
- package/lib/core/utils/edgeUtil.js +17 -3
- package/lib/core/utils/graphLinkUtil.js +9 -4
- package/lib/core/utils/imageUtil.js +12 -3
- package/lib/core/utils/linkUtil.js +1 -0
- package/lib/core/utils/manageStatusUtil.js +1 -0
- package/lib/core/utils/metricUtil.js +4 -0
- package/lib/core/utils/resourceUtil.js +4 -2
- package/lib/core/utils/saveSerialize.js +9 -3
- package/lib/core/utils/showGraphManageStatusUtil.js +23 -14
- package/lib/core/utils/showMessage.js +9 -0
- package/lib/core/viewer/components/plugins/ElementDetailDrawer/components/DetailDrawer.js +7 -0
- package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +64 -32
- package/lib/core/viewer/components/plugins/MetricPollingPlugin.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/DefaultDetailContent.js +23 -8
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +20 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +21 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +11 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +36 -10
- package/lib/core/viewer/components/plugins/ResourceDetail/components/DrawerTitle.js +24 -7
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +24 -15
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +17 -10
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BlockBox.js +7 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +29 -10
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/NetworkBaseInfo.js +36 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +229 -88
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +40 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/SingleResourceStrategyLink.js +8 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +87 -32
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +12 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +38 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +4 -8
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +31 -12
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +83 -19
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +44 -23
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +49 -21
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.js +3 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/useCiAttrAndMetricData.js +5 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleContainer.js +8 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +27 -8
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -10
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +17 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +23 -7
- package/lib/core/viewer/components/plugins/ResourceDetail/index.js +3 -0
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +33 -6
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +9 -1
- package/lib/core/viewer/components/titlebar/BasicTools.js +12 -3
- package/lib/core/viewer/components/titlebar/TopoViewerTitleBar.js +14 -4
- package/lib/core/viewer/components/titlebar/ViewerTools.js +5 -0
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +11 -2
- package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +28 -15
- package/lib/core/viewer/components/titlebar/widgets/EditButton.js +14 -3
- package/lib/core/viewer/components/titlebar/widgets/MoreButtonMenu.js +10 -1
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +26 -13
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +10 -1
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +25 -9
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +18 -6
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +9 -4
- package/lib/core/viewer/contextmenu/buildContextmenu.js +5 -0
- package/lib/core/viewer/contextmenu/buildLinkContextmenu.js +2 -2
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +3 -8
- package/lib/core/viewer/contextmenu/buildViewContextmenu.js +1 -0
- package/lib/createTopo.js +8 -2
- package/lib/index.js +19 -0
- package/lib/mock/mock.js +4 -5
- package/lib/networkTopo/components/Link/form.js +57 -25
- package/lib/networkTopo/components/Link/hook.js +100 -48
- package/lib/networkTopo/components/Link/index.js +77 -32
- package/lib/networkTopo/components/Link/setting.js +86 -45
- package/lib/networkTopo/components/Topo404.js +9 -0
- package/lib/networkTopo/components/TopoNoPermission.js +9 -0
- package/lib/networkTopo/components/TopoView.js +37 -13
- package/lib/networkTopo/createTopo.js +6 -0
- package/lib/networkTopo/getTopoData.js +43 -16
- package/lib/networkTopo/hooks/useEdgeExpand.js +6 -1
- package/lib/networkTopo/hooks/useGroupResources.js +5 -2
- package/lib/networkTopo/hooks/useLinkDynamicStyle.js +7 -1
- package/lib/networkTopo/hooks/viewer/useEdgeFlow.js +8 -5
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -7
- package/lib/networkTopo/index.js +7 -0
- package/lib/networkTopo/models/EdgeGroupTagTipBuilder.js +12 -2
- package/lib/networkTopo/models/ExtElementTagTipBuilder.js +8 -0
- package/lib/networkTopo/models/IpNodeTagsTipsBuilder.js +15 -2
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +54 -26
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +55 -40
- package/lib/networkTopo/models/TopoCenter.js +39 -8
- package/lib/networkTopo/services/alert.js +15 -5
- package/lib/networkTopo/services/authorization.js +35 -16
- package/lib/networkTopo/services/cmdb.js +211 -72
- package/lib/networkTopo/services/funcAuth.js +10 -3
- package/lib/networkTopo/services/index.js +7 -0
- package/lib/networkTopo/services/link.js +47 -11
- package/lib/networkTopo/services/mdc.js +26 -9
- package/lib/networkTopo/services/metric.js +20 -6
- package/lib/networkTopo/services/model.js +291 -89
- package/lib/networkTopo/services/risk.js +10 -3
- package/lib/networkTopo/services/topo/auth.js +19 -7
- package/lib/networkTopo/services/topo/basic.js +154 -57
- package/lib/networkTopo/services/topo/blacklist.js +17 -5
- package/lib/networkTopo/services/topo/ciInfo.js +20 -5
- package/lib/networkTopo/services/topo/icon.js +30 -11
- package/lib/networkTopo/services/topo/index.js +15 -0
- package/lib/networkTopo/services/topo/networkLink.js +17 -5
- package/lib/networkTopo/services/topo/relation.js +11 -3
- package/lib/networkTopo/services/topo/resourceWebUrl.js +25 -9
- package/lib/networkTopo/store/functionAuth.js +24 -9
- package/lib/networkTopo/store/index.js +6 -0
- package/lib/networkTopo/store/topoCenter.js +63 -22
- package/lib/networkTopo/store/topoLinkMod.js +12 -5
- package/lib/networkTopo/store/topoTreeMod.js +83 -19
- package/lib/networkTopo/utils/SortResourcesUtil.js +4 -1
- package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +7 -4
- package/lib/networkTopo/utils/edgeGroupTagUtil.js +19 -7
- package/lib/networkTopo/utils/exitLinkUtil.js +58 -38
- package/lib/networkTopo/utils/exportData.js +25 -10
- package/lib/networkTopo/utils/linPermissionUtil.js +3 -3
- package/lib/networkTopo/utils/linkUtil.js +2 -0
- package/lib/networkTopo/utils/resourcePermissionUtil.js +14 -4
- package/lib/networkTopo/utils/storage.js +5 -3
- package/lib/networkTopo/viewer/components/TitleBar.js +6 -0
- package/lib/networkTopo/viewer/components/TopologyViewer.js +12 -3
- package/lib/networkTopo/viewer/createTopoViewer.js +5 -0
- package/lib/networkTopo/viewer/index.js +9 -0
- package/lib/utils/ResourceConfigUtil.js +31 -17
- package/lib/utils/SpecialCharacterValidateUtil.js +2 -0
- package/lib/utils/ciType.js +7 -1
- package/lib/utils/clusterUtil.js +35 -15
- package/lib/utils/copyUtil.js +2 -0
- package/lib/utils/format.js +38 -12
- package/lib/utils/htElementDataUtil.js +12 -0
- package/lib/utils/htElementUtils.js +87 -26
- package/lib/utils/listToTree.js +3 -0
- package/lib/utils/resourceElementUtil.js +2 -0
- package/lib/utils/template.js +7 -6
- package/lib/utils/topoData.js +97 -51
- package/lib/utils/topoMocks.js +4 -3
- package/lib/utils/topoPermissionUtil.js +1 -0
- package/lib/utils/tree.js +46 -14
- package/lib/utils/treeUtil.js +3 -0
- package/package.json +3 -3
@@ -1,38 +1,61 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
exports.__esModule = true;
|
5
6
|
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
6
10
|
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
11
|
+
|
7
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
+
|
8
14
|
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
15
|
+
|
9
16
|
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
|
17
|
+
|
10
18
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
19
|
+
|
11
20
|
var _react = _interopRequireWildcard(require("react"));
|
21
|
+
|
12
22
|
var _lodash = _interopRequireDefault(require("lodash"));
|
23
|
+
|
13
24
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
25
|
+
|
14
26
|
var _componentTopologyGraph = require("@riil-frontend/component-topology-graph");
|
27
|
+
|
15
28
|
var _template = require("../../utils/template");
|
29
|
+
|
16
30
|
var _htElementUtils = require("../../utils/htElementUtils");
|
31
|
+
|
17
32
|
var _useResourceConfig = _interopRequireDefault(require("./useResourceConfig"));
|
33
|
+
|
18
34
|
var _useGroupAddResource = _interopRequireDefault(require("./useGroupAddResource"));
|
35
|
+
|
19
36
|
var _topoData = require("../../utils/topoData");
|
37
|
+
|
20
38
|
var _htElementDataUtil = require("../../utils/htElementDataUtil");
|
39
|
+
|
21
40
|
var _clusterUtil = require("../../utils/clusterUtil");
|
41
|
+
|
22
42
|
var _linkUtils = require("../models/utils/linkUtils");
|
43
|
+
|
23
44
|
var _exitLinkUtil = require("../../networkTopo/utils/exitLinkUtil");
|
45
|
+
|
24
46
|
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); }
|
47
|
+
|
25
48
|
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; }
|
26
|
-
|
49
|
+
|
27
50
|
var useTopoEdit = function useTopoEdit(params) {
|
28
51
|
var topo = params.topo,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
52
|
+
topoId = params.topoId,
|
53
|
+
isEditing = params.isEditing,
|
54
|
+
onSave = params.onSave,
|
55
|
+
onLineDelete = params.onLineDelete,
|
56
|
+
onNodeDelete = params.onNodeDelete,
|
57
|
+
topoShowType = params.topoShowType,
|
58
|
+
isLayerTopo = params.isLayerTopo;
|
36
59
|
var store = topo.store;
|
37
60
|
var emitEvent = (0, _react.useCallback)(function (eventType, eventData) {
|
38
61
|
topo.view.topoClient.emitEvent(eventType, eventData);
|
@@ -46,114 +69,138 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
46
69
|
resourceConfig: resourceConfig
|
47
70
|
});
|
48
71
|
var topoEditDispatchers = store.useModelDispatchers("topoEdit");
|
72
|
+
|
49
73
|
var _store$useModel = store.useModel("topoConfig"),
|
50
|
-
|
51
|
-
|
74
|
+
editState = _store$useModel[0],
|
75
|
+
editDispatchers = _store$useModel[1];
|
76
|
+
|
52
77
|
var topoDispatchers = store.useModelDispatchers("topoMod");
|
78
|
+
|
53
79
|
var _useState = (0, _react.useState)(false),
|
54
|
-
|
55
|
-
|
80
|
+
showComboResDrawer = _useState[0],
|
81
|
+
setShowComboResDrawer = _useState[1];
|
82
|
+
|
56
83
|
var _useState2 = (0, _react.useState)(null),
|
57
|
-
|
58
|
-
|
84
|
+
comboResData = _useState2[0],
|
85
|
+
setComboResData = _useState2[1];
|
86
|
+
|
59
87
|
var reset = function reset() {
|
60
88
|
var _topo$historyManager;
|
89
|
+
|
61
90
|
topoEditDispatchers.reset();
|
62
91
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
|
63
92
|
};
|
64
|
-
|
65
93
|
/**
|
66
94
|
* 增加资源到视图
|
67
95
|
*/
|
96
|
+
|
97
|
+
|
68
98
|
var showGlobalAddResourceDrawer = function showGlobalAddResourceDrawer() {
|
69
99
|
_rlog["default"].debug("showGlobalAddResourceDrawer", resourceConfig.getViewResources());
|
100
|
+
|
70
101
|
setComboResData(resourceConfig.getViewResources());
|
71
102
|
setShowComboResDrawer(true);
|
72
103
|
};
|
104
|
+
|
73
105
|
var onLayerAdded = /*#__PURE__*/function () {
|
74
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
106
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
|
75
107
|
var target, direction, config;
|
76
|
-
return
|
108
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
77
109
|
while (1) switch (_context.prev = _context.next) {
|
78
110
|
case 0:
|
79
111
|
target = _ref.target, direction = _ref.direction;
|
80
|
-
topo.historyManager.beginTransaction();
|
112
|
+
topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
|
81
113
|
|
82
|
-
// 从拓扑图获取分层和资源配置
|
83
114
|
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
115
|
+
|
84
116
|
_rlog["default"].info("onLayerAdd", {
|
85
117
|
config: config
|
86
|
-
});
|
87
|
-
|
118
|
+
}); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
|
119
|
+
|
120
|
+
|
88
121
|
if (!(!isLayerTopo && config.layers.length)) {
|
89
122
|
_context.next = 7;
|
90
123
|
break;
|
91
124
|
}
|
125
|
+
|
92
126
|
_context.next = 7;
|
93
127
|
return topoDispatchers.setTopoType(_template.TPL_TREE);
|
128
|
+
|
94
129
|
case 7:
|
95
130
|
// 更新配置
|
96
131
|
// resourceConfig.updateConfig(config);
|
97
132
|
// 更新配置对应的资源、链路
|
98
133
|
// editDispatchers.fetchDataByConfig();
|
99
|
-
|
100
134
|
topo.historyManager.endTransaction();
|
135
|
+
|
101
136
|
case 8:
|
102
137
|
case "end":
|
103
138
|
return _context.stop();
|
104
139
|
}
|
105
140
|
}, _callee);
|
106
141
|
}));
|
142
|
+
|
107
143
|
return function onLayerAdded(_x) {
|
108
144
|
return _ref2.apply(this, arguments);
|
109
145
|
};
|
110
146
|
}();
|
147
|
+
|
111
148
|
var deleteLayer = /*#__PURE__*/function () {
|
112
|
-
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
149
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(layerElement) {
|
113
150
|
var config;
|
114
|
-
return
|
151
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
115
152
|
while (1) switch (_context2.prev = _context2.next) {
|
116
153
|
case 0:
|
117
154
|
topo.historyManager.beginTransaction();
|
118
|
-
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, layerElement);
|
119
|
-
|
155
|
+
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
|
156
|
+
|
120
157
|
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
158
|
+
|
121
159
|
_rlog["default"].info("deleteLayer", {
|
122
160
|
config: config
|
123
|
-
});
|
124
|
-
|
161
|
+
}); // 如果没有分层,将拓扑类型切换为空白模板
|
162
|
+
|
163
|
+
|
125
164
|
if (config.layers.length) {
|
126
165
|
_context2.next = 7;
|
127
166
|
break;
|
128
167
|
}
|
168
|
+
|
129
169
|
_context2.next = 7;
|
130
170
|
return topoDispatchers.setTopoType(_template.TPL_BLANK);
|
171
|
+
|
131
172
|
case 7:
|
132
173
|
_context2.next = 9;
|
133
174
|
return resourceConfig.updateConfig(config);
|
175
|
+
|
134
176
|
case 9:
|
135
177
|
_context2.next = 11;
|
136
178
|
return editDispatchers.fetchDataByConfig();
|
179
|
+
|
137
180
|
case 11:
|
138
181
|
topo.historyManager.endTransaction();
|
182
|
+
|
139
183
|
case 12:
|
140
184
|
case "end":
|
141
185
|
return _context2.stop();
|
142
186
|
}
|
143
187
|
}, _callee2);
|
144
188
|
}));
|
189
|
+
|
145
190
|
return function deleteLayer(_x2) {
|
146
191
|
return _ref3.apply(this, arguments);
|
147
192
|
};
|
148
193
|
}();
|
194
|
+
|
149
195
|
var handleDeleteLayer = function handleDeleteLayer(layerElement) {
|
150
196
|
var hasChildren = !!layerElement.getChildren().toArray().length;
|
197
|
+
|
151
198
|
if (!hasChildren) {
|
152
199
|
deleteLayer(layerElement);
|
153
200
|
return;
|
154
|
-
}
|
201
|
+
} // 有子节点时需要确认
|
202
|
+
|
155
203
|
|
156
|
-
// 有子节点时需要确认
|
157
204
|
_dialog["default"].confirm({
|
158
205
|
title: "删除",
|
159
206
|
content: "若执行相关操作,此分层包含的内容也会一同被删除,确定删除吗?",
|
@@ -164,26 +211,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
164
211
|
type: "warning"
|
165
212
|
},
|
166
213
|
onOk: function () {
|
167
|
-
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
168
|
-
return
|
214
|
+
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
215
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
169
216
|
while (1) switch (_context3.prev = _context3.next) {
|
170
217
|
case 0:
|
171
218
|
deleteLayer(layerElement);
|
219
|
+
|
172
220
|
case 1:
|
173
221
|
case "end":
|
174
222
|
return _context3.stop();
|
175
223
|
}
|
176
224
|
}, _callee3);
|
177
225
|
}));
|
226
|
+
|
178
227
|
function onOk() {
|
179
228
|
return _onOk.apply(this, arguments);
|
180
229
|
}
|
230
|
+
|
181
231
|
return onOk;
|
182
232
|
}()
|
183
233
|
});
|
184
|
-
};
|
185
|
-
|
186
|
-
// const deleteGroupFooterBtn = () => {
|
234
|
+
}; // const deleteGroupFooterBtn = () => {
|
187
235
|
// return (
|
188
236
|
// <div>
|
189
237
|
// <Button type="primary" onClick={doDeleteOnlyGroup()}>
|
@@ -195,7 +243,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
195
243
|
// </div>
|
196
244
|
// );
|
197
245
|
// };
|
198
|
-
|
199
246
|
// const [groupDeleteVisible, setGroupDeleteVisible] = useState(false);
|
200
247
|
// function doDeleteOnlyGroup(data,group) {
|
201
248
|
// topo.historyManager.beginTransaction();
|
@@ -209,7 +256,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
209
256
|
// // viewRect.x + nodeRect.width + 2,
|
210
257
|
// // viewRect.y + nodeRect.height + 4
|
211
258
|
// // ); // 解决集群从区域内移出时,连线位置未更新的问题
|
212
|
-
|
213
259
|
// setTimeout(function () {
|
214
260
|
// child.iv();
|
215
261
|
// topo.historyManager.endTransaction();
|
@@ -222,11 +268,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
222
268
|
// }
|
223
269
|
// function doDelete(data) {
|
224
270
|
// topo.historyManager.beginTransaction();
|
225
|
-
|
226
271
|
// // FIXME 。如果命中其他的动态条件,则立即显示
|
227
272
|
// topo.view.topoClient.deleteGroup(data);
|
228
273
|
// setGroupDeleteVisible(false);
|
229
274
|
// }
|
275
|
+
|
230
276
|
/**
|
231
277
|
* 删除容器。
|
232
278
|
*
|
@@ -234,20 +280,24 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
234
280
|
*
|
235
281
|
* @param data
|
236
282
|
*/
|
283
|
+
|
284
|
+
|
237
285
|
var deleteGroup = function deleteGroup(data) {
|
238
286
|
var id = data.id,
|
239
|
-
|
240
|
-
|
287
|
+
tag = data.tag; // 新加的容器 tag 格式为 group_${id}
|
288
|
+
|
241
289
|
var group = topo.getDataModel().getDataById(tag) || topo.getDataModel().getDataByTag(id) || (0, _htElementUtils.getGroupElementByTag)(topo.getDataModel(), tag);
|
290
|
+
|
242
291
|
if (!group) {
|
243
292
|
return;
|
244
293
|
}
|
294
|
+
|
245
295
|
if (!(0, _htElementUtils.getGroupChildren)(group).filter(_htElementDataUtil.isResourceElement).length || (0, _clusterUtil.isClusterHtElement)(group)) {
|
246
296
|
doDelete();
|
247
297
|
return;
|
248
|
-
}
|
298
|
+
} // 有子节点时需要确认
|
299
|
+
|
249
300
|
|
250
|
-
// 有子节点时需要确认
|
251
301
|
var gdialog = _dialog["default"].show({
|
252
302
|
title: "删除",
|
253
303
|
// content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
|
@@ -272,13 +322,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
272
322
|
type: "warning"
|
273
323
|
}
|
274
324
|
});
|
325
|
+
|
275
326
|
function doDeleteOnlyGroup() {
|
276
327
|
topo.historyManager.beginTransaction();
|
277
328
|
console.log("仅删除区域", topo.view.topoClient, data);
|
278
329
|
var children = (0, _htElementUtils.getGroupChildren)(group);
|
279
330
|
children.map(function (child) {
|
280
|
-
child.setParent(null);
|
281
|
-
// var viewRect = topo.getGraphView().getViewRect();
|
331
|
+
child.setParent(null); // var viewRect = topo.getGraphView().getViewRect();
|
282
332
|
// var nodeRect = child.getRect();
|
283
333
|
// child.setPosition(
|
284
334
|
// viewRect.x + nodeRect.width + 2,
|
@@ -292,30 +342,33 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
292
342
|
});
|
293
343
|
topo.view.topoClient.deleteGroup(data);
|
294
344
|
topo.historyManager.endTransaction();
|
295
|
-
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide();
|
296
|
-
// console.log("仅删除区域", children, group);
|
345
|
+
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide(); // console.log("仅删除区域", children, group);
|
297
346
|
}
|
298
347
|
|
299
348
|
function doDelete() {
|
300
|
-
topo.historyManager.beginTransaction();
|
349
|
+
topo.historyManager.beginTransaction(); // FIXME 。如果命中其他的动态条件,则立即显示
|
301
350
|
|
302
|
-
// FIXME 。如果命中其他的动态条件,则立即显示
|
303
351
|
topo.view.topoClient.deleteGroup(data);
|
304
352
|
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide();
|
305
353
|
}
|
306
354
|
};
|
355
|
+
|
307
356
|
var deleteNode = function deleteNode(node) {
|
308
357
|
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, node);
|
309
358
|
};
|
359
|
+
|
310
360
|
var handleDeleteNode = function handleDeleteNode(element) {
|
311
361
|
var _topo$options$editor;
|
362
|
+
|
312
363
|
// 集群内成员禁用删除
|
313
364
|
if ((0, _clusterUtil.isClusterMemberHtElement)(element)) {
|
314
365
|
return;
|
315
366
|
}
|
316
|
-
|
317
|
-
// eslint-disable-next-line no-case-declarations
|
367
|
+
|
368
|
+
var data = element.getAttrObject(); // eslint-disable-next-line no-case-declarations
|
369
|
+
|
318
370
|
var nodeDeleteable = params.nodeDeleteable || ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.nodeDeleteable);
|
371
|
+
|
319
372
|
if (nodeDeleteable === undefined || nodeDeleteable(data)) {
|
320
373
|
if (typeof onNodeDelete === "function") {
|
321
374
|
onNodeDelete(data);
|
@@ -323,23 +376,28 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
323
376
|
deleteNode(data);
|
324
377
|
}
|
325
378
|
}
|
326
|
-
};
|
379
|
+
}; // 删除关联在节点上的出口链路
|
380
|
+
|
327
381
|
|
328
|
-
// 删除关联在节点上的出口链路
|
329
382
|
var deleteExLink = /*#__PURE__*/function () {
|
330
|
-
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
383
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(node) {
|
331
384
|
var _node$getEdges$toArra, _node$getEdges;
|
385
|
+
|
332
386
|
var config, edges, exportLinkIdList;
|
333
|
-
return
|
387
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
334
388
|
while (1) switch (_context4.prev = _context4.next) {
|
335
389
|
case 0:
|
336
390
|
config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
|
391
|
+
|
337
392
|
edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : []; // const exLink = [];
|
393
|
+
|
338
394
|
if (!(edges.length > 0)) {
|
339
395
|
_context4.next = 8;
|
340
396
|
break;
|
341
397
|
}
|
398
|
+
|
342
399
|
exportLinkIdList = [].concat(config.exportLinkIdList); //console.log("删除关联在节点上的出口链路- edges", edges,exportLinkIdList);
|
400
|
+
|
343
401
|
edges.map(function (edge) {
|
344
402
|
if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
|
345
403
|
// exLink.push(edge);
|
@@ -350,28 +408,35 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
350
408
|
config.exportLinkIdList = exportLinkIdList;
|
351
409
|
_context4.next = 8;
|
352
410
|
return resourceConfig.updateConfig(config);
|
411
|
+
|
353
412
|
case 8:
|
354
413
|
case "end":
|
355
414
|
return _context4.stop();
|
356
415
|
}
|
357
416
|
}, _callee4);
|
358
417
|
}));
|
418
|
+
|
359
419
|
return function deleteExLink(_x3) {
|
360
420
|
return _ref4.apply(this, arguments);
|
361
421
|
};
|
362
422
|
}();
|
423
|
+
|
363
424
|
var onDeleteElement = function onDeleteElement(data) {
|
364
425
|
var dtype = data.dtype;
|
426
|
+
|
365
427
|
_rlog["default"].info("onDeleteElement", data);
|
428
|
+
|
366
429
|
if ((0, _htElementUtils.isLayer)(data)) {
|
367
430
|
handleDeleteLayer(data);
|
368
431
|
return;
|
369
432
|
}
|
370
|
-
|
371
|
-
// 多选节点和连线时只删除节点,仅选择一根连线/链路时删除连线/链路
|
433
|
+
|
434
|
+
var selectedElements = topo.getSelectionModel().getSelection().toArray(); // 多选节点和连线时只删除节点,仅选择一根连线/链路时删除连线/链路
|
435
|
+
|
372
436
|
topo.historyManager.beginTransaction();
|
373
437
|
selectedElements.forEach(function (element) {
|
374
438
|
var elementData = element.getAttrObject();
|
439
|
+
|
375
440
|
if ((0, _htElementUtils.isGroup)(element)) {
|
376
441
|
deleteGroup(elementData);
|
377
442
|
} else if ((0, _htElementUtils.isNode)(element)) {
|
@@ -381,24 +446,28 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
381
446
|
}
|
382
447
|
});
|
383
448
|
topo.historyManager.endTransaction();
|
449
|
+
|
384
450
|
if (selectedElements.length === 1) {
|
385
451
|
switch (dtype) {
|
386
452
|
case "link":
|
387
453
|
if (onLineDelete) {
|
388
454
|
onLineDelete(data);
|
389
455
|
}
|
456
|
+
|
390
457
|
break;
|
458
|
+
|
391
459
|
default:
|
392
460
|
break;
|
393
461
|
}
|
394
462
|
}
|
395
463
|
};
|
396
|
-
|
397
464
|
/**
|
398
465
|
* 获得未存在的连线元素
|
399
466
|
* @param {*} elements
|
400
467
|
* @returns
|
401
468
|
*/
|
469
|
+
|
470
|
+
|
402
471
|
function findUNExistedLinkElements(elements) {
|
403
472
|
var dm = topo.getDataModel();
|
404
473
|
var newLinkElements = elements.filter(function (element) {
|
@@ -406,12 +475,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
406
475
|
});
|
407
476
|
return newLinkElements;
|
408
477
|
}
|
409
|
-
|
410
478
|
/**
|
411
479
|
* 获得未存在的元素
|
412
480
|
* @param {Array} elements
|
413
481
|
* @returns
|
414
482
|
*/
|
483
|
+
|
484
|
+
|
415
485
|
function findUNExistedElements(elements) {
|
416
486
|
var dm = topo.getDataModel();
|
417
487
|
var newLinkElements = elements.filter(function (element) {
|
@@ -419,27 +489,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
419
489
|
});
|
420
490
|
return newLinkElements;
|
421
491
|
}
|
422
|
-
|
423
492
|
/**
|
424
493
|
* 关联容器的资源
|
425
494
|
*/
|
495
|
+
|
496
|
+
|
426
497
|
function bindGroupResources(_x4, _x5) {
|
427
498
|
return _bindGroupResources.apply(this, arguments);
|
428
499
|
}
|
500
|
+
|
429
501
|
function _bindGroupResources() {
|
430
|
-
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
502
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(group, resources) {
|
431
503
|
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
432
|
-
|
504
|
+
|
505
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
433
506
|
while (1) switch (_context10.prev = _context10.next) {
|
434
507
|
case 0:
|
435
508
|
id = group.id, tag = group.tag;
|
509
|
+
|
436
510
|
_rlog["default"].debug("bindGroupResources--id, tag", id, tag);
|
511
|
+
|
437
512
|
topo.historyManager.beginTransaction();
|
438
513
|
_context10.next = 5;
|
439
514
|
return resourceConfig.updateGroupResources(group, resources);
|
515
|
+
|
440
516
|
case 5:
|
441
517
|
_context10.next = 7;
|
442
518
|
return editDispatchers.fetchDataByConfig();
|
519
|
+
|
443
520
|
case 7:
|
444
521
|
_yield$editDispatcher2 = _context10.sent;
|
445
522
|
elements = _yield$editDispatcher2.elements;
|
@@ -447,14 +524,17 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
447
524
|
nodeElements = (0, _topoData.findGroupChildren)(elements, group);
|
448
525
|
newLinkElements = findUNExistedLinkElements(elements);
|
449
526
|
updateElements = [].concat(nodeElements, newLinkElements);
|
527
|
+
|
450
528
|
if (updateElements.length) {
|
451
|
-
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_CONTAINER, updateElements);
|
452
|
-
|
529
|
+
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_CONTAINER, updateElements); // 临时放这里,仅拓扑中心有
|
530
|
+
|
453
531
|
if (topo.linkDynamicStyleExecutor) {
|
454
532
|
topo.linkDynamicStyleExecutor.execute();
|
455
533
|
}
|
456
534
|
}
|
535
|
+
|
457
536
|
topo.historyManager.endTransaction();
|
537
|
+
|
458
538
|
case 14:
|
459
539
|
case "end":
|
460
540
|
return _context10.stop();
|
@@ -463,16 +543,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
463
543
|
}));
|
464
544
|
return _bindGroupResources.apply(this, arguments);
|
465
545
|
}
|
546
|
+
|
466
547
|
function addGroupResources(_x6, _x7) {
|
467
548
|
return _addGroupResources.apply(this, arguments);
|
468
549
|
}
|
469
550
|
/**
|
470
551
|
* 关联视图的资源
|
471
552
|
*/
|
553
|
+
|
554
|
+
|
472
555
|
function _addGroupResources() {
|
473
|
-
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
556
|
+
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(group, newResourceIds) {
|
474
557
|
var groupConfig, resources, groupData;
|
475
|
-
return
|
558
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
476
559
|
while (1) switch (_context11.prev = _context11.next) {
|
477
560
|
case 0:
|
478
561
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
@@ -485,6 +568,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
485
568
|
};
|
486
569
|
_context11.next = 5;
|
487
570
|
return bindGroupResources(groupData, resources);
|
571
|
+
|
488
572
|
case 5:
|
489
573
|
case "end":
|
490
574
|
return _context11.stop();
|
@@ -493,6 +577,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
493
577
|
}));
|
494
578
|
return _addGroupResources.apply(this, arguments);
|
495
579
|
}
|
580
|
+
|
496
581
|
function bindViewResources(_x8) {
|
497
582
|
return _bindViewResources.apply(this, arguments);
|
498
583
|
}
|
@@ -502,10 +587,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
502
587
|
* @param newResourceIds 新增的资源id列表
|
503
588
|
* @return {Promise<void>}
|
504
589
|
*/
|
590
|
+
|
591
|
+
|
505
592
|
function _bindViewResources() {
|
506
|
-
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
593
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(data) {
|
507
594
|
var config, _yield$editDispatcher3, elements;
|
508
|
-
|
595
|
+
|
596
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
509
597
|
while (1) switch (_context12.prev = _context12.next) {
|
510
598
|
case 0:
|
511
599
|
// console.log("关联视图的资源", data);
|
@@ -513,17 +601,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
513
601
|
config.resources = data;
|
514
602
|
_context12.next = 4;
|
515
603
|
return resourceConfig.updateConfig(config);
|
604
|
+
|
516
605
|
case 4:
|
517
606
|
_context12.next = 6;
|
518
607
|
return editDispatchers.fetchDataByConfig();
|
608
|
+
|
519
609
|
case 6:
|
520
610
|
_yield$editDispatcher3 = _context12.sent;
|
521
611
|
elements = _yield$editDispatcher3.elements;
|
522
|
-
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements);
|
523
|
-
|
612
|
+
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
613
|
+
|
524
614
|
if (topo.linkDynamicStyleExecutor) {
|
525
615
|
topo.linkDynamicStyleExecutor.execute();
|
526
616
|
}
|
617
|
+
|
527
618
|
case 10:
|
528
619
|
case "end":
|
529
620
|
return _context12.stop();
|
@@ -532,44 +623,51 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
532
623
|
}));
|
533
624
|
return _bindViewResources.apply(this, arguments);
|
534
625
|
}
|
626
|
+
|
535
627
|
function addLayerResources(_x9, _x10) {
|
536
628
|
return _addLayerResources.apply(this, arguments);
|
537
629
|
}
|
630
|
+
|
538
631
|
function _addLayerResources() {
|
539
|
-
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
632
|
+
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
|
540
633
|
var _yield$editDispatcher4, elements, newElements;
|
541
|
-
|
634
|
+
|
635
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
542
636
|
while (1) switch (_context13.prev = _context13.next) {
|
543
637
|
case 0:
|
544
|
-
topo.historyManager.beginTransaction();
|
638
|
+
topo.historyManager.beginTransaction(); // 构造新的配置
|
545
639
|
|
546
|
-
// 构造新的配置
|
547
640
|
_context13.next = 3;
|
548
641
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
642
|
+
|
549
643
|
case 3:
|
550
644
|
_context13.next = 5;
|
551
645
|
return editDispatchers.fetchDataByConfig();
|
646
|
+
|
552
647
|
case 5:
|
553
648
|
_yield$editDispatcher4 = _context13.sent;
|
554
649
|
elements = _yield$editDispatcher4.elements;
|
555
650
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
556
651
|
newElements = findUNExistedElements(elements);
|
652
|
+
|
557
653
|
_rlog["default"].debug("添加分层资源", {
|
558
654
|
layer: group,
|
559
655
|
newElements: newElements
|
560
656
|
});
|
561
|
-
topo.getHtTopo().addElements(newElements);
|
562
657
|
|
563
|
-
// 临时放这里,仅拓扑中心有
|
658
|
+
topo.getHtTopo().addElements(newElements); // 临时放这里,仅拓扑中心有
|
659
|
+
|
564
660
|
if (topo.linkDynamicStyleExecutor) {
|
565
661
|
topo.linkDynamicStyleExecutor.execute();
|
566
662
|
}
|
663
|
+
|
567
664
|
topo.historyManager.endTransaction();
|
568
|
-
topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true);
|
569
|
-
|
665
|
+
topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true); // 添加资源后隐藏资源面板
|
666
|
+
|
570
667
|
topoEditDispatchers.update({
|
571
668
|
resourceTabActiveKey: null
|
572
669
|
});
|
670
|
+
|
573
671
|
case 14:
|
574
672
|
case "end":
|
575
673
|
return _context13.stop();
|
@@ -578,18 +676,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
578
676
|
}));
|
579
677
|
return _addLayerResources.apply(this, arguments);
|
580
678
|
}
|
679
|
+
|
581
680
|
function addResourceToFirstLayer(_x11) {
|
582
681
|
return _addResourceToFirstLayer.apply(this, arguments);
|
583
682
|
}
|
683
|
+
|
584
684
|
function _addResourceToFirstLayer() {
|
585
|
-
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
685
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(data) {
|
586
686
|
var group;
|
587
|
-
return
|
687
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
588
688
|
while (1) switch (_context14.prev = _context14.next) {
|
589
689
|
case 0:
|
590
690
|
group = resourceConfig.getGroups()[0];
|
591
691
|
_context14.next = 3;
|
592
692
|
return addLayerResources(group, data);
|
693
|
+
|
593
694
|
case 3:
|
594
695
|
case "end":
|
595
696
|
return _context14.stop();
|
@@ -598,76 +699,92 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
598
699
|
}));
|
599
700
|
return _addResourceToFirstLayer.apply(this, arguments);
|
600
701
|
}
|
702
|
+
|
601
703
|
function getAddResourceType() {
|
602
704
|
var type;
|
705
|
+
|
603
706
|
if (isLayerTopo) {
|
604
707
|
type = "addToFirstLayer";
|
605
708
|
}
|
709
|
+
|
606
710
|
return type;
|
607
711
|
}
|
608
|
-
|
609
712
|
/**
|
610
713
|
* 获得关联资源抽屉模式:新增、全量
|
611
714
|
*
|
612
715
|
* @return {string}
|
613
716
|
*/
|
717
|
+
|
718
|
+
|
614
719
|
function getAddResourceDrawerMode() {
|
615
720
|
return getAddResourceType() === "addToFirstLayer" ? "new" : "all";
|
616
721
|
}
|
617
|
-
|
618
722
|
/**
|
619
723
|
* 未选中元素添加资源
|
620
724
|
*
|
621
725
|
* @param {*} data
|
622
726
|
*/
|
727
|
+
|
728
|
+
|
623
729
|
var onSaveComboRes = /*#__PURE__*/function () {
|
624
|
-
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
625
|
-
return
|
730
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(data) {
|
731
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
626
732
|
while (1) switch (_context5.prev = _context5.next) {
|
627
733
|
case 0:
|
628
734
|
_rlog["default"].debug("关联资源-----onSaveComboRes", data);
|
735
|
+
|
629
736
|
topo.historyManager.beginTransaction();
|
737
|
+
|
630
738
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
631
739
|
_context5.next = 7;
|
632
740
|
break;
|
633
741
|
}
|
742
|
+
|
634
743
|
_context5.next = 5;
|
635
744
|
return addResourceToFirstLayer(data);
|
745
|
+
|
636
746
|
case 5:
|
637
747
|
_context5.next = 9;
|
638
748
|
break;
|
749
|
+
|
639
750
|
case 7:
|
640
751
|
_context5.next = 9;
|
641
752
|
return bindViewResources(data);
|
753
|
+
|
642
754
|
case 9:
|
643
755
|
topo.historyManager.endTransaction();
|
644
756
|
topo.getHtTopo().fitContent();
|
645
757
|
topoEditDispatchers.update({
|
646
758
|
resourceTabActiveKey: null
|
647
759
|
});
|
760
|
+
|
648
761
|
case 12:
|
649
762
|
case "end":
|
650
763
|
return _context5.stop();
|
651
764
|
}
|
652
765
|
}, _callee5);
|
653
766
|
}));
|
767
|
+
|
654
768
|
return function onSaveComboRes(_x12) {
|
655
769
|
return _ref5.apply(this, arguments);
|
656
770
|
};
|
657
771
|
}();
|
772
|
+
|
658
773
|
var onSaveTopo = /*#__PURE__*/function () {
|
659
|
-
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
774
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(data) {
|
660
775
|
var id, config, serialize, _config$layout, template, layout, saveConfig;
|
661
|
-
|
776
|
+
|
777
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
662
778
|
while (1) switch (_context7.prev = _context7.next) {
|
663
779
|
case 0:
|
664
780
|
id = data.id, config = data.config, serialize = data.serialize;
|
665
781
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
782
|
+
|
666
783
|
if (onSave) {
|
667
784
|
// 自定义保存
|
668
785
|
saveConfig = /*#__PURE__*/function () {
|
669
|
-
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
670
|
-
return
|
786
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
787
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
671
788
|
while (1) switch (_context6.prev = _context6.next) {
|
672
789
|
case 0:
|
673
790
|
_context6.next = 2;
|
@@ -676,41 +793,48 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
676
793
|
layout: layout,
|
677
794
|
serialize: serialize
|
678
795
|
});
|
796
|
+
|
679
797
|
case 2:
|
680
798
|
case "end":
|
681
799
|
return _context6.stop();
|
682
800
|
}
|
683
801
|
}, _callee6);
|
684
802
|
}));
|
803
|
+
|
685
804
|
return function saveConfig() {
|
686
805
|
return _ref7.apply(this, arguments);
|
687
806
|
};
|
688
807
|
}();
|
808
|
+
|
689
809
|
onSave({
|
690
810
|
topo: topo,
|
691
811
|
data: data,
|
692
812
|
saveConfig: saveConfig
|
693
813
|
});
|
694
814
|
}
|
815
|
+
|
695
816
|
case 3:
|
696
817
|
case "end":
|
697
818
|
return _context7.stop();
|
698
819
|
}
|
699
820
|
}, _callee7);
|
700
821
|
}));
|
822
|
+
|
701
823
|
return function onSaveTopo(_x13) {
|
702
824
|
return _ref6.apply(this, arguments);
|
703
825
|
};
|
704
826
|
}();
|
827
|
+
|
705
828
|
var saveBind = function saveBind(type, data) {
|
706
829
|
var eventData = {
|
707
830
|
type: type,
|
708
831
|
data: data
|
709
832
|
};
|
833
|
+
|
710
834
|
_rlog["default"].debug("TopoCenter:onSaveBind", eventData);
|
835
|
+
|
711
836
|
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, eventData);
|
712
837
|
};
|
713
|
-
|
714
838
|
/**
|
715
839
|
* 单节点绑定资源
|
716
840
|
*
|
@@ -722,10 +846,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
722
846
|
* 关联到已有区域里的节点
|
723
847
|
* 重新关联到已有区域里的节点
|
724
848
|
*/
|
849
|
+
|
850
|
+
|
725
851
|
var bindNodeResource = /*#__PURE__*/function () {
|
726
|
-
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
852
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(params) {
|
727
853
|
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
728
|
-
|
854
|
+
|
855
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
729
856
|
while (1) switch (_context9.prev = _context9.next) {
|
730
857
|
case 0:
|
731
858
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
@@ -735,21 +862,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
735
862
|
}), [newResId])
|
736
863
|
});
|
737
864
|
};
|
865
|
+
|
738
866
|
_doBind = function _doBind3() {
|
739
|
-
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
867
|
+
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
740
868
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
741
|
-
return
|
869
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
742
870
|
while (1) switch (_context8.prev = _context8.next) {
|
743
871
|
case 0:
|
744
872
|
dm = htTopo.getGraphView().dm(); // 创建
|
873
|
+
|
745
874
|
newLinkElements = findUNExistedLinkElements(elements);
|
746
875
|
createElementsData = null;
|
876
|
+
|
747
877
|
if (newData.type === "group") {
|
748
878
|
groupChildren = (0, _topoData.findGroupChildren)(elements, newData);
|
749
879
|
newGroupChildren = [];
|
750
880
|
existedGroupChildren = [];
|
751
881
|
groupChildren.forEach(function (groupChildData) {
|
752
882
|
var ele = dm.getDataByTag(groupChildData.id);
|
883
|
+
|
753
884
|
if (ele) {
|
754
885
|
existedGroupChildren.push(groupChildData);
|
755
886
|
} else {
|
@@ -766,8 +897,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
766
897
|
return item.type === "linkGroup";
|
767
898
|
})
|
768
899
|
};
|
769
|
-
htTopo.createElements(createElementsData);
|
770
|
-
|
900
|
+
htTopo.createElements(createElementsData); // 切换前图上如果存在集群内的节点,切换节点为集群后,移到集群内
|
901
|
+
|
771
902
|
groupElement = dm.getDataByTag(newData.id);
|
772
903
|
existedGroupChildren.forEach(function (groupChildData) {
|
773
904
|
var nodeElement = dm.getDataByTag(groupChildData.id);
|
@@ -786,33 +917,35 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
786
917
|
};
|
787
918
|
htTopo.createElements(createElementsData);
|
788
919
|
}
|
789
|
-
_rlog["default"].debug("批量创建元素", createElementsData);
|
790
920
|
|
791
|
-
// 恢复图标、大小、位置
|
921
|
+
_rlog["default"].debug("批量创建元素", createElementsData); // 恢复图标、大小、位置
|
922
|
+
|
923
|
+
|
792
924
|
newElement = dm.getDataByTag(newData.id);
|
925
|
+
|
793
926
|
if (newElement) {
|
794
927
|
newElement.setSize(node.getSize());
|
795
928
|
newElement.setPosition(node.getPosition());
|
796
929
|
newElement.setImage(node.getImage());
|
797
|
-
}
|
798
|
-
// 选中
|
799
|
-
sm = htTopo.getGraphView().sm();
|
800
|
-
sm.setSelection([newElement]);
|
930
|
+
} // 选中
|
801
931
|
|
802
|
-
// 移除旧节点
|
803
|
-
dm.remove(node);
|
804
932
|
|
805
|
-
|
806
|
-
|
933
|
+
sm = htTopo.getGraphView().sm();
|
934
|
+
sm.setSelection([newElement]); // 移除旧节点
|
807
935
|
|
936
|
+
dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
|
937
|
+
// node.a("customName", null);
|
808
938
|
// 删除关联在节点上的出口链路
|
939
|
+
|
809
940
|
_context8.next = 12;
|
810
941
|
return deleteExLink(node);
|
942
|
+
|
811
943
|
case 12:
|
812
944
|
// 临时放这里,仅拓扑中心有
|
813
945
|
if (topo.linkDynamicStyleExecutor) {
|
814
946
|
topo.linkDynamicStyleExecutor.execute();
|
815
947
|
}
|
948
|
+
|
816
949
|
case 13:
|
817
950
|
case "end":
|
818
951
|
return _context8.stop();
|
@@ -821,116 +954,148 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
821
954
|
}));
|
822
955
|
return _doBind.apply(this, arguments);
|
823
956
|
};
|
957
|
+
|
824
958
|
doBind = function _doBind2() {
|
825
959
|
return _doBind.apply(this, arguments);
|
826
960
|
};
|
961
|
+
|
827
962
|
topo.historyManager.beginTransaction();
|
828
963
|
id = params.id, oldResId = params.oldResId, newResId = params.newResId;
|
964
|
+
|
829
965
|
_rlog["default"].debug("bindNodeResource", params);
|
966
|
+
|
830
967
|
node = topo.getDataModel().getDataById(id); // 节点所属容器
|
968
|
+
|
831
969
|
parentGroupElement = node.getParent();
|
832
970
|
htTopo = topo.getHtTopo();
|
833
971
|
config = resourceConfig.getConfig();
|
972
|
+
|
834
973
|
if (parentGroupElement) {
|
835
974
|
// 在容器中
|
836
975
|
groupId = parentGroupElement.getTag(); // 容器业务id
|
976
|
+
|
837
977
|
groupTag = parentGroupElement.a("tag"); // 容器临时id
|
978
|
+
|
838
979
|
config.groups = config.groups.map(function (g) {
|
839
980
|
// 匹配到容器,替换资源或增加
|
840
981
|
if (g.id === groupId || g.tag === groupTag) {
|
841
982
|
return (0, _extends2["default"])({}, g, {
|
842
983
|
resources: replaceOrAddRes(g.resources, oldResId, newResId)
|
843
984
|
});
|
844
|
-
}
|
845
|
-
|
985
|
+
} // 未匹配到容器
|
986
|
+
|
987
|
+
|
846
988
|
return g;
|
847
989
|
});
|
848
990
|
} else {
|
849
991
|
// 在画布上
|
850
992
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
851
993
|
}
|
994
|
+
|
852
995
|
_context9.next = 13;
|
853
996
|
return resourceConfig.updateConfig(config);
|
997
|
+
|
854
998
|
case 13:
|
855
999
|
_context9.next = 15;
|
856
1000
|
return editDispatchers.fetchDataByConfig();
|
1001
|
+
|
857
1002
|
case 15:
|
858
1003
|
_yield$editDispatcher = _context9.sent;
|
859
1004
|
elements = _yield$editDispatcher.elements;
|
860
1005
|
newData = elements.find(function (item) {
|
861
1006
|
return item.id === newResId;
|
862
1007
|
});
|
1008
|
+
|
863
1009
|
if (newData) {
|
864
1010
|
_context9.next = 23;
|
865
1011
|
break;
|
866
1012
|
}
|
1013
|
+
|
867
1014
|
_message["default"].error("关联资源失败");
|
1015
|
+
|
868
1016
|
_rlog["default"].warn("关联资源失败");
|
1017
|
+
|
869
1018
|
topo.historyManager.endTransaction();
|
870
1019
|
return _context9.abrupt("return", false);
|
1020
|
+
|
871
1021
|
case 23:
|
872
1022
|
_context9.next = 25;
|
873
1023
|
return doBind();
|
1024
|
+
|
874
1025
|
case 25:
|
875
1026
|
topo.historyManager.endTransaction();
|
1027
|
+
|
876
1028
|
case 26:
|
877
1029
|
case "end":
|
878
1030
|
return _context9.stop();
|
879
1031
|
}
|
880
1032
|
}, _callee9);
|
881
1033
|
}));
|
1034
|
+
|
882
1035
|
return function bindNodeResource(_x14) {
|
883
1036
|
return _ref8.apply(this, arguments);
|
884
1037
|
};
|
885
1038
|
}();
|
886
|
-
|
887
1039
|
/**
|
888
1040
|
* 关联IP的图片节点
|
889
1041
|
*/
|
1042
|
+
|
1043
|
+
|
890
1044
|
function relateNodeIp(_x15, _x16) {
|
891
1045
|
return _relateNodeIp.apply(this, arguments);
|
892
1046
|
}
|
1047
|
+
|
893
1048
|
function _relateNodeIp() {
|
894
|
-
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
1049
|
+
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(txtValue, nodeElement) {
|
895
1050
|
var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
896
|
-
|
1051
|
+
|
1052
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
897
1053
|
while (1) switch (_context15.prev = _context15.next) {
|
898
1054
|
case 0:
|
899
1055
|
if (txtValue) {
|
900
1056
|
_context15.next = 2;
|
901
1057
|
break;
|
902
1058
|
}
|
1059
|
+
|
903
1060
|
return _context15.abrupt("return");
|
1061
|
+
|
904
1062
|
case 2:
|
905
1063
|
// if (txtValue === nodeElement.a('bindIp')) {
|
906
1064
|
// return;
|
907
1065
|
// }
|
908
1066
|
// 根据配置查询拓扑数据
|
909
1067
|
dm = topo.getDataModel(); // 执行唯一性验证
|
1068
|
+
|
910
1069
|
isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, txtValue, nodeElement); // 获取关联链路
|
1070
|
+
|
911
1071
|
if (!isUnique) {
|
912
1072
|
_context15.next = 23;
|
913
1073
|
break;
|
914
1074
|
}
|
1075
|
+
|
915
1076
|
ip = (0, _exitLinkUtil.buildIpNode)(txtValue);
|
916
1077
|
_context15.next = 8;
|
917
1078
|
return deleteExLink(nodeElement);
|
1079
|
+
|
918
1080
|
case 8:
|
919
1081
|
nodeElement.a(ip);
|
920
1082
|
nodeElement.setName(txtValue);
|
921
|
-
nodeElement.setTag("ip:" + txtValue);
|
922
|
-
|
1083
|
+
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1084
|
+
|
923
1085
|
configObj = topo.resourceConfig.getConfig();
|
924
1086
|
_context15.next = 14;
|
925
1087
|
return resourceConfig.updateConfig(configObj);
|
1088
|
+
|
926
1089
|
case 14:
|
927
1090
|
_context15.next = 16;
|
928
1091
|
return editDispatchers.fetchDataByConfig();
|
1092
|
+
|
929
1093
|
case 16:
|
930
1094
|
configData = _context15.sent;
|
931
1095
|
// console.log("configData",configObj, configData);
|
932
1096
|
_elements = configData.elements;
|
933
1097
|
newLinkElements = findUNExistedLinkElements(_elements); // console.log("configData", configData, newLinkElements);
|
1098
|
+
|
934
1099
|
newLink = newLinkElements.filter(function (item) {
|
935
1100
|
return item.type === "link";
|
936
1101
|
});
|
@@ -938,16 +1103,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
938
1103
|
return item.type === "linkGroup";
|
939
1104
|
}); // const newData = elements.find((item) => item.id === `ip:${txtValue}`);
|
940
1105
|
// console.log("newData",newLinkElements, newLink);
|
1106
|
+
|
941
1107
|
createElementsData = {
|
942
1108
|
groups: [],
|
943
1109
|
nodes: [],
|
944
1110
|
links: newLink,
|
945
1111
|
linkGroups: newLinkGroup
|
946
1112
|
}; // console.log("createElementsData", createElementsData);
|
1113
|
+
|
947
1114
|
if ([].concat(newLink, newLinkGroup).length > 0) {
|
948
1115
|
_htTopo = topo.getHtTopo();
|
1116
|
+
|
949
1117
|
_htTopo.createElements(createElementsData);
|
950
1118
|
}
|
1119
|
+
|
951
1120
|
case 23:
|
952
1121
|
case "end":
|
953
1122
|
return _context15.stop();
|
@@ -956,45 +1125,55 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
956
1125
|
}));
|
957
1126
|
return _relateNodeIp.apply(this, arguments);
|
958
1127
|
}
|
1128
|
+
|
959
1129
|
var onEvent = function onEvent(e) {
|
960
1130
|
var map = {};
|
961
1131
|
var handler = map[e.name];
|
1132
|
+
|
962
1133
|
if (handler) {
|
963
1134
|
handler(e.data);
|
964
1135
|
}
|
965
1136
|
};
|
1137
|
+
|
966
1138
|
var effectsState = store.useModelEffectsState("topoConfig");
|
967
1139
|
var topoLoading = effectsState.getTopoByConditions.isLoading;
|
968
|
-
|
969
1140
|
/**
|
970
1141
|
* 设置视图鼠标模式
|
971
1142
|
*/
|
1143
|
+
|
972
1144
|
var setViewMouseMode = function setViewMouseMode(mode) {
|
973
1145
|
_rlog["default"].debug("设置视图鼠标模式", mode);
|
1146
|
+
|
974
1147
|
topo.getHtTopo().setViewMouseMode(mode);
|
975
1148
|
topoEditDispatchers.update({
|
976
1149
|
viewMouseMode: mode
|
977
1150
|
});
|
978
1151
|
};
|
1152
|
+
|
979
1153
|
return {
|
980
1154
|
resourceConfig: resourceConfig,
|
1155
|
+
|
981
1156
|
/**
|
982
1157
|
* 拓扑结构加载中状态
|
983
1158
|
*/
|
984
1159
|
topoLoading: topoLoading,
|
985
1160
|
setViewMouseMode: setViewMouseMode,
|
1161
|
+
|
986
1162
|
/**
|
987
1163
|
* 资源绑定(多选)抽屉显示状态
|
988
1164
|
*/
|
989
1165
|
showComboResDrawer: showComboResDrawer,
|
1166
|
+
|
990
1167
|
/**
|
991
1168
|
* 资源绑定(多选)已选择资源(动态+固定)
|
992
1169
|
*/
|
993
1170
|
initialComboRes: comboResData,
|
1171
|
+
|
994
1172
|
/**
|
995
1173
|
* 当前资源对应的拓扑结构(点+线+容器)
|
996
1174
|
*/
|
997
1175
|
topo: editState.elements,
|
1176
|
+
|
998
1177
|
/**
|
999
1178
|
* 拓扑图全局已选固定资源
|
1000
1179
|
*/
|
@@ -1002,42 +1181,51 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1002
1181
|
onEvent: onEvent,
|
1003
1182
|
reset: reset,
|
1004
1183
|
addLayerResources: addLayerResources,
|
1184
|
+
|
1005
1185
|
/**
|
1006
1186
|
* 显示全局添加资源抽屉
|
1007
1187
|
*/
|
1008
1188
|
showGlobalAddResourceDrawer: showGlobalAddResourceDrawer,
|
1009
1189
|
groupAddResource: groupAddResource,
|
1010
1190
|
addGroupResources: addGroupResources,
|
1191
|
+
|
1011
1192
|
/**
|
1012
1193
|
* 添加资源抽屉类型
|
1013
1194
|
*/
|
1014
1195
|
getAddResourceDrawerMode: getAddResourceDrawerMode,
|
1196
|
+
|
1015
1197
|
/**
|
1016
1198
|
* 资源绑定(单选)保存选择
|
1017
1199
|
*/
|
1018
1200
|
bindNodeResource: bindNodeResource,
|
1201
|
+
|
1019
1202
|
/**
|
1020
1203
|
* 删除节点关联的出口链路
|
1021
1204
|
*/
|
1022
1205
|
deleteExLink: deleteExLink,
|
1206
|
+
|
1023
1207
|
/**
|
1024
1208
|
* 资源绑定(多选)保存选择
|
1025
1209
|
*/
|
1026
1210
|
onSaveComboRes: onSaveComboRes,
|
1211
|
+
|
1027
1212
|
/**
|
1028
1213
|
* 关闭资源绑定(多选)抽屉
|
1029
1214
|
*/
|
1030
1215
|
onCloseComboResDrawer: function onCloseComboResDrawer() {
|
1031
1216
|
return setShowComboResDrawer(false);
|
1032
1217
|
},
|
1218
|
+
|
1033
1219
|
/**
|
1034
1220
|
* 拓扑图元素(节点、连线、容器)删除回调
|
1035
1221
|
*/
|
1036
1222
|
onDeleteElement: onDeleteElement,
|
1223
|
+
|
1037
1224
|
/**
|
1038
1225
|
* 绑定图片ip
|
1039
1226
|
*/
|
1040
1227
|
relateNodeIp: relateNodeIp,
|
1228
|
+
|
1041
1229
|
/**
|
1042
1230
|
* 拓扑图保存回调
|
1043
1231
|
*/
|
@@ -1046,5 +1234,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1046
1234
|
onLayerAdded: onLayerAdded
|
1047
1235
|
};
|
1048
1236
|
};
|
1237
|
+
|
1049
1238
|
var _default = useTopoEdit;
|
1050
1239
|
exports["default"] = _default;
|