@abtnode/ux 1.16.17-beta-952ef53d → 1.16.17-beta-d81014f4
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/actions.js +1 -2
- package/es/blocklet/component/add.js +1 -1
- package/es/blocklet/component/domain-list.js +280 -158
- package/es/blocklet/component/index.js +0 -1
- package/es/blocklet/config-navigation.js +34 -10
- package/es/blocklet/router/domain-status.js +0 -1
- package/es/certificate.js +0 -1
- package/es/dot.js +2 -2
- package/es/locales/en.js +7 -1
- package/es/locales/zh.js +8 -2
- package/es/lost-passport.js +39 -37
- package/es/team/passports/index.js +8 -2
- package/lib/blocklet/actions.js +1 -2
- package/lib/blocklet/component/add.js +1 -1
- package/lib/blocklet/component/domain-list.js +292 -169
- package/lib/blocklet/component/index.js +1 -1
- package/lib/blocklet/config-navigation.js +34 -10
- package/lib/blocklet/router/domain-status.js +0 -1
- package/lib/certificate.js +0 -1
- package/lib/dot.js +1 -1
- package/lib/locales/en.js +7 -1
- package/lib/locales/zh.js +8 -2
- package/lib/lost-passport.js +39 -36
- package/lib/team/passports/index.js +8 -2
- package/package.json +17 -17
package/es/blocklet/actions.js
CHANGED
|
@@ -23,7 +23,6 @@ import Button from '@arcblock/ux/lib/Button';
|
|
|
23
23
|
import { getAppMissingConfigs, isDeletableBlocklet, hasRunnableComponent, getDisplayName, isInProgress } from '@blocklet/meta/lib/util';
|
|
24
24
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
25
25
|
import { BLOCKLET_CONTROLLER_STATUS, BLOCKLET_MODES, SUSPENDED_REASON } from '@blocklet/constant';
|
|
26
|
-
import { APP_STRUCT_VERSION } from '@abtnode/constant';
|
|
27
26
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
28
27
|
import { sleep, formatError, isDownloading } from '../util';
|
|
29
28
|
import { getServerUrl } from './util';
|
|
@@ -271,7 +270,7 @@ export default function BlockletActions({
|
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
272
|
};
|
|
274
|
-
const removeAction = !inService && isDeletableBlocklet(blocklet)
|
|
273
|
+
const removeAction = !inService && isDeletableBlocklet(blocklet) ? {
|
|
275
274
|
action: 'remove',
|
|
276
275
|
icon: Icons.Remove,
|
|
277
276
|
name: t('common.remove'),
|
|
@@ -579,7 +579,7 @@ export default function AddComponent({
|
|
|
579
579
|
} else {
|
|
580
580
|
doc = {
|
|
581
581
|
...doc,
|
|
582
|
-
pathPrefix: hasRootPath ? `/${urlPathFriendly(name)}` : '/',
|
|
582
|
+
pathPrefix: hasRootPath ? `/${urlPathFriendly(title) || urlPathFriendly(name)}` : '/',
|
|
583
583
|
title: title || '',
|
|
584
584
|
componentName: '',
|
|
585
585
|
hasEnvironmentsStep: component.current.meta?.environments?.length > 0
|
|
@@ -15,16 +15,17 @@ import Popover from '@mui/material/Popover';
|
|
|
15
15
|
import Tooltip from '@mui/material/Tooltip';
|
|
16
16
|
import Typography from '@mui/material/Typography';
|
|
17
17
|
import useTheme from '@mui/material/styles/useTheme';
|
|
18
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
18
19
|
import { encode as encodeBase32 } from '@abtnode/util/lib/base32';
|
|
19
20
|
import { isDidDomain } from '@abtnode/util/lib/url-evaluation';
|
|
20
21
|
import LockIcon from '@arcblock/icons/lib/LockIcon';
|
|
21
22
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
22
23
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
23
|
-
import { isInProgress } from '@blocklet/meta/lib/util';
|
|
24
|
+
import { isAccessible, isInProgress } from '@blocklet/meta/lib/util';
|
|
24
25
|
import Spinner from '@mui/material/CircularProgress';
|
|
25
|
-
import DidAddress from '../../did-address';
|
|
26
26
|
import { useBlockletContext } from '../../contexts/blocklet';
|
|
27
27
|
import { useNodeContext } from '../../contexts/node';
|
|
28
|
+
import DidAddress from '../../did-address';
|
|
28
29
|
import { withPermission } from '../../permission';
|
|
29
30
|
import { BlockletAdminRoles, getSystemDomains, sortDomains } from '../../util';
|
|
30
31
|
import AddCert from '../add-cert';
|
|
@@ -66,9 +67,8 @@ function DomainList({
|
|
|
66
67
|
const {
|
|
67
68
|
t
|
|
68
69
|
} = useLocaleContext();
|
|
69
|
-
const [domainInfoAnchorEl, setDomainInfoAnchorEl] = useState(null);
|
|
70
70
|
const [showAllDomains, setShowAllDomains] = useState(false);
|
|
71
|
-
const
|
|
71
|
+
const isMobile = useMediaQuery(x => x.breakpoints.down('md'));
|
|
72
72
|
const hasMutatePermission = useMemo(() => {
|
|
73
73
|
let res = hasPermission;
|
|
74
74
|
if (isServerless(blocklet)) {
|
|
@@ -76,12 +76,6 @@ function DomainList({
|
|
|
76
76
|
}
|
|
77
77
|
return res;
|
|
78
78
|
}, [hasPermission, inService, blocklet]);
|
|
79
|
-
const handlePopoverOpen = event => {
|
|
80
|
-
setDomainInfoAnchorEl(event.currentTarget);
|
|
81
|
-
};
|
|
82
|
-
const handlePopoverClose = () => {
|
|
83
|
-
setDomainInfoAnchorEl(null);
|
|
84
|
-
};
|
|
85
79
|
const {
|
|
86
80
|
site
|
|
87
81
|
} = blocklet;
|
|
@@ -133,161 +127,107 @@ function DomainList({
|
|
|
133
127
|
}), t('common.add')]
|
|
134
128
|
})
|
|
135
129
|
})]
|
|
136
|
-
}), blocklet.status
|
|
130
|
+
}), isAccessible(blocklet.status) === false && /*#__PURE__*/_jsx(Box, {
|
|
137
131
|
mt: 1.5,
|
|
138
132
|
mb: 1.5,
|
|
139
133
|
children: /*#__PURE__*/_jsx(Alert, {
|
|
140
134
|
severity: "warning",
|
|
141
135
|
children: t('blocklet.router.noRunning')
|
|
142
136
|
})
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}), /*#__PURE__*/_jsxs(Typography, {
|
|
216
|
-
component: "div",
|
|
217
|
-
style: {
|
|
218
|
-
display: 'flex',
|
|
219
|
-
marginTop: '12px'
|
|
220
|
-
},
|
|
221
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
222
|
-
component: "span",
|
|
223
|
-
style: {
|
|
224
|
-
width: '80px',
|
|
225
|
-
marginRight: '8px'
|
|
226
|
-
},
|
|
227
|
-
children: t('common.domain')
|
|
228
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
229
|
-
component: "span",
|
|
230
|
-
children: domain.value
|
|
231
|
-
})]
|
|
232
|
-
}), /*#__PURE__*/_jsxs(Typography, {
|
|
233
|
-
component: "div",
|
|
234
|
-
style: {
|
|
235
|
-
display: 'flex'
|
|
236
|
-
},
|
|
237
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
238
|
-
component: "span",
|
|
239
|
-
style: {
|
|
240
|
-
width: '80px',
|
|
241
|
-
marginRight: '8px'
|
|
242
|
-
},
|
|
243
|
-
children: "NFT"
|
|
244
|
-
}), /*#__PURE__*/_jsx(DidAddress, {
|
|
245
|
-
did: domain.nftDid
|
|
246
|
-
})]
|
|
247
|
-
})]
|
|
137
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
138
|
+
sx: {
|
|
139
|
+
display: 'flex',
|
|
140
|
+
flexDirection: 'column',
|
|
141
|
+
gap: 1
|
|
142
|
+
},
|
|
143
|
+
children: (showAllDomains ? domains : displayDomains).map(domain => /*#__PURE__*/_jsxs(_Fragment, {
|
|
144
|
+
children: [isMobile && /*#__PURE__*/_jsxs(Box, {
|
|
145
|
+
display: "flex",
|
|
146
|
+
flexDirection: "column",
|
|
147
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
148
|
+
display: "flex",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "flex-start",
|
|
151
|
+
children: /*#__PURE__*/_jsx(DomainLink, {
|
|
152
|
+
domain: domain,
|
|
153
|
+
target: "_blank",
|
|
154
|
+
children: domain.value
|
|
155
|
+
})
|
|
156
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
157
|
+
display: "flex",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
justifyContent: "space-between",
|
|
160
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
161
|
+
sx: {
|
|
162
|
+
display: 'flex',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
justifyContent: 'flex-start',
|
|
165
|
+
gap: 1
|
|
166
|
+
},
|
|
167
|
+
children: [/*#__PURE__*/_jsx(DomainStatus, {
|
|
168
|
+
domain: domain,
|
|
169
|
+
filters: ['domain']
|
|
170
|
+
}, `${domain.value}-domain`), /*#__PURE__*/_jsx(InnerAddDomain, {
|
|
171
|
+
domain: domain,
|
|
172
|
+
blocklet: blocklet,
|
|
173
|
+
hasMutatePermission: hasMutatePermission
|
|
174
|
+
})]
|
|
175
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
176
|
+
sx: {
|
|
177
|
+
button: {
|
|
178
|
+
padding: 0
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
children: /*#__PURE__*/_jsx(InnerAction, {
|
|
182
|
+
hasMutatePermission: hasMutatePermission,
|
|
183
|
+
site: site,
|
|
184
|
+
domain: domain,
|
|
185
|
+
blocklet: blocklet
|
|
186
|
+
})
|
|
187
|
+
})]
|
|
188
|
+
})]
|
|
189
|
+
}, domain.value), !isMobile && /*#__PURE__*/_jsxs(Box, {
|
|
190
|
+
display: "flex",
|
|
191
|
+
alignItems: "center",
|
|
192
|
+
justifyContent: "space-between",
|
|
193
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
194
|
+
display: "flex",
|
|
195
|
+
alignItems: "center",
|
|
196
|
+
justifyContent: "flex-start",
|
|
197
|
+
children: [/*#__PURE__*/_jsx(DomainStatus, {
|
|
198
|
+
domain: domain,
|
|
199
|
+
filters: ['domain']
|
|
200
|
+
}, `${domain.value}-domain`), /*#__PURE__*/_jsx(Box, {
|
|
201
|
+
sx: {
|
|
202
|
+
ml: 2,
|
|
203
|
+
mr: 0.5
|
|
204
|
+
},
|
|
205
|
+
children: /*#__PURE__*/_jsx(DomainLink, {
|
|
206
|
+
domain: domain,
|
|
207
|
+
target: "_blank",
|
|
208
|
+
children: domain.value
|
|
248
209
|
})
|
|
210
|
+
}), /*#__PURE__*/_jsx(InnerAddDomain, {
|
|
211
|
+
domain: domain,
|
|
212
|
+
blocklet: blocklet,
|
|
213
|
+
hasMutatePermission: hasMutatePermission
|
|
214
|
+
})]
|
|
215
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
216
|
+
sx: {
|
|
217
|
+
button: {
|
|
218
|
+
padding: 0
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
children: /*#__PURE__*/_jsx(InnerAction, {
|
|
222
|
+
hasMutatePermission: hasMutatePermission,
|
|
223
|
+
site: site,
|
|
224
|
+
domain: domain,
|
|
225
|
+
blocklet: blocklet
|
|
249
226
|
})
|
|
250
227
|
})]
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}, `${domain.value}-http`), hasMutatePermission && /*#__PURE__*/_jsx(AddCert, {
|
|
255
|
-
domain: domain.value,
|
|
256
|
-
domainStatus: domain.domainStatus,
|
|
257
|
-
did: blocklet.meta.did,
|
|
258
|
-
children: ({
|
|
259
|
-
open
|
|
260
|
-
}) => /*#__PURE__*/_jsx(Button, {
|
|
261
|
-
size: "small",
|
|
262
|
-
onClick: e => open(e),
|
|
263
|
-
children: t('router.cert.genLetsEncryptCert.title')
|
|
264
|
-
})
|
|
265
|
-
})]
|
|
266
|
-
}), hasMutatePermission && !domain.isProtected ? /*#__PURE__*/_jsx(DomainActions, {
|
|
267
|
-
site: site,
|
|
268
|
-
domain: domain,
|
|
269
|
-
blocklet: blocklet
|
|
270
|
-
}) : /*#__PURE__*/_jsx(Tooltip, {
|
|
271
|
-
title: t('blocklet.router.domainLockTooltip'),
|
|
272
|
-
placement: "top",
|
|
273
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
274
|
-
disabled: true,
|
|
275
|
-
size: "large",
|
|
276
|
-
style: {
|
|
277
|
-
pointerEvents: 'auto',
|
|
278
|
-
// padding replace to margin, fix the tooltip position
|
|
279
|
-
paddingTop: 0,
|
|
280
|
-
paddingBottom: 0,
|
|
281
|
-
margin: '12px 0'
|
|
282
|
-
},
|
|
283
|
-
children: /*#__PURE__*/_jsx(LockIcon, {
|
|
284
|
-
style: {
|
|
285
|
-
fill: theme.palette.text.disabled
|
|
286
|
-
}
|
|
287
|
-
})
|
|
288
|
-
})
|
|
289
|
-
})]
|
|
290
|
-
}, domain.value)), hiddenDomains.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
228
|
+
}, domain.value)]
|
|
229
|
+
}))
|
|
230
|
+
}), hiddenDomains.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
291
231
|
style: {
|
|
292
232
|
marginLeft: '20px',
|
|
293
233
|
marginTop: '12px'
|
|
@@ -316,7 +256,8 @@ DomainList.defaultProps = {
|
|
|
316
256
|
};
|
|
317
257
|
function DomainLink({
|
|
318
258
|
domain,
|
|
319
|
-
children
|
|
259
|
+
children,
|
|
260
|
+
...rest
|
|
320
261
|
}) {
|
|
321
262
|
const {
|
|
322
263
|
t
|
|
@@ -327,6 +268,7 @@ function DomainLink({
|
|
|
327
268
|
} = domain;
|
|
328
269
|
if (!accessibility || accessibility.loading) {
|
|
329
270
|
return /*#__PURE__*/_jsxs(LinkDiv, {
|
|
271
|
+
...rest,
|
|
330
272
|
children: [children, /*#__PURE__*/_jsx(Tooltip, {
|
|
331
273
|
title: t('blocklet.router.checkUrlAccessible'),
|
|
332
274
|
placement: "top-end",
|
|
@@ -341,6 +283,7 @@ function DomainLink({
|
|
|
341
283
|
}
|
|
342
284
|
if (!accessibility.accessible) {
|
|
343
285
|
return /*#__PURE__*/_jsx(LinkDiv, {
|
|
286
|
+
...rest,
|
|
344
287
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
345
288
|
title: t('blocklet.router.urlInaccessible'),
|
|
346
289
|
placement: "top-end",
|
|
@@ -351,6 +294,7 @@ function DomainLink({
|
|
|
351
294
|
});
|
|
352
295
|
}
|
|
353
296
|
return /*#__PURE__*/_jsx(LinkDiv, {
|
|
297
|
+
...rest,
|
|
354
298
|
children: /*#__PURE__*/_jsx("a", {
|
|
355
299
|
href: href,
|
|
356
300
|
target: "_blank",
|
|
@@ -368,9 +312,187 @@ const LinkDiv = styled.span`
|
|
|
368
312
|
& > * {
|
|
369
313
|
color: #222;
|
|
370
314
|
font-size: 18px;
|
|
315
|
+
word-break: break-all;
|
|
371
316
|
}
|
|
372
317
|
|
|
373
318
|
.status {
|
|
374
319
|
margin-left: 8px;
|
|
375
320
|
}
|
|
376
|
-
`;
|
|
321
|
+
`;
|
|
322
|
+
function InnerAction({
|
|
323
|
+
hasMutatePermission,
|
|
324
|
+
site,
|
|
325
|
+
domain,
|
|
326
|
+
blocklet
|
|
327
|
+
}) {
|
|
328
|
+
const theme = useTheme();
|
|
329
|
+
const {
|
|
330
|
+
t
|
|
331
|
+
} = useLocaleContext();
|
|
332
|
+
if (hasMutatePermission && !domain.isProtected) {
|
|
333
|
+
return /*#__PURE__*/_jsx(DomainActions, {
|
|
334
|
+
site: site,
|
|
335
|
+
domain: domain,
|
|
336
|
+
blocklet: blocklet
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
340
|
+
title: t('blocklet.router.domainLockTooltip'),
|
|
341
|
+
placement: "top",
|
|
342
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
343
|
+
disabled: true,
|
|
344
|
+
size: "large",
|
|
345
|
+
style: {
|
|
346
|
+
pointerEvents: 'auto',
|
|
347
|
+
// padding replace to margin, fix the tooltip position
|
|
348
|
+
paddingTop: 0,
|
|
349
|
+
paddingBottom: 0
|
|
350
|
+
},
|
|
351
|
+
children: /*#__PURE__*/_jsx(LockIcon, {
|
|
352
|
+
style: {
|
|
353
|
+
fill: theme.palette.text.disabled
|
|
354
|
+
}
|
|
355
|
+
})
|
|
356
|
+
})
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
InnerAction.propTypes = {
|
|
360
|
+
hasMutatePermission: PropTypes.bool.isRequired,
|
|
361
|
+
site: PropTypes.object.isRequired,
|
|
362
|
+
domain: DomainType.isRequired,
|
|
363
|
+
blocklet: PropTypes.object.isRequired
|
|
364
|
+
};
|
|
365
|
+
function InnerAddDomain({
|
|
366
|
+
domain,
|
|
367
|
+
blocklet,
|
|
368
|
+
hasMutatePermission
|
|
369
|
+
}) {
|
|
370
|
+
const theme = useTheme();
|
|
371
|
+
const {
|
|
372
|
+
t
|
|
373
|
+
} = useLocaleContext();
|
|
374
|
+
const [domainInfoAnchorEl, setDomainInfoAnchorEl] = useState(null);
|
|
375
|
+
const handlePopoverOpen = event => {
|
|
376
|
+
setDomainInfoAnchorEl(event.currentTarget);
|
|
377
|
+
};
|
|
378
|
+
const handlePopoverClose = () => {
|
|
379
|
+
setDomainInfoAnchorEl(null);
|
|
380
|
+
};
|
|
381
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
382
|
+
sx: {
|
|
383
|
+
display: 'flex',
|
|
384
|
+
justifyContent: 'flex-start',
|
|
385
|
+
alignItems: 'center',
|
|
386
|
+
gap: 1
|
|
387
|
+
},
|
|
388
|
+
children: [domain.type === 'nft-domain' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
389
|
+
children: [/*#__PURE__*/_jsx(DiamondIcon, {
|
|
390
|
+
onMouseEnter: handlePopoverOpen,
|
|
391
|
+
onMouseLeave: handlePopoverClose,
|
|
392
|
+
style: {
|
|
393
|
+
cursor: 'pointer',
|
|
394
|
+
fill: theme.palette.primary.main
|
|
395
|
+
}
|
|
396
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
397
|
+
id: "mouse-over-popover",
|
|
398
|
+
style: {
|
|
399
|
+
pointerEvents: 'none'
|
|
400
|
+
},
|
|
401
|
+
open: Boolean(domainInfoAnchorEl),
|
|
402
|
+
anchorEl: domainInfoAnchorEl,
|
|
403
|
+
anchorOrigin: {
|
|
404
|
+
vertical: 'bottom',
|
|
405
|
+
horizontal: 'left'
|
|
406
|
+
},
|
|
407
|
+
transformOrigin: {
|
|
408
|
+
vertical: 'top',
|
|
409
|
+
horizontal: 'left'
|
|
410
|
+
},
|
|
411
|
+
onClose: handlePopoverClose,
|
|
412
|
+
disableRestoreFocus: true,
|
|
413
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
414
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
415
|
+
style: {
|
|
416
|
+
display: 'flex',
|
|
417
|
+
flexDirection: 'column'
|
|
418
|
+
},
|
|
419
|
+
children: [/*#__PURE__*/_jsxs(Typography, {
|
|
420
|
+
component: "div",
|
|
421
|
+
style: {
|
|
422
|
+
display: 'flex',
|
|
423
|
+
alignItems: 'center'
|
|
424
|
+
},
|
|
425
|
+
children: [/*#__PURE__*/_jsx(DiamondIcon, {
|
|
426
|
+
style: {
|
|
427
|
+
fill: theme.palette.primary.main
|
|
428
|
+
}
|
|
429
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
430
|
+
component: "span",
|
|
431
|
+
style: {
|
|
432
|
+
marginLeft: '8px',
|
|
433
|
+
fontSize: '18px',
|
|
434
|
+
fontWeight: 'bolder'
|
|
435
|
+
},
|
|
436
|
+
children: t('router.domainAlias.nftDomain')
|
|
437
|
+
})]
|
|
438
|
+
}), /*#__PURE__*/_jsxs(Typography, {
|
|
439
|
+
component: "div",
|
|
440
|
+
style: {
|
|
441
|
+
display: 'flex',
|
|
442
|
+
marginTop: '12px'
|
|
443
|
+
},
|
|
444
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
445
|
+
component: "span",
|
|
446
|
+
style: {
|
|
447
|
+
width: '80px',
|
|
448
|
+
marginRight: '8px'
|
|
449
|
+
},
|
|
450
|
+
children: t('common.domain')
|
|
451
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
452
|
+
component: "span",
|
|
453
|
+
children: domain.value
|
|
454
|
+
})]
|
|
455
|
+
}), /*#__PURE__*/_jsxs(Typography, {
|
|
456
|
+
component: "div",
|
|
457
|
+
style: {
|
|
458
|
+
display: 'flex'
|
|
459
|
+
},
|
|
460
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
461
|
+
component: "span",
|
|
462
|
+
style: {
|
|
463
|
+
width: '80px',
|
|
464
|
+
marginRight: '8px'
|
|
465
|
+
},
|
|
466
|
+
children: "NFT"
|
|
467
|
+
}), /*#__PURE__*/_jsx(DidAddress, {
|
|
468
|
+
did: domain.nftDid
|
|
469
|
+
})]
|
|
470
|
+
})]
|
|
471
|
+
})
|
|
472
|
+
})
|
|
473
|
+
})]
|
|
474
|
+
}), /*#__PURE__*/_jsx(DomainStatus, {
|
|
475
|
+
domain: domain,
|
|
476
|
+
filters: ['http']
|
|
477
|
+
}, `${domain.value}-http`), hasMutatePermission && /*#__PURE__*/_jsx(AddCert, {
|
|
478
|
+
domain: domain.value,
|
|
479
|
+
domainStatus: domain.domainStatus,
|
|
480
|
+
did: blocklet.meta.did,
|
|
481
|
+
children: ({
|
|
482
|
+
open
|
|
483
|
+
}) => /*#__PURE__*/_jsx(Button, {
|
|
484
|
+
sx: {
|
|
485
|
+
padding: 0
|
|
486
|
+
},
|
|
487
|
+
size: "small",
|
|
488
|
+
onClick: e => open(e),
|
|
489
|
+
children: t('router.cert.genLetsEncryptCert.title')
|
|
490
|
+
})
|
|
491
|
+
})]
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
InnerAddDomain.propTypes = {
|
|
495
|
+
domain: DomainType.isRequired,
|
|
496
|
+
blocklet: PropTypes.object.isRequired,
|
|
497
|
+
hasMutatePermission: PropTypes.bool.isRequired
|
|
498
|
+
};
|
|
@@ -5,6 +5,7 @@ import ButtonGroup from '@mui/material/ButtonGroup';
|
|
|
5
5
|
import FormControl from '@mui/material/FormControl';
|
|
6
6
|
import InputLabel from '@mui/material/InputLabel';
|
|
7
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
8
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
8
9
|
import Paper from '@mui/material/Paper';
|
|
9
10
|
import Select from '@mui/material/Select';
|
|
10
11
|
import Toolbar from '@mui/material/Toolbar';
|
|
@@ -70,6 +71,7 @@ function ConfigNavigation() {
|
|
|
70
71
|
const {
|
|
71
72
|
roles
|
|
72
73
|
} = useTeamContext();
|
|
74
|
+
const isMobile = useMediaQuery(theme => theme.breakpoints.down('md'));
|
|
73
75
|
const pageState = useReactive({
|
|
74
76
|
saveLoading: false,
|
|
75
77
|
resetLoading: false,
|
|
@@ -139,7 +141,7 @@ function ConfigNavigation() {
|
|
|
139
141
|
try {
|
|
140
142
|
pageState.resetLoading = true;
|
|
141
143
|
await resetNavigation();
|
|
142
|
-
Toast.success('
|
|
144
|
+
Toast.success(t('navigation.action.resetSuccessful'), {
|
|
143
145
|
variant: 'success'
|
|
144
146
|
});
|
|
145
147
|
} catch (e) {
|
|
@@ -169,7 +171,16 @@ function ConfigNavigation() {
|
|
|
169
171
|
};
|
|
170
172
|
}, [blocklet.appDid, pageState.mockRole]);
|
|
171
173
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
172
|
-
children: [/*#__PURE__*/_jsx(
|
|
174
|
+
children: [isMobile && /*#__PURE__*/_jsx(Select, {
|
|
175
|
+
fullWidth: true,
|
|
176
|
+
size: "small",
|
|
177
|
+
value: navigationState.activeSection,
|
|
178
|
+
onChange: event => updateActiveSection(event.target.value),
|
|
179
|
+
children: Object.keys(navigationTypeMap).map(key => /*#__PURE__*/_jsxs(MenuItem, {
|
|
180
|
+
value: key,
|
|
181
|
+
children: [navigationTypeMap[key], ` (${getNavigation(key).length})`]
|
|
182
|
+
}))
|
|
183
|
+
}), !isMobile && /*#__PURE__*/_jsx(ButtonGroup, {
|
|
173
184
|
variant: "outlined",
|
|
174
185
|
children: Object.keys(navigationTypeMap).map(key => {
|
|
175
186
|
return /*#__PURE__*/_jsxs(Button, {
|
|
@@ -191,7 +202,7 @@ function ConfigNavigation() {
|
|
|
191
202
|
sx: {
|
|
192
203
|
flexGrow: 1
|
|
193
204
|
},
|
|
194
|
-
children:
|
|
205
|
+
children: t('common.config')
|
|
195
206
|
}), /*#__PURE__*/_jsx(ButtonGroup, {
|
|
196
207
|
variant: "outlined",
|
|
197
208
|
children: /*#__PURE__*/_jsx(LoadingButton, {
|
|
@@ -209,7 +220,7 @@ function ConfigNavigation() {
|
|
|
209
220
|
onClick: () => {
|
|
210
221
|
pageState.showResetConfirm = true;
|
|
211
222
|
},
|
|
212
|
-
children:
|
|
223
|
+
children: t('navigation.action.reset')
|
|
213
224
|
})
|
|
214
225
|
}), /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
215
226
|
variant: "outlined",
|
|
@@ -220,7 +231,7 @@ function ConfigNavigation() {
|
|
|
220
231
|
icon: "mdi:plus"
|
|
221
232
|
}),
|
|
222
233
|
onClick: () => handleAddNavigation(),
|
|
223
|
-
children:
|
|
234
|
+
children: t('navigation.action.new')
|
|
224
235
|
}), /*#__PURE__*/_jsx(LoadingButton, {
|
|
225
236
|
size: "small",
|
|
226
237
|
variant: "contained",
|
|
@@ -230,7 +241,7 @@ function ConfigNavigation() {
|
|
|
230
241
|
loading: pageState.saveLoading,
|
|
231
242
|
loadingPosition: "start",
|
|
232
243
|
onClick: handleSaveNavigation,
|
|
233
|
-
children:
|
|
244
|
+
children: t('common.save')
|
|
234
245
|
})]
|
|
235
246
|
})]
|
|
236
247
|
}), /*#__PURE__*/_jsx(Paper, {
|
|
@@ -278,7 +289,7 @@ function ConfigNavigation() {
|
|
|
278
289
|
sx: {
|
|
279
290
|
flexGrow: 1
|
|
280
291
|
},
|
|
281
|
-
children:
|
|
292
|
+
children: t('common.preview')
|
|
282
293
|
}), /*#__PURE__*/_jsxs(FormControl, {
|
|
283
294
|
sx: {
|
|
284
295
|
m: 1,
|
|
@@ -286,7 +297,7 @@ function ConfigNavigation() {
|
|
|
286
297
|
},
|
|
287
298
|
size: "small",
|
|
288
299
|
children: [/*#__PURE__*/_jsx(InputLabel, {
|
|
289
|
-
children:
|
|
300
|
+
children: t('common.role')
|
|
290
301
|
}), /*#__PURE__*/_jsx(Select, {
|
|
291
302
|
value: pageState.mockRole,
|
|
292
303
|
label: "Role",
|
|
@@ -313,8 +324,21 @@ function ConfigNavigation() {
|
|
|
313
324
|
components: navigationState.components,
|
|
314
325
|
rawNavigations: navigationState.rawNavigation
|
|
315
326
|
}), /*#__PURE__*/_jsx(Confirm, {
|
|
327
|
+
confirmButton: {
|
|
328
|
+
text: t('common.confirm'),
|
|
329
|
+
props: {
|
|
330
|
+
variant: 'contained',
|
|
331
|
+
color: 'error'
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
cancelButton: {
|
|
335
|
+
text: t('common.cancel'),
|
|
336
|
+
props: {
|
|
337
|
+
color: 'primary'
|
|
338
|
+
}
|
|
339
|
+
},
|
|
316
340
|
open: pageState.showResetConfirm,
|
|
317
|
-
title:
|
|
341
|
+
title: t('navigation.action.restConfirmTitle'),
|
|
318
342
|
onConfirm: async () => {
|
|
319
343
|
await handleResetNavigation();
|
|
320
344
|
pageState.showResetConfirm = false;
|
|
@@ -323,7 +347,7 @@ function ConfigNavigation() {
|
|
|
323
347
|
pageState.showResetConfirm = false;
|
|
324
348
|
},
|
|
325
349
|
children: /*#__PURE__*/_jsx("p", {
|
|
326
|
-
children:
|
|
350
|
+
children: t('navigation.action.restConfirmDesc')
|
|
327
351
|
})
|
|
328
352
|
})]
|
|
329
353
|
});
|