@riil-frontend/component-topology 12.0.0-dev.40 → 12.0.0-dev.42
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/index.css +1 -1
- package/build/index.js +6 -6
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +46 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +5 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +47 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +5 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/package.json +2 -2
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "12.0.0-dev.
|
27
|
+
var version = typeof "12.0.0-dev.42" === 'string' ? "12.0.0-dev.42" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -9,32 +9,65 @@ import BlockBox from "./BlockBox";
|
|
9
9
|
import Link from "../../../../../../../components/Link";
|
10
10
|
import service from "../../../../../../services/overview";
|
11
11
|
import styles from "./index.module.scss";
|
12
|
+
import { getHistory } from '@riil-frontend/component-topology-utils';
|
12
13
|
|
13
14
|
function formatUrl(url) {
|
14
|
-
|
15
|
+
var _window, _window$location;
|
16
|
+
|
17
|
+
console.log(url);
|
18
|
+
var prefix = '/default/pagecenter';
|
19
|
+
|
20
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
21
|
+
return url.split(prefix)[1];
|
22
|
+
} else {
|
23
|
+
return url;
|
24
|
+
}
|
15
25
|
}
|
16
26
|
|
17
27
|
function EventsCard(props) {
|
18
28
|
var alarmRiskList = props.alarmRiskList,
|
19
29
|
closeDetailDrawer = props.closeDetailDrawer,
|
20
|
-
onHandleAlarm = props.onHandleAlarm;
|
30
|
+
onHandleAlarm = props.onHandleAlarm;
|
31
|
+
|
32
|
+
var jumpTo = function jumpTo(url) {
|
33
|
+
closeDetailDrawer();
|
34
|
+
getHistory().push(formatUrl(url));
|
35
|
+
}; // 告警table列配置
|
36
|
+
|
21
37
|
|
22
38
|
var columns = [{
|
23
39
|
title: "描述",
|
24
40
|
dataIndex: "title",
|
25
41
|
key: "title",
|
26
42
|
cell: function cell(value, index, record) {
|
27
|
-
return
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
43
|
+
return (
|
44
|
+
/*#__PURE__*/
|
45
|
+
// <div
|
46
|
+
// className={styles["alarm-title"]}
|
47
|
+
// title={value}
|
48
|
+
// onClick={closeDetailDrawer}
|
49
|
+
// >
|
50
|
+
// <Icon
|
51
|
+
// type={record.icon}
|
52
|
+
// size="xs"
|
53
|
+
// className={`${styles["alarm-color-icon"]} ${record.className}`}
|
54
|
+
// />
|
55
|
+
// <Link to={formatUrl(record.link)}>{value}</Link>
|
56
|
+
// </div>
|
57
|
+
React.createElement("div", {
|
58
|
+
className: styles['alarm-title'],
|
59
|
+
title: value,
|
60
|
+
onClick: function onClick() {
|
61
|
+
jumpTo(record.link);
|
62
|
+
}
|
63
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
64
|
+
type: record.icon,
|
65
|
+
size: "xs",
|
66
|
+
className: styles['alarm-color-icon'] + " " + record.className
|
67
|
+
}), /*#__PURE__*/React.createElement("span", {
|
68
|
+
className: styles.link
|
69
|
+
}, value))
|
70
|
+
);
|
38
71
|
}
|
39
72
|
}, {
|
40
73
|
title: "时间",
|
@@ -15,7 +15,6 @@ import moment from 'moment';
|
|
15
15
|
import React, { useEffect, useMemo, useState } from 'react';
|
16
16
|
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
|
17
17
|
import Link from "../../../../../../../components/Link";
|
18
|
-
import { getHistory } from '@riil-frontend/component-topology-utils';
|
19
18
|
import { queryCisByIds, commonQueryCiData } from "../../../../../../services";
|
20
19
|
import service from "../../../../../../services/overview";
|
21
20
|
import BaseInfoBlock from "./BaseInfoBlock";
|
@@ -154,13 +153,7 @@ export default function ResourceOverview(props) {
|
|
154
153
|
window.topo_overview_metric_timer = null;
|
155
154
|
}
|
156
155
|
};
|
157
|
-
}, []);
|
158
|
-
|
159
|
-
var jumpTo = function jumpTo(url) {
|
160
|
-
getHistory.push(url);
|
161
|
-
onClose();
|
162
|
-
}; // 跳转前调用关闭操作
|
163
|
-
|
156
|
+
}, []); // 跳转前调用关闭操作
|
164
157
|
|
165
158
|
function onClose() {
|
166
159
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
@@ -339,13 +332,14 @@ export default function ResourceOverview(props) {
|
|
339
332
|
return /*#__PURE__*/React.createElement("div", {
|
340
333
|
className: styles['alarm-title'],
|
341
334
|
title: value,
|
342
|
-
onClick:
|
335
|
+
onClick: onClose
|
343
336
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
344
337
|
type: record.icon,
|
345
338
|
size: "xs",
|
346
339
|
className: styles['alarm-color-icon'] + " " + record.className
|
347
|
-
}), /*#__PURE__*/React.createElement(
|
348
|
-
className: styles.link
|
340
|
+
}), /*#__PURE__*/React.createElement(Link, {
|
341
|
+
className: styles.link,
|
342
|
+
to: formatUrl(record.link)
|
349
343
|
}, value));
|
350
344
|
}
|
351
345
|
}, {
|
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
54
54
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "12.0.0-dev.
|
57
|
+
var version = typeof "12.0.0-dev.42" === 'string' ? "12.0.0-dev.42" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -27,31 +27,65 @@ var _overview = _interopRequireDefault(require("../../../../../../services/overv
|
|
27
27
|
|
28
28
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
29
29
|
|
30
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
31
|
+
|
30
32
|
function formatUrl(url) {
|
31
|
-
|
33
|
+
var _window, _window$location;
|
34
|
+
|
35
|
+
console.log(url);
|
36
|
+
var prefix = '/default/pagecenter';
|
37
|
+
|
38
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
39
|
+
return url.split(prefix)[1];
|
40
|
+
} else {
|
41
|
+
return url;
|
42
|
+
}
|
32
43
|
}
|
33
44
|
|
34
45
|
function EventsCard(props) {
|
35
46
|
var alarmRiskList = props.alarmRiskList,
|
36
47
|
closeDetailDrawer = props.closeDetailDrawer,
|
37
|
-
onHandleAlarm = props.onHandleAlarm;
|
48
|
+
onHandleAlarm = props.onHandleAlarm;
|
49
|
+
|
50
|
+
var jumpTo = function jumpTo(url) {
|
51
|
+
closeDetailDrawer();
|
52
|
+
(0, _componentTopologyUtils.getHistory)().push(formatUrl(url));
|
53
|
+
}; // 告警table列配置
|
54
|
+
|
38
55
|
|
39
56
|
var columns = [{
|
40
57
|
title: "描述",
|
41
58
|
dataIndex: "title",
|
42
59
|
key: "title",
|
43
60
|
cell: function cell(value, index, record) {
|
44
|
-
return
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
61
|
+
return (
|
62
|
+
/*#__PURE__*/
|
63
|
+
// <div
|
64
|
+
// className={styles["alarm-title"]}
|
65
|
+
// title={value}
|
66
|
+
// onClick={closeDetailDrawer}
|
67
|
+
// >
|
68
|
+
// <Icon
|
69
|
+
// type={record.icon}
|
70
|
+
// size="xs"
|
71
|
+
// className={`${styles["alarm-color-icon"]} ${record.className}`}
|
72
|
+
// />
|
73
|
+
// <Link to={formatUrl(record.link)}>{value}</Link>
|
74
|
+
// </div>
|
75
|
+
_react["default"].createElement("div", {
|
76
|
+
className: _indexModule["default"]['alarm-title'],
|
77
|
+
title: value,
|
78
|
+
onClick: function onClick() {
|
79
|
+
jumpTo(record.link);
|
80
|
+
}
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
82
|
+
type: record.icon,
|
83
|
+
size: "xs",
|
84
|
+
className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
|
85
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
86
|
+
className: _indexModule["default"].link
|
87
|
+
}, value))
|
88
|
+
);
|
55
89
|
}
|
56
90
|
}, {
|
57
91
|
title: "时间",
|
@@ -25,8 +25,6 @@ var _rlog = require("@riil-frontend/component-topology-utils/lib/rlog");
|
|
25
25
|
|
26
26
|
var _Link = _interopRequireDefault(require("../../../../../../../components/Link"));
|
27
27
|
|
28
|
-
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
29
|
-
|
30
28
|
var _services = require("../../../../../../services");
|
31
29
|
|
32
30
|
var _overview = _interopRequireDefault(require("../../../../../../services/overview"));
|
@@ -189,14 +187,7 @@ function ResourceOverview(props) {
|
|
189
187
|
window.topo_overview_metric_timer = null;
|
190
188
|
}
|
191
189
|
};
|
192
|
-
}, []);
|
193
|
-
|
194
|
-
var jumpTo = function jumpTo(url) {
|
195
|
-
_componentTopologyUtils.getHistory.push(url);
|
196
|
-
|
197
|
-
onClose();
|
198
|
-
}; // 跳转前调用关闭操作
|
199
|
-
|
190
|
+
}, []); // 跳转前调用关闭操作
|
200
191
|
|
201
192
|
function onClose() {
|
202
193
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
@@ -375,13 +366,14 @@ function ResourceOverview(props) {
|
|
375
366
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
376
367
|
className: _indexModule["default"]['alarm-title'],
|
377
368
|
title: value,
|
378
|
-
onClick:
|
369
|
+
onClick: onClose
|
379
370
|
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
380
371
|
type: record.icon,
|
381
372
|
size: "xs",
|
382
373
|
className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
|
383
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
384
|
-
className: _indexModule["default"].link
|
374
|
+
}), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
375
|
+
className: _indexModule["default"].link,
|
376
|
+
to: formatUrl(record.link)
|
385
377
|
}, value));
|
386
378
|
}
|
387
379
|
}, {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "12.0.0-dev.
|
3
|
+
"version": "12.0.0-dev.42",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -123,6 +123,6 @@
|
|
123
123
|
"access": "public"
|
124
124
|
},
|
125
125
|
"license": "MIT",
|
126
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.42/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|