@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
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
3
3
|
import EdgeGroup from "../core/models/EdgeGroup";
|
4
4
|
var ht = window.ht;
|
5
|
+
|
5
6
|
function getElementData(element) {
|
6
7
|
var className = element.getClassName();
|
7
8
|
var commonData = {
|
@@ -13,13 +14,16 @@ function getElementData(element) {
|
|
13
14
|
attrObject: element.getAttrObject(),
|
14
15
|
styleMap: element.getStyleMap()
|
15
16
|
};
|
17
|
+
|
16
18
|
if (className === "ht.Edge") {
|
17
19
|
return _extends({}, commonData);
|
18
20
|
}
|
21
|
+
|
19
22
|
return _extends({}, commonData, {
|
20
23
|
position: element.getPosition()
|
21
24
|
});
|
22
25
|
}
|
26
|
+
|
23
27
|
export function isNode(element) {
|
24
28
|
// HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
25
29
|
// eslint-disable-next-line no-underscore-dangle
|
@@ -32,10 +36,12 @@ export function isValidEdge(element) {
|
|
32
36
|
if (!isEdge(element)) {
|
33
37
|
return false;
|
34
38
|
}
|
39
|
+
|
35
40
|
if (!element.getSource() || !element.getTarget()) {
|
36
41
|
rlog.error("isValidEdge 连线异常:源或目的为空", element);
|
37
42
|
return false;
|
38
43
|
}
|
44
|
+
|
39
45
|
return true;
|
40
46
|
}
|
41
47
|
export function isGroup(element) {
|
@@ -73,10 +79,12 @@ export function getGroupData(element) {
|
|
73
79
|
if (!element) {
|
74
80
|
return null;
|
75
81
|
}
|
82
|
+
|
76
83
|
var parent = element.getParent();
|
77
84
|
var groupInfo = parent ? {
|
78
85
|
groupId: parent.getTag(),
|
79
86
|
groupTag: parent.a("tag") // 父容器
|
87
|
+
|
80
88
|
} : {};
|
81
89
|
return _extends({
|
82
90
|
name: element.getStyleMap().label
|
@@ -97,6 +105,7 @@ export function getNodeData(element) {
|
|
97
105
|
var groupInfo = parent ? {
|
98
106
|
groupId: parent.getTag(),
|
99
107
|
groupTag: parent.a("tag") // 父容器
|
108
|
+
|
100
109
|
} : {};
|
101
110
|
return _extends({}, element.getAttrObject(), {
|
102
111
|
tag: element.getId(),
|
@@ -109,41 +118,44 @@ export function getEdges(dataModel) {
|
|
109
118
|
export function isEdgeGroupExpanded(edge) {
|
110
119
|
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s("edge.expanded");
|
111
120
|
}
|
112
|
-
|
113
121
|
/**
|
114
122
|
* 是否连线组代理
|
115
123
|
* @param {*} edge
|
116
124
|
* @returns
|
117
125
|
*/
|
126
|
+
|
118
127
|
export function isEdgeGroupAgent(edge) {
|
119
128
|
return isEdge(edge) && edge.getEdgeGroup() && edge.isEdgeGroupAgent();
|
120
129
|
}
|
121
|
-
|
122
130
|
/**
|
123
131
|
* 获得两个节点间的连线列表
|
124
132
|
* @param {*} node1
|
125
133
|
* @param {*} node2
|
126
134
|
* @returns
|
127
135
|
*/
|
136
|
+
|
128
137
|
export function getEdgesBetweenNodes(node1, node2) {
|
129
138
|
var edges = [];
|
130
139
|
var node1Edges = node1.getEdges();
|
140
|
+
|
131
141
|
if (!node1Edges) {
|
132
142
|
return edges;
|
133
143
|
}
|
144
|
+
|
134
145
|
node1Edges.toArray().filter(isValidEdge).forEach(function (edge) {
|
135
146
|
var isEdgeBetweenNodes = edge.getSource().getTag() === node2.getTag() || edge.getTarget().getTag() === node2.getTag();
|
147
|
+
|
136
148
|
if (isEdgeBetweenNodes) {
|
137
149
|
edges.push(edge);
|
138
150
|
}
|
139
151
|
});
|
140
152
|
return edges;
|
141
153
|
}
|
142
|
-
|
143
154
|
/**
|
144
155
|
* 获得节点间的连线组,连线<=1时返回null
|
145
156
|
* @returns
|
146
157
|
*/
|
158
|
+
|
147
159
|
export function getEdgeGroupByNodes(node1, node2) {
|
148
160
|
var htEdgeGroup = null;
|
149
161
|
getEdgesBetweenNodes(node1, node2).forEach(function (edge) {
|
@@ -151,19 +163,22 @@ export function getEdgeGroupByNodes(node1, node2) {
|
|
151
163
|
htEdgeGroup = edge.getEdgeGroup();
|
152
164
|
}
|
153
165
|
});
|
166
|
+
|
154
167
|
if (!htEdgeGroup) {
|
155
168
|
return null;
|
156
169
|
}
|
170
|
+
|
157
171
|
return new EdgeGroup(htEdgeGroup);
|
158
172
|
}
|
159
|
-
|
160
173
|
/**
|
161
174
|
* 获得节点间的连线组,连线<=1时返回null
|
162
175
|
* @returns
|
163
176
|
*/
|
177
|
+
|
164
178
|
export function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
165
179
|
var node1 = dataModel.getDataByTag(nodeTag1);
|
166
180
|
var node2 = dataModel.getDataByTag(nodeTag2);
|
181
|
+
|
167
182
|
if (!node1 || !node2) {
|
168
183
|
console.warn("getEdgeGroupByNodes 未找到节点", {
|
169
184
|
node1: node1,
|
@@ -173,12 +188,14 @@ export function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
|
173
188
|
});
|
174
189
|
return null;
|
175
190
|
}
|
191
|
+
|
176
192
|
return getEdgeGroupByNodes(node1, node2);
|
177
193
|
}
|
178
194
|
export function getEdgeGroups(dataModel) {
|
179
195
|
var edgeGroups = [];
|
180
196
|
getEdges(dataModel).forEach(function (edge) {
|
181
197
|
var group = edge.getEdgeGroup();
|
198
|
+
|
182
199
|
if (group && !edgeGroups.includes(group)) {
|
183
200
|
edgeGroups.push(group);
|
184
201
|
}
|
@@ -191,6 +208,7 @@ export function getEdgeGroupAgents(dataModel) {
|
|
191
208
|
export function getEdgeDatas(dataModel) {
|
192
209
|
return getEdges(dataModel).map(function (element) {
|
193
210
|
var _element$getSource, _element$getTarget;
|
211
|
+
|
194
212
|
return _extends({}, element.getAttrObject(), {
|
195
213
|
source: (_element$getSource = element.getSource()) === null || _element$getSource === void 0 ? void 0 : _element$getSource.getTag(),
|
196
214
|
target: (_element$getTarget = element.getTarget()) === null || _element$getTarget === void 0 ? void 0 : _element$getTarget.getTag(),
|
@@ -203,125 +221,133 @@ export function getNodesByGroupIdOrTag(dataModel, groupIdOrTag) {
|
|
203
221
|
return element.groupId === groupIdOrTag || element.groupTag === groupIdOrTag;
|
204
222
|
});
|
205
223
|
}
|
206
|
-
|
207
224
|
/**
|
208
225
|
* 获取分层里的节点列表
|
209
226
|
*
|
210
227
|
* @param layer
|
211
228
|
* @return {*}
|
212
229
|
*/
|
230
|
+
|
213
231
|
export function getLayerChildrenNodes(layer) {
|
214
232
|
if (!layer) {
|
215
233
|
return [];
|
216
234
|
}
|
235
|
+
|
217
236
|
return layer.getChildren().getArray().filter(isNode);
|
218
237
|
}
|
219
|
-
|
220
238
|
/**
|
221
239
|
* 获取分层里的节点列表
|
222
240
|
*
|
223
241
|
* @param layer
|
224
242
|
* @return {*}
|
225
243
|
*/
|
244
|
+
|
226
245
|
export function getLayerChildren(layer) {
|
227
246
|
if (!layer) {
|
228
247
|
return [];
|
229
248
|
}
|
249
|
+
|
230
250
|
return layer.getChildren().getArray();
|
231
251
|
}
|
232
|
-
|
233
252
|
/**
|
234
253
|
* 获取容器里的子元素列表
|
235
254
|
*
|
236
255
|
* @param group
|
237
256
|
* @return {*}
|
238
257
|
*/
|
258
|
+
|
239
259
|
export function getGroupChildren(group) {
|
240
260
|
if (!group) {
|
241
261
|
return [];
|
242
|
-
}
|
243
|
-
// HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
262
|
+
} // HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
244
263
|
// eslint-disable-next-line no-underscore-dangle
|
264
|
+
|
265
|
+
|
245
266
|
return group.getChildren().getArray().filter(function (node) {
|
246
267
|
return node._layer !== "container_blank";
|
247
268
|
});
|
248
269
|
}
|
249
|
-
|
250
270
|
/**
|
251
271
|
* 获取容器里的节点列表
|
252
272
|
*
|
253
273
|
* @param group
|
254
274
|
* @return {*}
|
255
275
|
*/
|
276
|
+
|
256
277
|
export function getGroupChildrenNodes(group) {
|
257
278
|
if (!group) {
|
258
279
|
return [];
|
259
280
|
}
|
281
|
+
|
260
282
|
return getGroupChildren(group).filter(isNode);
|
261
283
|
}
|
262
|
-
|
263
284
|
/**
|
264
285
|
* 获取容器里的节点数据列表
|
265
286
|
*
|
266
287
|
* @param group
|
267
288
|
* @return {*}
|
268
289
|
*/
|
290
|
+
|
269
291
|
export function getGroupChildrenData(group) {
|
270
292
|
return getGroupChildren(group).map(getNodeData);
|
271
293
|
}
|
272
294
|
export function setElementRuntimeStyle(element, name, value) {
|
273
295
|
var _extends2;
|
296
|
+
|
274
297
|
var prevRuntimeStyle = element.a("runtimeStyles") || {};
|
275
|
-
var runtimeStyle = _extends({}, prevRuntimeStyle, (_extends2 = {}, _extends2[name] = value, _extends2));
|
276
298
|
|
277
|
-
// if (prevRuntimeStyle[name] === undefined && value === undefined) {
|
299
|
+
var runtimeStyle = _extends({}, prevRuntimeStyle, (_extends2 = {}, _extends2[name] = value, _extends2)); // if (prevRuntimeStyle[name] === undefined && value === undefined) {
|
278
300
|
// return
|
279
301
|
// }
|
280
302
|
|
303
|
+
|
281
304
|
if (value === undefined) {
|
282
|
-
runtimeStyle[name] = undefined;
|
283
|
-
// delete runtimeStyle[name]
|
305
|
+
runtimeStyle[name] = undefined; // delete runtimeStyle[name]
|
284
306
|
}
|
285
307
|
|
286
308
|
element.a("runtimeStyles", runtimeStyle);
|
287
309
|
}
|
288
|
-
|
289
310
|
/**
|
290
311
|
* 判断拓扑图是否存在元素
|
291
312
|
*/
|
313
|
+
|
292
314
|
export function isExistedElement(htTopo, dataModel, data) {
|
293
315
|
if (dataModel.getDataByTag(data.id)) {
|
294
316
|
return true;
|
295
|
-
}
|
317
|
+
} // 识别区域
|
318
|
+
|
296
319
|
|
297
|
-
// 识别区域
|
298
320
|
var element = getElements(dataModel).find(function (item) {
|
299
321
|
return data.tag && item.a("tag") === data.tag;
|
300
322
|
});
|
323
|
+
|
301
324
|
if (element) {
|
302
325
|
return true;
|
303
|
-
}
|
326
|
+
} // 连线/连线组
|
327
|
+
|
304
328
|
|
305
|
-
// 连线/连线组
|
306
329
|
var edges = getEdges(dataModel);
|
330
|
+
|
307
331
|
for (var i = 0; i < edges.length; i++) {
|
308
|
-
var edge = edges[i];
|
332
|
+
var edge = edges[i]; // 如果连线组折叠,判断子连线
|
309
333
|
|
310
|
-
// 如果连线组折叠,判断子连线
|
311
334
|
var edgeData = htTopo.getEdgeData(edge);
|
335
|
+
|
312
336
|
if (edgeData) {
|
313
337
|
// eslint-disable-next-line no-underscore-dangle
|
314
338
|
var id = edgeData._attrObject.id;
|
339
|
+
|
315
340
|
if (id === data.id) {
|
316
341
|
return true;
|
317
342
|
}
|
318
|
-
}
|
319
|
-
|
320
|
-
// 如果连线组展开,判断连线组
|
343
|
+
} // 如果连线组展开,判断连线组
|
321
344
|
// eslint-disable-next-line no-underscore-dangle
|
345
|
+
|
346
|
+
|
322
347
|
if (edge.__edgeGroup && edge.__edgeGroup._tag === data.id) {
|
323
348
|
return true;
|
324
349
|
}
|
325
350
|
}
|
351
|
+
|
326
352
|
return false;
|
327
353
|
}
|
package/es/utils/template.js
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
// 空白模板
|
2
|
-
export var TPL_BLANK = 'auto';
|
3
|
-
|
4
|
-
export var TPL_TREE = 'layers';
|
5
|
-
|
6
|
-
export var TPL_REGION = 'partition';
|
7
|
-
// export const TPL_RING = 'ring';
|
2
|
+
export var TPL_BLANK = 'auto'; // 树状分层
|
3
|
+
|
4
|
+
export var TPL_TREE = 'layers'; // 分区
|
5
|
+
|
6
|
+
export var TPL_REGION = 'partition'; // export const TPL_RING = 'ring';
|
8
7
|
|
9
8
|
/**
|
10
9
|
* 默认布局
|
11
10
|
*/
|
11
|
+
|
12
12
|
export var DEFAULT_LAYOUT = {
|
13
13
|
id: 'hierarchical'
|
14
14
|
};
|
15
15
|
/**
|
16
16
|
* 默认容器数据
|
17
17
|
*/
|
18
|
+
|
18
19
|
export var DEFAULT_GROUP = {
|
19
20
|
name: '',
|
20
21
|
layout: DEFAULT_LAYOUT,
|
package/es/utils/topoData.js
CHANGED
@@ -12,7 +12,6 @@ import { isClusterHtElement, processCluster } from "./clusterUtil";
|
|
12
12
|
import { isGroup } from "./htElementUtils";
|
13
13
|
import v140UpgradeSerializeNodeImageSize from "../core/upgrade/v140UpgradeSerializeNodeImageSize";
|
14
14
|
import { getNodeNameVisible } from "../core/models/utils/nodeNameVisibleUtil";
|
15
|
-
|
16
15
|
/**
|
17
16
|
* 查找数组中对应key的值为value的元素并返回,只查找第一个符合的元素
|
18
17
|
* @param {Array} arr 数组
|
@@ -20,6 +19,7 @@ import { getNodeNameVisible } from "../core/models/utils/nodeNameVisibleUtil";
|
|
20
19
|
* @param {*} value 值
|
21
20
|
* @returns {*}
|
22
21
|
*/
|
22
|
+
|
23
23
|
export var findItem = function findItem(arr, key, value) {
|
24
24
|
return (arr || []).find(function (item) {
|
25
25
|
return item[key] && item[key] === value;
|
@@ -29,9 +29,8 @@ export var findItemIndex = function findItemIndex(arr, key, value) {
|
|
29
29
|
return (arr || []).findIndex(function (item) {
|
30
30
|
return item[key] && item[key] === value;
|
31
31
|
});
|
32
|
-
};
|
32
|
+
}; // 格式化容器
|
33
33
|
|
34
|
-
// 格式化容器
|
35
34
|
export function formatGroup(group) {
|
36
35
|
return _extends({}, group, {
|
37
36
|
styles: _extends({
|
@@ -44,21 +43,18 @@ export function formatGroup(group) {
|
|
44
43
|
showExpanded: true
|
45
44
|
}, typeof group.styles === "string" ? JSON.parse(group.styles) : group.styles || {})
|
46
45
|
});
|
47
|
-
}
|
46
|
+
} // 格式化容器
|
48
47
|
|
49
|
-
// 格式化容器
|
50
48
|
export function formatGroups(groups) {
|
51
49
|
return groups.map(formatGroup);
|
52
|
-
}
|
50
|
+
} // 格式化节点
|
53
51
|
|
54
|
-
// 格式化节点
|
55
52
|
var tfNode = function tfNode(topoEngine, node) {
|
56
53
|
return _extends({}, node, {
|
57
54
|
metrics: [],
|
58
55
|
attributes: []
|
59
56
|
});
|
60
57
|
};
|
61
|
-
|
62
58
|
/**
|
63
59
|
* ip、是否显示名称
|
64
60
|
*
|
@@ -66,9 +62,12 @@ var tfNode = function tfNode(topoEngine, node) {
|
|
66
62
|
* @param {*} topoData
|
67
63
|
* @returns
|
68
64
|
*/
|
65
|
+
|
66
|
+
|
69
67
|
function updateNodeInfo(topo, topoData) {
|
70
68
|
var _topo$store$getModelS = topo.store.getModelState('displayConfig'),
|
71
|
-
|
69
|
+
nodeTag = _topo$store$getModelS.nodeTag;
|
70
|
+
|
72
71
|
return _extends({}, topoData, {
|
73
72
|
nodes: topoData.nodes.map(function (node) {
|
74
73
|
var attributes = node.attributes;
|
@@ -82,17 +81,19 @@ function updateNodeInfo(topo, topoData) {
|
|
82
81
|
});
|
83
82
|
})
|
84
83
|
});
|
85
|
-
}
|
84
|
+
} // 格式化连线
|
85
|
+
|
86
86
|
|
87
|
-
// 格式化连线
|
88
87
|
var tfLink = function tfLink(engine, link) {
|
89
88
|
var _link$permission;
|
89
|
+
|
90
90
|
return _extends({}, link, {
|
91
91
|
name: (_link$permission = link.permission) !== null && _link$permission !== void 0 && _link$permission.readable ? link.name : "未知",
|
92
92
|
metrics: [],
|
93
93
|
attributes: []
|
94
94
|
});
|
95
95
|
};
|
96
|
+
|
96
97
|
export function getCiTypesFromCiElements(allCi) {
|
97
98
|
var ciTypes = [];
|
98
99
|
allCi.forEach(function (element) {
|
@@ -106,19 +107,21 @@ export function getCiTypes(topoData) {
|
|
106
107
|
var allCi = [].concat(topoData.nodes, topoData.links, topoData.linkGroups);
|
107
108
|
return getCiTypesFromCiElements(allCi);
|
108
109
|
}
|
109
|
-
|
110
110
|
/**
|
111
111
|
* 格式化拓扑数据
|
112
112
|
*
|
113
113
|
* @param {*} result
|
114
114
|
* @returns
|
115
115
|
*/
|
116
|
+
|
116
117
|
export function parseTopoData(result) {
|
117
118
|
var _result$global;
|
119
|
+
|
118
120
|
// 修正数据
|
119
121
|
var _ref = result.global || {},
|
120
|
-
|
121
|
-
|
122
|
+
extraConfig = _ref.extraConfig,
|
123
|
+
otherGlobal = _objectWithoutPropertiesLoose(_ref, _excluded);
|
124
|
+
|
122
125
|
return _extends({}, result, {
|
123
126
|
groups: result.groups || [],
|
124
127
|
nodes: (result.nodes || []).map(parsePermission),
|
@@ -127,17 +130,18 @@ export function parseTopoData(result) {
|
|
127
130
|
global: _extends({}, otherGlobal, {
|
128
131
|
extraConfig: JSON.parse(((_result$global = result.global) === null || _result$global === void 0 ? void 0 : _result$global.extraConfig) || "{}")
|
129
132
|
})
|
130
|
-
});
|
133
|
+
}); // 如果没有权限字段,则增加
|
131
134
|
|
132
|
-
// 如果没有权限字段,则增加
|
133
135
|
function parsePermission(data) {
|
134
136
|
if (data.permission) {
|
135
137
|
return data;
|
136
138
|
}
|
139
|
+
|
137
140
|
return _extends({}, data, {
|
138
141
|
permission: parseBasicPermission(data === null || data === void 0 ? void 0 : data.operation)
|
139
142
|
});
|
140
143
|
}
|
144
|
+
|
141
145
|
function parseBasicPermission(operation) {
|
142
146
|
return {
|
143
147
|
readable: !!operation,
|
@@ -146,21 +150,24 @@ export function parseTopoData(result) {
|
|
146
150
|
};
|
147
151
|
}
|
148
152
|
}
|
149
|
-
export function buildTopoGraphData() {
|
150
|
-
// TODO 构造拓扑图数据移到这里
|
153
|
+
export function buildTopoGraphData() {// TODO 构造拓扑图数据移到这里
|
151
154
|
}
|
155
|
+
|
152
156
|
function buildGlobal(_ref2) {
|
153
157
|
var _result$config, _engine$viewProps, _result$global2, _result$customGlobal, _result$customGlobal2, _engine$options$viewe, _engine$options$edito, _engine$options$edito2;
|
158
|
+
|
154
159
|
var result = _ref2.data,
|
155
|
-
|
156
|
-
|
157
|
-
|
160
|
+
linkTo = _ref2.linkTo,
|
161
|
+
globalConfig = _ref2.globalConfig,
|
162
|
+
engine = _ref2.engine;
|
158
163
|
var edgeFlow;
|
164
|
+
|
159
165
|
if ((_result$config = result.config) !== null && _result$config !== void 0 && _result$config.enableLineFlow) {
|
160
166
|
edgeFlow = {
|
161
167
|
type: "point",
|
162
168
|
// 必填,支持传送带drip、光点point、箭头arrow
|
163
169
|
direction: "from" // 流动方向,可为空,默认源到目的
|
170
|
+
|
164
171
|
};
|
165
172
|
}
|
166
173
|
|
@@ -169,6 +176,7 @@ function buildGlobal(_ref2) {
|
|
169
176
|
type: globalConfig.edgeFlow,
|
170
177
|
// 必填,支持传送带drip、光点point、箭头arrow
|
171
178
|
direction: globalConfig.edgeFlowDirection || "from" // 流动方向,可为空,默认源到目的
|
179
|
+
|
172
180
|
};
|
173
181
|
}
|
174
182
|
|
@@ -209,6 +217,7 @@ function buildGlobal(_ref2) {
|
|
209
217
|
icons: getEditorIcons(engine),
|
210
218
|
// 获取默认节点图标,可选参数。如果无返回值则继续使用内部默认
|
211
219
|
getDefaultNodeIcon: engine.options.getDefaultNodeIcon,
|
220
|
+
|
212
221
|
/**
|
213
222
|
* 编辑界面左侧面板控制元素是否可拖动到区域中node代表拖动的元素,group代表图上的区域
|
214
223
|
* 区域不能拖拽到区域
|
@@ -217,15 +226,18 @@ function buildGlobal(_ref2) {
|
|
217
226
|
canDragElementToGroup: function canDragElementToGroup(element, group) {
|
218
227
|
if (!isGroup(group)) {
|
219
228
|
return true;
|
220
|
-
}
|
221
|
-
|
229
|
+
} // 区域不能拖拽到区域
|
230
|
+
|
231
|
+
|
222
232
|
if (element.dtype === 'container' && isGroup(group)) {
|
223
233
|
return false;
|
224
|
-
}
|
225
|
-
|
234
|
+
} // 元素不能拖拽到集群
|
235
|
+
|
236
|
+
|
226
237
|
if (isClusterHtElement(group)) {
|
227
238
|
return false;
|
228
239
|
}
|
240
|
+
|
229
241
|
rlog.debug(element, group);
|
230
242
|
return true;
|
231
243
|
},
|
@@ -234,51 +246,52 @@ function buildGlobal(_ref2) {
|
|
234
246
|
rlog.debug('canDragGraphElementsToGroup', {
|
235
247
|
elements: elements,
|
236
248
|
targetGroup: targetGroup
|
237
|
-
});
|
238
|
-
|
249
|
+
}); // 非集群的区域不能拖拽到区域
|
250
|
+
|
239
251
|
if (elements.filter(function (ele) {
|
240
252
|
return isGroup(ele) && !isClusterHtElement(ele);
|
241
253
|
}).length && isGroup(targetGroup)) {
|
242
254
|
return false;
|
243
255
|
}
|
256
|
+
|
244
257
|
return true;
|
245
258
|
}
|
246
259
|
};
|
247
260
|
}
|
248
|
-
|
249
261
|
/**
|
250
262
|
* 将从后端接收的数据转化为topo组件中需要的数据
|
251
263
|
* 具体格式内容参考
|
252
264
|
* https://shimo.im/docs/yphCqyk9yqXWdp3Q/ 《拓扑数据结构》
|
253
265
|
*/
|
266
|
+
|
267
|
+
|
254
268
|
export var combTopoData = function combTopoData(_ref3) {
|
255
269
|
var _result$groups;
|
270
|
+
|
256
271
|
var data = _ref3.data,
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
var result = processCluster(updateNodeInfo(engine, data));
|
261
|
-
// rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
|
272
|
+
linkTo = _ref3.linkTo,
|
273
|
+
globalConfig = _ref3.globalConfig,
|
274
|
+
engine = _ref3.engine;
|
275
|
+
var result = processCluster(updateNodeInfo(engine, data)); // rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
|
262
276
|
|
263
277
|
var config = _extends({
|
264
278
|
type: "auto"
|
265
|
-
}, result.config);
|
279
|
+
}, result.config); // global
|
280
|
+
|
266
281
|
|
267
|
-
// global
|
268
282
|
var global = buildGlobal({
|
269
283
|
data: result,
|
270
284
|
linkTo: linkTo,
|
271
285
|
globalConfig: globalConfig,
|
272
286
|
engine: engine
|
273
|
-
});
|
287
|
+
}); // group
|
288
|
+
|
289
|
+
var groups = formatGroups((_result$groups = result.groups) !== null && _result$groups !== void 0 ? _result$groups : []); // nodes
|
274
290
|
|
275
|
-
// group
|
276
|
-
var groups = formatGroups((_result$groups = result.groups) !== null && _result$groups !== void 0 ? _result$groups : []);
|
277
|
-
// nodes
|
278
291
|
var nodes = result.nodes.map(function (node) {
|
279
292
|
return tfNode(engine, node);
|
280
|
-
});
|
281
|
-
|
293
|
+
}); // links
|
294
|
+
|
282
295
|
var links = result.links.map(function (link) {
|
283
296
|
var linkObj = tfLink(engine, link);
|
284
297
|
return linkObj;
|
@@ -295,9 +308,8 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
295
308
|
linkGroups: linkGroups,
|
296
309
|
links: links,
|
297
310
|
serialize: v140UpgradeSerializeNodeImageSize(result.serialize)
|
298
|
-
};
|
311
|
+
}; // 所有资源
|
299
312
|
|
300
|
-
// 所有资源
|
301
313
|
var allCis = [].concat(data.nodes, data.links, data.linkGroups);
|
302
314
|
var resAndMetrics = {
|
303
315
|
// topo所有ci的id集合
|
@@ -316,16 +328,13 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
316
328
|
operation: linkObj.operation
|
317
329
|
};
|
318
330
|
})
|
319
|
-
};
|
320
|
-
|
321
|
-
// rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
|
331
|
+
}; // rlog.debug("combTopoData-格式化后数据", topoData, resAndMetrics);
|
322
332
|
|
323
333
|
return {
|
324
334
|
topoData: topoData,
|
325
335
|
resAndMetrics: resAndMetrics
|
326
336
|
};
|
327
337
|
};
|
328
|
-
|
329
338
|
/**
|
330
339
|
* 获得两个节点间的连线列表
|
331
340
|
* @param {*} links
|
@@ -333,18 +342,19 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
333
342
|
* @param {*} id2
|
334
343
|
* @returns
|
335
344
|
*/
|
345
|
+
|
336
346
|
export function getLinksBetweenTwoNodes(links, id1, id2) {
|
337
347
|
return links.filter(function (link) {
|
338
348
|
return link.source === id1 && link.target === id2 || link.target === id1 && link.source === id2;
|
339
349
|
});
|
340
350
|
}
|
341
|
-
|
342
351
|
/**
|
343
352
|
* 将从topo组件返回的数据(global)转化为后端接收的数据
|
344
353
|
* 具体格式内容参考
|
345
354
|
* https://shimo.im/docs/VKt3HCKHYgJ9kvGP#anchor-g6Hw
|
346
355
|
* @param {} conditions
|
347
356
|
*/
|
357
|
+
|
348
358
|
export var combSaveTopoData = function combSaveTopoData(_ref4) {
|
349
359
|
var global = _ref4.global;
|
350
360
|
var topoDisplayConfig = global.topoDisplayConfig;
|
@@ -371,24 +381,26 @@ export function transtormElementsToMap(elements) {
|
|
371
381
|
};
|
372
382
|
return data;
|
373
383
|
}
|
374
|
-
|
375
384
|
/**
|
376
385
|
* 从拓扑数据中获取区域的子区域、子节点
|
377
386
|
* @param {*} elements
|
378
387
|
* @param {*} group
|
379
388
|
* @returns
|
380
389
|
*/
|
390
|
+
|
381
391
|
export function findGroupChildren(elements, group) {
|
382
392
|
var id = group.id,
|
383
|
-
|
393
|
+
tag = group.tag;
|
384
394
|
var children = [];
|
385
395
|
elements.forEach(function (element) {
|
386
396
|
var type = element.type,
|
387
|
-
|
388
|
-
|
397
|
+
groupId = element.groupId,
|
398
|
+
groupTag = element.groupTag;
|
389
399
|
var isChild = groupId === id || tag && groupTag === tag;
|
400
|
+
|
390
401
|
if (isChild) {
|
391
402
|
children.push(element);
|
403
|
+
|
392
404
|
if (type === 'group') {
|
393
405
|
children.push.apply(children, findGroupChildren(elements, element));
|
394
406
|
}
|