@abtnode/ux 1.16.19-beta-630ac853 → 1.16.19-beta-626e4d43
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/component/add-component-core.js +20 -11
- package/es/blocklet/component/domain-list.js +51 -40
- package/es/blocklet/component/environment.js +22 -20
- package/es/blocklet/component/index.js +35 -11
- package/es/blocklet/router/add-domain.js +38 -46
- package/es/locales/en.js +24 -10
- package/es/locales/zh.js +24 -10
- package/es/schema-form/index.js +9 -8
- package/es/subscription.js +33 -22
- package/lib/blocklet/component/add-component-core.js +19 -11
- package/lib/blocklet/component/domain-list.js +55 -44
- package/lib/blocklet/component/environment.js +22 -20
- package/lib/blocklet/component/index.js +25 -12
- package/lib/blocklet/router/add-domain.js +44 -50
- package/lib/locales/en.js +24 -10
- package/lib/locales/zh.js +24 -10
- package/lib/schema-form/index.js +7 -6
- package/lib/subscription.js +37 -26
- package/package.json +17 -17
|
@@ -322,6 +322,7 @@ export default function AddComponentCore({
|
|
|
322
322
|
component.current = {};
|
|
323
323
|
onClose();
|
|
324
324
|
};
|
|
325
|
+
const alreadyInstalled = did => (blocklet?.children || []).some(x => x.meta.did === did);
|
|
325
326
|
const onInstall = async payload => {
|
|
326
327
|
const {
|
|
327
328
|
pathPrefix: mountPoint,
|
|
@@ -522,7 +523,7 @@ export default function AddComponentCore({
|
|
|
522
523
|
} = meta;
|
|
523
524
|
|
|
524
525
|
// deleted history list
|
|
525
|
-
const
|
|
526
|
+
const deletedList = (blocklet.settings?.children || []).filter(x => x.status === 'deleted' && x.meta.bundleDid === bundleDid);
|
|
526
527
|
const componentDid = componentDidValue || '';
|
|
527
528
|
const newConfigs = meta.environments?.map(item => {
|
|
528
529
|
const {
|
|
@@ -613,21 +614,29 @@ export default function AddComponentCore({
|
|
|
613
614
|
const hasRootPath = blocklet.children.some(x => x.mountPoint === '/');
|
|
614
615
|
|
|
615
616
|
// use deleted history
|
|
616
|
-
const
|
|
617
|
-
|
|
617
|
+
const deletedConfig = deletedList.find(x => x.meta.bundleDid === bundleDid);
|
|
618
|
+
const installedConfig = blocklet.children.find(x => x.meta.bundleDid === bundleDid);
|
|
619
|
+
doc.title = title || '';
|
|
620
|
+
if (deletedConfig) {
|
|
618
621
|
doc = {
|
|
619
622
|
...doc,
|
|
620
|
-
pathPrefix:
|
|
621
|
-
|
|
622
|
-
componentName: config.meta.name,
|
|
623
|
+
pathPrefix: deletedConfig.mountPoint || '',
|
|
624
|
+
componentName: deletedConfig.meta.name,
|
|
623
625
|
// use history's environments
|
|
624
626
|
hasEnvironmentsStep: false
|
|
625
627
|
};
|
|
628
|
+
} else if (installedConfig) {
|
|
629
|
+
doc = {
|
|
630
|
+
...doc,
|
|
631
|
+
pathPrefix: installedConfig.mountPoint || '',
|
|
632
|
+
componentName: installedConfig.meta.name,
|
|
633
|
+
// use current's environments
|
|
634
|
+
hasEnvironmentsStep: false
|
|
635
|
+
};
|
|
626
636
|
} else {
|
|
627
637
|
doc = {
|
|
628
638
|
...doc,
|
|
629
639
|
pathPrefix: hasRootPath ? `/${urlPathFriendly(title) || urlPathFriendly(name)}` : '/',
|
|
630
|
-
title: title || '',
|
|
631
640
|
componentName: '',
|
|
632
641
|
hasEnvironmentsStep: component.current.meta?.environments?.length > 0
|
|
633
642
|
};
|
|
@@ -852,7 +861,7 @@ export default function AddComponentCore({
|
|
|
852
861
|
onCancel: () => {
|
|
853
862
|
onCancel();
|
|
854
863
|
}
|
|
855
|
-
}, hasStartEngine(meta) && {
|
|
864
|
+
}, hasStartEngine(meta) && !alreadyInstalled(meta.did) && {
|
|
856
865
|
key: 'config',
|
|
857
866
|
name: t('common.config'),
|
|
858
867
|
error,
|
|
@@ -900,7 +909,7 @@ export default function AddComponentCore({
|
|
|
900
909
|
onConfirm: () => {
|
|
901
910
|
onNext();
|
|
902
911
|
}
|
|
903
|
-
}, meta && params?.hasEnvironmentsStep && {
|
|
912
|
+
}, meta && !alreadyInstalled(meta.did) && params?.hasEnvironmentsStep && {
|
|
904
913
|
key: 'environment',
|
|
905
914
|
name: /*#__PURE__*/_jsxs(_Fragment, {
|
|
906
915
|
children: [t('common.environment'), " ", params.hasRequiredEnvironments && /*#__PURE__*/_jsx(Required, {})]
|
|
@@ -945,7 +954,7 @@ export default function AddComponentCore({
|
|
|
945
954
|
confirm: t('common.next'),
|
|
946
955
|
onCancel,
|
|
947
956
|
onConfirm: onNext
|
|
948
|
-
}, meta && params?.didSpaceCapability && {
|
|
957
|
+
}, meta && !alreadyInstalled(meta.did) && params?.didSpaceCapability && {
|
|
949
958
|
key: 'didSpace',
|
|
950
959
|
name: /*#__PURE__*/_jsxs(_Fragment, {
|
|
951
960
|
children: [t('blocklet.component.didSpaceConfig'), " ", params.didSpaceCapability === 'required' && /*#__PURE__*/_jsx(Required, {})]
|
|
@@ -985,7 +994,7 @@ export default function AddComponentCore({
|
|
|
985
994
|
onConfirm: onNext
|
|
986
995
|
}, {
|
|
987
996
|
key: 'install',
|
|
988
|
-
name: t('common.install'),
|
|
997
|
+
name: alreadyInstalled(meta?.did) ? t('common.upgrade') : t('common.install'),
|
|
989
998
|
disabled: false,
|
|
990
999
|
loading: false,
|
|
991
1000
|
body: /*#__PURE__*/_jsx(TypographyWrapper, {
|
|
@@ -58,11 +58,18 @@ export default function DomainListWithPermission(props) {
|
|
|
58
58
|
loadingRuntimeInfo: loadingRuntimeInfo
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
+
DomainListWithPermission.propTypes = {
|
|
62
|
+
listOnly: PropTypes.bool
|
|
63
|
+
};
|
|
64
|
+
DomainListWithPermission.defaultProps = {
|
|
65
|
+
listOnly: false
|
|
66
|
+
};
|
|
61
67
|
function DomainList({
|
|
62
68
|
hasPermission,
|
|
63
69
|
blocklet,
|
|
64
70
|
loadingRuntimeInfo,
|
|
65
|
-
inService
|
|
71
|
+
inService,
|
|
72
|
+
listOnly
|
|
66
73
|
}) {
|
|
67
74
|
const {
|
|
68
75
|
t
|
|
@@ -94,46 +101,48 @@ function DomainList({
|
|
|
94
101
|
}
|
|
95
102
|
});
|
|
96
103
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
97
|
-
children: [/*#__PURE__*/_jsxs(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
marginLeft: 16
|
|
116
|
-
},
|
|
117
|
-
variant: "contained",
|
|
118
|
-
color: "primary",
|
|
119
|
-
"data-cy": "add-domain-alias",
|
|
120
|
-
onClick: open,
|
|
121
|
-
disabled: isInProgress(blocklet.status),
|
|
122
|
-
children: [/*#__PURE__*/_jsx(AddIcon, {
|
|
104
|
+
children: [!listOnly && /*#__PURE__*/_jsxs(_Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
106
|
+
className: "title first",
|
|
107
|
+
display: "flex",
|
|
108
|
+
justifyContent: "space-between",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
111
|
+
children: t('common.domain')
|
|
112
|
+
}), hasMutatePermission && /*#__PURE__*/_jsx(AddDomainAlias, {
|
|
113
|
+
id: site.id,
|
|
114
|
+
title: t('router.domain.add.title'),
|
|
115
|
+
teamDid: blocklet.meta?.did,
|
|
116
|
+
appId: blocklet.appPid,
|
|
117
|
+
appPk: appPk,
|
|
118
|
+
systemDomains: systemDomains?.map(x => x.value),
|
|
119
|
+
children: ({
|
|
120
|
+
open
|
|
121
|
+
}) => /*#__PURE__*/_jsxs(Button, {
|
|
123
122
|
style: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
marginLeft: 16
|
|
124
|
+
},
|
|
125
|
+
variant: "contained",
|
|
126
|
+
color: "primary",
|
|
127
|
+
"data-cy": "add-domain-alias",
|
|
128
|
+
onClick: open,
|
|
129
|
+
disabled: isInProgress(blocklet.status),
|
|
130
|
+
children: [/*#__PURE__*/_jsx(AddIcon, {
|
|
131
|
+
style: {
|
|
132
|
+
fontSize: '1.3em',
|
|
133
|
+
marginRight: 4
|
|
134
|
+
}
|
|
135
|
+
}), t('common.add')]
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
}), isAccessible(blocklet.status) === false && /*#__PURE__*/_jsx(Box, {
|
|
139
|
+
mt: 1.5,
|
|
140
|
+
mb: 1.5,
|
|
141
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
142
|
+
severity: "warning",
|
|
143
|
+
children: t('blocklet.router.noRunning')
|
|
128
144
|
})
|
|
129
145
|
})]
|
|
130
|
-
}), isAccessible(blocklet.status) === false && /*#__PURE__*/_jsx(Box, {
|
|
131
|
-
mt: 1.5,
|
|
132
|
-
mb: 1.5,
|
|
133
|
-
children: /*#__PURE__*/_jsx(Alert, {
|
|
134
|
-
severity: "warning",
|
|
135
|
-
children: t('blocklet.router.noRunning')
|
|
136
|
-
})
|
|
137
146
|
}), /*#__PURE__*/_jsx(Box, {
|
|
138
147
|
sx: {
|
|
139
148
|
display: 'flex',
|
|
@@ -248,11 +257,13 @@ DomainList.propTypes = {
|
|
|
248
257
|
hasPermission: PropTypes.bool,
|
|
249
258
|
blocklet: PropTypes.object.isRequired,
|
|
250
259
|
loadingRuntimeInfo: PropTypes.bool,
|
|
251
|
-
inService: PropTypes.bool.isRequired
|
|
260
|
+
inService: PropTypes.bool.isRequired,
|
|
261
|
+
listOnly: PropTypes.bool
|
|
252
262
|
};
|
|
253
263
|
DomainList.defaultProps = {
|
|
254
264
|
hasPermission: false,
|
|
255
|
-
loadingRuntimeInfo: false
|
|
265
|
+
loadingRuntimeInfo: false,
|
|
266
|
+
listOnly: false
|
|
256
267
|
};
|
|
257
268
|
function DomainLink({
|
|
258
269
|
domain,
|
|
@@ -80,14 +80,16 @@ export default function ComponentEnvironment({
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
data.custom = true;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
try {
|
|
84
|
+
const result = await node.api.configBlocklet({
|
|
85
|
+
input: {
|
|
86
|
+
did: dids,
|
|
87
|
+
configs: [data]
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
90
|
onConfigChanged(result.blocklet);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
Toast.error(formatError(err));
|
|
91
93
|
}
|
|
92
94
|
};
|
|
93
95
|
const onEditConfig = async (newData, oldData) => {
|
|
@@ -125,9 +127,7 @@ export default function ComponentEnvironment({
|
|
|
125
127
|
configs
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
|
-
|
|
129
|
-
onConfigChanged(result.blocklet);
|
|
130
|
-
}
|
|
130
|
+
onConfigChanged(result.blocklet);
|
|
131
131
|
} catch (err) {
|
|
132
132
|
Toast.error(formatError(err));
|
|
133
133
|
}
|
|
@@ -141,17 +141,19 @@ export default function ComponentEnvironment({
|
|
|
141
141
|
Toast.error('Only key of custom env can be changed');
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
try {
|
|
145
|
+
const result = await node.api.configBlocklet({
|
|
146
|
+
input: {
|
|
147
|
+
did: dids,
|
|
148
|
+
configs: [{
|
|
149
|
+
key: data.key,
|
|
150
|
+
custom: true
|
|
151
|
+
}]
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
154
|
onConfigChanged(result.blocklet);
|
|
155
|
+
} catch (err) {
|
|
156
|
+
Toast.error(formatError(err));
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
|
|
@@ -276,26 +276,39 @@ function ComponentItem({
|
|
|
276
276
|
ancestors: ancestors
|
|
277
277
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
278
278
|
ml: "16px",
|
|
279
|
-
children: [/*#__PURE__*/
|
|
280
|
-
className: "component-
|
|
279
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
280
|
+
className: "component-header",
|
|
281
281
|
onClick: () => setComponentInfo(blocklet),
|
|
282
|
-
children:
|
|
282
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
283
|
+
className: "component-name",
|
|
284
|
+
children: getDisplayName(blocklet, true)
|
|
285
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
286
|
+
className: "component-version",
|
|
287
|
+
children: blocklet?.meta?.version
|
|
288
|
+
})]
|
|
283
289
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
284
290
|
display: "flex",
|
|
285
291
|
alignItems: "center",
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
sx: {
|
|
293
|
+
mt: '2px',
|
|
294
|
+
ml: -0.5
|
|
295
|
+
},
|
|
296
|
+
children: [status !== 'unknown' && /*#__PURE__*/_jsx(BlockletStatus, {
|
|
289
297
|
style: {
|
|
290
298
|
marginLeft: 4
|
|
291
299
|
},
|
|
292
|
-
|
|
293
|
-
|
|
300
|
+
status: status,
|
|
301
|
+
source: blocklet.source
|
|
302
|
+
}), !hasStartEngine(blocklet.meta) && /*#__PURE__*/_jsx(ResourceType, {
|
|
294
303
|
style: {
|
|
295
304
|
marginLeft: 4
|
|
296
305
|
},
|
|
297
|
-
|
|
298
|
-
|
|
306
|
+
blocklet: blocklet
|
|
307
|
+
}), /*#__PURE__*/_jsx(BlockletMode, {
|
|
308
|
+
style: {
|
|
309
|
+
marginLeft: 4
|
|
310
|
+
},
|
|
311
|
+
mode: blocklet.mode || ''
|
|
299
312
|
}), !!blocklet.dependents?.length && /*#__PURE__*/_jsx(Tooltip, {
|
|
300
313
|
title: [`${t('common.dependents')}: `, blocklet.dependents.map(x => /*#__PURE__*/_jsx(Box, {
|
|
301
314
|
pl: 1,
|
|
@@ -497,10 +510,21 @@ const StyledBadge = styled(Badge)`
|
|
|
497
510
|
}
|
|
498
511
|
`;
|
|
499
512
|
const StyledComponentRow = styled(Box)`
|
|
513
|
+
.component-header {
|
|
514
|
+
display: flex;
|
|
515
|
+
align-items: center;
|
|
516
|
+
align-items: flex-end;
|
|
517
|
+
cursor: pointer;
|
|
518
|
+
}
|
|
500
519
|
.component-name {
|
|
501
520
|
color: #222;
|
|
502
521
|
font-size: 16px;
|
|
503
|
-
|
|
522
|
+
}
|
|
523
|
+
.component-version {
|
|
524
|
+
color: #999;
|
|
525
|
+
font-size: 12px;
|
|
526
|
+
margin-left: 4px;
|
|
527
|
+
transform: translateY(-1px);
|
|
504
528
|
}
|
|
505
529
|
`;
|
|
506
530
|
export default function BlockletComponent({
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import Connect from '@arcblock/did-connect/lib/Connect';
|
|
2
|
+
import Button from '@arcblock/ux/lib/Button';
|
|
2
3
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
3
|
-
import DiamondIcon from '@mui/icons-material/Diamond';
|
|
4
|
-
import EditIcon from '@mui/icons-material/Edit';
|
|
5
4
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
6
5
|
import Box from '@mui/material/Box';
|
|
7
|
-
import Button from '@arcblock/ux/lib/Button';
|
|
8
6
|
import Link from '@mui/material/Link';
|
|
9
7
|
import TextField from '@mui/material/TextField';
|
|
10
|
-
import useTheme from '@mui/material/styles/useTheme';
|
|
11
8
|
import noop from 'lodash/noop';
|
|
9
|
+
import trim from 'lodash/trim';
|
|
12
10
|
import PropTypes from 'prop-types';
|
|
13
11
|
import useSetState from 'react-use/lib/useSetState';
|
|
14
12
|
import joinURL from 'url-join';
|
|
@@ -19,6 +17,7 @@ import { axios } from '../../util/api';
|
|
|
19
17
|
import DNSTip from './dns-tip';
|
|
20
18
|
import { parseDomainFromURL } from './util';
|
|
21
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
22
|
export default function AddDomain({
|
|
24
23
|
siteId,
|
|
@@ -29,9 +28,10 @@ export default function AddDomain({
|
|
|
29
28
|
appId,
|
|
30
29
|
appPk,
|
|
31
30
|
onSuccess,
|
|
31
|
+
disabled,
|
|
32
|
+
autoFocus,
|
|
32
33
|
...props
|
|
33
34
|
}) {
|
|
34
|
-
const theme = useTheme();
|
|
35
35
|
const {
|
|
36
36
|
t,
|
|
37
37
|
locale
|
|
@@ -84,23 +84,18 @@ export default function AddDomain({
|
|
|
84
84
|
const domainTypes = {
|
|
85
85
|
inputDomain: {
|
|
86
86
|
name: t('router.domainAlias.inputDomain'),
|
|
87
|
-
|
|
88
|
-
component: /*#__PURE__*/_jsxs(Box, {
|
|
87
|
+
component: /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
88
|
children: [/*#__PURE__*/_jsx(TextField, {
|
|
90
|
-
style: {
|
|
91
|
-
marginTop: '8px'
|
|
92
|
-
},
|
|
93
89
|
label: t('router.domainAlias.add.domainDescription'),
|
|
94
90
|
helperText: state.error || t('router.domainAlias.add.helperText'),
|
|
95
91
|
inputProps: {
|
|
96
92
|
'data-cy': 'domain-name-input'
|
|
97
93
|
},
|
|
98
94
|
fullWidth: true,
|
|
95
|
+
disabled: disabled,
|
|
99
96
|
value: state.domain,
|
|
100
97
|
onChange: e => {
|
|
101
|
-
const
|
|
102
|
-
value
|
|
103
|
-
} = e.target;
|
|
98
|
+
const value = trim(e.target?.value);
|
|
104
99
|
setState({
|
|
105
100
|
domain: value
|
|
106
101
|
});
|
|
@@ -114,7 +109,14 @@ export default function AddDomain({
|
|
|
114
109
|
error: errMessage
|
|
115
110
|
});
|
|
116
111
|
},
|
|
117
|
-
autoFocus:
|
|
112
|
+
autoFocus: autoFocus,
|
|
113
|
+
onBlur: () => {
|
|
114
|
+
if (!state.domain) {
|
|
115
|
+
setState({
|
|
116
|
+
error: null
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
},
|
|
118
120
|
size: "small",
|
|
119
121
|
variant: "outlined",
|
|
120
122
|
error: !!state.error
|
|
@@ -131,11 +133,7 @@ export default function AddDomain({
|
|
|
131
133
|
if (info?.nftDomainUrl) {
|
|
132
134
|
domainTypes.nftDomain = {
|
|
133
135
|
name: t('router.domainAlias.nftDomain'),
|
|
134
|
-
|
|
135
|
-
component: /*#__PURE__*/_jsxs(Box, {
|
|
136
|
-
sx: {
|
|
137
|
-
marginTop: '12px'
|
|
138
|
-
},
|
|
136
|
+
component: /*#__PURE__*/_jsxs(_Fragment, {
|
|
139
137
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
140
138
|
sx: {
|
|
141
139
|
maxWidth: '640px',
|
|
@@ -164,6 +162,7 @@ export default function AddDomain({
|
|
|
164
162
|
sx: {
|
|
165
163
|
marginTop: '8px'
|
|
166
164
|
},
|
|
165
|
+
disabled: disabled,
|
|
167
166
|
onClick: () => setState({
|
|
168
167
|
showNFTDomainAuth: true
|
|
169
168
|
}),
|
|
@@ -206,37 +205,26 @@ export default function AddDomain({
|
|
|
206
205
|
}
|
|
207
206
|
return -1;
|
|
208
207
|
});
|
|
209
|
-
return /*#__PURE__*/
|
|
208
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
210
209
|
...props,
|
|
211
|
-
children:
|
|
210
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
212
211
|
sx: {
|
|
213
212
|
display: 'flex',
|
|
213
|
+
flexDirection: 'column',
|
|
214
214
|
justifyContent: 'flex-start',
|
|
215
|
-
gap: '
|
|
215
|
+
gap: '1em'
|
|
216
216
|
},
|
|
217
|
-
children: inputDomainTypes.map(type => /*#__PURE__*/_jsxs(Box, {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
justifyContent: 'center',
|
|
227
|
-
alignItems: 'flex-start',
|
|
228
|
-
color: type === state.type ? theme.palette.primary.main : theme.palette.common.main,
|
|
229
|
-
border: `1px solid ${type === state.type ? theme.palette.primary.main : '#E0E0E0'}`
|
|
230
|
-
},
|
|
231
|
-
onClick: () => setState({
|
|
232
|
-
type
|
|
233
|
-
}),
|
|
234
|
-
children: [domainTypes[type].icon, domainTypes[type].name]
|
|
217
|
+
children: inputDomainTypes.map((type, index) => /*#__PURE__*/_jsxs(Box, {
|
|
218
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
219
|
+
children: `${t(`optionsOrder.${index + 1}`)}: ${domainTypes[type]?.name}`
|
|
220
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
221
|
+
sx: {
|
|
222
|
+
marginTop: '8px'
|
|
223
|
+
},
|
|
224
|
+
children: domainTypes[type]?.component
|
|
225
|
+
})]
|
|
235
226
|
}, type))
|
|
236
|
-
})
|
|
237
|
-
marginTop: "12px",
|
|
238
|
-
children: domainTypes[state.type]?.component
|
|
239
|
-
})]
|
|
227
|
+
})
|
|
240
228
|
});
|
|
241
229
|
}
|
|
242
230
|
AddDomain.propTypes = {
|
|
@@ -247,12 +235,16 @@ AddDomain.propTypes = {
|
|
|
247
235
|
onInputDomain: PropTypes.func,
|
|
248
236
|
onSuccess: PropTypes.func,
|
|
249
237
|
appId: PropTypes.string,
|
|
250
|
-
appPk: PropTypes.string
|
|
238
|
+
appPk: PropTypes.string,
|
|
239
|
+
disabled: PropTypes.bool,
|
|
240
|
+
autoFocus: PropTypes.bool
|
|
251
241
|
};
|
|
252
242
|
AddDomain.defaultProps = {
|
|
253
243
|
defaultCustomDomain: '',
|
|
254
244
|
onInputDomain: noop,
|
|
255
245
|
onSuccess: noop,
|
|
256
246
|
appId: '',
|
|
257
|
-
appPk: ''
|
|
247
|
+
appPk: '',
|
|
248
|
+
disabled: false,
|
|
249
|
+
autoFocus: true
|
|
258
250
|
};
|
package/es/locales/en.js
CHANGED
|
@@ -922,8 +922,8 @@ module.exports = {
|
|
|
922
922
|
recordValue: 'Record Value'
|
|
923
923
|
},
|
|
924
924
|
verify: {
|
|
925
|
-
ok: '
|
|
926
|
-
notResolved: 'This
|
|
925
|
+
ok: 'The domain resolution is normal',
|
|
926
|
+
notResolved: 'This domain neither resolved nor accessible, please check your DNS configuration'
|
|
927
927
|
},
|
|
928
928
|
https: {
|
|
929
929
|
ok: 'This domain has https enabled',
|
|
@@ -936,8 +936,8 @@ module.exports = {
|
|
|
936
936
|
}
|
|
937
937
|
},
|
|
938
938
|
domainAlias: {
|
|
939
|
-
inputDomain: '
|
|
940
|
-
nftDomain: '
|
|
939
|
+
inputDomain: 'Manually config domain',
|
|
940
|
+
nftDomain: 'Automatic config with DID Domain',
|
|
941
941
|
add: {
|
|
942
942
|
title: 'Add Additional Domain',
|
|
943
943
|
domainDescription: 'Please provide a valid domain name',
|
|
@@ -1594,13 +1594,23 @@ module.exports = {
|
|
|
1594
1594
|
federated: 'Federated Login'
|
|
1595
1595
|
},
|
|
1596
1596
|
expiration: {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1597
|
+
mobile: {
|
|
1598
|
+
tips: {
|
|
1599
|
+
success: '{validity}',
|
|
1600
|
+
warning: '{validity}',
|
|
1601
|
+
error: 'Expired'
|
|
1602
|
+
},
|
|
1603
|
+
loadFailed: 'Retry!'
|
|
1601
1604
|
},
|
|
1602
|
-
|
|
1603
|
-
|
|
1605
|
+
desktop: {
|
|
1606
|
+
tips: {
|
|
1607
|
+
success: 'Subscription will expire after {validity}',
|
|
1608
|
+
warning: 'Subscription will expire after {validity}',
|
|
1609
|
+
error: 'Subscription Expired'
|
|
1610
|
+
},
|
|
1611
|
+
loading: 'Load subscription...',
|
|
1612
|
+
loadFailed: 'Failed to load subscription info, please retry!'
|
|
1613
|
+
}
|
|
1604
1614
|
},
|
|
1605
1615
|
analytics: {
|
|
1606
1616
|
trend: 'Trends',
|
|
@@ -1665,5 +1675,9 @@ module.exports = {
|
|
|
1665
1675
|
},
|
|
1666
1676
|
disbandFederatedLogin: 'Disband federated login',
|
|
1667
1677
|
disbandFederatedLoginDescription: 'After disband federated login, all member site will quit federated login automatically'
|
|
1678
|
+
},
|
|
1679
|
+
optionsOrder: {
|
|
1680
|
+
1: 'Option One',
|
|
1681
|
+
2: 'Option Two'
|
|
1668
1682
|
}
|
|
1669
1683
|
};
|
package/es/locales/zh.js
CHANGED
|
@@ -925,8 +925,8 @@ module.exports = {
|
|
|
925
925
|
recordValue: '记录值'
|
|
926
926
|
},
|
|
927
927
|
verify: {
|
|
928
|
-
ok: '
|
|
929
|
-
notResolved: '
|
|
928
|
+
ok: '该域名解析正常',
|
|
929
|
+
notResolved: '该域名解析异常,请检查你域名服务商的 DNS 配置'
|
|
930
930
|
},
|
|
931
931
|
https: {
|
|
932
932
|
ok: '该域名已启用 HTTPS',
|
|
@@ -939,8 +939,8 @@ module.exports = {
|
|
|
939
939
|
}
|
|
940
940
|
},
|
|
941
941
|
domainAlias: {
|
|
942
|
-
inputDomain: '
|
|
943
|
-
nftDomain: '
|
|
942
|
+
inputDomain: '手动配置域名',
|
|
943
|
+
nftDomain: '通过 DID Domain 自动配置域名',
|
|
944
944
|
add: {
|
|
945
945
|
title: '添加额外域名',
|
|
946
946
|
domainDescription: '请填写有效的域名',
|
|
@@ -1598,13 +1598,23 @@ module.exports = {
|
|
|
1598
1598
|
federated: '统一登录'
|
|
1599
1599
|
},
|
|
1600
1600
|
expiration: {
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1601
|
+
mobile: {
|
|
1602
|
+
tips: {
|
|
1603
|
+
success: '{validity}',
|
|
1604
|
+
warning: '{validity}',
|
|
1605
|
+
error: '订阅已过期'
|
|
1606
|
+
},
|
|
1607
|
+
loadFailed: '请重试!'
|
|
1605
1608
|
},
|
|
1606
|
-
|
|
1607
|
-
|
|
1609
|
+
desktop: {
|
|
1610
|
+
tips: {
|
|
1611
|
+
success: '订阅将在{validity}后到期',
|
|
1612
|
+
warning: '订阅将在{validity}后到期',
|
|
1613
|
+
error: '订阅已过期'
|
|
1614
|
+
},
|
|
1615
|
+
loadFailed: '加载订阅信息失败,请重试!',
|
|
1616
|
+
loading: '加载订阅信息...'
|
|
1617
|
+
}
|
|
1608
1618
|
},
|
|
1609
1619
|
analytics: {
|
|
1610
1620
|
trend: '趋势',
|
|
@@ -1669,5 +1679,9 @@ module.exports = {
|
|
|
1669
1679
|
},
|
|
1670
1680
|
disbandFederatedLogin: '解散统一登录',
|
|
1671
1681
|
disbandFederatedLoginDescription: '解散统一登录后,将自动让所有成员站点自动退出统一登录站点群'
|
|
1682
|
+
},
|
|
1683
|
+
optionsOrder: {
|
|
1684
|
+
1: '选择一',
|
|
1685
|
+
2: '选择二'
|
|
1672
1686
|
}
|
|
1673
1687
|
};
|
package/es/schema-form/index.js
CHANGED
|
@@ -16,6 +16,14 @@ import Uploader from '../blocklet/logo-uploader';
|
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
const componentMap = {
|
|
20
|
+
input: TextInput,
|
|
21
|
+
color: ColorInput,
|
|
22
|
+
passport: PassportInput,
|
|
23
|
+
uploader: props => /*#__PURE__*/_jsx(Uploader, {
|
|
24
|
+
...props.componentProps
|
|
25
|
+
})
|
|
26
|
+
};
|
|
19
27
|
function getComponent(item, {
|
|
20
28
|
editing = false
|
|
21
29
|
}) {
|
|
@@ -24,6 +32,7 @@ function getComponent(item, {
|
|
|
24
32
|
render,
|
|
25
33
|
renderFormItem
|
|
26
34
|
} = item;
|
|
35
|
+
|
|
27
36
|
// if provided renderItem and editing is true, use it
|
|
28
37
|
if (editing && renderFormItem) {
|
|
29
38
|
return renderFormItem;
|
|
@@ -33,14 +42,6 @@ function getComponent(item, {
|
|
|
33
42
|
if (!editing && render) {
|
|
34
43
|
return render;
|
|
35
44
|
}
|
|
36
|
-
const componentMap = {
|
|
37
|
-
input: TextInput,
|
|
38
|
-
color: ColorInput,
|
|
39
|
-
passport: PassportInput,
|
|
40
|
-
uploader: props => /*#__PURE__*/_jsx(Uploader, {
|
|
41
|
-
...props.componentProps
|
|
42
|
-
})
|
|
43
|
-
};
|
|
44
45
|
return componentMap[componentType?.toLowerCase()];
|
|
45
46
|
}
|
|
46
47
|
export default function SchemaForm({
|