@riil-frontend/component-topology 2.15.44 → 2.15.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +25 -25
- package/es/components/Drawer/index.js +8 -2
- package/es/components/TagImageSelect/index.js +3 -1
- package/es/components/TagSelect/index.js +3 -3
- package/es/components/TemplateButton/index.module.scss +1 -0
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/es/core/common/icons/icon.js +1 -1
- package/es/core/common/icons/useIcons.js +1 -1
- package/es/core/components/TopoView/topoView.js +8 -18
- package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/es/core/editor/components/EditorPlugin.js +2 -2
- package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/es/core/models/TopoApp.js +9 -5
- package/es/core/store/coreModels.js +32 -26
- package/es/core/store/createStore.js +1 -1
- package/es/core/test/Test.js +3 -1
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +22 -21
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/es/createTopo.js +1 -1
- package/es/hooks/useAlarm.js +3 -6
- package/es/hooks/useResourceConfig.js +1 -1
- package/es/hooks/useTopoEdit.js +4 -8
- package/es/models/{iconManage.js → customIcon.js} +1 -1
- package/es/models/topoBizMod.js +22 -52
- package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
- package/es/models/topoMod.js +32 -69
- package/es/{components → topoCenter/components}/Link/form.js +0 -0
- package/es/{components → topoCenter/components}/Link/hook.js +0 -0
- package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/es/{components → topoCenter/components}/Link/setting.js +0 -0
- package/es/topoCenter/components/TopoView.js +16 -3
- package/es/topoCenter/components/Topology.js +0 -5
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/es/{models → topoCenter/store}/linkManager.js +0 -0
- package/lib/components/Drawer/index.js +7 -2
- package/lib/components/TagImageSelect/index.js +3 -1
- package/lib/components/TagSelect/index.js +3 -3
- package/lib/components/TemplateButton/index.module.scss +1 -0
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/lib/core/common/icons/icon.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -1
- package/lib/core/components/TopoView/topoView.js +9 -20
- package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/lib/core/editor/components/EditorPlugin.js +2 -2
- package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/lib/core/models/TopoApp.js +9 -5
- package/lib/core/store/coreModels.js +35 -26
- package/lib/core/store/createStore.js +2 -2
- package/lib/core/test/Test.js +3 -1
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +22 -21
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/lib/createTopo.js +1 -1
- package/lib/hooks/useAlarm.js +3 -6
- package/lib/hooks/useResourceConfig.js +1 -1
- package/lib/hooks/useTopoEdit.js +4 -8
- package/lib/models/{iconManage.js → customIcon.js} +1 -1
- package/lib/models/topoBizMod.js +22 -52
- package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
- package/lib/models/topoMod.js +32 -69
- package/lib/{components → topoCenter/components}/Link/form.js +0 -0
- package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
- package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
- package/lib/topoCenter/components/TopoView.js +19 -3
- package/lib/topoCenter/components/Topology.js +0 -7
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/lib/{models → topoCenter/store}/linkManager.js +0 -0
- package/package.json +2 -2
- package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
- package/es/core/store/getStoreModels.js +0 -40
- package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
- package/lib/core/store/getStoreModels.js +0 -67
|
@@ -224,9 +224,9 @@ export default function ResourceOverview(props) {
|
|
|
224
224
|
|
|
225
225
|
function _init() {
|
|
226
226
|
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
227
|
-
var _topo$options$resourc, _attributeMap$source_, _attributeMap$destina;
|
|
227
|
+
var _topo$options$resourc, _modelAttributeMap$ow, _modelAttributeMap$, _modelAttributeMap$2, _modelAttributeMap$3, _modelAttributeMap$di, _modelAttributeMap$ip, _modelAttributeMap$as, _modelAttributeMap$5, _modelAttributeMap$6, _modelAttributeMap$so, _attributeMap$source_, _modelAttributeMap$de, _attributeMap$destina;
|
|
228
228
|
|
|
229
|
-
var ciTypeMeta, link, linkConnectType, _ciTypeMeta, modelMetrics, ciName, modelAttributeMap, domain, topModelMetrics, isAppTopoFlag, _findItem, attributeMap, metrics, res_address, _attributeMap$, rated_bandwidth, _modelAttributeMap
|
|
229
|
+
var ciTypeMeta, link, linkConnectType, _ciTypeMeta, modelMetrics, ciName, modelAttributeMap, domain, topModelMetrics, isAppTopoFlag, _findItem, attributeMap, metrics, res_address, _attributeMap$, rated_bandwidth, _modelAttributeMap$4;
|
|
230
230
|
|
|
231
231
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
232
232
|
while (1) {
|
|
@@ -265,11 +265,12 @@ export default function ResourceOverview(props) {
|
|
|
265
265
|
// 拓扑(默认) ---------------------------
|
|
266
266
|
// 基本信息
|
|
267
267
|
_findItem = findItem(attrsAndMetrics, 'id', id), attributeMap = _findItem.attributeMap, metrics = _findItem.metrics;
|
|
268
|
-
console.log('基本信息', attributeMap, attrsAndMetrics); //
|
|
268
|
+
console.log('基本信息', attributeMap, attrsAndMetrics, modelAttributeMap); // userVisible
|
|
269
|
+
// 位置
|
|
269
270
|
|
|
270
271
|
res_address = false;
|
|
271
272
|
|
|
272
|
-
if (!modelAttributeMap['owned_computer_room']) {
|
|
273
|
+
if (!((_modelAttributeMap$ow = modelAttributeMap['owned_computer_room']) !== null && _modelAttributeMap$ow !== void 0 && _modelAttributeMap$ow.userVisible)) {
|
|
273
274
|
_context.next = 19;
|
|
274
275
|
break;
|
|
275
276
|
}
|
|
@@ -283,7 +284,7 @@ export default function ResourceOverview(props) {
|
|
|
283
284
|
break;
|
|
284
285
|
|
|
285
286
|
case 19:
|
|
286
|
-
if (modelAttributeMap[ciType + ".computer_room"] || modelAttributeMap[ciType + ".area"]) {
|
|
287
|
+
if ((_modelAttributeMap$ = modelAttributeMap[ciType + ".computer_room"]) !== null && _modelAttributeMap$ !== void 0 && _modelAttributeMap$.userVisible || (_modelAttributeMap$2 = modelAttributeMap[ciType + ".area"]) !== null && _modelAttributeMap$2 !== void 0 && _modelAttributeMap$2.userVisible) {
|
|
287
288
|
res_address = attributeMap[ciType + ".computer_room "] || attributeMap[ciType + ".area"] ? " " + (((_attributeMap$ = attributeMap[ciType + ".area_object"]) === null || _attributeMap$ === void 0 ? void 0 : _attributeMap$.displayName) || '') + " " + (attributeMap[ciType + ".computer_room"] || '') : false;
|
|
288
289
|
}
|
|
289
290
|
|
|
@@ -291,30 +292,30 @@ export default function ResourceOverview(props) {
|
|
|
291
292
|
// 链路带宽(取实际带宽)
|
|
292
293
|
rated_bandwidth = false;
|
|
293
294
|
|
|
294
|
-
if (modelAttributeMap[ciType + ".actual_bandwidth"]) {
|
|
295
|
-
rated_bandwidth = attributeMap[ciType + ".actual_bandwidth"] ? attributeMap[ciType + ".actual_bandwidth"] + " " + ((_modelAttributeMap$ = modelAttributeMap[ciType + ".actual_bandwidth"]) === null || _modelAttributeMap$ === void 0 ? void 0 : _modelAttributeMap
|
|
295
|
+
if ((_modelAttributeMap$3 = modelAttributeMap[ciType + ".actual_bandwidth"]) !== null && _modelAttributeMap$3 !== void 0 && _modelAttributeMap$3.userVisible) {
|
|
296
|
+
rated_bandwidth = attributeMap[ciType + ".actual_bandwidth"] ? attributeMap[ciType + ".actual_bandwidth"] + " " + ((_modelAttributeMap$4 = modelAttributeMap[ciType + ".actual_bandwidth"]) === null || _modelAttributeMap$4 === void 0 ? void 0 : _modelAttributeMap$4.unit) : '';
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
setBaseInfo({
|
|
299
300
|
// 资源
|
|
300
301
|
//display_name: modelAttributeMap['display_name'] ? attributeMap.display_name : false,
|
|
301
|
-
resource: modelAttributeMap['display_name'] ? {
|
|
302
|
+
resource: (_modelAttributeMap$di = modelAttributeMap['display_name']) !== null && _modelAttributeMap$di !== void 0 && _modelAttributeMap$di.userVisible ? {
|
|
302
303
|
display_name: attributeMap.display_name,
|
|
303
304
|
// 资源名称/显示名称
|
|
304
305
|
link: "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
305
306
|
|
|
306
307
|
} : false,
|
|
307
|
-
ipv4_address: modelAttributeMap['ipv4_address'] ? attributeMap.ipv4_address : false,
|
|
308
|
-
asset_number: modelAttributeMap['asset_number'] ? attributeMap.asset_number : false,
|
|
308
|
+
ipv4_address: (_modelAttributeMap$ip = modelAttributeMap['ipv4_address']) !== null && _modelAttributeMap$ip !== void 0 && _modelAttributeMap$ip.userVisible ? attributeMap.ipv4_address : false,
|
|
309
|
+
asset_number: (_modelAttributeMap$as = modelAttributeMap['asset_number']) !== null && _modelAttributeMap$as !== void 0 && _modelAttributeMap$as.userVisible ? attributeMap.asset_number : false,
|
|
309
310
|
ciName: ciName,
|
|
310
311
|
res_address: res_address,
|
|
311
312
|
// principal: modelAttributeMap[`${ciType}.principal`] ? attributeMap[`${ciType}.principal`] : false,
|
|
312
313
|
// 链路
|
|
313
314
|
rated_bandwidth: rated_bandwidth,
|
|
314
|
-
source_ipv4: modelAttributeMap[ciType + ".source_ipv4"] ? attributeMap[ciType + ".source_ipv4"] : false,
|
|
315
|
-
destination_ipv4: modelAttributeMap[ciType + ".destination_ipv4"] ? attributeMap[ciType + ".destination_ipv4"] : false,
|
|
316
|
-
source_Interface: modelAttributeMap['source_id'] ? (_attributeMap$source_ = attributeMap.source_id_object) === null || _attributeMap$source_ === void 0 ? void 0 : _attributeMap$source_.displayName : false,
|
|
317
|
-
destination_Interface: modelAttributeMap['destination_id'] ? (_attributeMap$destina = attributeMap.destination_id_object) === null || _attributeMap$destina === void 0 ? void 0 : _attributeMap$destina.displayName : false
|
|
315
|
+
source_ipv4: (_modelAttributeMap$5 = modelAttributeMap[ciType + ".source_ipv4"]) !== null && _modelAttributeMap$5 !== void 0 && _modelAttributeMap$5.userVisible ? attributeMap[ciType + ".source_ipv4"] : false,
|
|
316
|
+
destination_ipv4: (_modelAttributeMap$6 = modelAttributeMap[ciType + ".destination_ipv4"]) !== null && _modelAttributeMap$6 !== void 0 && _modelAttributeMap$6.userVisible ? attributeMap[ciType + ".destination_ipv4"] : false,
|
|
317
|
+
source_Interface: (_modelAttributeMap$so = modelAttributeMap['source_id']) !== null && _modelAttributeMap$so !== void 0 && _modelAttributeMap$so.userVisible ? (_attributeMap$source_ = attributeMap.source_id_object) === null || _attributeMap$source_ === void 0 ? void 0 : _attributeMap$source_.displayName : false,
|
|
318
|
+
destination_Interface: (_modelAttributeMap$de = modelAttributeMap['destination_id']) !== null && _modelAttributeMap$de !== void 0 && _modelAttributeMap$de.userVisible ? (_attributeMap$destina = attributeMap.destination_id_object) === null || _attributeMap$destina === void 0 ? void 0 : _attributeMap$destina.displayName : false
|
|
318
319
|
}); // 资源/链路-关键指标 数据 metrics,模型 topo.ciTyeCache.getCiType(ciType)
|
|
319
320
|
|
|
320
321
|
setIndicator(topModelMetrics.map(function (item) {
|
|
@@ -344,7 +345,7 @@ export default function ResourceOverview(props) {
|
|
|
344
345
|
|
|
345
346
|
function _initAppTopo() {
|
|
346
347
|
_initAppTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(topModelMetrics, modelAttributeMap, ciName, domain) {
|
|
347
|
-
var _topo$options$resourc2, _alarmList;
|
|
348
|
+
var _topo$options$resourc2, _modelAttributeMap$ow2, _modelAttributeMap$7, _modelAttributeMap$8, _modelAttributeMap$di2, _modelAttributeMap$ip2, _modelAttributeMap$as2, _alarmList;
|
|
348
349
|
|
|
349
350
|
var _yield$topo$options$r, metrics, alarmList, attributeMap, res_address, _attributeMap$2;
|
|
350
351
|
|
|
@@ -376,7 +377,7 @@ export default function ResourceOverview(props) {
|
|
|
376
377
|
// 位置
|
|
377
378
|
res_address = false;
|
|
378
379
|
|
|
379
|
-
if (!modelAttributeMap['owned_computer_room']) {
|
|
380
|
+
if (!((_modelAttributeMap$ow2 = modelAttributeMap['owned_computer_room']) !== null && _modelAttributeMap$ow2 !== void 0 && _modelAttributeMap$ow2.userVisible)) {
|
|
380
381
|
_context2.next = 17;
|
|
381
382
|
break;
|
|
382
383
|
}
|
|
@@ -390,7 +391,7 @@ export default function ResourceOverview(props) {
|
|
|
390
391
|
break;
|
|
391
392
|
|
|
392
393
|
case 17:
|
|
393
|
-
if (modelAttributeMap[ciType + ".computer_room"] || modelAttributeMap[ciType + ".area"]) {
|
|
394
|
+
if ((_modelAttributeMap$7 = modelAttributeMap[ciType + ".computer_room"]) !== null && _modelAttributeMap$7 !== void 0 && _modelAttributeMap$7.userVisible || (_modelAttributeMap$8 = modelAttributeMap[ciType + ".area"]) !== null && _modelAttributeMap$8 !== void 0 && _modelAttributeMap$8.userVisible) {
|
|
394
395
|
res_address = attributeMap[ciType + ".computer_room "] || attributeMap[ciType + ".area"] ? " " + (((_attributeMap$2 = attributeMap[ciType + ".area_object"]) === null || _attributeMap$2 === void 0 ? void 0 : _attributeMap$2.displayName) || '') + " " + (attributeMap[ciType + ".computer_room"] || '') : false;
|
|
395
396
|
}
|
|
396
397
|
|
|
@@ -398,14 +399,14 @@ export default function ResourceOverview(props) {
|
|
|
398
399
|
setBaseInfo({
|
|
399
400
|
// 资源
|
|
400
401
|
//display_name: modelAttributeMap['display_name'] ? attributeMap.display_name : false,
|
|
401
|
-
resource: modelAttributeMap['display_name'] ? {
|
|
402
|
+
resource: (_modelAttributeMap$di2 = modelAttributeMap['display_name']) !== null && _modelAttributeMap$di2 !== void 0 && _modelAttributeMap$di2.userVisible ? {
|
|
402
403
|
display_name: attributeMap.display_name,
|
|
403
404
|
// 资源名称/显示名称
|
|
404
405
|
link: "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType // 资源跳转链接
|
|
405
406
|
|
|
406
407
|
} : false,
|
|
407
|
-
ipv4_address: modelAttributeMap['ipv4_address'] ? attributeMap.ipv4_address : false,
|
|
408
|
-
asset_number: modelAttributeMap['asset_number'] ? attributeMap.asset_number : false,
|
|
408
|
+
ipv4_address: (_modelAttributeMap$ip2 = modelAttributeMap['ipv4_address']) !== null && _modelAttributeMap$ip2 !== void 0 && _modelAttributeMap$ip2.userVisible ? attributeMap.ipv4_address : false,
|
|
409
|
+
asset_number: (_modelAttributeMap$as2 = modelAttributeMap['asset_number']) !== null && _modelAttributeMap$as2 !== void 0 && _modelAttributeMap$as2.userVisible ? attributeMap.asset_number : false,
|
|
409
410
|
ciName: ciName,
|
|
410
411
|
res_address: res_address // principal: modelAttributeMap[`${ciType}.principal`] ? attributeMap[`${ciType}.principal`] : false,
|
|
411
412
|
|
|
@@ -563,7 +564,7 @@ export default function ResourceOverview(props) {
|
|
|
563
564
|
pageNum: 1,
|
|
564
565
|
pageSize: 999,
|
|
565
566
|
sortField: "alertLevel",
|
|
566
|
-
sortOrder: "
|
|
567
|
+
sortOrder: "desc"
|
|
567
568
|
});
|
|
568
569
|
|
|
569
570
|
case 2:
|
|
@@ -6,70 +6,71 @@ export default function buildNodeContextmenu(topoApp) {
|
|
|
6
6
|
return {
|
|
7
7
|
enable: true,
|
|
8
8
|
items: [// {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: 'Web控制台',
|
|
18
|
-
icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
19
|
-
visible:
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
items: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
9
|
+
// label: '概览',
|
|
10
|
+
// id: 'Resource.detail',
|
|
11
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_overview.svg',
|
|
12
|
+
// visible: (data) => {
|
|
13
|
+
// return isResource(data) && !!data.operation;
|
|
14
|
+
// }
|
|
15
|
+
// },
|
|
16
|
+
// {
|
|
17
|
+
// label: 'Web控制台',
|
|
18
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
19
|
+
// visible: (data) => {
|
|
20
|
+
// return isResource(data) && !!data.operation;
|
|
21
|
+
// },
|
|
22
|
+
// items: [
|
|
23
|
+
// {
|
|
24
|
+
// label: '访问',
|
|
25
|
+
// id: 'Resource.WebConsole.open',
|
|
26
|
+
// disable: (data) => {
|
|
27
|
+
// const {resourceWebControllUrl} = topoApp.pluginManager.pluginMap;
|
|
28
|
+
// return !resourceWebControllUrl.getResourceUrl(data.id)
|
|
29
|
+
// },
|
|
30
|
+
// },
|
|
31
|
+
// { label: '设置', id: 'Resource.WebConsole.setting' },
|
|
32
|
+
// ]
|
|
33
|
+
// },
|
|
34
|
+
// {
|
|
35
|
+
// label: '资源操作',
|
|
36
|
+
// id: 'Resource.Operate',
|
|
37
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_operands.svg',
|
|
38
|
+
// visible: (data) => {
|
|
39
|
+
// if (!isResource(data)) {
|
|
40
|
+
// return false;
|
|
41
|
+
// }
|
|
42
|
+
// const {ciType} = data;
|
|
43
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
44
|
+
// if (!ciMeta) {
|
|
45
|
+
// return false;
|
|
46
|
+
// }
|
|
47
|
+
// const {domain} = ciMeta;
|
|
48
|
+
// // 是否有该页签,与资源详情保持一致
|
|
49
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
50
|
+
// return !!data.operation && hasTab;
|
|
51
|
+
// }
|
|
52
|
+
// },
|
|
53
|
+
// {
|
|
54
|
+
// label: 'Syslog',
|
|
55
|
+
// id: 'Resource.Syslog',
|
|
56
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_syslog.svg',
|
|
57
|
+
// visible: (data) => {
|
|
58
|
+
// if (!isResource(data)) {
|
|
59
|
+
// return false;
|
|
60
|
+
// }
|
|
61
|
+
// const {ciType} = data;
|
|
62
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
63
|
+
// if (!ciMeta) {
|
|
64
|
+
// return false;
|
|
65
|
+
// }
|
|
66
|
+
// const {domain} = ciMeta;
|
|
67
|
+
// // 是否有该页签,与资源详情保持一致
|
|
68
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
69
|
+
// return !!data.operation && hasTab;
|
|
70
|
+
// }
|
|
71
|
+
// },
|
|
72
|
+
// { label: '打开属性设置', id: 'openSet' },
|
|
73
|
+
// { label: '打开全局属性设置', id: 'openAllSet' },
|
|
73
74
|
]
|
|
74
75
|
};
|
|
75
76
|
}
|
package/es/createTopo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { createTopoApp } from "./core/
|
|
2
|
+
import { createTopoApp } from "./core/createTopoApp";
|
|
3
3
|
import createMenuCommands from "./contextmenu/createMenuCommands";
|
|
4
4
|
import getTopoData from "./topoCenter/getTopoData";
|
|
5
5
|
export function createTopo(options) {
|
package/es/hooks/useAlarm.js
CHANGED
|
@@ -26,9 +26,7 @@ export default function useAlarm(options) {
|
|
|
26
26
|
|
|
27
27
|
var _store$useModel2 = store.useModel("topoBizMod"),
|
|
28
28
|
bizState = _store$useModel2[0],
|
|
29
|
-
bizDispatchers = _store$useModel2[1];
|
|
30
|
-
|
|
31
|
-
var linkDynamicStyleDispatcher = store.getModel("linkDynamicStyle")[1]; // rlog.debug(
|
|
29
|
+
bizDispatchers = _store$useModel2[1]; // rlog.debug(
|
|
32
30
|
// "useAlarm.useEffect 获取初始化告警----------init",
|
|
33
31
|
// topo,
|
|
34
32
|
// allData,
|
|
@@ -63,6 +61,7 @@ export default function useAlarm(options) {
|
|
|
63
61
|
// };
|
|
64
62
|
// }, [alarmIsOpened]);
|
|
65
63
|
|
|
64
|
+
|
|
66
65
|
function getAlarmByEE(_x) {
|
|
67
66
|
return _getAlarmByEE.apply(this, arguments);
|
|
68
67
|
}
|
|
@@ -110,9 +109,7 @@ export default function useAlarm(options) {
|
|
|
110
109
|
rlog.debug("useAlarm.getAlarmByEE 推送告警到ht", alarmList, bizState);
|
|
111
110
|
|
|
112
111
|
if (alarmIsOpened) {
|
|
113
|
-
topo.loadAlarm(alarmList);
|
|
114
|
-
|
|
115
|
-
linkDynamicStyleDispatcher.execute();
|
|
112
|
+
topo.loadAlarm(alarmList);
|
|
116
113
|
}
|
|
117
114
|
|
|
118
115
|
case 12:
|
|
@@ -9,7 +9,7 @@ import { getEdges, getNodes } from "../utils/htElementUtils";
|
|
|
9
9
|
export default function (props) {
|
|
10
10
|
var topo = props.topo;
|
|
11
11
|
var store = topo.store;
|
|
12
|
-
var editDispatchers = store.useModelDispatchers('
|
|
12
|
+
var editDispatchers = store.useModelDispatchers('topoConfig');
|
|
13
13
|
|
|
14
14
|
var loadConfig = /*#__PURE__*/function () {
|
|
15
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
package/es/hooks/useTopoEdit.js
CHANGED
|
@@ -39,7 +39,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
39
39
|
topoEditState = _store$useModel[0],
|
|
40
40
|
topoEditDispatchers = _store$useModel[1];
|
|
41
41
|
|
|
42
|
-
var _store$useModel2 = store.useModel('
|
|
42
|
+
var _store$useModel2 = store.useModel('topoConfig'),
|
|
43
43
|
editState = _store$useModel2[0],
|
|
44
44
|
editDispatchers = _store$useModel2[1];
|
|
45
45
|
|
|
@@ -105,9 +105,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
105
105
|
}); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
|
|
106
106
|
|
|
107
107
|
if (!isLayerTopo && config.layers.length) {
|
|
108
|
-
topoDispatchers.
|
|
109
|
-
type: TPL_TREE
|
|
110
|
-
});
|
|
108
|
+
topoDispatchers.setTopoType(TPL_TREE);
|
|
111
109
|
} // 更新配置
|
|
112
110
|
|
|
113
111
|
|
|
@@ -125,9 +123,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
125
123
|
}); // 如果没有分层,将拓扑类型切换为空白模板
|
|
126
124
|
|
|
127
125
|
if (!config.layers.length) {
|
|
128
|
-
topoDispatchers.
|
|
129
|
-
type: TPL_BLANK
|
|
130
|
-
});
|
|
126
|
+
topoDispatchers.setTopoType(TPL_BLANK);
|
|
131
127
|
} // 更新配置
|
|
132
128
|
|
|
133
129
|
|
|
@@ -921,7 +917,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
921
917
|
}
|
|
922
918
|
};
|
|
923
919
|
|
|
924
|
-
var effectsState = store.useModelEffectsState('
|
|
920
|
+
var effectsState = store.useModelEffectsState('topoConfig');
|
|
925
921
|
var topoLoading = effectsState.getTopoByConditions.isLoading;
|
|
926
922
|
return {
|
|
927
923
|
resourceConfig: resourceConfig,
|
|
@@ -163,7 +163,7 @@ export default function (engine) {
|
|
|
163
163
|
_this3.update({
|
|
164
164
|
visible: false,
|
|
165
165
|
icons: {
|
|
166
|
-
node: [].concat(rootState.
|
|
166
|
+
node: [].concat(rootState.customIcon.icons.node, data.map(addIconUrlData)),
|
|
167
167
|
container: []
|
|
168
168
|
}
|
|
169
169
|
});
|
package/es/models/topoBizMod.js
CHANGED
|
@@ -67,105 +67,75 @@ export default function (engine) {
|
|
|
67
67
|
}, _callee);
|
|
68
68
|
}))();
|
|
69
69
|
},
|
|
70
|
-
getCiInfo: function getCiInfo(conditions, state) {
|
|
71
|
-
var _this2 = this;
|
|
72
|
-
|
|
73
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
74
|
-
var result;
|
|
75
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
76
|
-
while (1) {
|
|
77
|
-
switch (_context2.prev = _context2.next) {
|
|
78
|
-
case 0:
|
|
79
|
-
_context2.next = 2;
|
|
80
|
-
return getCiMeta(conditions);
|
|
81
|
-
|
|
82
|
-
case 2:
|
|
83
|
-
result = _context2.sent;
|
|
84
|
-
|
|
85
|
-
// rlog.debug('getCiInfo', result);
|
|
86
|
-
_this2.update({
|
|
87
|
-
// alarmList: result.datas,
|
|
88
|
-
currentCiInfo: result // drawerAlarmPageInfo,
|
|
89
|
-
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
case 4:
|
|
93
|
-
case "end":
|
|
94
|
-
return _context2.stop();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, _callee2);
|
|
98
|
-
}))();
|
|
99
|
-
},
|
|
100
70
|
// 根据ci的id获取属性的值
|
|
101
71
|
getCiArrByIds: function getCiArrByIds(conditions, state) {
|
|
102
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
72
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
103
73
|
var resIdsList, result;
|
|
104
|
-
return _regeneratorRuntime.wrap(function
|
|
74
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
105
75
|
while (1) {
|
|
106
|
-
switch (
|
|
76
|
+
switch (_context2.prev = _context2.next) {
|
|
107
77
|
case 0:
|
|
108
78
|
resIdsList = state.topoBizMod.resAndMetrics.resIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList);
|
|
109
79
|
// const ciIds = encodeURIComponent(resIdsList);
|
|
110
80
|
|
|
111
|
-
|
|
112
|
-
|
|
81
|
+
_context2.prev = 1;
|
|
82
|
+
_context2.next = 4;
|
|
113
83
|
return topoServer.getBatchCiArr({
|
|
114
84
|
ids: resIdsList
|
|
115
85
|
});
|
|
116
86
|
|
|
117
87
|
case 4:
|
|
118
|
-
result =
|
|
119
|
-
return
|
|
88
|
+
result = _context2.sent;
|
|
89
|
+
return _context2.abrupt("return", result.content);
|
|
120
90
|
|
|
121
91
|
case 8:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return
|
|
92
|
+
_context2.prev = 8;
|
|
93
|
+
_context2.t0 = _context2["catch"](1);
|
|
94
|
+
return _context2.abrupt("return", null);
|
|
125
95
|
|
|
126
96
|
case 11:
|
|
127
97
|
case "end":
|
|
128
|
-
return
|
|
98
|
+
return _context2.stop();
|
|
129
99
|
}
|
|
130
100
|
}
|
|
131
|
-
},
|
|
101
|
+
}, _callee2, null, [[1, 8]]);
|
|
132
102
|
}))();
|
|
133
103
|
},
|
|
134
104
|
// 初始化,统一获取指标和属性
|
|
135
105
|
getCiBizByIds: function getCiBizByIds(conditions, state) {
|
|
136
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
106
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
137
107
|
var _conditions$ciIds, _conditions$codes;
|
|
138
108
|
|
|
139
109
|
var _state$topoBizMod$res, resIdsList, metrics, ciIds, codes, metricResult, arrResult;
|
|
140
110
|
|
|
141
|
-
return _regeneratorRuntime.wrap(function
|
|
111
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
142
112
|
while (1) {
|
|
143
|
-
switch (
|
|
113
|
+
switch (_context3.prev = _context3.next) {
|
|
144
114
|
case 0:
|
|
145
115
|
_state$topoBizMod$res = state.topoBizMod.resAndMetrics, resIdsList = _state$topoBizMod$res.resIdsList, metrics = _state$topoBizMod$res.metrics;
|
|
146
116
|
ciIds = encodeURIComponent((_conditions$ciIds = conditions === null || conditions === void 0 ? void 0 : conditions.ciIds) !== null && _conditions$ciIds !== void 0 ? _conditions$ciIds : resIdsList);
|
|
147
117
|
codes = encodeURIComponent((_conditions$codes = conditions === null || conditions === void 0 ? void 0 : conditions.codes) !== null && _conditions$codes !== void 0 ? _conditions$codes : metrics);
|
|
148
|
-
|
|
118
|
+
_context3.next = 5;
|
|
149
119
|
return getLatestMetrics(ciIds, codes);
|
|
150
120
|
|
|
151
121
|
case 5:
|
|
152
|
-
metricResult =
|
|
153
|
-
|
|
122
|
+
metricResult = _context3.sent;
|
|
123
|
+
_context3.next = 8;
|
|
154
124
|
return topoServer.getBatchCiArr(ciIds);
|
|
155
125
|
|
|
156
126
|
case 8:
|
|
157
|
-
arrResult =
|
|
158
|
-
return
|
|
127
|
+
arrResult = _context3.sent;
|
|
128
|
+
return _context3.abrupt("return", {
|
|
159
129
|
metricResult: metricResult,
|
|
160
130
|
arrResult: arrResult
|
|
161
131
|
});
|
|
162
132
|
|
|
163
133
|
case 10:
|
|
164
134
|
case "end":
|
|
165
|
-
return
|
|
135
|
+
return _context3.stop();
|
|
166
136
|
}
|
|
167
137
|
}
|
|
168
|
-
},
|
|
138
|
+
}, _callee3);
|
|
169
139
|
}))();
|
|
170
140
|
},
|
|
171
141
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 拓扑配置
|
|
7
|
+
*/
|
|
4
8
|
import { getUUID, isAvailableArray } from "@riil-frontend/utils";
|
|
5
9
|
import { transformTopoElements } from "@riil-frontend/component-topology-graph/es/utils";
|
|
6
10
|
import topoService, { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
|
@@ -245,7 +249,7 @@ export default function (topoApp) {
|
|
|
245
249
|
while (1) {
|
|
246
250
|
switch (_context2.prev = _context2.next) {
|
|
247
251
|
case 0:
|
|
248
|
-
editState = rootState.
|
|
252
|
+
editState = rootState.topoConfig;
|
|
249
253
|
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
|
250
254
|
query = {
|
|
251
255
|
id: rootState.topoMod.topoId,
|
|
@@ -329,7 +333,7 @@ export default function (topoApp) {
|
|
|
329
333
|
data = _context4.sent;
|
|
330
334
|
rlog.debug("getTopoByConditions--------", data, groupInfo);
|
|
331
335
|
_context4.next = 13;
|
|
332
|
-
return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.
|
|
336
|
+
return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
|
|
333
337
|
|
|
334
338
|
case 13:
|
|
335
339
|
_yield$Promise$all = _context4.sent;
|
|
@@ -397,7 +401,7 @@ export default function (topoApp) {
|
|
|
397
401
|
var _this5 = this;
|
|
398
402
|
|
|
399
403
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
400
|
-
var _state$
|
|
404
|
+
var _state$topoConfig$vie;
|
|
401
405
|
|
|
402
406
|
var currentBackground;
|
|
403
407
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
@@ -407,7 +411,7 @@ export default function (topoApp) {
|
|
|
407
411
|
currentBackground = topoApp.store.getModelState('background').current;
|
|
408
412
|
_context6.next = 3;
|
|
409
413
|
return _saveTopo(_extends({}, data, {
|
|
410
|
-
viewGroupId: (_state$
|
|
414
|
+
viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
|
|
411
415
|
template: state.topoMod.type,
|
|
412
416
|
// 背景图
|
|
413
417
|
backgroundId: currentBackground ? currentBackground.id : null
|