@abtnode/ux 1.16.20-beta-28c66e0b → 1.16.20-beta-9c254d14
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/add-cert.js +24 -10
- package/es/blocklet/component/domain-list.js +5 -0
- package/es/blocklet/publish/create-project.js +5 -2
- package/es/blocklet/publish/create-release.js +15 -1
- package/es/blocklet/publish/resource.js +25 -7
- package/es/blocklet/router/add-domain.js +14 -7
- package/lib/blocklet/add-cert.js +26 -12
- package/lib/blocklet/component/domain-list.js +70 -62
- package/lib/blocklet/publish/create-project.js +5 -2
- package/lib/blocklet/publish/create-release.js +16 -2
- package/lib/blocklet/publish/resource.js +22 -8
- package/lib/blocklet/router/add-domain.js +16 -9
- package/package.json +9 -9
package/es/blocklet/add-cert.js
CHANGED
|
@@ -5,9 +5,9 @@ import useAsyncRetry from 'react-use/lib/useAsyncRetry';
|
|
|
5
5
|
import Tooltip from '@mui/material/Tooltip';
|
|
6
6
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
7
7
|
import Alert from '@arcblock/ux/lib/Alert';
|
|
8
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
8
9
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
10
|
import { BlockletEvents } from '@blocklet/constant';
|
|
10
|
-
import Toast from '@arcblock/ux/lib/Toast';
|
|
11
11
|
import Confirm from '../confirm';
|
|
12
12
|
import { useNodeContext } from '../contexts/node';
|
|
13
13
|
import { useBlockletContext } from '../contexts/blocklet';
|
|
@@ -21,21 +21,26 @@ function Add(props) {
|
|
|
21
21
|
t
|
|
22
22
|
} = useLocaleContext();
|
|
23
23
|
const [loading, setLoading] = useState(false);
|
|
24
|
+
const {
|
|
25
|
+
inService
|
|
26
|
+
} = useNodeContext();
|
|
24
27
|
const [confirmSetting, setConfirmSetting] = useState(null);
|
|
25
28
|
const {
|
|
29
|
+
siteId,
|
|
26
30
|
domain,
|
|
27
31
|
onAdd,
|
|
28
32
|
children,
|
|
29
33
|
did
|
|
30
34
|
} = props;
|
|
35
|
+
const [issuing, setIssuing] = useState(false);
|
|
31
36
|
const {
|
|
32
37
|
api,
|
|
33
38
|
ws: {
|
|
34
39
|
useSubscription
|
|
35
40
|
}
|
|
36
41
|
} = useNodeContext();
|
|
37
|
-
const [issuing, setIssuing] = useState(false);
|
|
38
42
|
const {
|
|
43
|
+
mode,
|
|
39
44
|
actions: {
|
|
40
45
|
refreshDomainStatus
|
|
41
46
|
}
|
|
@@ -54,18 +59,24 @@ function Add(props) {
|
|
|
54
59
|
const handleIssueComplete = (cert, type) => {
|
|
55
60
|
if (cert.domain === domain) {
|
|
56
61
|
setIssuing(false);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
setLoading(false);
|
|
63
|
+
|
|
64
|
+
// Setup 模式下有全局通知,所以这里不需要通知
|
|
65
|
+
if (inService && mode !== 'setup') {
|
|
66
|
+
if (type === 'success') {
|
|
67
|
+
Toast.success(`The ${cert.domain} certificate is issued successfully`);
|
|
68
|
+
} else if (type === 'error') {
|
|
69
|
+
Toast.error(`Failed to issue certificate for ${cert.domain}`);
|
|
70
|
+
}
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
};
|
|
64
74
|
useEffect(() => {
|
|
65
|
-
if (
|
|
66
|
-
|
|
75
|
+
if (certState.loading) {
|
|
76
|
+
return;
|
|
67
77
|
}
|
|
68
|
-
|
|
78
|
+
setIssuing(isCertInProgress(certState.value?.status));
|
|
79
|
+
}, [certState.loading, certState.value?.status]);
|
|
69
80
|
useSubscription(BlockletEvents.certError, cert => handleIssueComplete(cert, 'error'));
|
|
70
81
|
useSubscription(BlockletEvents.certIssued, cert => {
|
|
71
82
|
certState.retry();
|
|
@@ -89,8 +100,10 @@ function Add(props) {
|
|
|
89
100
|
try {
|
|
90
101
|
await api.issueLetsEncryptCert({
|
|
91
102
|
input: {
|
|
103
|
+
siteId,
|
|
92
104
|
domain,
|
|
93
|
-
did
|
|
105
|
+
did,
|
|
106
|
+
inBlockletSetup: mode === 'setup'
|
|
94
107
|
}
|
|
95
108
|
});
|
|
96
109
|
onAdd();
|
|
@@ -142,6 +155,7 @@ function Add(props) {
|
|
|
142
155
|
Add.propTypes = {
|
|
143
156
|
domain: PropTypes.string.isRequired,
|
|
144
157
|
did: PropTypes.string.isRequired,
|
|
158
|
+
siteId: PropTypes.string.isRequired,
|
|
145
159
|
onAdd: PropTypes.func,
|
|
146
160
|
children: PropTypes.any
|
|
147
161
|
};
|
|
@@ -177,6 +177,7 @@ function DomainList({
|
|
|
177
177
|
domain: domain,
|
|
178
178
|
filters: ['domain']
|
|
179
179
|
}, `${domain.value}-domain`), /*#__PURE__*/_jsx(InnerAddDomain, {
|
|
180
|
+
siteId: blocklet.site?.id,
|
|
180
181
|
domain: domain,
|
|
181
182
|
blocklet: blocklet,
|
|
182
183
|
hasMutatePermission: hasMutatePermission
|
|
@@ -217,6 +218,7 @@ function DomainList({
|
|
|
217
218
|
children: domain.value
|
|
218
219
|
})
|
|
219
220
|
}), /*#__PURE__*/_jsx(InnerAddDomain, {
|
|
221
|
+
siteId: blocklet.site?.id,
|
|
220
222
|
domain: domain,
|
|
221
223
|
blocklet: blocklet,
|
|
222
224
|
hasMutatePermission: hasMutatePermission
|
|
@@ -374,6 +376,7 @@ InnerAction.propTypes = {
|
|
|
374
376
|
blocklet: PropTypes.object.isRequired
|
|
375
377
|
};
|
|
376
378
|
function InnerAddDomain({
|
|
379
|
+
siteId,
|
|
377
380
|
domain,
|
|
378
381
|
blocklet,
|
|
379
382
|
hasMutatePermission
|
|
@@ -486,6 +489,7 @@ function InnerAddDomain({
|
|
|
486
489
|
domain: domain,
|
|
487
490
|
filters: ['http']
|
|
488
491
|
}, `${domain.value}-http`), hasMutatePermission && /*#__PURE__*/_jsx(AddCert, {
|
|
492
|
+
siteId: siteId,
|
|
489
493
|
domain: domain.value,
|
|
490
494
|
domainStatus: domain.domainStatus,
|
|
491
495
|
did: blocklet.meta.did,
|
|
@@ -503,6 +507,7 @@ function InnerAddDomain({
|
|
|
503
507
|
});
|
|
504
508
|
}
|
|
505
509
|
InnerAddDomain.propTypes = {
|
|
510
|
+
siteId: PropTypes.string.isRequired,
|
|
506
511
|
domain: DomainType.isRequired,
|
|
507
512
|
blocklet: PropTypes.object.isRequired,
|
|
508
513
|
hasMutatePermission: PropTypes.bool.isRequired
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Link, useNavigate, useParams } from 'react-router-dom';
|
|
3
|
+
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
|
3
4
|
import MenuItem from '@mui/material/MenuItem';
|
|
4
5
|
import TextField from '@mui/material/TextField';
|
|
5
6
|
import Typography from '@mui/material/Typography';
|
|
@@ -52,6 +53,7 @@ export default function CreateProject({
|
|
|
52
53
|
} = useNodeContext();
|
|
53
54
|
const [blockletDid, setBlockletDid] = useState();
|
|
54
55
|
const [openConnect, setOpenConnect] = useState(false);
|
|
56
|
+
const [manualCreateBlockletDid] = useLocalStorage('manual-create-blocklet-did', false);
|
|
55
57
|
const {
|
|
56
58
|
componentDid = ''
|
|
57
59
|
} = useParams();
|
|
@@ -122,10 +124,11 @@ export default function CreateProject({
|
|
|
122
124
|
readonly: true,
|
|
123
125
|
autoComplete: "off",
|
|
124
126
|
variant: "outlined",
|
|
125
|
-
|
|
127
|
+
onChange: e => manualCreateBlockletDid && setBlockletDid(e.target.value),
|
|
128
|
+
onClick: () => !manualCreateBlockletDid && !blockletDid && setOpenConnect(true),
|
|
126
129
|
InputProps: {
|
|
127
130
|
'data-cy': 'export-blocklet-did',
|
|
128
|
-
endAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
|
131
|
+
endAdornment: !manualCreateBlockletDid && /*#__PURE__*/_jsx(InputAdornment, {
|
|
129
132
|
position: "end",
|
|
130
133
|
children: /*#__PURE__*/_jsx(Button, {
|
|
131
134
|
onClick: () => setOpenConnect(true),
|
|
@@ -249,7 +249,13 @@ export default function CreateRelease({
|
|
|
249
249
|
}).catch(err => {
|
|
250
250
|
setCreateLoading(false);
|
|
251
251
|
setLoading(false);
|
|
252
|
-
|
|
252
|
+
const msg = formatError(err);
|
|
253
|
+
Toast.error(msg);
|
|
254
|
+
if (/resource.*empty/.test(msg)) {
|
|
255
|
+
setParamsErrTip({
|
|
256
|
+
blockletResource: msg
|
|
257
|
+
});
|
|
258
|
+
}
|
|
253
259
|
});
|
|
254
260
|
};
|
|
255
261
|
if (!params && loading) {
|
|
@@ -265,12 +271,20 @@ export default function CreateRelease({
|
|
|
265
271
|
const item = resourceComponents.find(x => x.meta.did === tab);
|
|
266
272
|
const resourceContent = item ? /*#__PURE__*/_jsx(Box, {
|
|
267
273
|
children: /*#__PURE__*/_jsx(Resource, {
|
|
274
|
+
error: paramsErrTip.blockletResource,
|
|
268
275
|
app: blocklet,
|
|
269
276
|
component: item,
|
|
270
277
|
projectId: projectId,
|
|
271
278
|
release: {
|
|
272
279
|
...release,
|
|
273
280
|
id: releaseId
|
|
281
|
+
},
|
|
282
|
+
onSave: selected => {
|
|
283
|
+
if (selected.length) {
|
|
284
|
+
setParamsErrTip({
|
|
285
|
+
blockletResource: ''
|
|
286
|
+
});
|
|
287
|
+
}
|
|
274
288
|
}
|
|
275
289
|
})
|
|
276
290
|
}) : /*#__PURE__*/_jsx(Box, {
|
|
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import joinUrl from 'url-join';
|
|
5
|
+
import classnames from 'classnames';
|
|
5
6
|
import Box from '@mui/material/Box';
|
|
6
7
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
7
8
|
import Button from '@arcblock/ux/lib/Button';
|
|
@@ -27,7 +28,9 @@ export default function Resource({
|
|
|
27
28
|
app,
|
|
28
29
|
component,
|
|
29
30
|
projectId,
|
|
30
|
-
release
|
|
31
|
+
release,
|
|
32
|
+
error,
|
|
33
|
+
onSave
|
|
31
34
|
}) {
|
|
32
35
|
const {
|
|
33
36
|
t,
|
|
@@ -64,7 +67,7 @@ export default function Resource({
|
|
|
64
67
|
Toast.error(err.message);
|
|
65
68
|
}
|
|
66
69
|
};
|
|
67
|
-
const
|
|
70
|
+
const _onSave = async () => {
|
|
68
71
|
const params = selectedResourceIds;
|
|
69
72
|
try {
|
|
70
73
|
setLoading(true);
|
|
@@ -77,6 +80,7 @@ export default function Resource({
|
|
|
77
80
|
Toast.success(t('common.saveSuccess'));
|
|
78
81
|
setLoading(false);
|
|
79
82
|
saveSelected(selectedResourceIds);
|
|
83
|
+
onSave(selectedResourceIds);
|
|
80
84
|
} catch (err) {
|
|
81
85
|
setLoading(false);
|
|
82
86
|
Toast.error(err.message);
|
|
@@ -114,7 +118,8 @@ export default function Resource({
|
|
|
114
118
|
})
|
|
115
119
|
});
|
|
116
120
|
}
|
|
117
|
-
return /*#__PURE__*/_jsx(Container, {
|
|
121
|
+
return [/*#__PURE__*/_jsx(Container, {
|
|
122
|
+
className: classnames(error && 'error'),
|
|
118
123
|
children: /*#__PURE__*/_jsxs(Box, {
|
|
119
124
|
children: [/*#__PURE__*/_jsx(Tree, {
|
|
120
125
|
data: resources,
|
|
@@ -128,29 +133,41 @@ export default function Resource({
|
|
|
128
133
|
children: /*#__PURE__*/_jsx(Button, {
|
|
129
134
|
variant: "contained",
|
|
130
135
|
disabled: loading,
|
|
131
|
-
onClick: () =>
|
|
136
|
+
onClick: () => _onSave(),
|
|
132
137
|
children: t('common.save')
|
|
133
138
|
})
|
|
134
139
|
})]
|
|
135
140
|
})
|
|
136
|
-
})
|
|
141
|
+
}), !!error && /*#__PURE__*/_jsx(Box, {
|
|
142
|
+
color: "error.main",
|
|
143
|
+
mt: 1,
|
|
144
|
+
fontSize: 14,
|
|
145
|
+
children: error
|
|
146
|
+
})];
|
|
137
147
|
}
|
|
138
148
|
Resource.propTypes = {
|
|
139
149
|
component: PropTypes.object.isRequired,
|
|
140
150
|
app: PropTypes.object.isRequired,
|
|
141
151
|
projectId: PropTypes.string.isRequired,
|
|
152
|
+
error: PropTypes.string,
|
|
142
153
|
release: PropTypes.shape({
|
|
143
154
|
id: PropTypes.string.isRequired,
|
|
144
155
|
status: PropTypes.string
|
|
145
|
-
})
|
|
156
|
+
}),
|
|
157
|
+
onSave: PropTypes.func
|
|
146
158
|
};
|
|
147
159
|
Resource.defaultProps = {
|
|
160
|
+
error: '',
|
|
148
161
|
release: {
|
|
149
162
|
id: ''
|
|
150
|
-
}
|
|
163
|
+
},
|
|
164
|
+
onSave: () => {}
|
|
151
165
|
};
|
|
152
166
|
const Container = styled(Box)`
|
|
153
167
|
border: 1px solid #ccc;
|
|
168
|
+
&.error {
|
|
169
|
+
border-color: ${props => props.theme.palette.error.main};
|
|
170
|
+
}
|
|
154
171
|
border-radius: 4px;
|
|
155
172
|
padding: 16px;
|
|
156
173
|
padding-bottom: 0px;
|
|
@@ -164,5 +181,6 @@ const Container = styled(Box)`
|
|
|
164
181
|
position: sticky;
|
|
165
182
|
bottom: 0;
|
|
166
183
|
background: #fff;
|
|
184
|
+
z-index: 10;
|
|
167
185
|
}
|
|
168
186
|
`;
|
|
@@ -30,6 +30,7 @@ export default function AddDomain({
|
|
|
30
30
|
onSuccess,
|
|
31
31
|
disabled,
|
|
32
32
|
autoFocus,
|
|
33
|
+
inBlockletSetup,
|
|
33
34
|
...props
|
|
34
35
|
}) {
|
|
35
36
|
const {
|
|
@@ -56,14 +57,16 @@ export default function AddDomain({
|
|
|
56
57
|
chainHost
|
|
57
58
|
}) => {
|
|
58
59
|
try {
|
|
60
|
+
const tmpDomain = parseDomainFromURL(domain);
|
|
59
61
|
await api.addDomainAlias({
|
|
60
62
|
input: {
|
|
61
63
|
id: siteId,
|
|
62
64
|
type: 'nft-domain',
|
|
63
|
-
domainAlias:
|
|
65
|
+
domainAlias: tmpDomain,
|
|
64
66
|
nftDid,
|
|
65
67
|
chainHost,
|
|
66
|
-
teamDid
|
|
68
|
+
teamDid,
|
|
69
|
+
inBlockletSetup
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
await sleep(2000);
|
|
@@ -72,8 +75,10 @@ export default function AddDomain({
|
|
|
72
75
|
showNFTDomainAuth: false
|
|
73
76
|
});
|
|
74
77
|
onSuccess({
|
|
75
|
-
domain,
|
|
76
|
-
type: state.type
|
|
78
|
+
domain: tmpDomain,
|
|
79
|
+
type: state.type,
|
|
80
|
+
nftDid,
|
|
81
|
+
chainHost
|
|
77
82
|
});
|
|
78
83
|
} finally {
|
|
79
84
|
setState({
|
|
@@ -215,7 +220,7 @@ export default function AddDomain({
|
|
|
215
220
|
gap: '1em'
|
|
216
221
|
},
|
|
217
222
|
children: inputDomainTypes.map((type, index) => /*#__PURE__*/_jsxs(Box, {
|
|
218
|
-
children: [/*#__PURE__*/_jsx(Box, {
|
|
223
|
+
children: [inputDomainTypes.length > 1 && /*#__PURE__*/_jsx(Box, {
|
|
219
224
|
children: `${t(`optionsOrder.${index + 1}`)}: ${domainTypes[type]?.name}`
|
|
220
225
|
}), /*#__PURE__*/_jsx(Box, {
|
|
221
226
|
sx: {
|
|
@@ -237,7 +242,8 @@ AddDomain.propTypes = {
|
|
|
237
242
|
appId: PropTypes.string,
|
|
238
243
|
appPk: PropTypes.string,
|
|
239
244
|
disabled: PropTypes.bool,
|
|
240
|
-
autoFocus: PropTypes.bool
|
|
245
|
+
autoFocus: PropTypes.bool,
|
|
246
|
+
inBlockletSetup: PropTypes.bool
|
|
241
247
|
};
|
|
242
248
|
AddDomain.defaultProps = {
|
|
243
249
|
defaultCustomDomain: '',
|
|
@@ -246,5 +252,6 @@ AddDomain.defaultProps = {
|
|
|
246
252
|
appId: '',
|
|
247
253
|
appPk: '',
|
|
248
254
|
disabled: false,
|
|
249
|
-
autoFocus: true
|
|
255
|
+
autoFocus: true,
|
|
256
|
+
inBlockletSetup: false
|
|
250
257
|
};
|
package/lib/blocklet/add-cert.js
CHANGED
|
@@ -10,9 +10,9 @@ var _useAsyncRetry = _interopRequireDefault(require("react-use/lib/useAsyncRetry
|
|
|
10
10
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
11
11
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
12
12
|
var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
|
|
13
|
+
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
13
14
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
14
15
|
var _constant = require("@blocklet/constant");
|
|
15
|
-
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
16
16
|
var _confirm = _interopRequireDefault(require("../confirm"));
|
|
17
17
|
var _node = require("../contexts/node");
|
|
18
18
|
var _blocklet = require("../contexts/blocklet");
|
|
@@ -30,26 +30,31 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
30
30
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
31
|
const isCertInProgress = status => ['waiting', 'creating', 'renewaling'].includes(status);
|
|
32
32
|
function Add(props) {
|
|
33
|
-
var _certState$value2;
|
|
33
|
+
var _certState$value2, _certState$value3;
|
|
34
34
|
const {
|
|
35
35
|
t
|
|
36
36
|
} = (0, _context.useLocaleContext)();
|
|
37
37
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
38
|
+
const {
|
|
39
|
+
inService
|
|
40
|
+
} = (0, _node.useNodeContext)();
|
|
38
41
|
const [confirmSetting, setConfirmSetting] = (0, _react.useState)(null);
|
|
39
42
|
const {
|
|
43
|
+
siteId,
|
|
40
44
|
domain,
|
|
41
45
|
onAdd,
|
|
42
46
|
children,
|
|
43
47
|
did
|
|
44
48
|
} = props;
|
|
49
|
+
const [issuing, setIssuing] = (0, _react.useState)(false);
|
|
45
50
|
const {
|
|
46
51
|
api,
|
|
47
52
|
ws: {
|
|
48
53
|
useSubscription
|
|
49
54
|
}
|
|
50
55
|
} = (0, _node.useNodeContext)();
|
|
51
|
-
const [issuing, setIssuing] = (0, _react.useState)(false);
|
|
52
56
|
const {
|
|
57
|
+
mode,
|
|
53
58
|
actions: {
|
|
54
59
|
refreshDomainStatus
|
|
55
60
|
}
|
|
@@ -68,19 +73,25 @@ function Add(props) {
|
|
|
68
73
|
const handleIssueComplete = (cert, type) => {
|
|
69
74
|
if (cert.domain === domain) {
|
|
70
75
|
setIssuing(false);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
setLoading(false);
|
|
77
|
+
|
|
78
|
+
// Setup 模式下有全局通知,所以这里不需要通知
|
|
79
|
+
if (inService && mode !== 'setup') {
|
|
80
|
+
if (type === 'success') {
|
|
81
|
+
_Toast.default.success("The ".concat(cert.domain, " certificate is issued successfully"));
|
|
82
|
+
} else if (type === 'error') {
|
|
83
|
+
_Toast.default.error("Failed to issue certificate for ".concat(cert.domain));
|
|
84
|
+
}
|
|
75
85
|
}
|
|
76
86
|
}
|
|
77
87
|
};
|
|
78
88
|
(0, _react.useEffect)(() => {
|
|
79
89
|
var _certState$value;
|
|
80
|
-
if (
|
|
81
|
-
|
|
90
|
+
if (certState.loading) {
|
|
91
|
+
return;
|
|
82
92
|
}
|
|
83
|
-
|
|
93
|
+
setIssuing(isCertInProgress((_certState$value = certState.value) === null || _certState$value === void 0 ? void 0 : _certState$value.status));
|
|
94
|
+
}, [certState.loading, (_certState$value2 = certState.value) === null || _certState$value2 === void 0 ? void 0 : _certState$value2.status]);
|
|
84
95
|
useSubscription(_constant.BlockletEvents.certError, cert => handleIssueComplete(cert, 'error'));
|
|
85
96
|
useSubscription(_constant.BlockletEvents.certIssued, cert => {
|
|
86
97
|
certState.retry();
|
|
@@ -91,7 +102,7 @@ function Add(props) {
|
|
|
91
102
|
return ''; // 如果正在加载证书的状态,则不渲染任何元素
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
if (((_certState$
|
|
105
|
+
if (((_certState$value3 = certState.value) === null || _certState$value3 === void 0 ? void 0 : _certState$value3.status) === 'normal') {
|
|
95
106
|
return ''; // 如果证书已经生成,则不渲染任何元素
|
|
96
107
|
}
|
|
97
108
|
|
|
@@ -104,8 +115,10 @@ function Add(props) {
|
|
|
104
115
|
try {
|
|
105
116
|
await api.issueLetsEncryptCert({
|
|
106
117
|
input: {
|
|
118
|
+
siteId,
|
|
107
119
|
domain,
|
|
108
|
-
did
|
|
120
|
+
did,
|
|
121
|
+
inBlockletSetup: mode === 'setup'
|
|
109
122
|
}
|
|
110
123
|
});
|
|
111
124
|
onAdd();
|
|
@@ -157,6 +170,7 @@ function Add(props) {
|
|
|
157
170
|
Add.propTypes = {
|
|
158
171
|
domain: _propTypes.default.string.isRequired,
|
|
159
172
|
did: _propTypes.default.string.isRequired,
|
|
173
|
+
siteId: _propTypes.default.string.isRequired,
|
|
160
174
|
onAdd: _propTypes.default.func,
|
|
161
175
|
children: _propTypes.default.any
|
|
162
176
|
};
|
|
@@ -173,34 +173,78 @@ function DomainList(_ref) {
|
|
|
173
173
|
flexDirection: 'column',
|
|
174
174
|
gap: 1
|
|
175
175
|
},
|
|
176
|
-
children: (showAllDomains ? domains : displayDomains).map(domain =>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
176
|
+
children: (showAllDomains ? domains : displayDomains).map(domain => {
|
|
177
|
+
var _blocklet$site3, _blocklet$site4;
|
|
178
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
179
|
+
children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
181
180
|
display: "flex",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
children:
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
flexDirection: "column",
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
183
|
+
display: "flex",
|
|
184
|
+
alignItems: "center",
|
|
185
|
+
justifyContent: "flex-start",
|
|
186
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
|
|
187
|
+
domain: domain,
|
|
188
|
+
target: "_blank",
|
|
189
|
+
children: domain.value
|
|
190
|
+
})
|
|
191
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
192
|
+
display: "flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "space-between",
|
|
195
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
196
|
+
sx: {
|
|
197
|
+
display: 'flex',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
justifyContent: 'flex-start',
|
|
200
|
+
gap: 1
|
|
201
|
+
},
|
|
202
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
|
|
203
|
+
domain: domain,
|
|
204
|
+
filters: ['domain']
|
|
205
|
+
}, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAddDomain, {
|
|
206
|
+
siteId: (_blocklet$site3 = blocklet.site) === null || _blocklet$site3 === void 0 ? void 0 : _blocklet$site3.id,
|
|
207
|
+
domain: domain,
|
|
208
|
+
blocklet: blocklet,
|
|
209
|
+
hasMutatePermission: hasMutatePermission
|
|
210
|
+
})]
|
|
211
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
212
|
+
sx: {
|
|
213
|
+
button: {
|
|
214
|
+
padding: 0
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAction, {
|
|
218
|
+
hasMutatePermission: hasMutatePermission,
|
|
219
|
+
site: site,
|
|
220
|
+
domain: domain,
|
|
221
|
+
blocklet: blocklet
|
|
222
|
+
})
|
|
223
|
+
})]
|
|
224
|
+
})]
|
|
225
|
+
}, domain.value), !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
190
226
|
display: "flex",
|
|
191
227
|
alignItems: "center",
|
|
192
228
|
justifyContent: "space-between",
|
|
193
229
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
justifyContent: 'flex-start',
|
|
198
|
-
gap: 1
|
|
199
|
-
},
|
|
230
|
+
display: "flex",
|
|
231
|
+
alignItems: "center",
|
|
232
|
+
justifyContent: "flex-start",
|
|
200
233
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
|
|
201
234
|
domain: domain,
|
|
202
235
|
filters: ['domain']
|
|
203
|
-
}, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
236
|
+
}, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
237
|
+
sx: {
|
|
238
|
+
ml: 2,
|
|
239
|
+
mr: 0.5
|
|
240
|
+
},
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
|
|
242
|
+
domain: domain,
|
|
243
|
+
target: "_blank",
|
|
244
|
+
children: domain.value
|
|
245
|
+
})
|
|
246
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAddDomain, {
|
|
247
|
+
siteId: (_blocklet$site4 = blocklet.site) === null || _blocklet$site4 === void 0 ? void 0 : _blocklet$site4.id,
|
|
204
248
|
domain: domain,
|
|
205
249
|
blocklet: blocklet,
|
|
206
250
|
hasMutatePermission: hasMutatePermission
|
|
@@ -218,48 +262,9 @@ function DomainList(_ref) {
|
|
|
218
262
|
blocklet: blocklet
|
|
219
263
|
})
|
|
220
264
|
})]
|
|
221
|
-
})]
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
alignItems: "center",
|
|
225
|
-
justifyContent: "space-between",
|
|
226
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
227
|
-
display: "flex",
|
|
228
|
-
alignItems: "center",
|
|
229
|
-
justifyContent: "flex-start",
|
|
230
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
|
|
231
|
-
domain: domain,
|
|
232
|
-
filters: ['domain']
|
|
233
|
-
}, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
234
|
-
sx: {
|
|
235
|
-
ml: 2,
|
|
236
|
-
mr: 0.5
|
|
237
|
-
},
|
|
238
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
|
|
239
|
-
domain: domain,
|
|
240
|
-
target: "_blank",
|
|
241
|
-
children: domain.value
|
|
242
|
-
})
|
|
243
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAddDomain, {
|
|
244
|
-
domain: domain,
|
|
245
|
-
blocklet: blocklet,
|
|
246
|
-
hasMutatePermission: hasMutatePermission
|
|
247
|
-
})]
|
|
248
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
249
|
-
sx: {
|
|
250
|
-
button: {
|
|
251
|
-
padding: 0
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAction, {
|
|
255
|
-
hasMutatePermission: hasMutatePermission,
|
|
256
|
-
site: site,
|
|
257
|
-
domain: domain,
|
|
258
|
-
blocklet: blocklet
|
|
259
|
-
})
|
|
260
|
-
})]
|
|
261
|
-
}, domain.value)]
|
|
262
|
-
}))
|
|
265
|
+
}, domain.value)]
|
|
266
|
+
});
|
|
267
|
+
})
|
|
263
268
|
}), hiddenDomains.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
264
269
|
style: {
|
|
265
270
|
marginLeft: '20px',
|
|
@@ -387,6 +392,7 @@ InnerAction.propTypes = {
|
|
|
387
392
|
};
|
|
388
393
|
function InnerAddDomain(_ref5) {
|
|
389
394
|
let {
|
|
395
|
+
siteId,
|
|
390
396
|
domain,
|
|
391
397
|
blocklet,
|
|
392
398
|
hasMutatePermission
|
|
@@ -499,6 +505,7 @@ function InnerAddDomain(_ref5) {
|
|
|
499
505
|
domain: domain,
|
|
500
506
|
filters: ['http']
|
|
501
507
|
}, "".concat(domain.value, "-http")), hasMutatePermission && /*#__PURE__*/(0, _jsxRuntime.jsx)(_addCert.default, {
|
|
508
|
+
siteId: siteId,
|
|
502
509
|
domain: domain.value,
|
|
503
510
|
domainStatus: domain.domainStatus,
|
|
504
511
|
did: blocklet.meta.did,
|
|
@@ -519,6 +526,7 @@ function InnerAddDomain(_ref5) {
|
|
|
519
526
|
});
|
|
520
527
|
}
|
|
521
528
|
InnerAddDomain.propTypes = {
|
|
529
|
+
siteId: _propTypes.default.string.isRequired,
|
|
522
530
|
domain: _types.DomainType.isRequired,
|
|
523
531
|
blocklet: _propTypes.default.object.isRequired,
|
|
524
532
|
hasMutatePermission: _propTypes.default.bool.isRequired
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = CreateProject;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
+
var _useLocalStorage = _interopRequireDefault(require("react-use/lib/useLocalStorage"));
|
|
9
10
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
10
11
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
11
12
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
@@ -65,6 +66,7 @@ function CreateProject(_ref) {
|
|
|
65
66
|
} = (0, _node.useNodeContext)();
|
|
66
67
|
const [blockletDid, setBlockletDid] = (0, _react.useState)();
|
|
67
68
|
const [openConnect, setOpenConnect] = (0, _react.useState)(false);
|
|
69
|
+
const [manualCreateBlockletDid] = (0, _useLocalStorage.default)('manual-create-blocklet-did', false);
|
|
68
70
|
const {
|
|
69
71
|
componentDid = ''
|
|
70
72
|
} = (0, _reactRouterDom.useParams)();
|
|
@@ -135,10 +137,11 @@ function CreateProject(_ref) {
|
|
|
135
137
|
readonly: true,
|
|
136
138
|
autoComplete: "off",
|
|
137
139
|
variant: "outlined",
|
|
138
|
-
|
|
140
|
+
onChange: e => manualCreateBlockletDid && setBlockletDid(e.target.value),
|
|
141
|
+
onClick: () => !manualCreateBlockletDid && !blockletDid && setOpenConnect(true),
|
|
139
142
|
InputProps: {
|
|
140
143
|
'data-cy': 'export-blocklet-did',
|
|
141
|
-
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputAdornment.default, {
|
|
144
|
+
endAdornment: !manualCreateBlockletDid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputAdornment.default, {
|
|
142
145
|
position: "end",
|
|
143
146
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
144
147
|
onClick: () => setOpenConnect(true),
|
|
@@ -262,7 +262,13 @@ function CreateRelease(_ref2) {
|
|
|
262
262
|
}).catch(err => {
|
|
263
263
|
setCreateLoading(false);
|
|
264
264
|
setLoading(false);
|
|
265
|
-
|
|
265
|
+
const msg = (0, _util.formatError)(err);
|
|
266
|
+
_Toast.default.error(msg);
|
|
267
|
+
if (/resource.*empty/.test(msg)) {
|
|
268
|
+
setParamsErrTip({
|
|
269
|
+
blockletResource: msg
|
|
270
|
+
});
|
|
271
|
+
}
|
|
266
272
|
});
|
|
267
273
|
};
|
|
268
274
|
if (!params && loading) {
|
|
@@ -278,12 +284,20 @@ function CreateRelease(_ref2) {
|
|
|
278
284
|
const item = resourceComponents.find(x => x.meta.did === tab);
|
|
279
285
|
const resourceContent = item ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
280
286
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_resource.default, {
|
|
287
|
+
error: paramsErrTip.blockletResource,
|
|
281
288
|
app: blocklet,
|
|
282
289
|
component: item,
|
|
283
290
|
projectId: projectId,
|
|
284
291
|
release: _objectSpread(_objectSpread({}, release), {}, {
|
|
285
292
|
id: releaseId
|
|
286
|
-
})
|
|
293
|
+
}),
|
|
294
|
+
onSave: selected => {
|
|
295
|
+
if (selected.length) {
|
|
296
|
+
setParamsErrTip({
|
|
297
|
+
blockletResource: ''
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
287
301
|
})
|
|
288
302
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
289
303
|
display: "flex",
|
|
@@ -8,6 +8,7 @@ var _react = require("react");
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
12
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
13
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
13
14
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
@@ -36,7 +37,9 @@ function Resource(_ref) {
|
|
|
36
37
|
app,
|
|
37
38
|
component,
|
|
38
39
|
projectId,
|
|
39
|
-
release
|
|
40
|
+
release,
|
|
41
|
+
error,
|
|
42
|
+
onSave
|
|
40
43
|
} = _ref;
|
|
41
44
|
const {
|
|
42
45
|
t,
|
|
@@ -73,7 +76,7 @@ function Resource(_ref) {
|
|
|
73
76
|
_Toast.default.error(err.message);
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
|
-
const
|
|
79
|
+
const _onSave = async () => {
|
|
77
80
|
const params = selectedResourceIds;
|
|
78
81
|
try {
|
|
79
82
|
setLoading(true);
|
|
@@ -86,6 +89,7 @@ function Resource(_ref) {
|
|
|
86
89
|
_Toast.default.success(t('common.saveSuccess'));
|
|
87
90
|
setLoading(false);
|
|
88
91
|
saveSelected(selectedResourceIds);
|
|
92
|
+
onSave(selectedResourceIds);
|
|
89
93
|
} catch (err) {
|
|
90
94
|
setLoading(false);
|
|
91
95
|
_Toast.default.error(err.message);
|
|
@@ -124,7 +128,8 @@ function Resource(_ref) {
|
|
|
124
128
|
})
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
131
|
+
return [/*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
132
|
+
className: (0, _classnames.default)(error && 'error'),
|
|
128
133
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
129
134
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_tree.default, {
|
|
130
135
|
data: resources,
|
|
@@ -138,25 +143,34 @@ function Resource(_ref) {
|
|
|
138
143
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
139
144
|
variant: "contained",
|
|
140
145
|
disabled: loading,
|
|
141
|
-
onClick: () =>
|
|
146
|
+
onClick: () => _onSave(),
|
|
142
147
|
children: t('common.save')
|
|
143
148
|
})
|
|
144
149
|
})]
|
|
145
150
|
})
|
|
146
|
-
})
|
|
151
|
+
}), !!error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
152
|
+
color: "error.main",
|
|
153
|
+
mt: 1,
|
|
154
|
+
fontSize: 14,
|
|
155
|
+
children: error
|
|
156
|
+
})];
|
|
147
157
|
}
|
|
148
158
|
Resource.propTypes = {
|
|
149
159
|
component: _propTypes.default.object.isRequired,
|
|
150
160
|
app: _propTypes.default.object.isRequired,
|
|
151
161
|
projectId: _propTypes.default.string.isRequired,
|
|
162
|
+
error: _propTypes.default.string,
|
|
152
163
|
release: _propTypes.default.shape({
|
|
153
164
|
id: _propTypes.default.string.isRequired,
|
|
154
165
|
status: _propTypes.default.string
|
|
155
|
-
})
|
|
166
|
+
}),
|
|
167
|
+
onSave: _propTypes.default.func
|
|
156
168
|
};
|
|
157
169
|
Resource.defaultProps = {
|
|
170
|
+
error: '',
|
|
158
171
|
release: {
|
|
159
172
|
id: ''
|
|
160
|
-
}
|
|
173
|
+
},
|
|
174
|
+
onSave: () => {}
|
|
161
175
|
};
|
|
162
|
-
const Container = (0, _styled.default)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 16px;\n padding-bottom: 0px;\n max-height: 600px;\n overflow-y: auto;\n .footer {\n border-top: 1px solid #ddd;\n display: flex;\n padding: 12px 0;\n margin-top: 12px;\n position: sticky;\n bottom: 0;\n background: #fff;\n }\n"])));
|
|
176
|
+
const Container = (0, _styled.default)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid #ccc;\n &.error {\n border-color: ", ";\n }\n border-radius: 4px;\n padding: 16px;\n padding-bottom: 0px;\n max-height: 600px;\n overflow-y: auto;\n .footer {\n border-top: 1px solid #ddd;\n display: flex;\n padding: 12px 0;\n margin-top: 12px;\n position: sticky;\n bottom: 0;\n background: #fff;\n z-index: 10;\n }\n"])), props => props.theme.palette.error.main);
|
|
@@ -23,7 +23,7 @@ var _api = require("../../util/api");
|
|
|
23
23
|
var _dnsTip = _interopRequireDefault(require("./dns-tip"));
|
|
24
24
|
var _util3 = require("./util");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _excluded = ["siteId", "teamDid", "cnameDomain", "defaultCustomDomain", "onInputDomain", "appId", "appPk", "onSuccess", "disabled", "autoFocus"];
|
|
26
|
+
const _excluded = ["siteId", "teamDid", "cnameDomain", "defaultCustomDomain", "onInputDomain", "appId", "appPk", "onSuccess", "disabled", "autoFocus", "inBlockletSetup"];
|
|
27
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
28
|
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; }
|
|
29
29
|
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; }
|
|
@@ -43,7 +43,8 @@ function AddDomain(_ref) {
|
|
|
43
43
|
appPk,
|
|
44
44
|
onSuccess,
|
|
45
45
|
disabled,
|
|
46
|
-
autoFocus
|
|
46
|
+
autoFocus,
|
|
47
|
+
inBlockletSetup
|
|
47
48
|
} = _ref,
|
|
48
49
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
49
50
|
const {
|
|
@@ -71,14 +72,16 @@ function AddDomain(_ref) {
|
|
|
71
72
|
chainHost
|
|
72
73
|
} = _ref2;
|
|
73
74
|
try {
|
|
75
|
+
const tmpDomain = (0, _util3.parseDomainFromURL)(domain);
|
|
74
76
|
await api.addDomainAlias({
|
|
75
77
|
input: {
|
|
76
78
|
id: siteId,
|
|
77
79
|
type: 'nft-domain',
|
|
78
|
-
domainAlias:
|
|
80
|
+
domainAlias: tmpDomain,
|
|
79
81
|
nftDid,
|
|
80
82
|
chainHost,
|
|
81
|
-
teamDid
|
|
83
|
+
teamDid,
|
|
84
|
+
inBlockletSetup
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
87
|
await (0, _util2.sleep)(2000);
|
|
@@ -87,8 +90,10 @@ function AddDomain(_ref) {
|
|
|
87
90
|
showNFTDomainAuth: false
|
|
88
91
|
});
|
|
89
92
|
onSuccess({
|
|
90
|
-
domain,
|
|
91
|
-
type: state.type
|
|
93
|
+
domain: tmpDomain,
|
|
94
|
+
type: state.type,
|
|
95
|
+
nftDid,
|
|
96
|
+
chainHost
|
|
92
97
|
});
|
|
93
98
|
} finally {
|
|
94
99
|
setState({
|
|
@@ -232,7 +237,7 @@ function AddDomain(_ref) {
|
|
|
232
237
|
children: inputDomainTypes.map((type, index) => {
|
|
233
238
|
var _domainTypes$type, _domainTypes$type2;
|
|
234
239
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
235
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
240
|
+
children: [inputDomainTypes.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
236
241
|
children: "".concat(t("optionsOrder.".concat(index + 1)), ": ").concat((_domainTypes$type = domainTypes[type]) === null || _domainTypes$type === void 0 ? void 0 : _domainTypes$type.name)
|
|
237
242
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
238
243
|
sx: {
|
|
@@ -255,7 +260,8 @@ AddDomain.propTypes = {
|
|
|
255
260
|
appId: _propTypes.default.string,
|
|
256
261
|
appPk: _propTypes.default.string,
|
|
257
262
|
disabled: _propTypes.default.bool,
|
|
258
|
-
autoFocus: _propTypes.default.bool
|
|
263
|
+
autoFocus: _propTypes.default.bool,
|
|
264
|
+
inBlockletSetup: _propTypes.default.bool
|
|
259
265
|
};
|
|
260
266
|
AddDomain.defaultProps = {
|
|
261
267
|
defaultCustomDomain: '',
|
|
@@ -264,5 +270,6 @@ AddDomain.defaultProps = {
|
|
|
264
270
|
appId: '',
|
|
265
271
|
appPk: '',
|
|
266
272
|
disabled: false,
|
|
267
|
-
autoFocus: true
|
|
273
|
+
autoFocus: true,
|
|
274
|
+
inBlockletSetup: false
|
|
268
275
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.20-beta-
|
|
3
|
+
"version": "1.16.20-beta-9c254d14",
|
|
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.20-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.20-beta-
|
|
32
|
-
"@abtnode/util": "1.16.20-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.20-beta-9c254d14",
|
|
31
|
+
"@abtnode/constant": "1.16.20-beta-9c254d14",
|
|
32
|
+
"@abtnode/util": "1.16.20-beta-9c254d14",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.103",
|
|
35
35
|
"@arcblock/did-connect": "^2.8.20",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@arcblock/react-hooks": "^2.8.20",
|
|
40
40
|
"@arcblock/terminal": "^2.8.20",
|
|
41
41
|
"@arcblock/ux": "^2.8.20",
|
|
42
|
-
"@blocklet/constant": "1.16.20-beta-
|
|
42
|
+
"@blocklet/constant": "1.16.20-beta-9c254d14",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.46",
|
|
44
|
-
"@blocklet/list": "^0.12.
|
|
45
|
-
"@blocklet/meta": "1.16.20-beta-
|
|
44
|
+
"@blocklet/list": "^0.12.56",
|
|
45
|
+
"@blocklet/meta": "1.16.20-beta-9c254d14",
|
|
46
46
|
"@blocklet/ui-react": "^2.8.20",
|
|
47
|
-
"@blocklet/uploader": "^0.0.
|
|
47
|
+
"@blocklet/uploader": "^0.0.52",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
50
50
|
"@iconify/react": "^4.0.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
101
101
|
"glob": "^10.3.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "2f74601e9a8f2e07e872a629b6abc8d4bc1fd371",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|