@abtnode/ux 1.16.13-beta-d17a7de4 → 1.16.13-beta-90ded76f
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/lib/blocklet/component/index.js +27 -7
- package/lib/blocklet/overview.js +3 -2
- package/lib/blocklet/runtime-info.js +4 -6
- package/lib/blocklet/storage/backups.js +18 -30
- package/lib/blocklet/storage/connected.js +8 -0
- package/lib/blocklet/storage/disconnect.js +29 -15
- package/lib/blocklet/transfer-owner.js +2 -4
- package/lib/certificate.js +4 -3
- package/lib/{monitor → insights}/card.js +8 -11
- package/lib/{monitor/cpu.js → insights/chart.js} +43 -44
- package/lib/insights/cpu.js +44 -0
- package/lib/insights/memory.js +80 -0
- package/lib/{blocklet/monitor.js → insights/runtime.js} +20 -22
- package/lib/insights/traffic.js +204 -0
- package/lib/invitation/invitation-receive.js +1 -1
- package/lib/locales/en.js +20 -1
- package/lib/locales/zh.js +20 -1
- package/lib/logs/download.js +1 -1
- package/lib/relative-time.js +2 -2
- package/lib/subscription.js +1 -1
- package/lib/team/members/invite-member.js +3 -2
- package/lib/team/members/member.js +4 -3
- package/lib/team/members/passport-issuances.js +3 -2
- package/lib/team/members/transfer-node.js +2 -4
- package/lib/util/index.js +12 -40
- package/package.json +9 -9
- package/lib/monitor/memory.js +0 -144
- /package/lib/{monitor → insights}/disk.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.13-beta-
|
|
3
|
+
"version": "1.16.13-beta-90ded76f",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@abtnode/auth": "1.16.13-beta-
|
|
27
|
-
"@abtnode/constant": "1.16.13-beta-
|
|
28
|
-
"@abtnode/util": "1.16.13-beta-
|
|
26
|
+
"@abtnode/auth": "1.16.13-beta-90ded76f",
|
|
27
|
+
"@abtnode/constant": "1.16.13-beta-90ded76f",
|
|
28
|
+
"@abtnode/util": "1.16.13-beta-90ded76f",
|
|
29
29
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
30
30
|
"@arcblock/did": "^1.18.84",
|
|
31
31
|
"@arcblock/did-connect": "^2.5.53",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@arcblock/react-hooks": "^2.5.53",
|
|
35
35
|
"@arcblock/terminal": "^2.5.53",
|
|
36
36
|
"@arcblock/ux": "^2.5.53",
|
|
37
|
-
"@blocklet/constant": "1.16.13-beta-
|
|
37
|
+
"@blocklet/constant": "1.16.13-beta-90ded76f",
|
|
38
38
|
"@blocklet/launcher-layout": "2.1.26",
|
|
39
39
|
"@blocklet/list": "^0.12.4",
|
|
40
|
-
"@blocklet/meta": "1.16.13-beta-
|
|
40
|
+
"@blocklet/meta": "1.16.13-beta-90ded76f",
|
|
41
41
|
"@blocklet/ui-react": "^2.5.53",
|
|
42
42
|
"@emotion/react": "^11.10.4",
|
|
43
43
|
"@emotion/styled": "^11.10.4",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@mui/lab": "^5.0.0-alpha.102",
|
|
48
48
|
"@mui/material": "^5.10.8",
|
|
49
49
|
"@mui/styles": "^5.10.8",
|
|
50
|
+
"@mui/x-date-pickers": "^6.9.0",
|
|
50
51
|
"@ocap/client": "1.18.84",
|
|
51
52
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
52
53
|
"ahooks": "^3.7.1",
|
|
53
54
|
"axios": "^0.27.2",
|
|
54
55
|
"classnames": "^2.3.2",
|
|
55
|
-
"dayjs": "^1.11.7",
|
|
56
56
|
"dsbridge": "3.1.4",
|
|
57
57
|
"file-saver": "^2.0.5",
|
|
58
58
|
"filesize": "^6.4.0",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"jszip": "^3.10.1",
|
|
65
65
|
"lodash": "^4.17.21",
|
|
66
66
|
"md5": "^2.3.0",
|
|
67
|
-
"moment": "^2.29.4",
|
|
68
67
|
"ms": "^2.1.3",
|
|
68
|
+
"mui-daterange-picker": "^1.0.5",
|
|
69
69
|
"nanoid": "^4.0.0",
|
|
70
70
|
"p-wait-for": "^4.1.0",
|
|
71
71
|
"pretty-ms-i18n": "^1.0.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"@babel/preset-react": "^7.18.6",
|
|
95
95
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "e6d4b88fe2cb45e00e5d745e1cd148dc76a019a4"
|
|
98
98
|
}
|
package/lib/monitor/memory.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = MemoryMonitor;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _filesize = _interopRequireDefault(require("filesize"));
|
|
10
|
-
var _ahooks = require("ahooks");
|
|
11
|
-
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
|
-
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
13
|
-
var _Sparkline = _interopRequireDefault(require("@arcblock/ux/lib/Sparkline"));
|
|
14
|
-
var _card = _interopRequireDefault(require("./card"));
|
|
15
|
-
var _util = require("../util");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable react/jsx-one-expression-per-line */
|
|
23
|
-
const formatNumber = x => (0, _filesize.default)(x);
|
|
24
|
-
function MemoryMonitor(_ref) {
|
|
25
|
-
let {
|
|
26
|
-
instanceCount,
|
|
27
|
-
title,
|
|
28
|
-
total,
|
|
29
|
-
used,
|
|
30
|
-
history,
|
|
31
|
-
hideDescription
|
|
32
|
-
} = _ref;
|
|
33
|
-
const {
|
|
34
|
-
t
|
|
35
|
-
} = (0, _react.useContext)(_context.LocaleContext);
|
|
36
|
-
const svgRef = (0, _react.useRef)(null);
|
|
37
|
-
const tooltipRef = (0, _react.useRef)(null);
|
|
38
|
-
const tooltipState = (0, _ahooks.useReactive)({
|
|
39
|
-
style: {
|
|
40
|
-
top: 0,
|
|
41
|
-
left: 0
|
|
42
|
-
},
|
|
43
|
-
hidden: true,
|
|
44
|
-
textContent: ''
|
|
45
|
-
});
|
|
46
|
-
const [dom, setDom] = (0, _react.useState)();
|
|
47
|
-
const size = (0, _ahooks.useSize)(dom) || {};
|
|
48
|
-
const showPercent = !!total;
|
|
49
|
-
const available = total - used;
|
|
50
|
-
const memoryPercent = showPercent ? "(".concat(Math.floor(used / total * 100), "%)") : '';
|
|
51
|
-
const memoryList = [];
|
|
52
|
-
if (instanceCount) {
|
|
53
|
-
memoryList.push({
|
|
54
|
-
title: t('system.instances'),
|
|
55
|
-
metric: instanceCount
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
memoryList.push({
|
|
59
|
-
title: t('system.used'),
|
|
60
|
-
metric: (0, _filesize.default)(used)
|
|
61
|
-
});
|
|
62
|
-
if (showPercent) {
|
|
63
|
-
memoryList.push({
|
|
64
|
-
title: t('system.free'),
|
|
65
|
-
metric: (0, _filesize.default)(available)
|
|
66
|
-
}, {
|
|
67
|
-
title: t('system.total'),
|
|
68
|
-
metric: (0, _filesize.default)(total)
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const sparklineOptions = {
|
|
72
|
-
onmousemove(event, dataPoint) {
|
|
73
|
-
const date = (0, _util.formatTime)(dataPoint.date, 'HH:mm');
|
|
74
|
-
const left = '80px';
|
|
75
|
-
tooltipState.textContent = "".concat(date, ": ").concat(formatNumber(dataPoint.value));
|
|
76
|
-
tooltipState.style.top = '-30px';
|
|
77
|
-
tooltipState.style.left = left;
|
|
78
|
-
tooltipState.hidden = false;
|
|
79
|
-
},
|
|
80
|
-
onmouseout() {
|
|
81
|
-
tooltipState.hidden = true;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
(0, _react.useEffect)(() => {
|
|
85
|
-
// if (!loading) {
|
|
86
|
-
// // see: https://github.com/alibaba/hooks/issues/838
|
|
87
|
-
// }
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
setDom(document.querySelector('.mem-sparkline'));
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
if (svgRef.current) {
|
|
92
|
-
(0, _Sparkline.default)(svgRef.current, history, sparklineOptions);
|
|
93
|
-
}
|
|
94
|
-
}, 400);
|
|
95
|
-
});
|
|
96
|
-
}, [history]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
97
|
-
|
|
98
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_card.default, {
|
|
99
|
-
title: title || t('common.memory'),
|
|
100
|
-
value: "".concat((0, _filesize.default)(Math.floor(used || 0)), " ").concat(memoryPercent),
|
|
101
|
-
graph: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
102
|
-
className: "card-sparkline mem-sparkline",
|
|
103
|
-
style: {
|
|
104
|
-
marginTop: 16
|
|
105
|
-
},
|
|
106
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
107
|
-
ref: svgRef,
|
|
108
|
-
className: "sparkline",
|
|
109
|
-
width: size.width || 100,
|
|
110
|
-
height: 30,
|
|
111
|
-
strokeWidth: "2"
|
|
112
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
113
|
-
className: "tooltip",
|
|
114
|
-
ref: tooltipRef,
|
|
115
|
-
hidden: tooltipState.hidden,
|
|
116
|
-
style: _objectSpread({}, tooltipState.style),
|
|
117
|
-
children: tooltipState.textContent
|
|
118
|
-
})]
|
|
119
|
-
}),
|
|
120
|
-
description: memoryList.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
121
|
-
sx: {
|
|
122
|
-
marginLeft: index === 0 ? 0 : 2
|
|
123
|
-
},
|
|
124
|
-
children: [x.title, ": ", x.metric]
|
|
125
|
-
}, x.title)),
|
|
126
|
-
hideDescription: hideDescription
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
MemoryMonitor.propTypes = {
|
|
130
|
-
title: _propTypes.default.string,
|
|
131
|
-
instanceCount: _propTypes.default.number,
|
|
132
|
-
total: _propTypes.default.number,
|
|
133
|
-
used: _propTypes.default.number,
|
|
134
|
-
history: _propTypes.default.array,
|
|
135
|
-
hideDescription: _propTypes.default.bool
|
|
136
|
-
};
|
|
137
|
-
MemoryMonitor.defaultProps = {
|
|
138
|
-
title: '',
|
|
139
|
-
instanceCount: null,
|
|
140
|
-
total: null,
|
|
141
|
-
used: null,
|
|
142
|
-
history: [],
|
|
143
|
-
hideDescription: false
|
|
144
|
-
};
|
|
File without changes
|