@abtnode/ux 1.16.15-beta-324519fc → 1.16.15-beta-58d50c9a
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/es/blocklet/audit-logs.js +6 -1
- package/es/blocklet/component/index.js +1 -1
- package/es/blocklet/component/start.js +1 -1
- package/es/blocklet/storage/backups.js +20 -6
- package/es/blocklet/storage/item.js +4 -8
- package/es/contexts/blocklet-storage.js +9 -3
- package/es/locales/en.js +7 -1
- package/es/locales/zh.js +7 -1
- package/es/logs/download.js +1 -0
- package/lib/blocklet/audit-logs.js +6 -1
- package/lib/blocklet/component/index.js +1 -1
- package/lib/blocklet/component/start.js +1 -1
- package/lib/blocklet/storage/backups.js +26 -13
- package/lib/blocklet/storage/item.js +4 -8
- package/lib/contexts/blocklet-storage.js +9 -3
- package/lib/locales/en.js +7 -1
- package/lib/locales/zh.js +7 -1
- package/lib/logs/download.js +1 -0
- package/package.json +7 -7
|
@@ -83,7 +83,12 @@ function AuditLog({
|
|
|
83
83
|
}),
|
|
84
84
|
target: "_blank",
|
|
85
85
|
children: [log.actor.fullName, log.actor.role ? `(${log.actor.role})` : '']
|
|
86
|
-
}), ' ', "
|
|
86
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
87
|
+
style: {
|
|
88
|
+
margin: '0 4px'
|
|
89
|
+
},
|
|
90
|
+
children: "-"
|
|
91
|
+
}), " ", log.action]
|
|
87
92
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
88
93
|
className: "log-content",
|
|
89
94
|
maxWidth: "lg",
|
|
@@ -377,7 +377,7 @@ function ComponentItem({
|
|
|
377
377
|
component: blocklet,
|
|
378
378
|
onStart: onStart,
|
|
379
379
|
onStop: onStop,
|
|
380
|
-
disabled: app.status
|
|
380
|
+
disabled: !['starting', 'stopping'].includes(app.status) && isInProgress(app.status)
|
|
381
381
|
}), /*#__PURE__*/_jsx(Actions, {
|
|
382
382
|
"data-cy": "component-actions",
|
|
383
383
|
actions: [hasStartEngine(blocklet.meta) ? {
|
|
@@ -40,7 +40,7 @@ export default function StartComponent({
|
|
|
40
40
|
setLoading(false);
|
|
41
41
|
};
|
|
42
42
|
const componentDisabled = disabled || loading;
|
|
43
|
-
const isStop = ['starting', 'running'].includes(component.status);
|
|
43
|
+
const isStop = ['starting', 'running', 'stopping'].includes(component.status);
|
|
44
44
|
const Icon = isStop ? StopIcon : StartIcon;
|
|
45
45
|
const btn = /*#__PURE__*/_jsx(StyledButton, {
|
|
46
46
|
disabled: componentDisabled,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
import Tag from '@arcblock/ux/lib/Tag';
|
|
2
3
|
import Datatable from '@arcblock/ux/lib/Datatable';
|
|
3
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
4
5
|
import { Box, CircularProgress, Icon, Link, Tooltip, Typography } from '@mui/material';
|
|
5
6
|
import React from 'react';
|
|
6
|
-
import { isEmpty
|
|
7
|
+
import { isEmpty } from 'lodash';
|
|
7
8
|
import dayjs from '@abtnode/util/lib/dayjs';
|
|
8
9
|
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
|
10
|
+
import { BACKUPS } from '@abtnode/constant';
|
|
9
11
|
import { useBlockletStorageContext } from '../../contexts/blocklet-storage';
|
|
12
|
+
import { getDIDSpaceDidFromEndpoint } from '../../util/spaces';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
*
|
|
@@ -39,9 +42,20 @@ function SpacesBackupRecords({
|
|
|
39
42
|
// eslint-disable-next-line no-unused-vars
|
|
40
43
|
const {
|
|
41
44
|
targetUrl,
|
|
42
|
-
targetName
|
|
45
|
+
targetName,
|
|
46
|
+
status,
|
|
47
|
+
createdAt
|
|
43
48
|
} = backups[index];
|
|
44
|
-
const
|
|
49
|
+
const timeoutError = status === BACKUPS.STATUS.PROGRESS && dayjs().diff(createdAt, 'hours') >= BACKUPS.TIMEOUT_HOURS;
|
|
50
|
+
const success = status === BACKUPS.STATUS.SUCCEEDED && !timeoutError;
|
|
51
|
+
const spaceName = targetName || spaceGateways.find(spaceGateway => targetUrl?.includes(getDIDSpaceDidFromEndpoint(spaceGateway?.endpoint)))?.name || 'Unknown DID Space';
|
|
52
|
+
if (!success) {
|
|
53
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
54
|
+
variant: "body1",
|
|
55
|
+
fontSize: "16px",
|
|
56
|
+
children: spaceName
|
|
57
|
+
});
|
|
58
|
+
}
|
|
45
59
|
return /*#__PURE__*/_jsx(Link, {
|
|
46
60
|
fontSize: "16px",
|
|
47
61
|
href: targetUrl,
|
|
@@ -110,10 +124,10 @@ function SpacesBackupRecords({
|
|
|
110
124
|
message,
|
|
111
125
|
createdAt
|
|
112
126
|
} = backups?.[index] ?? {};
|
|
113
|
-
const timeoutError =
|
|
127
|
+
const timeoutError = status === BACKUPS.STATUS.PROGRESS && dayjs().diff(createdAt, 'hours') >= BACKUPS.TIMEOUT_HOURS;
|
|
114
128
|
const timeoutErrorMessage = timeoutError && t('common.timeoutError');
|
|
115
|
-
const pending =
|
|
116
|
-
const success = status ===
|
|
129
|
+
const pending = status === BACKUPS.STATUS.PROGRESS && !timeoutError;
|
|
130
|
+
const success = status === BACKUPS.STATUS.SUCCEEDED && !timeoutError;
|
|
117
131
|
if (pending) {
|
|
118
132
|
return /*#__PURE__*/_jsxs(Typography, {
|
|
119
133
|
display: "inline-flex",
|
|
@@ -64,10 +64,9 @@ import { useBlockletStorageContext } from '../../contexts/blocklet-storage';
|
|
|
64
64
|
* @param {{
|
|
65
65
|
* spaceGateway: import('./connected').SpaceGateway
|
|
66
66
|
* connected: boolean,
|
|
67
|
-
* progress: any,
|
|
68
67
|
* onDelete: (spaceGateway: import('./connected').SpaceGateway) => Promise<void>,
|
|
69
68
|
* onBackupNow: () => Promise<void>,
|
|
70
|
-
* }} { spaceGateway }
|
|
69
|
+
* }} { spaceGateway, connected,, onDelete, onBackupNow }
|
|
71
70
|
*/
|
|
72
71
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
73
72
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -107,14 +106,10 @@ function SpaceItem({
|
|
|
107
106
|
const {
|
|
108
107
|
updateSpaceGateway,
|
|
109
108
|
backupEndpoint,
|
|
110
|
-
backupProgress
|
|
109
|
+
backupProgress,
|
|
110
|
+
refreshBackupEndpoint
|
|
111
111
|
} = useBlockletStorageContext();
|
|
112
|
-
|
|
113
|
-
// TEST:
|
|
114
112
|
const [loading, setLoading] = useState(false);
|
|
115
|
-
// backupProgress.message = '(12/99)备份到备份到备份到备份到备';
|
|
116
|
-
// backupProgress.progress = 99;
|
|
117
|
-
|
|
118
113
|
const [authorizeConnect, setAuthorizeConnect] = useState({
|
|
119
114
|
open: false,
|
|
120
115
|
action: 'one-click-authorization',
|
|
@@ -176,6 +171,7 @@ function SpaceItem({
|
|
|
176
171
|
}]
|
|
177
172
|
}
|
|
178
173
|
});
|
|
174
|
+
refreshBackupEndpoint();
|
|
179
175
|
Toast.success(t('storage.spaces.connect.switchToSpaceSucceeded', {
|
|
180
176
|
name: spaceGateway.name ? `(${spaceGateway.name})` : ''
|
|
181
177
|
}));
|
|
@@ -30,6 +30,7 @@ import useBackups from '../hooks/use-backups';
|
|
|
30
30
|
* backupProgress: any,
|
|
31
31
|
* backups: Backup[],
|
|
32
32
|
* backupsLoading: boolean,
|
|
33
|
+
* refreshBackupEndpoint: () => void,
|
|
33
34
|
* }} BlockletStorageContextType
|
|
34
35
|
*/
|
|
35
36
|
|
|
@@ -65,9 +66,10 @@ function BlockletStorageProvider({
|
|
|
65
66
|
const backupProgress = useBackupProgress({
|
|
66
67
|
appDid: blocklet?.appDid
|
|
67
68
|
});
|
|
69
|
+
const [backupEndpointRefresh, setBackupEndpointRefresh] = useState(false);
|
|
68
70
|
const backupEndpoint = useMemo(() => getSpaceBackupEndpoint(blocklet?.environments),
|
|
69
71
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
[blocklet, spaceGatewaysRefresh]);
|
|
72
|
+
[blocklet, spaceGatewaysRefresh, backupEndpointRefresh]);
|
|
71
73
|
const [backupsLoading, setBackupsLoading] = useState(false);
|
|
72
74
|
const {
|
|
73
75
|
backups
|
|
@@ -140,7 +142,7 @@ function BlockletStorageProvider({
|
|
|
140
142
|
input: {
|
|
141
143
|
did: blocklet.meta.did,
|
|
142
144
|
where: {
|
|
143
|
-
|
|
145
|
+
did: spaceGateway.did
|
|
144
146
|
},
|
|
145
147
|
spaceGateway
|
|
146
148
|
}
|
|
@@ -170,6 +172,9 @@ function BlockletStorageProvider({
|
|
|
170
172
|
* @param {SpaceGateway} spaceGateway
|
|
171
173
|
*/
|
|
172
174
|
const spaceGatewayIsSelected = spaceGateway => spaceGateway?.endpoint === backupEndpoint;
|
|
175
|
+
const refreshBackupEndpoint = () => {
|
|
176
|
+
setBackupEndpointRefresh(p => !p);
|
|
177
|
+
};
|
|
173
178
|
return /*#__PURE__*/_jsx(Provider, {
|
|
174
179
|
value: {
|
|
175
180
|
spaceGateways,
|
|
@@ -183,7 +188,8 @@ function BlockletStorageProvider({
|
|
|
183
188
|
backupEndpoint,
|
|
184
189
|
backupProgress,
|
|
185
190
|
backups,
|
|
186
|
-
backupsLoading
|
|
191
|
+
backupsLoading,
|
|
192
|
+
refreshBackupEndpoint
|
|
187
193
|
},
|
|
188
194
|
children: children
|
|
189
195
|
});
|
package/es/locales/en.js
CHANGED
|
@@ -230,6 +230,7 @@ module.exports = {
|
|
|
230
230
|
protocol: 'Protocol',
|
|
231
231
|
published: 'published',
|
|
232
232
|
purchase: 'Purchase',
|
|
233
|
+
readMore: 'Read More',
|
|
233
234
|
redirect: 'Redirect',
|
|
234
235
|
redirectCode: 'Redirect Code',
|
|
235
236
|
redirectPermanently: 'Permanent Redirect',
|
|
@@ -598,7 +599,12 @@ module.exports = {
|
|
|
598
599
|
routingEngine: 'Routing Engine',
|
|
599
600
|
ownerNftURL: 'Owner NFT',
|
|
600
601
|
expirationLeft: 'Expiration Left',
|
|
601
|
-
startFromCrashTip: 'Blocklet Server did not exit normally last time, please manually start the blocklets that needs to be run.'
|
|
602
|
+
startFromCrashTip: 'Blocklet Server did not exit normally last time, please manually start the blocklets that needs to be run.',
|
|
603
|
+
runtimeConfig: {
|
|
604
|
+
blockletMaxMemoryLimit: 'Blocklet Max Memory Limit',
|
|
605
|
+
daemonMaxMemoryLimit: 'Server Max Memory Limit',
|
|
606
|
+
proxyMaxMemoryLimit: 'Event Bus Max Memory Limit'
|
|
607
|
+
}
|
|
602
608
|
},
|
|
603
609
|
store: {
|
|
604
610
|
nameSort: 'Name',
|
package/es/locales/zh.js
CHANGED
|
@@ -235,6 +235,7 @@ module.exports = {
|
|
|
235
235
|
protocol: '协议',
|
|
236
236
|
published: '发布于',
|
|
237
237
|
purchase: '购买',
|
|
238
|
+
readMore: '查看更多',
|
|
238
239
|
redirect: '重定向',
|
|
239
240
|
redirectCode: '重定向状态码',
|
|
240
241
|
redirectPermanently: '永久重定向',
|
|
@@ -605,7 +606,12 @@ module.exports = {
|
|
|
605
606
|
routingEngine: '路由引擎',
|
|
606
607
|
ownerNftURL: '所有者 NFT',
|
|
607
608
|
expirationLeft: '有效期还剩',
|
|
608
|
-
startFromCrashTip: '应用Server 上次未正常退出,请手动启动需要运行的 blocklet.'
|
|
609
|
+
startFromCrashTip: '应用Server 上次未正常退出,请手动启动需要运行的 blocklet.',
|
|
610
|
+
runtimeConfig: {
|
|
611
|
+
blockletMaxMemoryLimit: 'Blocklet 最大内存限制',
|
|
612
|
+
daemonMaxMemoryLimit: 'Server 最大内存限制',
|
|
613
|
+
proxyMaxMemoryLimit: '消息总线最大内存限制'
|
|
614
|
+
}
|
|
609
615
|
},
|
|
610
616
|
store: {
|
|
611
617
|
nameSort: '名称',
|
package/es/logs/download.js
CHANGED
|
@@ -94,7 +94,12 @@ function AuditLog(_ref2) {
|
|
|
94
94
|
}),
|
|
95
95
|
target: "_blank",
|
|
96
96
|
children: [log.actor.fullName, log.actor.role ? "(".concat(log.actor.role, ")") : '']
|
|
97
|
-
}), ' ',
|
|
97
|
+
}), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
98
|
+
style: {
|
|
99
|
+
margin: '0 4px'
|
|
100
|
+
},
|
|
101
|
+
children: "-"
|
|
102
|
+
}), " ", log.action]
|
|
98
103
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
99
104
|
className: "log-content",
|
|
100
105
|
maxWidth: "lg",
|
|
@@ -403,7 +403,7 @@ function ComponentItem(_ref) {
|
|
|
403
403
|
component: blocklet,
|
|
404
404
|
onStart: onStart,
|
|
405
405
|
onStop: onStop,
|
|
406
|
-
disabled: app.status
|
|
406
|
+
disabled: !['starting', 'stopping'].includes(app.status) && (0, _util.isInProgress)(app.status)
|
|
407
407
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_actions.default, {
|
|
408
408
|
"data-cy": "component-actions",
|
|
409
409
|
actions: [(0, _util.hasStartEngine)(blocklet.meta) ? {
|
|
@@ -50,7 +50,7 @@ function StartComponent(_ref) {
|
|
|
50
50
|
setLoading(false);
|
|
51
51
|
};
|
|
52
52
|
const componentDisabled = disabled || loading;
|
|
53
|
-
const isStop = ['starting', 'running'].includes(component.status);
|
|
53
|
+
const isStop = ['starting', 'running', 'stopping'].includes(component.status);
|
|
54
54
|
const Icon = isStop ? _Stop.default : _PlayArrow.default;
|
|
55
55
|
const btn = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledButton, {
|
|
56
56
|
disabled: componentDisabled,
|
|
@@ -12,7 +12,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
13
|
var _dayjs = _interopRequireDefault(require("@abtnode/util/lib/dayjs"));
|
|
14
14
|
var _HelpOutline = _interopRequireDefault(require("@mui/icons-material/HelpOutline"));
|
|
15
|
+
var _constant = require("@abtnode/constant");
|
|
15
16
|
var _blockletStorage = require("../../contexts/blocklet-storage");
|
|
17
|
+
var _spaces = require("../../util/spaces");
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
20
|
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; }
|
|
@@ -20,14 +22,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
22
|
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
23
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
24
|
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); }
|
|
23
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } /**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } /* eslint-disable no-console */ /**
|
|
26
|
+
*
|
|
27
|
+
* @description
|
|
28
|
+
* @param {{
|
|
29
|
+
* progress: any,
|
|
30
|
+
* } & import('@mui/material').BoxProps} { progress, ...rest }
|
|
31
|
+
* @return {React.Component}
|
|
32
|
+
*/
|
|
31
33
|
function SpacesBackupRecords(_ref) {
|
|
32
34
|
let rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
33
35
|
const {
|
|
@@ -48,9 +50,20 @@ function SpacesBackupRecords(_ref) {
|
|
|
48
50
|
// eslint-disable-next-line no-unused-vars
|
|
49
51
|
const {
|
|
50
52
|
targetUrl,
|
|
51
|
-
targetName
|
|
53
|
+
targetName,
|
|
54
|
+
status,
|
|
55
|
+
createdAt
|
|
52
56
|
} = backups[index];
|
|
53
|
-
const
|
|
57
|
+
const timeoutError = status === _constant.BACKUPS.STATUS.PROGRESS && (0, _dayjs.default)().diff(createdAt, 'hours') >= _constant.BACKUPS.TIMEOUT_HOURS;
|
|
58
|
+
const success = status === _constant.BACKUPS.STATUS.SUCCEEDED && !timeoutError;
|
|
59
|
+
const spaceName = targetName || ((_spaceGateways$find = spaceGateways.find(spaceGateway => targetUrl === null || targetUrl === void 0 ? void 0 : targetUrl.includes((0, _spaces.getDIDSpaceDidFromEndpoint)(spaceGateway === null || spaceGateway === void 0 ? void 0 : spaceGateway.endpoint)))) === null || _spaceGateways$find === void 0 ? void 0 : _spaceGateways$find.name) || 'Unknown DID Space';
|
|
60
|
+
if (!success) {
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
62
|
+
variant: "body1",
|
|
63
|
+
fontSize: "16px",
|
|
64
|
+
children: spaceName
|
|
65
|
+
});
|
|
66
|
+
}
|
|
54
67
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Link, {
|
|
55
68
|
fontSize: "16px",
|
|
56
69
|
href: targetUrl,
|
|
@@ -120,10 +133,10 @@ function SpacesBackupRecords(_ref) {
|
|
|
120
133
|
message,
|
|
121
134
|
createdAt
|
|
122
135
|
} = (_backups$index = backups === null || backups === void 0 ? void 0 : backups[index]) !== null && _backups$index !== void 0 ? _backups$index : {};
|
|
123
|
-
const timeoutError =
|
|
136
|
+
const timeoutError = status === _constant.BACKUPS.STATUS.PROGRESS && (0, _dayjs.default)().diff(createdAt, 'hours') >= _constant.BACKUPS.TIMEOUT_HOURS;
|
|
124
137
|
const timeoutErrorMessage = timeoutError && t('common.timeoutError');
|
|
125
|
-
const pending =
|
|
126
|
-
const success = status ===
|
|
138
|
+
const pending = status === _constant.BACKUPS.STATUS.PROGRESS && !timeoutError;
|
|
139
|
+
const success = status === _constant.BACKUPS.STATUS.SUCCEEDED && !timeoutError;
|
|
127
140
|
if (pending) {
|
|
128
141
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
129
142
|
display: "inline-flex",
|
|
@@ -81,10 +81,9 @@ SpaceDisconnected.defaultProps = {
|
|
|
81
81
|
* @param {{
|
|
82
82
|
* spaceGateway: import('./connected').SpaceGateway
|
|
83
83
|
* connected: boolean,
|
|
84
|
-
* progress: any,
|
|
85
84
|
* onDelete: (spaceGateway: import('./connected').SpaceGateway) => Promise<void>,
|
|
86
85
|
* onBackupNow: () => Promise<void>,
|
|
87
|
-
* }} { spaceGateway }
|
|
86
|
+
* }} { spaceGateway, connected,, onDelete, onBackupNow }
|
|
88
87
|
*/
|
|
89
88
|
function SpaceItem(_ref) {
|
|
90
89
|
let {
|
|
@@ -122,14 +121,10 @@ function SpaceItem(_ref) {
|
|
|
122
121
|
const {
|
|
123
122
|
updateSpaceGateway,
|
|
124
123
|
backupEndpoint,
|
|
125
|
-
backupProgress
|
|
124
|
+
backupProgress,
|
|
125
|
+
refreshBackupEndpoint
|
|
126
126
|
} = (0, _blockletStorage.useBlockletStorageContext)();
|
|
127
|
-
|
|
128
|
-
// TEST:
|
|
129
127
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
130
|
-
// backupProgress.message = '(12/99)备份到备份到备份到备份到备';
|
|
131
|
-
// backupProgress.progress = 99;
|
|
132
|
-
|
|
133
128
|
const [authorizeConnect, setAuthorizeConnect] = (0, _react.useState)({
|
|
134
129
|
open: false,
|
|
135
130
|
action: 'one-click-authorization',
|
|
@@ -190,6 +185,7 @@ function SpaceItem(_ref) {
|
|
|
190
185
|
}]
|
|
191
186
|
}
|
|
192
187
|
});
|
|
188
|
+
refreshBackupEndpoint();
|
|
193
189
|
_Toast.default.success(t('storage.spaces.connect.switchToSpaceSucceeded', {
|
|
194
190
|
name: spaceGateway.name ? "(".concat(spaceGateway.name, ")") : ''
|
|
195
191
|
}));
|
|
@@ -41,6 +41,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
41
41
|
* backupProgress: any,
|
|
42
42
|
* backups: Backup[],
|
|
43
43
|
* backupsLoading: boolean,
|
|
44
|
+
* refreshBackupEndpoint: () => void,
|
|
44
45
|
* }} BlockletStorageContextType
|
|
45
46
|
*/ /** @type {import('react').Context<BlockletStorageContextType>} */
|
|
46
47
|
const BlockletStorageContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
@@ -76,9 +77,10 @@ function BlockletStorageProvider(_ref) {
|
|
|
76
77
|
const backupProgress = (0, _useBackupProgress.default)({
|
|
77
78
|
appDid: blocklet === null || blocklet === void 0 ? void 0 : blocklet.appDid
|
|
78
79
|
});
|
|
80
|
+
const [backupEndpointRefresh, setBackupEndpointRefresh] = (0, _react.useState)(false);
|
|
79
81
|
const backupEndpoint = (0, _react.useMemo)(() => (0, _spaces.getSpaceBackupEndpoint)(blocklet === null || blocklet === void 0 ? void 0 : blocklet.environments),
|
|
80
82
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
-
[blocklet, spaceGatewaysRefresh]);
|
|
83
|
+
[blocklet, spaceGatewaysRefresh, backupEndpointRefresh]);
|
|
82
84
|
const [backupsLoading, setBackupsLoading] = (0, _react.useState)(false);
|
|
83
85
|
const {
|
|
84
86
|
backups
|
|
@@ -151,7 +153,7 @@ function BlockletStorageProvider(_ref) {
|
|
|
151
153
|
input: {
|
|
152
154
|
did: blocklet.meta.did,
|
|
153
155
|
where: {
|
|
154
|
-
|
|
156
|
+
did: spaceGateway.did
|
|
155
157
|
},
|
|
156
158
|
spaceGateway
|
|
157
159
|
}
|
|
@@ -181,6 +183,9 @@ function BlockletStorageProvider(_ref) {
|
|
|
181
183
|
* @param {SpaceGateway} spaceGateway
|
|
182
184
|
*/
|
|
183
185
|
const spaceGatewayIsSelected = spaceGateway => (spaceGateway === null || spaceGateway === void 0 ? void 0 : spaceGateway.endpoint) === backupEndpoint;
|
|
186
|
+
const refreshBackupEndpoint = () => {
|
|
187
|
+
setBackupEndpointRefresh(p => !p);
|
|
188
|
+
};
|
|
184
189
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Provider, {
|
|
185
190
|
value: {
|
|
186
191
|
spaceGateways,
|
|
@@ -194,7 +199,8 @@ function BlockletStorageProvider(_ref) {
|
|
|
194
199
|
backupEndpoint,
|
|
195
200
|
backupProgress,
|
|
196
201
|
backups,
|
|
197
|
-
backupsLoading
|
|
202
|
+
backupsLoading,
|
|
203
|
+
refreshBackupEndpoint
|
|
198
204
|
},
|
|
199
205
|
children: children
|
|
200
206
|
});
|
package/lib/locales/en.js
CHANGED
|
@@ -232,6 +232,7 @@ module.exports = {
|
|
|
232
232
|
protocol: 'Protocol',
|
|
233
233
|
published: 'published',
|
|
234
234
|
purchase: 'Purchase',
|
|
235
|
+
readMore: 'Read More',
|
|
235
236
|
redirect: 'Redirect',
|
|
236
237
|
redirectCode: 'Redirect Code',
|
|
237
238
|
redirectPermanently: 'Permanent Redirect',
|
|
@@ -600,7 +601,12 @@ module.exports = {
|
|
|
600
601
|
routingEngine: 'Routing Engine',
|
|
601
602
|
ownerNftURL: 'Owner NFT',
|
|
602
603
|
expirationLeft: 'Expiration Left',
|
|
603
|
-
startFromCrashTip: 'Blocklet Server did not exit normally last time, please manually start the blocklets that needs to be run.'
|
|
604
|
+
startFromCrashTip: 'Blocklet Server did not exit normally last time, please manually start the blocklets that needs to be run.',
|
|
605
|
+
runtimeConfig: {
|
|
606
|
+
blockletMaxMemoryLimit: 'Blocklet Max Memory Limit',
|
|
607
|
+
daemonMaxMemoryLimit: 'Server Max Memory Limit',
|
|
608
|
+
proxyMaxMemoryLimit: 'Event Bus Max Memory Limit'
|
|
609
|
+
}
|
|
604
610
|
},
|
|
605
611
|
store: {
|
|
606
612
|
nameSort: 'Name',
|
package/lib/locales/zh.js
CHANGED
|
@@ -237,6 +237,7 @@ module.exports = {
|
|
|
237
237
|
protocol: '协议',
|
|
238
238
|
published: '发布于',
|
|
239
239
|
purchase: '购买',
|
|
240
|
+
readMore: '查看更多',
|
|
240
241
|
redirect: '重定向',
|
|
241
242
|
redirectCode: '重定向状态码',
|
|
242
243
|
redirectPermanently: '永久重定向',
|
|
@@ -607,7 +608,12 @@ module.exports = {
|
|
|
607
608
|
routingEngine: '路由引擎',
|
|
608
609
|
ownerNftURL: '所有者 NFT',
|
|
609
610
|
expirationLeft: '有效期还剩',
|
|
610
|
-
startFromCrashTip: '应用Server 上次未正常退出,请手动启动需要运行的 blocklet.'
|
|
611
|
+
startFromCrashTip: '应用Server 上次未正常退出,请手动启动需要运行的 blocklet.',
|
|
612
|
+
runtimeConfig: {
|
|
613
|
+
blockletMaxMemoryLimit: 'Blocklet 最大内存限制',
|
|
614
|
+
daemonMaxMemoryLimit: 'Server 最大内存限制',
|
|
615
|
+
proxyMaxMemoryLimit: '消息总线最大内存限制'
|
|
616
|
+
}
|
|
611
617
|
},
|
|
612
618
|
store: {
|
|
613
619
|
nameSort: '名称',
|
package/lib/logs/download.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.15-beta-
|
|
3
|
+
"version": "1.16.15-beta-58d50c9a",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.15-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.15-beta-
|
|
32
|
-
"@abtnode/util": "1.16.15-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.15-beta-58d50c9a",
|
|
31
|
+
"@abtnode/constant": "1.16.15-beta-58d50c9a",
|
|
32
|
+
"@abtnode/util": "1.16.15-beta-58d50c9a",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.89",
|
|
35
35
|
"@arcblock/did-connect": "^2.7.9",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@arcblock/react-hooks": "^2.7.9",
|
|
40
40
|
"@arcblock/terminal": "^2.7.9",
|
|
41
41
|
"@arcblock/ux": "^2.7.9",
|
|
42
|
-
"@blocklet/constant": "1.16.15-beta-
|
|
42
|
+
"@blocklet/constant": "1.16.15-beta-58d50c9a",
|
|
43
43
|
"@blocklet/launcher-layout": "2.1.101",
|
|
44
44
|
"@blocklet/list": "^0.12.31",
|
|
45
|
-
"@blocklet/meta": "1.16.15-beta-
|
|
45
|
+
"@blocklet/meta": "1.16.15-beta-58d50c9a",
|
|
46
46
|
"@blocklet/ui-react": "^2.7.9",
|
|
47
47
|
"@emotion/react": "^11.10.4",
|
|
48
48
|
"@emotion/styled": "^11.10.4",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
99
99
|
"glob": "^10.3.3"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "c54236c1daace6451db561fa6b3eea21ba07bb4d",
|
|
102
102
|
"exports": {
|
|
103
103
|
".": {
|
|
104
104
|
"import": "./es/index.js",
|