@abtnode/ux 1.16.19-beta-ba354e01 → 1.16.19-beta-beb58af7
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/router/add-domain.js +38 -46
- package/es/locales/en.js +8 -4
- package/es/locales/zh.js +8 -4
- package/es/schema-form/index.js +9 -8
- 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/router/add-domain.js +44 -50
- package/lib/locales/en.js +8 -4
- package/lib/locales/zh.js +8 -4
- package/lib/schema-form/index.js +7 -6
- 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
|
|
|
@@ -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',
|
|
@@ -1665,5 +1665,9 @@ module.exports = {
|
|
|
1665
1665
|
},
|
|
1666
1666
|
disbandFederatedLogin: 'Disband federated login',
|
|
1667
1667
|
disbandFederatedLoginDescription: 'After disband federated login, all member site will quit federated login automatically'
|
|
1668
|
+
},
|
|
1669
|
+
optionsOrder: {
|
|
1670
|
+
1: 'Option One',
|
|
1671
|
+
2: 'Option Two'
|
|
1668
1672
|
}
|
|
1669
1673
|
};
|
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: '请填写有效的域名',
|
|
@@ -1669,5 +1669,9 @@ module.exports = {
|
|
|
1669
1669
|
},
|
|
1670
1670
|
disbandFederatedLogin: '解散统一登录',
|
|
1671
1671
|
disbandFederatedLoginDescription: '解散统一登录后,将自动让所有成员站点自动退出统一登录站点群'
|
|
1672
|
+
},
|
|
1673
|
+
optionsOrder: {
|
|
1674
|
+
1: '选择一',
|
|
1675
|
+
2: '选择二'
|
|
1672
1676
|
}
|
|
1673
1677
|
};
|
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({
|
|
@@ -341,6 +341,7 @@ function AddComponentCore(_ref3) {
|
|
|
341
341
|
component.current = {};
|
|
342
342
|
onClose();
|
|
343
343
|
};
|
|
344
|
+
const alreadyInstalled = did => ((blocklet === null || blocklet === void 0 ? void 0 : blocklet.children) || []).some(x => x.meta.did === did);
|
|
344
345
|
const onInstall = async payload => {
|
|
345
346
|
var _component$current2, _component$current3;
|
|
346
347
|
const {
|
|
@@ -538,7 +539,7 @@ function AddComponentCore(_ref3) {
|
|
|
538
539
|
} = meta;
|
|
539
540
|
|
|
540
541
|
// deleted history list
|
|
541
|
-
const
|
|
542
|
+
const deletedList = (((_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.children) || []).filter(x => x.status === 'deleted' && x.meta.bundleDid === bundleDid);
|
|
542
543
|
const componentDid = componentDidValue || '';
|
|
543
544
|
const newConfigs = (_meta$environments = meta.environments) === null || _meta$environments === void 0 ? void 0 : _meta$environments.map(item => {
|
|
544
545
|
const {
|
|
@@ -623,20 +624,27 @@ function AddComponentCore(_ref3) {
|
|
|
623
624
|
const hasRootPath = blocklet.children.some(x => x.mountPoint === '/');
|
|
624
625
|
|
|
625
626
|
// use deleted history
|
|
626
|
-
const
|
|
627
|
-
|
|
627
|
+
const deletedConfig = deletedList.find(x => x.meta.bundleDid === bundleDid);
|
|
628
|
+
const installedConfig = blocklet.children.find(x => x.meta.bundleDid === bundleDid);
|
|
629
|
+
doc.title = title || '';
|
|
630
|
+
if (deletedConfig) {
|
|
628
631
|
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
629
|
-
pathPrefix:
|
|
630
|
-
|
|
631
|
-
componentName: config.meta.name,
|
|
632
|
+
pathPrefix: deletedConfig.mountPoint || '',
|
|
633
|
+
componentName: deletedConfig.meta.name,
|
|
632
634
|
// use history's environments
|
|
633
635
|
hasEnvironmentsStep: false
|
|
634
636
|
});
|
|
637
|
+
} else if (installedConfig) {
|
|
638
|
+
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
639
|
+
pathPrefix: installedConfig.mountPoint || '',
|
|
640
|
+
componentName: installedConfig.meta.name,
|
|
641
|
+
// use current's environments
|
|
642
|
+
hasEnvironmentsStep: false
|
|
643
|
+
});
|
|
635
644
|
} else {
|
|
636
645
|
var _component$current$me, _component$current$me2;
|
|
637
646
|
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
638
647
|
pathPrefix: hasRootPath ? "/".concat((0, _urlPathFriendly.default)(title) || (0, _urlPathFriendly.default)(name)) : '/',
|
|
639
|
-
title: title || '',
|
|
640
648
|
componentName: '',
|
|
641
649
|
hasEnvironmentsStep: ((_component$current$me = component.current.meta) === null || _component$current$me === void 0 ? void 0 : (_component$current$me2 = _component$current$me.environments) === null || _component$current$me2 === void 0 ? void 0 : _component$current$me2.length) > 0
|
|
642
650
|
});
|
|
@@ -861,7 +869,7 @@ function AddComponentCore(_ref3) {
|
|
|
861
869
|
onCancel: () => {
|
|
862
870
|
_onCancel();
|
|
863
871
|
}
|
|
864
|
-
}, (0, _util.hasStartEngine)(meta) && {
|
|
872
|
+
}, (0, _util.hasStartEngine)(meta) && !alreadyInstalled(meta.did) && {
|
|
865
873
|
key: 'config',
|
|
866
874
|
name: t('common.config'),
|
|
867
875
|
error,
|
|
@@ -909,7 +917,7 @@ function AddComponentCore(_ref3) {
|
|
|
909
917
|
onConfirm: () => {
|
|
910
918
|
_onNext();
|
|
911
919
|
}
|
|
912
|
-
}, meta && (params === null || params === void 0 ? void 0 : params.hasEnvironmentsStep) && {
|
|
920
|
+
}, meta && !alreadyInstalled(meta.did) && (params === null || params === void 0 ? void 0 : params.hasEnvironmentsStep) && {
|
|
913
921
|
key: 'environment',
|
|
914
922
|
name: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
915
923
|
children: [t('common.environment'), " ", params.hasRequiredEnvironments && /*#__PURE__*/(0, _jsxRuntime.jsx)(_required.default, {})]
|
|
@@ -955,7 +963,7 @@ function AddComponentCore(_ref3) {
|
|
|
955
963
|
confirm: t('common.next'),
|
|
956
964
|
onCancel: _onCancel,
|
|
957
965
|
onConfirm: _onNext
|
|
958
|
-
}, meta && (params === null || params === void 0 ? void 0 : params.didSpaceCapability) && {
|
|
966
|
+
}, meta && !alreadyInstalled(meta.did) && (params === null || params === void 0 ? void 0 : params.didSpaceCapability) && {
|
|
959
967
|
key: 'didSpace',
|
|
960
968
|
name: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
961
969
|
children: [t('blocklet.component.didSpaceConfig'), " ", params.didSpaceCapability === 'required' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_required.default, {})]
|
|
@@ -995,7 +1003,7 @@ function AddComponentCore(_ref3) {
|
|
|
995
1003
|
onConfirm: _onNext
|
|
996
1004
|
}, {
|
|
997
1005
|
key: 'install',
|
|
998
|
-
name: t('common.install'),
|
|
1006
|
+
name: alreadyInstalled(meta === null || meta === void 0 ? void 0 : meta.did) ? t('common.upgrade') : t('common.install'),
|
|
999
1007
|
disabled: false,
|
|
1000
1008
|
loading: false,
|
|
1001
1009
|
body: /*#__PURE__*/(0, _jsxRuntime.jsx)(TypographyWrapper, {
|
|
@@ -74,13 +74,20 @@ function DomainListWithPermission(props) {
|
|
|
74
74
|
loadingRuntimeInfo: loadingRuntimeInfo
|
|
75
75
|
}));
|
|
76
76
|
}
|
|
77
|
+
DomainListWithPermission.propTypes = {
|
|
78
|
+
listOnly: _propTypes.default.bool
|
|
79
|
+
};
|
|
80
|
+
DomainListWithPermission.defaultProps = {
|
|
81
|
+
listOnly: false
|
|
82
|
+
};
|
|
77
83
|
function DomainList(_ref) {
|
|
78
84
|
var _blocklet$site2, _blocklet$environment, _blocklet$environment2, _blocklet$meta;
|
|
79
85
|
let {
|
|
80
86
|
hasPermission,
|
|
81
87
|
blocklet,
|
|
82
88
|
loadingRuntimeInfo,
|
|
83
|
-
inService
|
|
89
|
+
inService,
|
|
90
|
+
listOnly
|
|
84
91
|
} = _ref;
|
|
85
92
|
const {
|
|
86
93
|
t
|
|
@@ -115,49 +122,51 @@ function DomainList(_ref) {
|
|
|
115
122
|
}
|
|
116
123
|
});
|
|
117
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
118
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
children:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
marginLeft: 16
|
|
139
|
-
},
|
|
140
|
-
variant: "contained",
|
|
141
|
-
color: "primary",
|
|
142
|
-
"data-cy": "add-domain-alias",
|
|
143
|
-
onClick: open,
|
|
144
|
-
disabled: (0, _util.isInProgress)(blocklet.status),
|
|
145
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Add.default, {
|
|
125
|
+
children: [!listOnly && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
127
|
+
className: "title first",
|
|
128
|
+
display: "flex",
|
|
129
|
+
justifyContent: "space-between",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
132
|
+
children: t('common.domain')
|
|
133
|
+
}), hasMutatePermission && /*#__PURE__*/(0, _jsxRuntime.jsx)(_addDomainAlias.default, {
|
|
134
|
+
id: site.id,
|
|
135
|
+
title: t('router.domain.add.title'),
|
|
136
|
+
teamDid: (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did,
|
|
137
|
+
appId: blocklet.appPid,
|
|
138
|
+
appPk: appPk,
|
|
139
|
+
systemDomains: systemDomains === null || systemDomains === void 0 ? void 0 : systemDomains.map(x => x.value),
|
|
140
|
+
children: _ref2 => {
|
|
141
|
+
let {
|
|
142
|
+
open
|
|
143
|
+
} = _ref2;
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
146
145
|
style: {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
marginLeft: 16
|
|
147
|
+
},
|
|
148
|
+
variant: "contained",
|
|
149
|
+
color: "primary",
|
|
150
|
+
"data-cy": "add-domain-alias",
|
|
151
|
+
onClick: open,
|
|
152
|
+
disabled: (0, _util.isInProgress)(blocklet.status),
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Add.default, {
|
|
154
|
+
style: {
|
|
155
|
+
fontSize: '1.3em',
|
|
156
|
+
marginRight: 4
|
|
157
|
+
}
|
|
158
|
+
}), t('common.add')]
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
})]
|
|
162
|
+
}), (0, _util.isAccessible)(blocklet.status) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
163
|
+
mt: 1.5,
|
|
164
|
+
mb: 1.5,
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
166
|
+
severity: "warning",
|
|
167
|
+
children: t('blocklet.router.noRunning')
|
|
168
|
+
})
|
|
153
169
|
})]
|
|
154
|
-
}), (0, _util.isAccessible)(blocklet.status) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
155
|
-
mt: 1.5,
|
|
156
|
-
mb: 1.5,
|
|
157
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
158
|
-
severity: "warning",
|
|
159
|
-
children: t('blocklet.router.noRunning')
|
|
160
|
-
})
|
|
161
170
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
162
171
|
sx: {
|
|
163
172
|
display: 'flex',
|
|
@@ -272,11 +281,13 @@ DomainList.propTypes = {
|
|
|
272
281
|
hasPermission: _propTypes.default.bool,
|
|
273
282
|
blocklet: _propTypes.default.object.isRequired,
|
|
274
283
|
loadingRuntimeInfo: _propTypes.default.bool,
|
|
275
|
-
inService: _propTypes.default.bool.isRequired
|
|
284
|
+
inService: _propTypes.default.bool.isRequired,
|
|
285
|
+
listOnly: _propTypes.default.bool
|
|
276
286
|
};
|
|
277
287
|
DomainList.defaultProps = {
|
|
278
288
|
hasPermission: false,
|
|
279
|
-
loadingRuntimeInfo: false
|
|
289
|
+
loadingRuntimeInfo: false,
|
|
290
|
+
listOnly: false
|
|
280
291
|
};
|
|
281
292
|
function DomainLink(_ref3) {
|
|
282
293
|
let {
|
|
@@ -93,14 +93,16 @@ function ComponentEnvironment(_ref) {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
data.custom = true;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
try {
|
|
97
|
+
const result = await node.api.configBlocklet({
|
|
98
|
+
input: {
|
|
99
|
+
did: dids,
|
|
100
|
+
configs: [data]
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
103
|
onConfigChanged(result.blocklet);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
_Toast.default.error((0, _util2.formatError)(err));
|
|
104
106
|
}
|
|
105
107
|
};
|
|
106
108
|
const onEditConfig = async (newData, oldData) => {
|
|
@@ -138,9 +140,7 @@ function ComponentEnvironment(_ref) {
|
|
|
138
140
|
configs
|
|
139
141
|
}
|
|
140
142
|
});
|
|
141
|
-
|
|
142
|
-
onConfigChanged(result.blocklet);
|
|
143
|
-
}
|
|
143
|
+
onConfigChanged(result.blocklet);
|
|
144
144
|
} catch (err) {
|
|
145
145
|
_Toast.default.error((0, _util2.formatError)(err));
|
|
146
146
|
}
|
|
@@ -154,17 +154,19 @@ function ComponentEnvironment(_ref) {
|
|
|
154
154
|
_Toast.default.error('Only key of custom env can be changed');
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
try {
|
|
158
|
+
const result = await node.api.configBlocklet({
|
|
159
|
+
input: {
|
|
160
|
+
did: dids,
|
|
161
|
+
configs: [{
|
|
162
|
+
key: data.key,
|
|
163
|
+
custom: true
|
|
164
|
+
}]
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
167
|
onConfigChanged(result.blocklet);
|
|
168
|
+
} catch (err) {
|
|
169
|
+
_Toast.default.error((0, _util2.formatError)(err));
|
|
168
170
|
}
|
|
169
171
|
};
|
|
170
172
|
|
|
@@ -5,16 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = AddDomain;
|
|
7
7
|
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
8
|
+
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
8
9
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
9
|
-
var _Diamond = _interopRequireDefault(require("@mui/icons-material/Diamond"));
|
|
10
|
-
var _Edit = _interopRequireDefault(require("@mui/icons-material/Edit"));
|
|
11
10
|
var _OpenInNew = _interopRequireDefault(require("@mui/icons-material/OpenInNew"));
|
|
12
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
-
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
14
12
|
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
15
13
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
16
|
-
var _useTheme = _interopRequireDefault(require("@mui/material/styles/useTheme"));
|
|
17
14
|
var _noop = _interopRequireDefault(require("lodash/noop"));
|
|
15
|
+
var _trim = _interopRequireDefault(require("lodash/trim"));
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
17
|
var _useSetState = _interopRequireDefault(require("react-use/lib/useSetState"));
|
|
20
18
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
@@ -25,7 +23,7 @@ var _api = require("../../util/api");
|
|
|
25
23
|
var _dnsTip = _interopRequireDefault(require("./dns-tip"));
|
|
26
24
|
var _util3 = require("./util");
|
|
27
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
const _excluded = ["siteId", "teamDid", "cnameDomain", "defaultCustomDomain", "onInputDomain", "appId", "appPk", "onSuccess"];
|
|
26
|
+
const _excluded = ["siteId", "teamDid", "cnameDomain", "defaultCustomDomain", "onInputDomain", "appId", "appPk", "onSuccess", "disabled", "autoFocus"];
|
|
29
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
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; }
|
|
31
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; }
|
|
@@ -35,7 +33,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
35
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
36
34
|
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; }
|
|
37
35
|
function AddDomain(_ref) {
|
|
38
|
-
var _domainTypes$state$ty;
|
|
39
36
|
let {
|
|
40
37
|
siteId,
|
|
41
38
|
teamDid,
|
|
@@ -44,10 +41,11 @@ function AddDomain(_ref) {
|
|
|
44
41
|
onInputDomain,
|
|
45
42
|
appId,
|
|
46
43
|
appPk,
|
|
47
|
-
onSuccess
|
|
44
|
+
onSuccess,
|
|
45
|
+
disabled,
|
|
46
|
+
autoFocus
|
|
48
47
|
} = _ref,
|
|
49
48
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
-
const theme = (0, _useTheme.default)();
|
|
51
49
|
const {
|
|
52
50
|
t,
|
|
53
51
|
locale
|
|
@@ -101,23 +99,19 @@ function AddDomain(_ref) {
|
|
|
101
99
|
const domainTypes = {
|
|
102
100
|
inputDomain: {
|
|
103
101
|
name: t('router.domainAlias.inputDomain'),
|
|
104
|
-
|
|
105
|
-
component: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
102
|
+
component: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
106
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
|
107
|
-
style: {
|
|
108
|
-
marginTop: '8px'
|
|
109
|
-
},
|
|
110
104
|
label: t('router.domainAlias.add.domainDescription'),
|
|
111
105
|
helperText: state.error || t('router.domainAlias.add.helperText'),
|
|
112
106
|
inputProps: {
|
|
113
107
|
'data-cy': 'domain-name-input'
|
|
114
108
|
},
|
|
115
109
|
fullWidth: true,
|
|
110
|
+
disabled: disabled,
|
|
116
111
|
value: state.domain,
|
|
117
112
|
onChange: e => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
} = e.target;
|
|
113
|
+
var _e$target;
|
|
114
|
+
const value = (0, _trim.default)((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
121
115
|
setState({
|
|
122
116
|
domain: value
|
|
123
117
|
});
|
|
@@ -131,7 +125,14 @@ function AddDomain(_ref) {
|
|
|
131
125
|
error: errMessage
|
|
132
126
|
});
|
|
133
127
|
},
|
|
134
|
-
autoFocus:
|
|
128
|
+
autoFocus: autoFocus,
|
|
129
|
+
onBlur: () => {
|
|
130
|
+
if (!state.domain) {
|
|
131
|
+
setState({
|
|
132
|
+
error: null
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
},
|
|
135
136
|
size: "small",
|
|
136
137
|
variant: "outlined",
|
|
137
138
|
error: !!state.error
|
|
@@ -148,11 +149,7 @@ function AddDomain(_ref) {
|
|
|
148
149
|
if (info !== null && info !== void 0 && info.nftDomainUrl) {
|
|
149
150
|
domainTypes.nftDomain = {
|
|
150
151
|
name: t('router.domainAlias.nftDomain'),
|
|
151
|
-
|
|
152
|
-
component: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
153
|
-
sx: {
|
|
154
|
-
marginTop: '12px'
|
|
155
|
-
},
|
|
152
|
+
component: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
156
153
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
157
154
|
sx: {
|
|
158
155
|
maxWidth: '640px',
|
|
@@ -181,6 +178,7 @@ function AddDomain(_ref) {
|
|
|
181
178
|
sx: {
|
|
182
179
|
marginTop: '8px'
|
|
183
180
|
},
|
|
181
|
+
disabled: disabled,
|
|
184
182
|
onClick: () => setState({
|
|
185
183
|
showNFTDomainAuth: true
|
|
186
184
|
}),
|
|
@@ -223,36 +221,28 @@ function AddDomain(_ref) {
|
|
|
223
221
|
}
|
|
224
222
|
return -1;
|
|
225
223
|
});
|
|
226
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
227
|
-
children:
|
|
224
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
225
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
228
226
|
sx: {
|
|
229
227
|
display: 'flex',
|
|
228
|
+
flexDirection: 'column',
|
|
230
229
|
justifyContent: 'flex-start',
|
|
231
|
-
gap: '
|
|
230
|
+
gap: '1em'
|
|
232
231
|
},
|
|
233
|
-
children: inputDomainTypes.map(type
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
onClick: () => setState({
|
|
248
|
-
type
|
|
249
|
-
}),
|
|
250
|
-
children: [domainTypes[type].icon, domainTypes[type].name]
|
|
251
|
-
}, type))
|
|
252
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
253
|
-
marginTop: "12px",
|
|
254
|
-
children: (_domainTypes$state$ty = domainTypes[state.type]) === null || _domainTypes$state$ty === void 0 ? void 0 : _domainTypes$state$ty.component
|
|
255
|
-
})]
|
|
232
|
+
children: inputDomainTypes.map((type, index) => {
|
|
233
|
+
var _domainTypes$type, _domainTypes$type2;
|
|
234
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
235
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
236
|
+
children: "".concat(t("optionsOrder.".concat(index + 1)), ": ").concat((_domainTypes$type = domainTypes[type]) === null || _domainTypes$type === void 0 ? void 0 : _domainTypes$type.name)
|
|
237
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
238
|
+
sx: {
|
|
239
|
+
marginTop: '8px'
|
|
240
|
+
},
|
|
241
|
+
children: (_domainTypes$type2 = domainTypes[type]) === null || _domainTypes$type2 === void 0 ? void 0 : _domainTypes$type2.component
|
|
242
|
+
})]
|
|
243
|
+
}, type);
|
|
244
|
+
})
|
|
245
|
+
})
|
|
256
246
|
}));
|
|
257
247
|
}
|
|
258
248
|
AddDomain.propTypes = {
|
|
@@ -263,12 +253,16 @@ AddDomain.propTypes = {
|
|
|
263
253
|
onInputDomain: _propTypes.default.func,
|
|
264
254
|
onSuccess: _propTypes.default.func,
|
|
265
255
|
appId: _propTypes.default.string,
|
|
266
|
-
appPk: _propTypes.default.string
|
|
256
|
+
appPk: _propTypes.default.string,
|
|
257
|
+
disabled: _propTypes.default.bool,
|
|
258
|
+
autoFocus: _propTypes.default.bool
|
|
267
259
|
};
|
|
268
260
|
AddDomain.defaultProps = {
|
|
269
261
|
defaultCustomDomain: '',
|
|
270
262
|
onInputDomain: _noop.default,
|
|
271
263
|
onSuccess: _noop.default,
|
|
272
264
|
appId: '',
|
|
273
|
-
appPk: ''
|
|
265
|
+
appPk: '',
|
|
266
|
+
disabled: false,
|
|
267
|
+
autoFocus: true
|
|
274
268
|
};
|
package/lib/locales/en.js
CHANGED
|
@@ -924,8 +924,8 @@ module.exports = {
|
|
|
924
924
|
recordValue: 'Record Value'
|
|
925
925
|
},
|
|
926
926
|
verify: {
|
|
927
|
-
ok: '
|
|
928
|
-
notResolved: 'This
|
|
927
|
+
ok: 'The domain resolution is normal',
|
|
928
|
+
notResolved: 'This domain neither resolved nor accessible, please check your DNS configuration'
|
|
929
929
|
},
|
|
930
930
|
https: {
|
|
931
931
|
ok: 'This domain has https enabled',
|
|
@@ -938,8 +938,8 @@ module.exports = {
|
|
|
938
938
|
}
|
|
939
939
|
},
|
|
940
940
|
domainAlias: {
|
|
941
|
-
inputDomain: '
|
|
942
|
-
nftDomain: '
|
|
941
|
+
inputDomain: 'Manually config domain',
|
|
942
|
+
nftDomain: 'Automatic config with DID Domain',
|
|
943
943
|
add: {
|
|
944
944
|
title: 'Add Additional Domain',
|
|
945
945
|
domainDescription: 'Please provide a valid domain name',
|
|
@@ -1667,5 +1667,9 @@ module.exports = {
|
|
|
1667
1667
|
},
|
|
1668
1668
|
disbandFederatedLogin: 'Disband federated login',
|
|
1669
1669
|
disbandFederatedLoginDescription: 'After disband federated login, all member site will quit federated login automatically'
|
|
1670
|
+
},
|
|
1671
|
+
optionsOrder: {
|
|
1672
|
+
1: 'Option One',
|
|
1673
|
+
2: 'Option Two'
|
|
1670
1674
|
}
|
|
1671
1675
|
};
|
package/lib/locales/zh.js
CHANGED
|
@@ -927,8 +927,8 @@ module.exports = {
|
|
|
927
927
|
recordValue: '记录值'
|
|
928
928
|
},
|
|
929
929
|
verify: {
|
|
930
|
-
ok: '
|
|
931
|
-
notResolved: '
|
|
930
|
+
ok: '该域名解析正常',
|
|
931
|
+
notResolved: '该域名解析异常,请检查你域名服务商的 DNS 配置'
|
|
932
932
|
},
|
|
933
933
|
https: {
|
|
934
934
|
ok: '该域名已启用 HTTPS',
|
|
@@ -941,8 +941,8 @@ module.exports = {
|
|
|
941
941
|
}
|
|
942
942
|
},
|
|
943
943
|
domainAlias: {
|
|
944
|
-
inputDomain: '
|
|
945
|
-
nftDomain: '
|
|
944
|
+
inputDomain: '手动配置域名',
|
|
945
|
+
nftDomain: '通过 DID Domain 自动配置域名',
|
|
946
946
|
add: {
|
|
947
947
|
title: '添加额外域名',
|
|
948
948
|
domainDescription: '请填写有效的域名',
|
|
@@ -1671,5 +1671,9 @@ module.exports = {
|
|
|
1671
1671
|
},
|
|
1672
1672
|
disbandFederatedLogin: '解散统一登录',
|
|
1673
1673
|
disbandFederatedLoginDescription: '解散统一登录后,将自动让所有成员站点自动退出统一登录站点群'
|
|
1674
|
+
},
|
|
1675
|
+
optionsOrder: {
|
|
1676
|
+
1: '选择一',
|
|
1677
|
+
2: '选择二'
|
|
1674
1678
|
}
|
|
1675
1679
|
};
|
package/lib/schema-form/index.js
CHANGED
|
@@ -28,6 +28,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
28
28
|
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; }
|
|
29
29
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
30
|
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); }
|
|
31
|
+
const componentMap = {
|
|
32
|
+
input: _textInput.default,
|
|
33
|
+
color: _colorInput.default,
|
|
34
|
+
passport: _passportInput.default,
|
|
35
|
+
uploader: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_logoUploader.default, _objectSpread({}, props.componentProps))
|
|
36
|
+
};
|
|
31
37
|
function getComponent(item, _ref) {
|
|
32
38
|
let {
|
|
33
39
|
editing = false
|
|
@@ -37,6 +43,7 @@ function getComponent(item, _ref) {
|
|
|
37
43
|
render,
|
|
38
44
|
renderFormItem
|
|
39
45
|
} = item;
|
|
46
|
+
|
|
40
47
|
// if provided renderItem and editing is true, use it
|
|
41
48
|
if (editing && renderFormItem) {
|
|
42
49
|
return renderFormItem;
|
|
@@ -46,12 +53,6 @@ function getComponent(item, _ref) {
|
|
|
46
53
|
if (!editing && render) {
|
|
47
54
|
return render;
|
|
48
55
|
}
|
|
49
|
-
const componentMap = {
|
|
50
|
-
input: _textInput.default,
|
|
51
|
-
color: _colorInput.default,
|
|
52
|
-
passport: _passportInput.default,
|
|
53
|
-
uploader: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_logoUploader.default, _objectSpread({}, props.componentProps))
|
|
54
|
-
};
|
|
55
56
|
return componentMap[componentType === null || componentType === void 0 ? void 0 : componentType.toLowerCase()];
|
|
56
57
|
}
|
|
57
58
|
function SchemaForm(_ref2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.19-beta-
|
|
3
|
+
"version": "1.16.19-beta-beb58af7",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,23 +27,23 @@
|
|
|
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.19-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.19-beta-
|
|
32
|
-
"@abtnode/util": "1.16.19-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.19-beta-beb58af7",
|
|
31
|
+
"@abtnode/constant": "1.16.19-beta-beb58af7",
|
|
32
|
+
"@abtnode/util": "1.16.19-beta-beb58af7",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
|
-
"@arcblock/did": "^1.18.
|
|
35
|
-
"@arcblock/did-connect": "^2.8.
|
|
34
|
+
"@arcblock/did": "^1.18.101",
|
|
35
|
+
"@arcblock/did-connect": "^2.8.17",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.8.
|
|
38
|
-
"@arcblock/nft-display": "2.8.
|
|
39
|
-
"@arcblock/react-hooks": "^2.8.
|
|
40
|
-
"@arcblock/terminal": "^2.8.
|
|
41
|
-
"@arcblock/ux": "^2.8.
|
|
42
|
-
"@blocklet/constant": "1.16.19-beta-
|
|
43
|
-
"@blocklet/launcher-layout": "2.2.
|
|
37
|
+
"@arcblock/icons": "^2.8.17",
|
|
38
|
+
"@arcblock/nft-display": "2.8.17",
|
|
39
|
+
"@arcblock/react-hooks": "^2.8.17",
|
|
40
|
+
"@arcblock/terminal": "^2.8.17",
|
|
41
|
+
"@arcblock/ux": "^2.8.17",
|
|
42
|
+
"@blocklet/constant": "1.16.19-beta-beb58af7",
|
|
43
|
+
"@blocklet/launcher-layout": "2.2.43",
|
|
44
44
|
"@blocklet/list": "^0.12.53",
|
|
45
|
-
"@blocklet/meta": "1.16.19-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.8.
|
|
45
|
+
"@blocklet/meta": "1.16.19-beta-beb58af7",
|
|
46
|
+
"@blocklet/ui-react": "^2.8.17",
|
|
47
47
|
"@blocklet/uploader": "^0.0.45",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@mui/material": "^5.14.10",
|
|
55
55
|
"@mui/styles": "^5.14.10",
|
|
56
56
|
"@mui/x-date-pickers": "^6.14.0",
|
|
57
|
-
"@ocap/client": "1.18.
|
|
57
|
+
"@ocap/client": "1.18.101",
|
|
58
58
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
59
59
|
"ahooks": "^3.7.1",
|
|
60
60
|
"axios": "^0.27.2",
|
|
@@ -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": "7b56e521b292c57251fc9f35c96dde4957f4c010",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|