@abtnode/ux 1.16.6-beta-56be9f01 → 1.16.6-beta-e2082fec
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/audit-logs.js +5 -2
- package/lib/contexts/audit-log.js +43 -34
- package/lib/team/members/index.js +17 -0
- package/package.json +17 -16
|
@@ -11,6 +11,7 @@ var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar")
|
|
|
11
11
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
12
12
|
var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
|
|
13
13
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
14
|
+
var _constant = require("@abtnode/constant");
|
|
14
15
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
15
16
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
16
17
|
var _Pagination = _interopRequireDefault(require("@mui/lab/Pagination"));
|
|
@@ -34,7 +35,7 @@ const getUserLink = _ref => {
|
|
|
34
35
|
} = _ref;
|
|
35
36
|
if (inService) {
|
|
36
37
|
// TODO
|
|
37
|
-
return "/members?did=".concat(log.actor.did);
|
|
38
|
+
return "".concat(_constant.WELLKNOWN_BLOCKLET_ADMIN_PATH, "/members?did=").concat(log.actor.did);
|
|
38
39
|
}
|
|
39
40
|
if (log.scope === info.did) {
|
|
40
41
|
return "/team/members?did=".concat(log.actor.did);
|
|
@@ -183,10 +184,12 @@ function AuditLogs() {
|
|
|
183
184
|
}
|
|
184
185
|
function WrappedAuditLogs(_ref3) {
|
|
185
186
|
let {
|
|
186
|
-
scope
|
|
187
|
+
scope,
|
|
188
|
+
categories
|
|
187
189
|
} = _ref3;
|
|
188
190
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_auditLog.AuditLogProvider, {
|
|
189
191
|
scope: scope,
|
|
192
|
+
categories: categories,
|
|
190
193
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AuditLogs, {})
|
|
191
194
|
});
|
|
192
195
|
}
|
|
@@ -24,7 +24,8 @@ exports.AuditLogConsumer = Consumer;
|
|
|
24
24
|
function AuditLogProvider(_ref) {
|
|
25
25
|
let {
|
|
26
26
|
children,
|
|
27
|
-
scope = ''
|
|
27
|
+
scope = '',
|
|
28
|
+
categories = []
|
|
28
29
|
} = _ref;
|
|
29
30
|
const {
|
|
30
31
|
api: client
|
|
@@ -38,6 +39,45 @@ function AuditLogProvider(_ref) {
|
|
|
38
39
|
});
|
|
39
40
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
40
41
|
const [category, setCategory] = (0, _useLocalStorage.default)("audit-log-category-".concat(scope), 'all');
|
|
42
|
+
const categoryList = [{
|
|
43
|
+
value: 'all',
|
|
44
|
+
label: 'All',
|
|
45
|
+
description: ''
|
|
46
|
+
}, {
|
|
47
|
+
value: 'blocklet',
|
|
48
|
+
label: 'Blocklet Management',
|
|
49
|
+
description: ''
|
|
50
|
+
}, {
|
|
51
|
+
value: 'server',
|
|
52
|
+
label: 'Server Management',
|
|
53
|
+
description: ''
|
|
54
|
+
}, {
|
|
55
|
+
value: 'team',
|
|
56
|
+
label: 'Team Management',
|
|
57
|
+
description: ''
|
|
58
|
+
}, {
|
|
59
|
+
value: 'security',
|
|
60
|
+
label: 'Security',
|
|
61
|
+
description: ''
|
|
62
|
+
}, {
|
|
63
|
+
value: 'certificates',
|
|
64
|
+
label: 'Certificate Management',
|
|
65
|
+
description: ''
|
|
66
|
+
}, {
|
|
67
|
+
value: 'integrations',
|
|
68
|
+
label: 'Integration Management',
|
|
69
|
+
description: ''
|
|
70
|
+
}, {
|
|
71
|
+
value: 'gateway',
|
|
72
|
+
label: 'Gateway',
|
|
73
|
+
description: ''
|
|
74
|
+
}];
|
|
75
|
+
const filterCategories = categoryList.filter(item => {
|
|
76
|
+
if (categories.length) {
|
|
77
|
+
return item.value === 'all' || categories.includes(item.value);
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
});
|
|
41
81
|
const fetchLogs = async function fetchLogs() {
|
|
42
82
|
let {
|
|
43
83
|
page = 1,
|
|
@@ -52,6 +92,7 @@ function AuditLogProvider(_ref) {
|
|
|
52
92
|
try {
|
|
53
93
|
// eslint-disable-next-line no-shadow
|
|
54
94
|
const res = await client.getAuditLogs({
|
|
95
|
+
// 由于 blocklet 中的 audit-log 本身就不包含 server 类型的,所以这里的 category 查询不需要对 server 类型的做额外的处理
|
|
55
96
|
input: {
|
|
56
97
|
paging: {
|
|
57
98
|
page
|
|
@@ -89,39 +130,7 @@ function AuditLogProvider(_ref) {
|
|
|
89
130
|
category,
|
|
90
131
|
scope
|
|
91
132
|
},
|
|
92
|
-
categories:
|
|
93
|
-
value: 'all',
|
|
94
|
-
label: 'All',
|
|
95
|
-
description: ''
|
|
96
|
-
}, {
|
|
97
|
-
value: 'blocklet',
|
|
98
|
-
label: 'Blocklet Management',
|
|
99
|
-
description: ''
|
|
100
|
-
}, {
|
|
101
|
-
value: 'server',
|
|
102
|
-
label: 'Server Management',
|
|
103
|
-
description: ''
|
|
104
|
-
}, {
|
|
105
|
-
value: 'team',
|
|
106
|
-
label: 'Team Management',
|
|
107
|
-
description: ''
|
|
108
|
-
}, {
|
|
109
|
-
value: 'security',
|
|
110
|
-
label: 'Security',
|
|
111
|
-
description: ''
|
|
112
|
-
}, {
|
|
113
|
-
value: 'certificates',
|
|
114
|
-
label: 'Certificate Management',
|
|
115
|
-
description: ''
|
|
116
|
-
}, {
|
|
117
|
-
value: 'integrations',
|
|
118
|
-
label: 'Integration Management',
|
|
119
|
-
description: ''
|
|
120
|
-
}, {
|
|
121
|
-
value: 'gateway',
|
|
122
|
-
label: 'Gateway',
|
|
123
|
-
description: ''
|
|
124
|
-
}],
|
|
133
|
+
categories: filterCategories,
|
|
125
134
|
setCategory,
|
|
126
135
|
data: auditLogs,
|
|
127
136
|
paging
|
|
@@ -25,6 +25,8 @@ var _ExternalIssuerIcon = _interopRequireDefault(require("@arcblock/icons/lib/Ex
|
|
|
25
25
|
var _Datatable = _interopRequireWildcard(require("@arcblock/ux/lib/Datatable"));
|
|
26
26
|
var _RelativeTime = _interopRequireDefault(require("@arcblock/ux/lib/RelativeTime"));
|
|
27
27
|
var _constant = require("@abtnode/constant");
|
|
28
|
+
var _useUrlState = _interopRequireDefault(require("@ahooksjs/use-url-state"));
|
|
29
|
+
var _ahooks = require("ahooks");
|
|
28
30
|
var _toast = _interopRequireDefault(require("../../toast"));
|
|
29
31
|
var _node = require("../../contexts/node");
|
|
30
32
|
var _team = require("../../contexts/team");
|
|
@@ -146,6 +148,9 @@ function MemberList(_ref2) {
|
|
|
146
148
|
const [users, setUsers] = (0, _react.useState)([]);
|
|
147
149
|
const [rowCount, setRowCount] = (0, _react.useState)();
|
|
148
150
|
const [userCounts, setUserCounts] = (0, _react.useState)([]);
|
|
151
|
+
const [urlState] = (0, _useUrlState.default)({
|
|
152
|
+
did: undefined
|
|
153
|
+
});
|
|
149
154
|
const durableKey = "members-".concat(teamDid);
|
|
150
155
|
const tableDurableData = (0, _Datatable.getDurableData)(durableKey);
|
|
151
156
|
const [search, setSearch] = (0, _react.useState)({
|
|
@@ -155,6 +160,18 @@ function MemberList(_ref2) {
|
|
|
155
160
|
pageSize: tableDurableData.rowsPerPage || 10,
|
|
156
161
|
page: tableDurableData.page ? tableDurableData.page + 1 : 1
|
|
157
162
|
});
|
|
163
|
+
(0, _ahooks.useMount)(async () => {
|
|
164
|
+
if (urlState.did) {
|
|
165
|
+
const {
|
|
166
|
+
user
|
|
167
|
+
} = await api.getUser({
|
|
168
|
+
did: urlState.did
|
|
169
|
+
});
|
|
170
|
+
if (user) {
|
|
171
|
+
setMemberDialog(user);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
158
175
|
const sideList = (roles || []).map(x => ({
|
|
159
176
|
name: x.name,
|
|
160
177
|
title: x.title,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.6-beta-
|
|
3
|
+
"version": "1.16.6-beta-e2082fec",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,21 +22,22 @@
|
|
|
22
22
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@abtnode/auth": "1.16.6-beta-
|
|
26
|
-
"@abtnode/constant": "1.16.6-beta-
|
|
27
|
-
"@abtnode/util": "1.16.6-beta-
|
|
28
|
-
"@
|
|
29
|
-
"@arcblock/did
|
|
25
|
+
"@abtnode/auth": "1.16.6-beta-e2082fec",
|
|
26
|
+
"@abtnode/constant": "1.16.6-beta-e2082fec",
|
|
27
|
+
"@abtnode/util": "1.16.6-beta-e2082fec",
|
|
28
|
+
"@ahooksjs/use-url-state": "^3.5.1",
|
|
29
|
+
"@arcblock/did": "^1.18.77",
|
|
30
|
+
"@arcblock/did-connect": "^2.5.36",
|
|
30
31
|
"@arcblock/did-motif": "^1.1.10",
|
|
31
|
-
"@arcblock/icons": "^2.5.
|
|
32
|
-
"@arcblock/react-hooks": "^2.5.
|
|
33
|
-
"@arcblock/terminal": "^2.5.
|
|
34
|
-
"@arcblock/ux": "^2.5.
|
|
35
|
-
"@blocklet/constant": "1.16.6-beta-
|
|
36
|
-
"@blocklet/launcher-layout": "2.0.
|
|
32
|
+
"@arcblock/icons": "^2.5.36",
|
|
33
|
+
"@arcblock/react-hooks": "^2.5.36",
|
|
34
|
+
"@arcblock/terminal": "^2.5.36",
|
|
35
|
+
"@arcblock/ux": "^2.5.36",
|
|
36
|
+
"@blocklet/constant": "1.16.6-beta-e2082fec",
|
|
37
|
+
"@blocklet/launcher-layout": "2.0.36",
|
|
37
38
|
"@blocklet/list": "^0.11.22",
|
|
38
|
-
"@blocklet/meta": "1.16.6-beta-
|
|
39
|
-
"@blocklet/ui-react": "^2.5.
|
|
39
|
+
"@blocklet/meta": "1.16.6-beta-e2082fec",
|
|
40
|
+
"@blocklet/ui-react": "^2.5.36",
|
|
40
41
|
"@emotion/react": "^11.10.4",
|
|
41
42
|
"@emotion/styled": "^11.10.4",
|
|
42
43
|
"@iconify/react": "^4.0.0",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"@mui/lab": "^5.0.0-alpha.102",
|
|
46
47
|
"@mui/material": "^5.10.8",
|
|
47
48
|
"@mui/styles": "^5.10.8",
|
|
48
|
-
"@ocap/client": "1.18.
|
|
49
|
+
"@ocap/client": "1.18.77",
|
|
49
50
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
50
51
|
"ahooks": "^3.7.1",
|
|
51
52
|
"axios": "^0.27.2",
|
|
@@ -91,5 +92,5 @@
|
|
|
91
92
|
"@babel/preset-react": "^7.18.6",
|
|
92
93
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
93
94
|
},
|
|
94
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "851e0ab17f1c6e160aedc47fcdbf7dd54dfa7237"
|
|
95
96
|
}
|