@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
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _Button from "@alifd/next/es/button";
|
4
4
|
import _Dialog from "@alifd/next/es/dialog";
|
5
5
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
6
|
-
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
7
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
8
8
|
import _ from "lodash";
|
9
9
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
@@ -17,15 +17,16 @@ import { isResourceElement } from "../../utils/htElementDataUtil";
|
|
17
17
|
import { isClusterHtElement, isClusterMemberHtElement } from "../../utils/clusterUtil";
|
18
18
|
import { mergeExportLinkData } from "../models/utils/linkUtils";
|
19
19
|
import { isUniqueIp, buildIpNode } from "../../networkTopo/utils/exitLinkUtil";
|
20
|
+
|
20
21
|
var useTopoEdit = function useTopoEdit(params) {
|
21
22
|
var topo = params.topo,
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
topoId = params.topoId,
|
24
|
+
isEditing = params.isEditing,
|
25
|
+
onSave = params.onSave,
|
26
|
+
onLineDelete = params.onLineDelete,
|
27
|
+
onNodeDelete = params.onNodeDelete,
|
28
|
+
topoShowType = params.topoShowType,
|
29
|
+
isLayerTopo = params.isLayerTopo;
|
29
30
|
var store = topo.store;
|
30
31
|
var emitEvent = useCallback(function (eventType, eventData) {
|
31
32
|
topo.view.topoClient.emitEvent(eventType, eventData);
|
@@ -39,114 +40,133 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
39
40
|
resourceConfig: resourceConfig
|
40
41
|
});
|
41
42
|
var topoEditDispatchers = store.useModelDispatchers("topoEdit");
|
43
|
+
|
42
44
|
var _store$useModel = store.useModel("topoConfig"),
|
43
|
-
|
44
|
-
|
45
|
+
editState = _store$useModel[0],
|
46
|
+
editDispatchers = _store$useModel[1];
|
47
|
+
|
45
48
|
var topoDispatchers = store.useModelDispatchers("topoMod");
|
49
|
+
|
46
50
|
var _useState = useState(false),
|
47
|
-
|
48
|
-
|
51
|
+
showComboResDrawer = _useState[0],
|
52
|
+
setShowComboResDrawer = _useState[1];
|
53
|
+
|
49
54
|
var _useState2 = useState(null),
|
50
|
-
|
51
|
-
|
55
|
+
comboResData = _useState2[0],
|
56
|
+
setComboResData = _useState2[1];
|
57
|
+
|
52
58
|
var reset = function reset() {
|
53
59
|
var _topo$historyManager;
|
60
|
+
|
54
61
|
topoEditDispatchers.reset();
|
55
62
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
|
56
63
|
};
|
57
|
-
|
58
64
|
/**
|
59
65
|
* 增加资源到视图
|
60
66
|
*/
|
67
|
+
|
68
|
+
|
61
69
|
var showGlobalAddResourceDrawer = function showGlobalAddResourceDrawer() {
|
62
70
|
rlog.debug("showGlobalAddResourceDrawer", resourceConfig.getViewResources());
|
63
71
|
setComboResData(resourceConfig.getViewResources());
|
64
72
|
setShowComboResDrawer(true);
|
65
73
|
};
|
74
|
+
|
66
75
|
var onLayerAdded = /*#__PURE__*/function () {
|
67
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
76
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
68
77
|
var target, direction, config;
|
69
|
-
return _regeneratorRuntime
|
78
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
70
79
|
while (1) switch (_context.prev = _context.next) {
|
71
80
|
case 0:
|
72
81
|
target = _ref.target, direction = _ref.direction;
|
73
|
-
topo.historyManager.beginTransaction();
|
82
|
+
topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
|
74
83
|
|
75
|
-
// 从拓扑图获取分层和资源配置
|
76
84
|
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
77
85
|
rlog.info("onLayerAdd", {
|
78
86
|
config: config
|
79
|
-
});
|
80
|
-
|
87
|
+
}); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
|
88
|
+
|
81
89
|
if (!(!isLayerTopo && config.layers.length)) {
|
82
90
|
_context.next = 7;
|
83
91
|
break;
|
84
92
|
}
|
93
|
+
|
85
94
|
_context.next = 7;
|
86
95
|
return topoDispatchers.setTopoType(TPL_TREE);
|
96
|
+
|
87
97
|
case 7:
|
88
98
|
// 更新配置
|
89
99
|
// resourceConfig.updateConfig(config);
|
90
100
|
// 更新配置对应的资源、链路
|
91
101
|
// editDispatchers.fetchDataByConfig();
|
92
|
-
|
93
102
|
topo.historyManager.endTransaction();
|
103
|
+
|
94
104
|
case 8:
|
95
105
|
case "end":
|
96
106
|
return _context.stop();
|
97
107
|
}
|
98
108
|
}, _callee);
|
99
109
|
}));
|
110
|
+
|
100
111
|
return function onLayerAdded(_x) {
|
101
112
|
return _ref2.apply(this, arguments);
|
102
113
|
};
|
103
114
|
}();
|
115
|
+
|
104
116
|
var deleteLayer = /*#__PURE__*/function () {
|
105
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
117
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layerElement) {
|
106
118
|
var config;
|
107
|
-
return _regeneratorRuntime
|
119
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
108
120
|
while (1) switch (_context2.prev = _context2.next) {
|
109
121
|
case 0:
|
110
122
|
topo.historyManager.beginTransaction();
|
111
|
-
emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement);
|
112
|
-
|
123
|
+
emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
|
124
|
+
|
113
125
|
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
114
126
|
rlog.info("deleteLayer", {
|
115
127
|
config: config
|
116
|
-
});
|
117
|
-
|
128
|
+
}); // 如果没有分层,将拓扑类型切换为空白模板
|
129
|
+
|
118
130
|
if (config.layers.length) {
|
119
131
|
_context2.next = 7;
|
120
132
|
break;
|
121
133
|
}
|
134
|
+
|
122
135
|
_context2.next = 7;
|
123
136
|
return topoDispatchers.setTopoType(TPL_BLANK);
|
137
|
+
|
124
138
|
case 7:
|
125
139
|
_context2.next = 9;
|
126
140
|
return resourceConfig.updateConfig(config);
|
141
|
+
|
127
142
|
case 9:
|
128
143
|
_context2.next = 11;
|
129
144
|
return editDispatchers.fetchDataByConfig();
|
145
|
+
|
130
146
|
case 11:
|
131
147
|
topo.historyManager.endTransaction();
|
148
|
+
|
132
149
|
case 12:
|
133
150
|
case "end":
|
134
151
|
return _context2.stop();
|
135
152
|
}
|
136
153
|
}, _callee2);
|
137
154
|
}));
|
155
|
+
|
138
156
|
return function deleteLayer(_x2) {
|
139
157
|
return _ref3.apply(this, arguments);
|
140
158
|
};
|
141
159
|
}();
|
160
|
+
|
142
161
|
var handleDeleteLayer = function handleDeleteLayer(layerElement) {
|
143
162
|
var hasChildren = !!layerElement.getChildren().toArray().length;
|
163
|
+
|
144
164
|
if (!hasChildren) {
|
145
165
|
deleteLayer(layerElement);
|
146
166
|
return;
|
147
|
-
}
|
167
|
+
} // 有子节点时需要确认
|
168
|
+
|
148
169
|
|
149
|
-
// 有子节点时需要确认
|
150
170
|
_Dialog.confirm({
|
151
171
|
title: "删除",
|
152
172
|
content: "若执行相关操作,此分层包含的内容也会一同被删除,确定删除吗?",
|
@@ -157,26 +177,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
157
177
|
type: "warning"
|
158
178
|
},
|
159
179
|
onOk: function () {
|
160
|
-
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
161
|
-
return _regeneratorRuntime
|
180
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
181
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
162
182
|
while (1) switch (_context3.prev = _context3.next) {
|
163
183
|
case 0:
|
164
184
|
deleteLayer(layerElement);
|
185
|
+
|
165
186
|
case 1:
|
166
187
|
case "end":
|
167
188
|
return _context3.stop();
|
168
189
|
}
|
169
190
|
}, _callee3);
|
170
191
|
}));
|
192
|
+
|
171
193
|
function onOk() {
|
172
194
|
return _onOk.apply(this, arguments);
|
173
195
|
}
|
196
|
+
|
174
197
|
return onOk;
|
175
198
|
}()
|
176
199
|
});
|
177
|
-
};
|
178
|
-
|
179
|
-
// const deleteGroupFooterBtn = () => {
|
200
|
+
}; // const deleteGroupFooterBtn = () => {
|
180
201
|
// return (
|
181
202
|
// <div>
|
182
203
|
// <Button type="primary" onClick={doDeleteOnlyGroup()}>
|
@@ -188,7 +209,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
188
209
|
// </div>
|
189
210
|
// );
|
190
211
|
// };
|
191
|
-
|
192
212
|
// const [groupDeleteVisible, setGroupDeleteVisible] = useState(false);
|
193
213
|
// function doDeleteOnlyGroup(data,group) {
|
194
214
|
// topo.historyManager.beginTransaction();
|
@@ -202,7 +222,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
202
222
|
// // viewRect.x + nodeRect.width + 2,
|
203
223
|
// // viewRect.y + nodeRect.height + 4
|
204
224
|
// // ); // 解决集群从区域内移出时,连线位置未更新的问题
|
205
|
-
|
206
225
|
// setTimeout(function () {
|
207
226
|
// child.iv();
|
208
227
|
// topo.historyManager.endTransaction();
|
@@ -215,11 +234,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
215
234
|
// }
|
216
235
|
// function doDelete(data) {
|
217
236
|
// topo.historyManager.beginTransaction();
|
218
|
-
|
219
237
|
// // FIXME 。如果命中其他的动态条件,则立即显示
|
220
238
|
// topo.view.topoClient.deleteGroup(data);
|
221
239
|
// setGroupDeleteVisible(false);
|
222
240
|
// }
|
241
|
+
|
223
242
|
/**
|
224
243
|
* 删除容器。
|
225
244
|
*
|
@@ -227,20 +246,24 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
227
246
|
*
|
228
247
|
* @param data
|
229
248
|
*/
|
249
|
+
|
250
|
+
|
230
251
|
var deleteGroup = function deleteGroup(data) {
|
231
252
|
var id = data.id,
|
232
|
-
|
233
|
-
|
253
|
+
tag = data.tag; // 新加的容器 tag 格式为 group_${id}
|
254
|
+
|
234
255
|
var group = topo.getDataModel().getDataById(tag) || topo.getDataModel().getDataByTag(id) || getGroupElementByTag(topo.getDataModel(), tag);
|
256
|
+
|
235
257
|
if (!group) {
|
236
258
|
return;
|
237
259
|
}
|
260
|
+
|
238
261
|
if (!getGroupChildren(group).filter(isResourceElement).length || isClusterHtElement(group)) {
|
239
262
|
doDelete();
|
240
263
|
return;
|
241
|
-
}
|
264
|
+
} // 有子节点时需要确认
|
265
|
+
|
242
266
|
|
243
|
-
// 有子节点时需要确认
|
244
267
|
var gdialog = _Dialog.show({
|
245
268
|
title: "删除",
|
246
269
|
// content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
|
@@ -265,13 +288,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
265
288
|
type: "warning"
|
266
289
|
}
|
267
290
|
});
|
291
|
+
|
268
292
|
function doDeleteOnlyGroup() {
|
269
293
|
topo.historyManager.beginTransaction();
|
270
294
|
console.log("仅删除区域", topo.view.topoClient, data);
|
271
295
|
var children = getGroupChildren(group);
|
272
296
|
children.map(function (child) {
|
273
|
-
child.setParent(null);
|
274
|
-
// var viewRect = topo.getGraphView().getViewRect();
|
297
|
+
child.setParent(null); // var viewRect = topo.getGraphView().getViewRect();
|
275
298
|
// var nodeRect = child.getRect();
|
276
299
|
// child.setPosition(
|
277
300
|
// viewRect.x + nodeRect.width + 2,
|
@@ -285,30 +308,33 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
285
308
|
});
|
286
309
|
topo.view.topoClient.deleteGroup(data);
|
287
310
|
topo.historyManager.endTransaction();
|
288
|
-
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide();
|
289
|
-
// console.log("仅删除区域", children, group);
|
311
|
+
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide(); // console.log("仅删除区域", children, group);
|
290
312
|
}
|
291
313
|
|
292
314
|
function doDelete() {
|
293
|
-
topo.historyManager.beginTransaction();
|
315
|
+
topo.historyManager.beginTransaction(); // FIXME 。如果命中其他的动态条件,则立即显示
|
294
316
|
|
295
|
-
// FIXME 。如果命中其他的动态条件,则立即显示
|
296
317
|
topo.view.topoClient.deleteGroup(data);
|
297
318
|
gdialog === null || gdialog === void 0 ? void 0 : gdialog.hide();
|
298
319
|
}
|
299
320
|
};
|
321
|
+
|
300
322
|
var deleteNode = function deleteNode(node) {
|
301
323
|
emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, node);
|
302
324
|
};
|
325
|
+
|
303
326
|
var handleDeleteNode = function handleDeleteNode(element) {
|
304
327
|
var _topo$options$editor;
|
328
|
+
|
305
329
|
// 集群内成员禁用删除
|
306
330
|
if (isClusterMemberHtElement(element)) {
|
307
331
|
return;
|
308
332
|
}
|
309
|
-
|
310
|
-
// eslint-disable-next-line no-case-declarations
|
333
|
+
|
334
|
+
var data = element.getAttrObject(); // eslint-disable-next-line no-case-declarations
|
335
|
+
|
311
336
|
var nodeDeleteable = params.nodeDeleteable || ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.nodeDeleteable);
|
337
|
+
|
312
338
|
if (nodeDeleteable === undefined || nodeDeleteable(data)) {
|
313
339
|
if (typeof onNodeDelete === "function") {
|
314
340
|
onNodeDelete(data);
|
@@ -316,23 +342,28 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
316
342
|
deleteNode(data);
|
317
343
|
}
|
318
344
|
}
|
319
|
-
};
|
345
|
+
}; // 删除关联在节点上的出口链路
|
346
|
+
|
320
347
|
|
321
|
-
// 删除关联在节点上的出口链路
|
322
348
|
var deleteExLink = /*#__PURE__*/function () {
|
323
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
349
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
|
324
350
|
var _node$getEdges$toArra, _node$getEdges;
|
351
|
+
|
325
352
|
var config, edges, exportLinkIdList;
|
326
|
-
return _regeneratorRuntime
|
353
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
327
354
|
while (1) switch (_context4.prev = _context4.next) {
|
328
355
|
case 0:
|
329
356
|
config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
|
357
|
+
|
330
358
|
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 = [];
|
359
|
+
|
331
360
|
if (!(edges.length > 0)) {
|
332
361
|
_context4.next = 8;
|
333
362
|
break;
|
334
363
|
}
|
364
|
+
|
335
365
|
exportLinkIdList = [].concat(config.exportLinkIdList); //console.log("删除关联在节点上的出口链路- edges", edges,exportLinkIdList);
|
366
|
+
|
336
367
|
edges.map(function (edge) {
|
337
368
|
if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
|
338
369
|
// exLink.push(edge);
|
@@ -343,28 +374,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
343
374
|
config.exportLinkIdList = exportLinkIdList;
|
344
375
|
_context4.next = 8;
|
345
376
|
return resourceConfig.updateConfig(config);
|
377
|
+
|
346
378
|
case 8:
|
347
379
|
case "end":
|
348
380
|
return _context4.stop();
|
349
381
|
}
|
350
382
|
}, _callee4);
|
351
383
|
}));
|
384
|
+
|
352
385
|
return function deleteExLink(_x3) {
|
353
386
|
return _ref4.apply(this, arguments);
|
354
387
|
};
|
355
388
|
}();
|
389
|
+
|
356
390
|
var onDeleteElement = function onDeleteElement(data) {
|
357
391
|
var dtype = data.dtype;
|
358
392
|
rlog.info("onDeleteElement", data);
|
393
|
+
|
359
394
|
if (isLayer(data)) {
|
360
395
|
handleDeleteLayer(data);
|
361
396
|
return;
|
362
397
|
}
|
363
|
-
|
364
|
-
// 多选节点和连线时只删除节点,仅选择一根连线/链路时删除连线/链路
|
398
|
+
|
399
|
+
var selectedElements = topo.getSelectionModel().getSelection().toArray(); // 多选节点和连线时只删除节点,仅选择一根连线/链路时删除连线/链路
|
400
|
+
|
365
401
|
topo.historyManager.beginTransaction();
|
366
402
|
selectedElements.forEach(function (element) {
|
367
403
|
var elementData = element.getAttrObject();
|
404
|
+
|
368
405
|
if (isGroup(element)) {
|
369
406
|
deleteGroup(elementData);
|
370
407
|
} else if (isNode(element)) {
|
@@ -374,24 +411,28 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
374
411
|
}
|
375
412
|
});
|
376
413
|
topo.historyManager.endTransaction();
|
414
|
+
|
377
415
|
if (selectedElements.length === 1) {
|
378
416
|
switch (dtype) {
|
379
417
|
case "link":
|
380
418
|
if (onLineDelete) {
|
381
419
|
onLineDelete(data);
|
382
420
|
}
|
421
|
+
|
383
422
|
break;
|
423
|
+
|
384
424
|
default:
|
385
425
|
break;
|
386
426
|
}
|
387
427
|
}
|
388
428
|
};
|
389
|
-
|
390
429
|
/**
|
391
430
|
* 获得未存在的连线元素
|
392
431
|
* @param {*} elements
|
393
432
|
* @returns
|
394
433
|
*/
|
434
|
+
|
435
|
+
|
395
436
|
function findUNExistedLinkElements(elements) {
|
396
437
|
var dm = topo.getDataModel();
|
397
438
|
var newLinkElements = elements.filter(function (element) {
|
@@ -399,12 +440,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
399
440
|
});
|
400
441
|
return newLinkElements;
|
401
442
|
}
|
402
|
-
|
403
443
|
/**
|
404
444
|
* 获得未存在的元素
|
405
445
|
* @param {Array} elements
|
406
446
|
* @returns
|
407
447
|
*/
|
448
|
+
|
449
|
+
|
408
450
|
function findUNExistedElements(elements) {
|
409
451
|
var dm = topo.getDataModel();
|
410
452
|
var newLinkElements = elements.filter(function (element) {
|
@@ -412,17 +454,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
412
454
|
});
|
413
455
|
return newLinkElements;
|
414
456
|
}
|
415
|
-
|
416
457
|
/**
|
417
458
|
* 关联容器的资源
|
418
459
|
*/
|
460
|
+
|
461
|
+
|
419
462
|
function bindGroupResources(_x4, _x5) {
|
420
463
|
return _bindGroupResources.apply(this, arguments);
|
421
464
|
}
|
465
|
+
|
422
466
|
function _bindGroupResources() {
|
423
|
-
_bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
467
|
+
_bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(group, resources) {
|
424
468
|
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
425
|
-
|
469
|
+
|
470
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
426
471
|
while (1) switch (_context10.prev = _context10.next) {
|
427
472
|
case 0:
|
428
473
|
id = group.id, tag = group.tag;
|
@@ -430,9 +475,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
430
475
|
topo.historyManager.beginTransaction();
|
431
476
|
_context10.next = 5;
|
432
477
|
return resourceConfig.updateGroupResources(group, resources);
|
478
|
+
|
433
479
|
case 5:
|
434
480
|
_context10.next = 7;
|
435
481
|
return editDispatchers.fetchDataByConfig();
|
482
|
+
|
436
483
|
case 7:
|
437
484
|
_yield$editDispatcher2 = _context10.sent;
|
438
485
|
elements = _yield$editDispatcher2.elements;
|
@@ -440,14 +487,17 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
440
487
|
nodeElements = findGroupChildren(elements, group);
|
441
488
|
newLinkElements = findUNExistedLinkElements(elements);
|
442
489
|
updateElements = [].concat(nodeElements, newLinkElements);
|
490
|
+
|
443
491
|
if (updateElements.length) {
|
444
|
-
saveBind(TopoEvent.DATA_TYPE_RESOURCE_CONTAINER, updateElements);
|
445
|
-
|
492
|
+
saveBind(TopoEvent.DATA_TYPE_RESOURCE_CONTAINER, updateElements); // 临时放这里,仅拓扑中心有
|
493
|
+
|
446
494
|
if (topo.linkDynamicStyleExecutor) {
|
447
495
|
topo.linkDynamicStyleExecutor.execute();
|
448
496
|
}
|
449
497
|
}
|
498
|
+
|
450
499
|
topo.historyManager.endTransaction();
|
500
|
+
|
451
501
|
case 14:
|
452
502
|
case "end":
|
453
503
|
return _context10.stop();
|
@@ -456,16 +506,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
456
506
|
}));
|
457
507
|
return _bindGroupResources.apply(this, arguments);
|
458
508
|
}
|
509
|
+
|
459
510
|
function addGroupResources(_x6, _x7) {
|
460
511
|
return _addGroupResources.apply(this, arguments);
|
461
512
|
}
|
462
513
|
/**
|
463
514
|
* 关联视图的资源
|
464
515
|
*/
|
516
|
+
|
517
|
+
|
465
518
|
function _addGroupResources() {
|
466
|
-
_addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
519
|
+
_addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, newResourceIds) {
|
467
520
|
var groupConfig, resources, groupData;
|
468
|
-
return _regeneratorRuntime
|
521
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
469
522
|
while (1) switch (_context11.prev = _context11.next) {
|
470
523
|
case 0:
|
471
524
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
@@ -478,6 +531,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
478
531
|
};
|
479
532
|
_context11.next = 5;
|
480
533
|
return bindGroupResources(groupData, resources);
|
534
|
+
|
481
535
|
case 5:
|
482
536
|
case "end":
|
483
537
|
return _context11.stop();
|
@@ -486,6 +540,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
486
540
|
}));
|
487
541
|
return _addGroupResources.apply(this, arguments);
|
488
542
|
}
|
543
|
+
|
489
544
|
function bindViewResources(_x8) {
|
490
545
|
return _bindViewResources.apply(this, arguments);
|
491
546
|
}
|
@@ -495,10 +550,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
495
550
|
* @param newResourceIds 新增的资源id列表
|
496
551
|
* @return {Promise<void>}
|
497
552
|
*/
|
553
|
+
|
554
|
+
|
498
555
|
function _bindViewResources() {
|
499
|
-
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
556
|
+
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(data) {
|
500
557
|
var config, _yield$editDispatcher3, elements;
|
501
|
-
|
558
|
+
|
559
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
502
560
|
while (1) switch (_context12.prev = _context12.next) {
|
503
561
|
case 0:
|
504
562
|
// console.log("关联视图的资源", data);
|
@@ -506,17 +564,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
506
564
|
config.resources = data;
|
507
565
|
_context12.next = 4;
|
508
566
|
return resourceConfig.updateConfig(config);
|
567
|
+
|
509
568
|
case 4:
|
510
569
|
_context12.next = 6;
|
511
570
|
return editDispatchers.fetchDataByConfig();
|
571
|
+
|
512
572
|
case 6:
|
513
573
|
_yield$editDispatcher3 = _context12.sent;
|
514
574
|
elements = _yield$editDispatcher3.elements;
|
515
|
-
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements);
|
516
|
-
|
575
|
+
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
576
|
+
|
517
577
|
if (topo.linkDynamicStyleExecutor) {
|
518
578
|
topo.linkDynamicStyleExecutor.execute();
|
519
579
|
}
|
580
|
+
|
520
581
|
case 10:
|
521
582
|
case "end":
|
522
583
|
return _context12.stop();
|
@@ -525,23 +586,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
525
586
|
}));
|
526
587
|
return _bindViewResources.apply(this, arguments);
|
527
588
|
}
|
589
|
+
|
528
590
|
function addLayerResources(_x9, _x10) {
|
529
591
|
return _addLayerResources.apply(this, arguments);
|
530
592
|
}
|
593
|
+
|
531
594
|
function _addLayerResources() {
|
532
|
-
_addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
595
|
+
_addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
|
533
596
|
var _yield$editDispatcher4, elements, newElements;
|
534
|
-
|
597
|
+
|
598
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
535
599
|
while (1) switch (_context13.prev = _context13.next) {
|
536
600
|
case 0:
|
537
|
-
topo.historyManager.beginTransaction();
|
601
|
+
topo.historyManager.beginTransaction(); // 构造新的配置
|
538
602
|
|
539
|
-
// 构造新的配置
|
540
603
|
_context13.next = 3;
|
541
604
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
605
|
+
|
542
606
|
case 3:
|
543
607
|
_context13.next = 5;
|
544
608
|
return editDispatchers.fetchDataByConfig();
|
609
|
+
|
545
610
|
case 5:
|
546
611
|
_yield$editDispatcher4 = _context13.sent;
|
547
612
|
elements = _yield$editDispatcher4.elements;
|
@@ -551,18 +616,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
551
616
|
layer: group,
|
552
617
|
newElements: newElements
|
553
618
|
});
|
554
|
-
topo.getHtTopo().addElements(newElements);
|
619
|
+
topo.getHtTopo().addElements(newElements); // 临时放这里,仅拓扑中心有
|
555
620
|
|
556
|
-
// 临时放这里,仅拓扑中心有
|
557
621
|
if (topo.linkDynamicStyleExecutor) {
|
558
622
|
topo.linkDynamicStyleExecutor.execute();
|
559
623
|
}
|
624
|
+
|
560
625
|
topo.historyManager.endTransaction();
|
561
|
-
topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true);
|
562
|
-
|
626
|
+
topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true); // 添加资源后隐藏资源面板
|
627
|
+
|
563
628
|
topoEditDispatchers.update({
|
564
629
|
resourceTabActiveKey: null
|
565
630
|
});
|
631
|
+
|
566
632
|
case 14:
|
567
633
|
case "end":
|
568
634
|
return _context13.stop();
|
@@ -571,18 +637,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
571
637
|
}));
|
572
638
|
return _addLayerResources.apply(this, arguments);
|
573
639
|
}
|
640
|
+
|
574
641
|
function addResourceToFirstLayer(_x11) {
|
575
642
|
return _addResourceToFirstLayer.apply(this, arguments);
|
576
643
|
}
|
644
|
+
|
577
645
|
function _addResourceToFirstLayer() {
|
578
|
-
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
646
|
+
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
|
579
647
|
var group;
|
580
|
-
return _regeneratorRuntime
|
648
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
581
649
|
while (1) switch (_context14.prev = _context14.next) {
|
582
650
|
case 0:
|
583
651
|
group = resourceConfig.getGroups()[0];
|
584
652
|
_context14.next = 3;
|
585
653
|
return addLayerResources(group, data);
|
654
|
+
|
586
655
|
case 3:
|
587
656
|
case "end":
|
588
657
|
return _context14.stop();
|
@@ -591,76 +660,91 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
591
660
|
}));
|
592
661
|
return _addResourceToFirstLayer.apply(this, arguments);
|
593
662
|
}
|
663
|
+
|
594
664
|
function getAddResourceType() {
|
595
665
|
var type;
|
666
|
+
|
596
667
|
if (isLayerTopo) {
|
597
668
|
type = "addToFirstLayer";
|
598
669
|
}
|
670
|
+
|
599
671
|
return type;
|
600
672
|
}
|
601
|
-
|
602
673
|
/**
|
603
674
|
* 获得关联资源抽屉模式:新增、全量
|
604
675
|
*
|
605
676
|
* @return {string}
|
606
677
|
*/
|
678
|
+
|
679
|
+
|
607
680
|
function getAddResourceDrawerMode() {
|
608
681
|
return getAddResourceType() === "addToFirstLayer" ? "new" : "all";
|
609
682
|
}
|
610
|
-
|
611
683
|
/**
|
612
684
|
* 未选中元素添加资源
|
613
685
|
*
|
614
686
|
* @param {*} data
|
615
687
|
*/
|
688
|
+
|
689
|
+
|
616
690
|
var onSaveComboRes = /*#__PURE__*/function () {
|
617
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
618
|
-
return _regeneratorRuntime
|
691
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
|
692
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
619
693
|
while (1) switch (_context5.prev = _context5.next) {
|
620
694
|
case 0:
|
621
695
|
rlog.debug("关联资源-----onSaveComboRes", data);
|
622
696
|
topo.historyManager.beginTransaction();
|
697
|
+
|
623
698
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
624
699
|
_context5.next = 7;
|
625
700
|
break;
|
626
701
|
}
|
702
|
+
|
627
703
|
_context5.next = 5;
|
628
704
|
return addResourceToFirstLayer(data);
|
705
|
+
|
629
706
|
case 5:
|
630
707
|
_context5.next = 9;
|
631
708
|
break;
|
709
|
+
|
632
710
|
case 7:
|
633
711
|
_context5.next = 9;
|
634
712
|
return bindViewResources(data);
|
713
|
+
|
635
714
|
case 9:
|
636
715
|
topo.historyManager.endTransaction();
|
637
716
|
topo.getHtTopo().fitContent();
|
638
717
|
topoEditDispatchers.update({
|
639
718
|
resourceTabActiveKey: null
|
640
719
|
});
|
720
|
+
|
641
721
|
case 12:
|
642
722
|
case "end":
|
643
723
|
return _context5.stop();
|
644
724
|
}
|
645
725
|
}, _callee5);
|
646
726
|
}));
|
727
|
+
|
647
728
|
return function onSaveComboRes(_x12) {
|
648
729
|
return _ref5.apply(this, arguments);
|
649
730
|
};
|
650
731
|
}();
|
732
|
+
|
651
733
|
var onSaveTopo = /*#__PURE__*/function () {
|
652
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
734
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
|
653
735
|
var id, config, serialize, _config$layout, template, layout, saveConfig;
|
654
|
-
|
736
|
+
|
737
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
655
738
|
while (1) switch (_context7.prev = _context7.next) {
|
656
739
|
case 0:
|
657
740
|
id = data.id, config = data.config, serialize = data.serialize;
|
658
741
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
742
|
+
|
659
743
|
if (onSave) {
|
660
744
|
// 自定义保存
|
661
745
|
saveConfig = /*#__PURE__*/function () {
|
662
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
663
|
-
return _regeneratorRuntime
|
746
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
747
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
664
748
|
while (1) switch (_context6.prev = _context6.next) {
|
665
749
|
case 0:
|
666
750
|
_context6.next = 2;
|
@@ -669,32 +753,38 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
669
753
|
layout: layout,
|
670
754
|
serialize: serialize
|
671
755
|
});
|
756
|
+
|
672
757
|
case 2:
|
673
758
|
case "end":
|
674
759
|
return _context6.stop();
|
675
760
|
}
|
676
761
|
}, _callee6);
|
677
762
|
}));
|
763
|
+
|
678
764
|
return function saveConfig() {
|
679
765
|
return _ref7.apply(this, arguments);
|
680
766
|
};
|
681
767
|
}();
|
768
|
+
|
682
769
|
onSave({
|
683
770
|
topo: topo,
|
684
771
|
data: data,
|
685
772
|
saveConfig: saveConfig
|
686
773
|
});
|
687
774
|
}
|
775
|
+
|
688
776
|
case 3:
|
689
777
|
case "end":
|
690
778
|
return _context7.stop();
|
691
779
|
}
|
692
780
|
}, _callee7);
|
693
781
|
}));
|
782
|
+
|
694
783
|
return function onSaveTopo(_x13) {
|
695
784
|
return _ref6.apply(this, arguments);
|
696
785
|
};
|
697
786
|
}();
|
787
|
+
|
698
788
|
var saveBind = function saveBind(type, data) {
|
699
789
|
var eventData = {
|
700
790
|
type: type,
|
@@ -703,7 +793,6 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
703
793
|
rlog.debug("TopoCenter:onSaveBind", eventData);
|
704
794
|
emitEvent(TopoEvent.EVENT_DATA_RESULT, eventData);
|
705
795
|
};
|
706
|
-
|
707
796
|
/**
|
708
797
|
* 单节点绑定资源
|
709
798
|
*
|
@@ -715,10 +804,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
715
804
|
* 关联到已有区域里的节点
|
716
805
|
* 重新关联到已有区域里的节点
|
717
806
|
*/
|
807
|
+
|
808
|
+
|
718
809
|
var bindNodeResource = /*#__PURE__*/function () {
|
719
|
-
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
810
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(params) {
|
720
811
|
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
721
|
-
|
812
|
+
|
813
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
722
814
|
while (1) switch (_context9.prev = _context9.next) {
|
723
815
|
case 0:
|
724
816
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
@@ -728,21 +820,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
728
820
|
}), [newResId])
|
729
821
|
});
|
730
822
|
};
|
823
|
+
|
731
824
|
_doBind = function _doBind3() {
|
732
|
-
_doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
825
|
+
_doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
733
826
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
734
|
-
return _regeneratorRuntime
|
827
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
735
828
|
while (1) switch (_context8.prev = _context8.next) {
|
736
829
|
case 0:
|
737
830
|
dm = htTopo.getGraphView().dm(); // 创建
|
831
|
+
|
738
832
|
newLinkElements = findUNExistedLinkElements(elements);
|
739
833
|
createElementsData = null;
|
834
|
+
|
740
835
|
if (newData.type === "group") {
|
741
836
|
groupChildren = findGroupChildren(elements, newData);
|
742
837
|
newGroupChildren = [];
|
743
838
|
existedGroupChildren = [];
|
744
839
|
groupChildren.forEach(function (groupChildData) {
|
745
840
|
var ele = dm.getDataByTag(groupChildData.id);
|
841
|
+
|
746
842
|
if (ele) {
|
747
843
|
existedGroupChildren.push(groupChildData);
|
748
844
|
} else {
|
@@ -759,8 +855,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
759
855
|
return item.type === "linkGroup";
|
760
856
|
})
|
761
857
|
};
|
762
|
-
htTopo.createElements(createElementsData);
|
763
|
-
|
858
|
+
htTopo.createElements(createElementsData); // 切换前图上如果存在集群内的节点,切换节点为集群后,移到集群内
|
859
|
+
|
764
860
|
groupElement = dm.getDataByTag(newData.id);
|
765
861
|
existedGroupChildren.forEach(function (groupChildData) {
|
766
862
|
var nodeElement = dm.getDataByTag(groupChildData.id);
|
@@ -779,33 +875,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
779
875
|
};
|
780
876
|
htTopo.createElements(createElementsData);
|
781
877
|
}
|
782
|
-
rlog.debug("批量创建元素", createElementsData);
|
783
878
|
|
784
|
-
// 恢复图标、大小、位置
|
879
|
+
rlog.debug("批量创建元素", createElementsData); // 恢复图标、大小、位置
|
880
|
+
|
785
881
|
newElement = dm.getDataByTag(newData.id);
|
882
|
+
|
786
883
|
if (newElement) {
|
787
884
|
newElement.setSize(node.getSize());
|
788
885
|
newElement.setPosition(node.getPosition());
|
789
886
|
newElement.setImage(node.getImage());
|
790
|
-
}
|
791
|
-
// 选中
|
792
|
-
sm = htTopo.getGraphView().sm();
|
793
|
-
sm.setSelection([newElement]);
|
887
|
+
} // 选中
|
794
888
|
|
795
|
-
// 移除旧节点
|
796
|
-
dm.remove(node);
|
797
889
|
|
798
|
-
|
799
|
-
|
890
|
+
sm = htTopo.getGraphView().sm();
|
891
|
+
sm.setSelection([newElement]); // 移除旧节点
|
800
892
|
|
893
|
+
dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
|
894
|
+
// node.a("customName", null);
|
801
895
|
// 删除关联在节点上的出口链路
|
896
|
+
|
802
897
|
_context8.next = 12;
|
803
898
|
return deleteExLink(node);
|
899
|
+
|
804
900
|
case 12:
|
805
901
|
// 临时放这里,仅拓扑中心有
|
806
902
|
if (topo.linkDynamicStyleExecutor) {
|
807
903
|
topo.linkDynamicStyleExecutor.execute();
|
808
904
|
}
|
905
|
+
|
809
906
|
case 13:
|
810
907
|
case "end":
|
811
908
|
return _context8.stop();
|
@@ -814,116 +911,145 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
814
911
|
}));
|
815
912
|
return _doBind.apply(this, arguments);
|
816
913
|
};
|
914
|
+
|
817
915
|
doBind = function _doBind2() {
|
818
916
|
return _doBind.apply(this, arguments);
|
819
917
|
};
|
918
|
+
|
820
919
|
topo.historyManager.beginTransaction();
|
821
920
|
id = params.id, oldResId = params.oldResId, newResId = params.newResId;
|
822
921
|
rlog.debug("bindNodeResource", params);
|
823
922
|
node = topo.getDataModel().getDataById(id); // 节点所属容器
|
923
|
+
|
824
924
|
parentGroupElement = node.getParent();
|
825
925
|
htTopo = topo.getHtTopo();
|
826
926
|
config = resourceConfig.getConfig();
|
927
|
+
|
827
928
|
if (parentGroupElement) {
|
828
929
|
// 在容器中
|
829
930
|
groupId = parentGroupElement.getTag(); // 容器业务id
|
931
|
+
|
830
932
|
groupTag = parentGroupElement.a("tag"); // 容器临时id
|
933
|
+
|
831
934
|
config.groups = config.groups.map(function (g) {
|
832
935
|
// 匹配到容器,替换资源或增加
|
833
936
|
if (g.id === groupId || g.tag === groupTag) {
|
834
937
|
return _extends({}, g, {
|
835
938
|
resources: replaceOrAddRes(g.resources, oldResId, newResId)
|
836
939
|
});
|
837
|
-
}
|
838
|
-
|
940
|
+
} // 未匹配到容器
|
941
|
+
|
942
|
+
|
839
943
|
return g;
|
840
944
|
});
|
841
945
|
} else {
|
842
946
|
// 在画布上
|
843
947
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
844
948
|
}
|
949
|
+
|
845
950
|
_context9.next = 13;
|
846
951
|
return resourceConfig.updateConfig(config);
|
952
|
+
|
847
953
|
case 13:
|
848
954
|
_context9.next = 15;
|
849
955
|
return editDispatchers.fetchDataByConfig();
|
956
|
+
|
850
957
|
case 15:
|
851
958
|
_yield$editDispatcher = _context9.sent;
|
852
959
|
elements = _yield$editDispatcher.elements;
|
853
960
|
newData = elements.find(function (item) {
|
854
961
|
return item.id === newResId;
|
855
962
|
});
|
963
|
+
|
856
964
|
if (newData) {
|
857
965
|
_context9.next = 23;
|
858
966
|
break;
|
859
967
|
}
|
968
|
+
|
860
969
|
_Message.error("关联资源失败");
|
970
|
+
|
861
971
|
rlog.warn("关联资源失败");
|
862
972
|
topo.historyManager.endTransaction();
|
863
973
|
return _context9.abrupt("return", false);
|
974
|
+
|
864
975
|
case 23:
|
865
976
|
_context9.next = 25;
|
866
977
|
return doBind();
|
978
|
+
|
867
979
|
case 25:
|
868
980
|
topo.historyManager.endTransaction();
|
981
|
+
|
869
982
|
case 26:
|
870
983
|
case "end":
|
871
984
|
return _context9.stop();
|
872
985
|
}
|
873
986
|
}, _callee9);
|
874
987
|
}));
|
988
|
+
|
875
989
|
return function bindNodeResource(_x14) {
|
876
990
|
return _ref8.apply(this, arguments);
|
877
991
|
};
|
878
992
|
}();
|
879
|
-
|
880
993
|
/**
|
881
994
|
* 关联IP的图片节点
|
882
995
|
*/
|
996
|
+
|
997
|
+
|
883
998
|
function relateNodeIp(_x15, _x16) {
|
884
999
|
return _relateNodeIp.apply(this, arguments);
|
885
1000
|
}
|
1001
|
+
|
886
1002
|
function _relateNodeIp() {
|
887
|
-
_relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
1003
|
+
_relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(txtValue, nodeElement) {
|
888
1004
|
var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
889
|
-
|
1005
|
+
|
1006
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
890
1007
|
while (1) switch (_context15.prev = _context15.next) {
|
891
1008
|
case 0:
|
892
1009
|
if (txtValue) {
|
893
1010
|
_context15.next = 2;
|
894
1011
|
break;
|
895
1012
|
}
|
1013
|
+
|
896
1014
|
return _context15.abrupt("return");
|
1015
|
+
|
897
1016
|
case 2:
|
898
1017
|
// if (txtValue === nodeElement.a('bindIp')) {
|
899
1018
|
// return;
|
900
1019
|
// }
|
901
1020
|
// 根据配置查询拓扑数据
|
902
1021
|
dm = topo.getDataModel(); // 执行唯一性验证
|
1022
|
+
|
903
1023
|
isUnique = isUniqueIp(dm, txtValue, nodeElement); // 获取关联链路
|
1024
|
+
|
904
1025
|
if (!isUnique) {
|
905
1026
|
_context15.next = 23;
|
906
1027
|
break;
|
907
1028
|
}
|
1029
|
+
|
908
1030
|
ip = buildIpNode(txtValue);
|
909
1031
|
_context15.next = 8;
|
910
1032
|
return deleteExLink(nodeElement);
|
1033
|
+
|
911
1034
|
case 8:
|
912
1035
|
nodeElement.a(ip);
|
913
1036
|
nodeElement.setName(txtValue);
|
914
|
-
nodeElement.setTag("ip:" + txtValue);
|
915
|
-
|
1037
|
+
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1038
|
+
|
916
1039
|
configObj = topo.resourceConfig.getConfig();
|
917
1040
|
_context15.next = 14;
|
918
1041
|
return resourceConfig.updateConfig(configObj);
|
1042
|
+
|
919
1043
|
case 14:
|
920
1044
|
_context15.next = 16;
|
921
1045
|
return editDispatchers.fetchDataByConfig();
|
1046
|
+
|
922
1047
|
case 16:
|
923
1048
|
configData = _context15.sent;
|
924
1049
|
// console.log("configData",configObj, configData);
|
925
1050
|
_elements = configData.elements;
|
926
1051
|
newLinkElements = findUNExistedLinkElements(_elements); // console.log("configData", configData, newLinkElements);
|
1052
|
+
|
927
1053
|
newLink = newLinkElements.filter(function (item) {
|
928
1054
|
return item.type === "link";
|
929
1055
|
});
|
@@ -931,16 +1057,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
931
1057
|
return item.type === "linkGroup";
|
932
1058
|
}); // const newData = elements.find((item) => item.id === `ip:${txtValue}`);
|
933
1059
|
// console.log("newData",newLinkElements, newLink);
|
1060
|
+
|
934
1061
|
createElementsData = {
|
935
1062
|
groups: [],
|
936
1063
|
nodes: [],
|
937
1064
|
links: newLink,
|
938
1065
|
linkGroups: newLinkGroup
|
939
1066
|
}; // console.log("createElementsData", createElementsData);
|
1067
|
+
|
940
1068
|
if ([].concat(newLink, newLinkGroup).length > 0) {
|
941
1069
|
_htTopo = topo.getHtTopo();
|
1070
|
+
|
942
1071
|
_htTopo.createElements(createElementsData);
|
943
1072
|
}
|
1073
|
+
|
944
1074
|
case 23:
|
945
1075
|
case "end":
|
946
1076
|
return _context15.stop();
|
@@ -949,19 +1079,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
949
1079
|
}));
|
950
1080
|
return _relateNodeIp.apply(this, arguments);
|
951
1081
|
}
|
1082
|
+
|
952
1083
|
var onEvent = function onEvent(e) {
|
953
1084
|
var map = {};
|
954
1085
|
var handler = map[e.name];
|
1086
|
+
|
955
1087
|
if (handler) {
|
956
1088
|
handler(e.data);
|
957
1089
|
}
|
958
1090
|
};
|
1091
|
+
|
959
1092
|
var effectsState = store.useModelEffectsState("topoConfig");
|
960
1093
|
var topoLoading = effectsState.getTopoByConditions.isLoading;
|
961
|
-
|
962
1094
|
/**
|
963
1095
|
* 设置视图鼠标模式
|
964
1096
|
*/
|
1097
|
+
|
965
1098
|
var setViewMouseMode = function setViewMouseMode(mode) {
|
966
1099
|
rlog.debug("设置视图鼠标模式", mode);
|
967
1100
|
topo.getHtTopo().setViewMouseMode(mode);
|
@@ -969,25 +1102,31 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
969
1102
|
viewMouseMode: mode
|
970
1103
|
});
|
971
1104
|
};
|
1105
|
+
|
972
1106
|
return {
|
973
1107
|
resourceConfig: resourceConfig,
|
1108
|
+
|
974
1109
|
/**
|
975
1110
|
* 拓扑结构加载中状态
|
976
1111
|
*/
|
977
1112
|
topoLoading: topoLoading,
|
978
1113
|
setViewMouseMode: setViewMouseMode,
|
1114
|
+
|
979
1115
|
/**
|
980
1116
|
* 资源绑定(多选)抽屉显示状态
|
981
1117
|
*/
|
982
1118
|
showComboResDrawer: showComboResDrawer,
|
1119
|
+
|
983
1120
|
/**
|
984
1121
|
* 资源绑定(多选)已选择资源(动态+固定)
|
985
1122
|
*/
|
986
1123
|
initialComboRes: comboResData,
|
1124
|
+
|
987
1125
|
/**
|
988
1126
|
* 当前资源对应的拓扑结构(点+线+容器)
|
989
1127
|
*/
|
990
1128
|
topo: editState.elements,
|
1129
|
+
|
991
1130
|
/**
|
992
1131
|
* 拓扑图全局已选固定资源
|
993
1132
|
*/
|
@@ -995,42 +1134,51 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
995
1134
|
onEvent: onEvent,
|
996
1135
|
reset: reset,
|
997
1136
|
addLayerResources: addLayerResources,
|
1137
|
+
|
998
1138
|
/**
|
999
1139
|
* 显示全局添加资源抽屉
|
1000
1140
|
*/
|
1001
1141
|
showGlobalAddResourceDrawer: showGlobalAddResourceDrawer,
|
1002
1142
|
groupAddResource: groupAddResource,
|
1003
1143
|
addGroupResources: addGroupResources,
|
1144
|
+
|
1004
1145
|
/**
|
1005
1146
|
* 添加资源抽屉类型
|
1006
1147
|
*/
|
1007
1148
|
getAddResourceDrawerMode: getAddResourceDrawerMode,
|
1149
|
+
|
1008
1150
|
/**
|
1009
1151
|
* 资源绑定(单选)保存选择
|
1010
1152
|
*/
|
1011
1153
|
bindNodeResource: bindNodeResource,
|
1154
|
+
|
1012
1155
|
/**
|
1013
1156
|
* 删除节点关联的出口链路
|
1014
1157
|
*/
|
1015
1158
|
deleteExLink: deleteExLink,
|
1159
|
+
|
1016
1160
|
/**
|
1017
1161
|
* 资源绑定(多选)保存选择
|
1018
1162
|
*/
|
1019
1163
|
onSaveComboRes: onSaveComboRes,
|
1164
|
+
|
1020
1165
|
/**
|
1021
1166
|
* 关闭资源绑定(多选)抽屉
|
1022
1167
|
*/
|
1023
1168
|
onCloseComboResDrawer: function onCloseComboResDrawer() {
|
1024
1169
|
return setShowComboResDrawer(false);
|
1025
1170
|
},
|
1171
|
+
|
1026
1172
|
/**
|
1027
1173
|
* 拓扑图元素(节点、连线、容器)删除回调
|
1028
1174
|
*/
|
1029
1175
|
onDeleteElement: onDeleteElement,
|
1176
|
+
|
1030
1177
|
/**
|
1031
1178
|
* 绑定图片ip
|
1032
1179
|
*/
|
1033
1180
|
relateNodeIp: relateNodeIp,
|
1181
|
+
|
1034
1182
|
/**
|
1035
1183
|
* 拓扑图保存回调
|
1036
1184
|
*/
|
@@ -1039,4 +1187,5 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1039
1187
|
onLayerAdded: onLayerAdded
|
1040
1188
|
};
|
1041
1189
|
};
|
1190
|
+
|
1042
1191
|
export default useTopoEdit;
|