@riil-frontend/component-topology 12.0.0-dev.1 → 12.0.0-dev.11
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +14 -14
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/core/components/AlarmListPanel/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/components/TopoView/topoView.js +6 -2
- package/es/core/editor/components/BackgroundView/index.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
- package/es/core/editor/components/EditorPlugin.js +1 -1
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +26 -9
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/store/background.js +1 -1
- package/es/core/editor/store/historyManager.js +1 -1
- package/es/core/editor/store/topoEdit.js +1 -1
- package/es/core/editor/utils/copyElementUtil.js +24 -9
- package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useCiAttributeChange.js +35 -16
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +1 -1
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +48 -52
- package/es/core/models/Alarm.js +1 -1
- package/es/core/models/AttributeMetricDisplay.js +6 -3
- package/es/core/models/HistoryManager.js +1 -1
- package/es/core/models/SelectionModel.js +1 -1
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +5 -1
- package/es/core/models/cache/DictCache.js +1 -1
- package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +0 -1
- package/es/core/services/alarm.js +1 -1
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/customIcon.js +1 -1
- package/es/core/store/models/displayConfig.js +1 -1
- package/es/core/store/models/selection.js +1 -1
- package/es/core/store/models/topoBaseInfoOverview.js +1 -1
- package/es/core/store/models/topoBizMod.js +1 -1
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoGraphView.js +1 -1
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/lock.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +1 -1
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/es/core/utils/edgeUtil.js +2 -1
- package/es/core/utils/metricUtil.js +8 -1
- package/es/core/utils/showMessage.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/networkTopo/components/Link/index.js +1 -1
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/model.js +1 -1
- package/es/networkTopo/services/topo/basic.js +4 -4
- package/es/networkTopo/services/topo/ciInfo.js +1 -1
- package/es/networkTopo/store/functionAuth.js +1 -1
- package/es/networkTopo/store/topoCenter.js +1 -1
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +4 -37
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +156 -0
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -0
- package/es/utils/format.js +1 -1
- package/es/utils/topoData.js +4 -2
- package/lib/components/BatchAttrMetric/setting.js +2 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
- package/lib/core/components/AlarmListPanel/index.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/components/TopoView/topoView.js +14 -10
- package/lib/core/editor/components/BackgroundView/index.js +3 -3
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/EditorPlugin.js +3 -3
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/store/background.js +1 -1
- package/lib/core/editor/store/historyManager.js +1 -1
- package/lib/core/editor/store/topoEdit.js +1 -1
- package/lib/core/editor/utils/copyElementUtil.js +29 -9
- package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useCiAttributeChange.js +34 -15
- package/lib/core/hooks/useManageStatus.js +1 -1
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +47 -51
- package/lib/core/models/Alarm.js +10 -10
- package/lib/core/models/AttributeMetricDisplay.js +8 -4
- package/lib/core/models/HistoryManager.js +8 -8
- package/lib/core/models/SelectionModel.js +5 -5
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +6 -2
- package/lib/core/models/cache/DictCache.js +2 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/services/alarm.js +2 -2
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/customIcon.js +3 -3
- package/lib/core/store/models/displayConfig.js +1 -1
- package/lib/core/store/models/selection.js +1 -1
- package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
- package/lib/core/store/models/topoBizMod.js +1 -1
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoGraphView.js +1 -1
- package/lib/core/store/models/topoMod.js +9 -9
- package/lib/core/store/models/viewer/lock.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +1 -1
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/lib/core/utils/edgeUtil.js +2 -1
- package/lib/core/utils/metricUtil.js +8 -1
- package/lib/core/utils/showMessage.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/networkTopo/components/Link/index.js +2 -2
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
- package/lib/networkTopo/models/TopoCenter.js +1 -1
- package/lib/networkTopo/services/model.js +1 -3
- package/lib/networkTopo/services/topo/basic.js +4 -6
- package/lib/networkTopo/services/topo/ciInfo.js +0 -2
- package/lib/networkTopo/store/functionAuth.js +1 -1
- package/lib/networkTopo/store/topoCenter.js +1 -1
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +4 -39
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +169 -0
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +4 -4
@@ -7,7 +7,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
7
7
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
8
8
|
var _excluded = ["value", "defaultSet", "dataSource"];
|
9
9
|
import React, { useState, useMemo, useEffect } from 'react';
|
10
|
-
import rlog from '@riil-frontend/component-topology-utils
|
10
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
11
11
|
import ActionTree from '@riil-frontend/component-action-tree';
|
12
12
|
import NoDataPage from '@riil-frontend/component-topology-common/es/components/NoDataPage';
|
13
13
|
import TableLayout from '@riil-frontend/component-table-layout';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import ModelAttrSelectDrawer from "./ModelAttrSelectDrawer";
|
4
4
|
|
5
5
|
function parseValue(value) {
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import Drawer from "../Drawer";
|
7
7
|
import ResourceSelectList from "./ResourceSelectList";
|
8
8
|
import styles from "./ResourceSelectDrawer.module.scss";
|
@@ -3,7 +3,7 @@ import _Button from "@alifd/next/es/button";
|
|
3
3
|
import _Card from "@alifd/next/es/card";
|
4
4
|
import React, { useState, useEffect } from 'react';
|
5
5
|
import NoDataPage from '@riil-frontend/component-no-data-page';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import AlarmListItem from "./components/AlarmListItem";
|
8
8
|
import styles from "./index.module.scss";
|
9
9
|
import { alarmListDemo } from "./mocks";
|
@@ -3,7 +3,7 @@ import _Form from "@alifd/next/es/form";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
4
|
import _Field from "@alifd/next/es/field";
|
5
5
|
import React, { useEffect, useImperativeHandle, useState } from 'react';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import NodeTag from "./NodeTag";
|
8
8
|
import EdgeFlow from "./EdgeFlow";
|
9
9
|
import NodeTip from "./NodeTip";
|
@@ -2,8 +2,8 @@ import _Message from "@alifd/next/es/message";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
|
-
import React, {
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import React, { useRef, useState } from 'react';
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import Drawer from "../../../components/Drawer";
|
8
8
|
import DisplaySetting from "./DisplaySetting";
|
9
9
|
import useDisplaySetting from "./hooks/useDisplaySetting";
|
@@ -2,7 +2,7 @@ import _Button from "@alifd/next/es/button";
|
|
2
2
|
import _Box from "@alifd/next/es/box";
|
3
3
|
import _Radio from "@alifd/next/es/radio";
|
4
4
|
import React, { useImperativeHandle, useRef } from 'react';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { DEFAULT_CUSTOM_CONFIG } from "../../../../constants/ResourceInfoDisplay";
|
7
7
|
import CommonCheckboxGroup from "./CommonCheckboxGroup";
|
8
8
|
import ResourceDiplayInfoSetting from "../../ResourceViewAttributeSetting/Setting";
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
3
3
|
var _excluded = ["topo", "showType", "value"];
|
4
4
|
import React, { forwardRef, useEffect, useState } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import ModelAttrSelectDrawer from "../../../../components/ModelAttrSelectDrawer";
|
8
8
|
import { getNodeModels } from "../../ResourceViewAttributeSetting/nodeCiTypeAttrUtil";
|
9
9
|
/**
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
3
|
var _excluded = ["topo", "elementType", "showType", "value"];
|
4
4
|
import React, { forwardRef, useState } from 'react';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { getNodeModels } from "./nodeCiTypeAttrUtil";
|
7
7
|
import ModelAttrSelectDrawer from "../../../components/ModelAttrSelectDrawer";
|
8
8
|
/**
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
5
5
|
import classnames from 'classnames';
|
6
6
|
import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
7
7
|
import PortalContainer from '@riil-frontend/component-topology-graph/es/components/PortalContainer';
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils'; // 通用
|
9
9
|
|
10
10
|
import showMessage from "../../utils/showMessage";
|
11
11
|
import { TPL_TREE } from "../../../utils/template";
|
@@ -161,7 +161,11 @@ var Topology = function Topology(props) {
|
|
161
161
|
|
162
162
|
if (initSelectionId) {
|
163
163
|
var ele = topo.getHtTopo().getGraphView().dm().getDataByTag(initSelectionId);
|
164
|
-
|
164
|
+
|
165
|
+
if (ele) {
|
166
|
+
topo.getHtTopo().getGraphView().sm().setSelection([ele]);
|
167
|
+
}
|
168
|
+
|
165
169
|
var selectionDispatchers = topo.store.getModelDispatchers('selection');
|
166
170
|
selectionDispatchers.update({
|
167
171
|
initSelectionId: null
|
@@ -13,7 +13,7 @@ import UploadDialog from "./UploadDialog";
|
|
13
13
|
import api from "../../../services/background";
|
14
14
|
import { getBackgroundImageUrl, getBackgroundThumbnailImageUrl } from "../../../utils/backgroundUtil";
|
15
15
|
import { getImageSize } from "../../../utils/imageUtil";
|
16
|
-
import rlog from '@riil-frontend/component-topology-utils
|
16
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
17
17
|
|
18
18
|
function List(props) {
|
19
19
|
var selected = props.selected,
|
@@ -11,7 +11,7 @@ import React from 'react';
|
|
11
11
|
import topoServer from '@riil-frontend/component-topology-common/es/services/topo/index';
|
12
12
|
import _ from 'lodash';
|
13
13
|
import { getToken } from '@riil-frontend/utils';
|
14
|
-
import rlog from '@riil-frontend/component-topology-utils
|
14
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
15
15
|
import { validateSpecialCharacter } from "../../../../utils/SpecialCharacterValidateUtil";
|
16
16
|
import "./UploadIconDialog.scss";
|
17
17
|
import styles from "./UploadIconDialog.module.scss";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import React, { useEffect } from 'react';
|
3
|
-
import rlog from '@riil-frontend/component-topology-utils
|
3
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
4
4
|
import CustomIconPlugin from "./CustomIconPlugin";
|
5
5
|
import SaveLoading from "./plugins/SaveLoading";
|
6
6
|
import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useEffect, useRef, useMemo } from 'react';
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
4
4
|
import HtCustomImagePanel from "./HtCustomImagePanel";
|
5
5
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
2
|
import ResizeObserver from 'resize-observer-polyfill';
|
3
|
-
import rlog from '@riil-frontend/component-topology-utils
|
3
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
4
4
|
import styles from "./HtImagePalette.module.scss";
|
5
5
|
/**
|
6
6
|
* 组件面板
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import ResizeObserver from 'resize-observer-polyfill';
|
4
4
|
import styles from "./HtImagePalette.module.scss";
|
5
5
|
/**
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _Box from "@alifd/next/es/box";
|
1
2
|
import _Field from "@alifd/next/es/field";
|
2
3
|
import _Select from "@alifd/next/es/select";
|
3
4
|
import _Form from "@alifd/next/es/form";
|
@@ -142,12 +143,19 @@ function EdgeType(props) {
|
|
142
143
|
className: styles.lineBox
|
143
144
|
}, /*#__PURE__*/React.createElement(_Form, {
|
144
145
|
field: field,
|
145
|
-
inline: true,
|
146
146
|
labelAlign: "top"
|
147
147
|
}, /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(LineType, {
|
148
148
|
name: "lineButton"
|
149
|
-
})), /*#__PURE__*/React.createElement(
|
150
|
-
|
149
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Box, {
|
150
|
+
direction: "row",
|
151
|
+
style: {
|
152
|
+
gap: 8
|
153
|
+
}
|
154
|
+
}, /*#__PURE__*/React.createElement(FormItem, {
|
155
|
+
label: "\u8D77\u70B9",
|
156
|
+
style: {
|
157
|
+
margin: 0
|
158
|
+
}
|
151
159
|
}, /*#__PURE__*/React.createElement(_Select, {
|
152
160
|
name: "startPoint",
|
153
161
|
placeholder: " ",
|
@@ -155,7 +163,8 @@ function EdgeType(props) {
|
|
155
163
|
container: function container(trigger) {
|
156
164
|
return trigger.parentNode;
|
157
165
|
}
|
158
|
-
}
|
166
|
+
},
|
167
|
+
className: styles.endPointSelect
|
159
168
|
}, START_TYPE_OPTIONS.map(function (item, index) {
|
160
169
|
return /*#__PURE__*/React.createElement(Option, {
|
161
170
|
value: item.value,
|
@@ -168,7 +177,10 @@ function EdgeType(props) {
|
|
168
177
|
className: styles.iconImg
|
169
178
|
}));
|
170
179
|
}))), /*#__PURE__*/React.createElement(FormItem, {
|
171
|
-
label: "\u7EC8\u70B9"
|
180
|
+
label: "\u7EC8\u70B9",
|
181
|
+
style: {
|
182
|
+
margin: 0
|
183
|
+
}
|
172
184
|
}, /*#__PURE__*/React.createElement(_Select, {
|
173
185
|
name: "endPoint",
|
174
186
|
placeholder: " ",
|
@@ -176,7 +188,8 @@ function EdgeType(props) {
|
|
176
188
|
container: function container(trigger) {
|
177
189
|
return trigger.parentNode;
|
178
190
|
}
|
179
|
-
}
|
191
|
+
},
|
192
|
+
className: styles.endPointSelect
|
180
193
|
}, END_TYPE_OPTIONS.map(function (item, index) {
|
181
194
|
return /*#__PURE__*/React.createElement(Option, {
|
182
195
|
value: item.value,
|
@@ -189,7 +202,10 @@ function EdgeType(props) {
|
|
189
202
|
className: styles.iconImg
|
190
203
|
}));
|
191
204
|
}))), /*#__PURE__*/React.createElement(FormItem, {
|
192
|
-
label: "\u7C7B\u578B"
|
205
|
+
label: "\u7C7B\u578B",
|
206
|
+
style: {
|
207
|
+
margin: 0
|
208
|
+
}
|
193
209
|
}, /*#__PURE__*/React.createElement(_Select, {
|
194
210
|
name: "lineMold",
|
195
211
|
popupProps: {
|
@@ -197,7 +213,8 @@ function EdgeType(props) {
|
|
197
213
|
return trigger.parentNode;
|
198
214
|
}
|
199
215
|
},
|
200
|
-
placeholder: " "
|
216
|
+
placeholder: " ",
|
217
|
+
className: styles.lineMoldSelect
|
201
218
|
}, LINE_MOLD_OPTIONS.map(function (item, index) {
|
202
219
|
return /*#__PURE__*/React.createElement(Option, {
|
203
220
|
value: item.value,
|
@@ -209,7 +226,7 @@ function EdgeType(props) {
|
|
209
226
|
alt: "",
|
210
227
|
className: styles.iconImg
|
211
228
|
}));
|
212
|
-
})))));
|
229
|
+
})))))));
|
213
230
|
}
|
214
231
|
|
215
232
|
EdgeType.defaultProps = {
|
@@ -1,10 +1,30 @@
|
|
1
1
|
@import '~@alifd/next/variables.scss';
|
2
2
|
|
3
3
|
.lineBox{
|
4
|
-
width: 236px;
|
5
4
|
background: #FFFFFF;
|
6
5
|
border-radius: 4px;
|
7
6
|
margin-bottom: -7px;
|
7
|
+
|
8
|
+
.endPointSelect {
|
9
|
+
min-width: 0;
|
10
|
+
width: 64px;
|
11
|
+
:global {
|
12
|
+
.#{$css-prefix}select-inner {
|
13
|
+
min-width:0 !important;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.lineMoldSelect {
|
19
|
+
min-width: 0;
|
20
|
+
width: 88px;
|
21
|
+
:global {
|
22
|
+
.#{$css-prefix}select-inner {
|
23
|
+
min-width:0 !important;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
8
28
|
:global {
|
9
29
|
.#{$css-prefix}form-item:first-child{
|
10
30
|
margin-top: 0;
|
@@ -38,6 +38,15 @@ var LINE_TYPE_OPTIONS = [{
|
|
38
38
|
// icon: 'topo_linear_icon_pointsline',
|
39
39
|
// },
|
40
40
|
];
|
41
|
+
|
42
|
+
if (localStorage.getItem('topo.test.edge.customType') === 'true') {
|
43
|
+
LINE_TYPE_OPTIONS.push({
|
44
|
+
value: 'points',
|
45
|
+
label: '自由线形',
|
46
|
+
icon: 'topo_linear_icon_pointsline'
|
47
|
+
});
|
48
|
+
}
|
49
|
+
|
41
50
|
var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
42
51
|
var value = props.value,
|
43
52
|
onChange = props.onChange,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import React, { useState } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import SizeInput from "../SizeInput";
|
6
6
|
var NODE_SIZE_LOCK = 'NODE_SIZE_LOCK';
|
7
7
|
/**
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _Form from "@alifd/next/es/form";
|
5
5
|
import React, { useState } from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
|
-
import rlog from '@riil-frontend/component-topology-utils
|
7
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
8
8
|
import NodeSizeNumberPicker from "./NodeSizeNumberPicker";
|
9
9
|
import styles from "./NodeSizeInput.module.scss";
|
10
10
|
var FormItem = _Form.Item;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _Form from "@alifd/next/es/form";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _Field from "@alifd/next/es/field";
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import React, { useEffect } from 'react';
|
6
6
|
import { SPECIAL_CHARACTER_FORM_ITEM_VALIDATE_PROPS, validateSpecialCharacter } from "../../../../../../utils/SpecialCharacterValidateUtil";
|
7
7
|
import NameInput from "../../common/NameInput";
|
@@ -5,7 +5,7 @@ import _Input from "@alifd/next/es/input";
|
|
5
5
|
import _Field from "@alifd/next/es/field";
|
6
6
|
import _Collapse from "@alifd/next/es/collapse";
|
7
7
|
import React, { useState, useEffect } from 'react';
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
import AlignSetting from "../../../common/AlignSetting"; // import BatchSetNodeSize from '../../view/BatchSetNodeSize';
|
10
10
|
|
11
11
|
import { SPECIAL_CHARACTER_FORM_ITEM_VALIDATE_PROPS, validateSpecialCharacter } from "../../../../../../../utils/SpecialCharacterValidateUtil"; // import LineType from '../../../common/LineType';
|
package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import { useEffect, useState } from 'react';
|
3
3
|
import useDataModelDataPropertyChange from "../../../../../../common/hooks/ht/useDataModelDataPropertyChange";
|
4
4
|
export default (function (props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import hotkeys from 'hotkeys-js';
|
2
2
|
import { useEffect } from 'react';
|
3
|
-
import { handleCopyHotkey, handlePasteHotkey } from "../utils/copyElementUtil";
|
3
|
+
import { destroyPasteEventListener, handleCopyHotkey, handlePasteHotkey, initPasteEventListener } from "../utils/copyElementUtil";
|
4
4
|
|
5
5
|
function initKeyboardShortcuts(props) {
|
6
6
|
var topo = props.topo,
|
@@ -35,8 +35,10 @@ function unbindKeyboardShortcuts(props) {
|
|
35
35
|
|
36
36
|
export default function useKeyboardShortcut(props) {
|
37
37
|
useEffect(function () {
|
38
|
+
initPasteEventListener();
|
38
39
|
initKeyboardShortcuts(props);
|
39
40
|
return function () {
|
41
|
+
destroyPasteEventListener();
|
40
42
|
unbindKeyboardShortcuts(props);
|
41
43
|
};
|
42
44
|
}, []);
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 背景图
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
export default {
|
10
10
|
// 定义 model 的初始 state
|
11
11
|
state: {
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
* 动态设置链路样式 Model
|
5
5
|
*/
|
6
6
|
// import _ from 'lodash';
|
7
|
-
import rlog from '@riil-frontend/component-topology-utils
|
7
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
8
8
|
var defaultState = {
|
9
9
|
undoable: false,
|
10
10
|
redoable: false
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 拓扑编辑 Model
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
var initState = {
|
10
10
|
// 是否就绪
|
11
11
|
ready: false,
|
@@ -1,13 +1,26 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import { clipboard } from "../../../utils/clipboardUtil";
|
3
4
|
export function handleCopyHotkey(event, options) {
|
4
5
|
var target = event.target || event.srcElement;
|
5
6
|
var tagName = target.tagName;
|
6
7
|
|
7
8
|
if (tagName !== 'BODY') {
|
8
|
-
copy(options);
|
9
|
+
copy(options.topo);
|
9
10
|
}
|
10
11
|
}
|
12
|
+
export function initPasteEventListener() {
|
13
|
+
document.addEventListener("paste", handlePasteEventListener);
|
14
|
+
}
|
15
|
+
export function destroyPasteEventListener() {
|
16
|
+
document.removeEventListener("paste", handlePasteEventListener);
|
17
|
+
}
|
18
|
+
|
19
|
+
function handlePasteEventListener(e) {
|
20
|
+
var clipdata = e.clipboardData || window.clipboardData;
|
21
|
+
console.log("主动粘贴", clipdata.getData("text/plain"));
|
22
|
+
}
|
23
|
+
|
11
24
|
export function handlePasteHotkey(event, options) {
|
12
25
|
var target = event.target || event.srcElement;
|
13
26
|
var tagName = target.tagName;
|
@@ -17,8 +30,7 @@ export function handlePasteHotkey(event, options) {
|
|
17
30
|
}
|
18
31
|
}
|
19
32
|
|
20
|
-
function copy(
|
21
|
-
var topo = options.topo;
|
33
|
+
function copy(topo) {
|
22
34
|
var gv = topo.getHtTopo().getGraphView();
|
23
35
|
var dm = gv.dm();
|
24
36
|
var sm = dm.sm();
|
@@ -102,14 +114,14 @@ function doPaste(topo, clipboardText) {
|
|
102
114
|
var parseDm = new ht.DataModel();
|
103
115
|
var parseSerializer = new ht.JSONSerializer(parseDm);
|
104
116
|
parseSerializer.deserialize(clipboardText);
|
105
|
-
var elements = parseDm.getDatas().toArray();
|
117
|
+
var elements = parseDm.getDatas().toArray();
|
118
|
+
parseDm.clear(); // 添加到拓扑图
|
106
119
|
|
107
120
|
var gv = topo.getHtTopo().getGraphView();
|
108
121
|
var dm = gv.dm();
|
109
122
|
elements.forEach(function (d) {
|
110
123
|
dm.add(d);
|
111
|
-
});
|
112
|
-
parseDm.clear(); // 粘贴之后进行处理
|
124
|
+
}); // 粘贴之后进行处理
|
113
125
|
|
114
126
|
var sm = dm.sm();
|
115
127
|
sm.cs();
|
@@ -123,6 +135,8 @@ function doPaste(topo, clipboardText) {
|
|
123
135
|
// TODO
|
124
136
|
// gv.translate(-60, -60)
|
125
137
|
|
138
|
+
|
139
|
+
copy(topo);
|
126
140
|
}
|
127
141
|
|
128
142
|
function isPasetToOriginTopo() {
|
@@ -139,9 +153,10 @@ function _writeClipboard() {
|
|
139
153
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
140
154
|
while (1) switch (_context2.prev = _context2.next) {
|
141
155
|
case 0:
|
142
|
-
|
156
|
+
localStorage.setItem('topo.copy.text', text);
|
157
|
+
clipboard.writeText(text);
|
143
158
|
|
144
|
-
case
|
159
|
+
case 2:
|
145
160
|
case "end":
|
146
161
|
return _context2.stop();
|
147
162
|
}
|
@@ -159,7 +174,7 @@ function _readClipboard() {
|
|
159
174
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
160
175
|
while (1) switch (_context3.prev = _context3.next) {
|
161
176
|
case 0:
|
162
|
-
return _context3.abrupt("return",
|
177
|
+
return _context3.abrupt("return", localStorage.getItem('topo.copy.text'));
|
163
178
|
|
164
179
|
case 1:
|
165
180
|
case "end":
|
File without changes
|
@@ -1,25 +1,49 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import CiCache from "../models/cache/CiCache";
|
4
4
|
import useTopoEventListener from "./useTopoEventListener";
|
5
5
|
|
6
|
+
function ciExistTopo(topoData, ciChangeData) {
|
7
|
+
if (!topoData) {
|
8
|
+
return false;
|
9
|
+
}
|
10
|
+
|
11
|
+
var ciIds = [].concat(topoData.nodes, topoData.links, topoData.linkGroups).map(function (data) {
|
12
|
+
return data.ciId || data.id;
|
13
|
+
});
|
14
|
+
return ciIds.includes(ciChangeData.id);
|
15
|
+
}
|
16
|
+
|
6
17
|
function mergeData(cis, ciChangeData) {
|
7
|
-
|
8
|
-
return item.
|
9
|
-
}
|
18
|
+
var matchData = function matchData(item) {
|
19
|
+
return (item.ciId || item.id) === ciChangeData.id;
|
20
|
+
};
|
21
|
+
|
22
|
+
if (!cis.find(matchData)) {
|
10
23
|
return cis;
|
11
24
|
}
|
12
25
|
|
13
26
|
return cis.map(function (ci) {
|
14
|
-
if (ci
|
15
|
-
return
|
16
|
-
attributes: _extends({}, ci.attributes, ciChangeData.attributes)
|
17
|
-
});
|
27
|
+
if (!matchData(ci)) {
|
28
|
+
return ci;
|
18
29
|
}
|
19
30
|
|
20
|
-
return ci
|
31
|
+
return _extends({}, ci, {
|
32
|
+
id: ci.id,
|
33
|
+
attributes: _extends({}, ci.attributes, ciChangeData.attributes)
|
34
|
+
});
|
21
35
|
});
|
22
36
|
}
|
37
|
+
|
38
|
+
function mergeTopoData(topoData, ciChangeData) {
|
39
|
+
var newData = _extends({}, topoData, {
|
40
|
+
nodes: mergeData(topoData.nodes, ciChangeData),
|
41
|
+
links: mergeData(topoData.links, ciChangeData),
|
42
|
+
linkGroups: mergeData(topoData.linkGroups, ciChangeData)
|
43
|
+
});
|
44
|
+
|
45
|
+
return newData;
|
46
|
+
}
|
23
47
|
/**
|
24
48
|
* 监听ci属性变更
|
25
49
|
*
|
@@ -35,13 +59,8 @@ export default function useCiAttributeChange(props) {
|
|
35
59
|
// 更新拓扑数据
|
36
60
|
var topoData = topo.store.getModelState('topoMod').data;
|
37
61
|
|
38
|
-
if (topoData) {
|
39
|
-
var newData =
|
40
|
-
nodes: mergeData(topoData.nodes, ciChangeData),
|
41
|
-
links: mergeData(topoData.links, ciChangeData),
|
42
|
-
linkGroups: mergeData(topoData.linkGroups, ciChangeData)
|
43
|
-
});
|
44
|
-
|
62
|
+
if (ciExistTopo(topoData, ciChangeData)) {
|
63
|
+
var newData = mergeTopoData(topoData, ciChangeData);
|
45
64
|
var topoDispatchers = topo.store.getModelDispatchers('topoMod');
|
46
65
|
topoDispatchers.update({
|
47
66
|
data: newData
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import { useEffect } from 'react';
|
3
3
|
import useTopoEventListener from "./useTopoEventListener";
|
4
4
|
ht.Default.setImage('resource.subIcon.unMoniter', '/img/topo/alarmStatusIcon/未监控.svg');
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useRequest } from 'ahooks';
|
6
6
|
import _ from 'lodash';
|
7
|
-
import rlog from '@riil-frontend/component-topology-utils
|
7
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
8
8
|
import { useCbbEventListener } from '@riil-frontend/component-riil-event-emitter';
|
9
9
|
import DictCache from "../models/cache/DictCache";
|
10
10
|
import useCiAttributeChange from "./useCiAttributeChange";
|
@@ -42,9 +42,7 @@ export default function (props) {
|
|
42
42
|
return {
|
43
43
|
resources: config.resources,
|
44
44
|
groups: config.groups,
|
45
|
-
|
46
|
-
relateTopoIdList: config.relateTopoIdList //linkIps: config.linkIps,
|
47
|
-
|
45
|
+
relateTopoIdList: config.relateTopoIdList
|
48
46
|
};
|
49
47
|
};
|
50
48
|
|