@abtnode/ux 1.16.29-next-680cf137 → 1.16.30-beta-00e8bdd1
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/lib/blocklet/component/blocklet-owner-info.js +35 -0
- package/lib/blocklet/component/component-info-dialog.js +7 -2
- package/lib/blocklet/component/environment.js +16 -6
- package/lib/blocklet/component/index.js +30 -27
- package/lib/blocklet/configuration.js +2 -34
- package/lib/blocklet/disk-info.js +66 -55
- package/lib/blocklet/install-from-url.js +9 -3
- package/lib/blocklet/publish/create-release/blocklets.js +5 -5
- package/lib/blocklet/publish/create-release/branding.js +14 -11
- package/lib/blocklet/publish/create-release/connect-store-button.js +11 -10
- package/lib/blocklet/publish/create-release/header.js +136 -123
- package/lib/blocklet/publish/create-release/index.js +16 -16
- package/lib/blocklet/publish/create-release/project-setting.js +182 -0
- package/lib/blocklet/publish/create-release/resource-select.js +16 -12
- package/lib/blocklet/publish/hooks/use-want-to-connect-store.js +6 -2
- package/lib/blocklet/publish/utils/get-studio-store-list.js +3 -0
- package/lib/blocklet/publish/utils/parse-resource-relate-components.js +31 -0
- package/lib/blocklet/storage/auto-check-update.js +2 -2
- package/lib/blocklet/storage/connected.js +1 -3
- package/lib/blocklet/storage/disconnect.js +1 -7
- package/lib/contexts/blocklet-auto-check-update.js +54 -0
- package/lib/contexts/blocklet-storage.js +0 -19
- package/lib/hooks/blocklet.js +17 -5
- package/lib/locales/ar.js +8 -2
- package/lib/locales/de.js +8 -2
- package/lib/locales/en.js +6 -0
- package/lib/locales/es.js +8 -2
- package/lib/locales/fr.js +8 -2
- package/lib/locales/hi.js +8 -2
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +8 -2
- package/lib/locales/ja.js +8 -2
- package/lib/locales/ko.js +8 -2
- package/lib/locales/pt.js +8 -2
- package/lib/locales/ru.js +8 -2
- package/lib/locales/th.js +8 -2
- package/lib/locales/vi.js +8 -2
- package/lib/locales/zh-tw.js +8 -2
- package/lib/locales/zh.js +8 -2
- package/lib/team/members/invite-member.js +16 -3
- package/lib/team/members/issue-passport.js +17 -2
- package/lib/team/members/member.js +59 -23
- package/lib/util/index.js +0 -14
- package/package.json +20 -20
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import DID from '@arcblock/ux/lib/DID';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default function BlockletOwnerInfo({
|
|
6
|
+
owner,
|
|
7
|
+
locale
|
|
8
|
+
}) {
|
|
9
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
10
|
+
sx: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
gap: 1
|
|
14
|
+
},
|
|
15
|
+
children: [owner.fullName, owner.did ? /*#__PURE__*/_jsx(DID, {
|
|
16
|
+
sx: {
|
|
17
|
+
lineHeight: 'initial',
|
|
18
|
+
'&::before': {
|
|
19
|
+
content: '"("'
|
|
20
|
+
},
|
|
21
|
+
'&::after': {
|
|
22
|
+
content: '")"'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
did: owner.did,
|
|
26
|
+
compact: true,
|
|
27
|
+
size: 14,
|
|
28
|
+
locale: locale
|
|
29
|
+
}) : null]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
BlockletOwnerInfo.propTypes = {
|
|
33
|
+
owner: PropTypes.object.isRequired,
|
|
34
|
+
locale: PropTypes.string.isRequired
|
|
35
|
+
};
|
|
@@ -6,13 +6,15 @@ import { Badge, Box } from '@mui/material';
|
|
|
6
6
|
import InfoRow from '@arcblock/ux/lib/InfoRow';
|
|
7
7
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
8
8
|
import { getDisplayName, hasStartEngine } from '@blocklet/meta/lib/util';
|
|
9
|
+
import { formatPerson } from '@blocklet/meta/lib/fix';
|
|
9
10
|
import { useDeletingBlockletContext } from '../../contexts/deleting-blocklets';
|
|
10
11
|
import Tag from '../../tag';
|
|
11
|
-
import {
|
|
12
|
+
import { formatToDatetime } from '../../util';
|
|
12
13
|
import DidAddress from '../../did-address';
|
|
13
14
|
import BlockletSource from '../blocklet-source';
|
|
14
15
|
import BlockletStatus from '../status';
|
|
15
16
|
import BlockletVersion from '../version';
|
|
17
|
+
import BlockletOwnerInfo from './blocklet-owner-info';
|
|
16
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
19
|
const isResource = component => !component?.meta?.group;
|
|
18
20
|
const getEngineRows = (engine, t) => {
|
|
@@ -171,7 +173,10 @@ export default function ComponentInfoDialog({
|
|
|
171
173
|
})
|
|
172
174
|
}, {
|
|
173
175
|
name: t('common.author'),
|
|
174
|
-
value:
|
|
176
|
+
value: componentInfo.meta.owner ? /*#__PURE__*/_jsx(BlockletOwnerInfo, {
|
|
177
|
+
owner: componentInfo.meta.owner,
|
|
178
|
+
locale: locale
|
|
179
|
+
}) : formatPerson(componentInfo.meta.author)
|
|
175
180
|
}, {
|
|
176
181
|
name: t('common.engine'),
|
|
177
182
|
value: getEngineRows(componentInfo.engine, t).map(({
|
|
@@ -49,6 +49,16 @@ const isCustom = (env, blocklet, ancestors = []) => {
|
|
|
49
49
|
}
|
|
50
50
|
return env.custom;
|
|
51
51
|
};
|
|
52
|
+
const isValidKey = key => {
|
|
53
|
+
if ([BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(key)) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (key.startsWith('BLOCKLET_') || key.startsWith('COMPONENT_')) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
};
|
|
61
|
+
const isCustomKey = key => [BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(key) === false;
|
|
52
62
|
export default function ComponentEnvironment({
|
|
53
63
|
blocklet,
|
|
54
64
|
ancestors
|
|
@@ -74,11 +84,11 @@ export default function ComponentEnvironment({
|
|
|
74
84
|
Toast.error(t('blocklet.config.environment.keyValueRequired'));
|
|
75
85
|
return;
|
|
76
86
|
}
|
|
77
|
-
if (data.key
|
|
87
|
+
if (isValidKey(data.key) === false) {
|
|
78
88
|
Toast.error(t('blocklet.config.environment.invalidKey'));
|
|
79
89
|
return;
|
|
80
90
|
}
|
|
81
|
-
data.custom =
|
|
91
|
+
data.custom = isCustomKey(data.key);
|
|
82
92
|
try {
|
|
83
93
|
const result = await node.api.configBlocklet({
|
|
84
94
|
input: {
|
|
@@ -97,7 +107,7 @@ export default function ComponentEnvironment({
|
|
|
97
107
|
Toast.error(t('blocklet.config.environment.keyValueRequired'));
|
|
98
108
|
return;
|
|
99
109
|
}
|
|
100
|
-
if (newData.key
|
|
110
|
+
if (isValidKey(newData.key) === false) {
|
|
101
111
|
Toast.error(t('blocklet.config.environment.invalidKey'));
|
|
102
112
|
return;
|
|
103
113
|
}
|
|
@@ -119,7 +129,7 @@ export default function ComponentEnvironment({
|
|
|
119
129
|
}
|
|
120
130
|
configs.push({
|
|
121
131
|
key: oldData.key,
|
|
122
|
-
custom:
|
|
132
|
+
custom: isCustomKey(newData.key)
|
|
123
133
|
});
|
|
124
134
|
}
|
|
125
135
|
try {
|
|
@@ -149,7 +159,7 @@ export default function ComponentEnvironment({
|
|
|
149
159
|
did: dids,
|
|
150
160
|
configs: [{
|
|
151
161
|
key: data.key,
|
|
152
|
-
custom:
|
|
162
|
+
custom: isCustomKey(data.key)
|
|
153
163
|
}]
|
|
154
164
|
}
|
|
155
165
|
});
|
|
@@ -160,7 +170,7 @@ export default function ComponentEnvironment({
|
|
|
160
170
|
};
|
|
161
171
|
|
|
162
172
|
// configs
|
|
163
|
-
const componentConfigs = (blocklet.configs || []).filter(x => !BLOCKLET_CONFIGURABLE_KEY[x.key]);
|
|
173
|
+
const componentConfigs = (blocklet.configs || []).filter(x => !BLOCKLET_CONFIGURABLE_KEY[x.key] || [BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(x.key));
|
|
164
174
|
const sharedConfigObj = getSharedConfigObj(ancestors[0], blocklet);
|
|
165
175
|
const missingRequiredConfigs = getComponentMissingConfigs(blocklet, ancestors[0]);
|
|
166
176
|
const configs = componentConfigs.map(x => ({
|
|
@@ -37,6 +37,7 @@ import ComponentCell, { StyledBadge, StyledComponentRow } from './component-cell
|
|
|
37
37
|
import OptionalComponentCell from './optional-component-cell';
|
|
38
38
|
import AddComponentDialog from './add-component/add-component-dialog';
|
|
39
39
|
import Actions from '../../actions';
|
|
40
|
+
import { BlockletAutoCheckUpdateProvider } from '../../contexts/blocklet-auto-check-update';
|
|
40
41
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
41
42
|
export default function BlockletComponent({
|
|
42
43
|
blocklet,
|
|
@@ -248,33 +249,35 @@ export default function BlockletComponent({
|
|
|
248
249
|
children: [components?.length ? `${t('common.components')} (${components.length})` : `${t('common.components')}`, !needMigration && /*#__PURE__*/_jsx(Permission, {
|
|
249
250
|
permission: inService ? '' : 'mutate_blocklets',
|
|
250
251
|
role: inService ? BlockletAdminRoles : [],
|
|
251
|
-
children: /*#__PURE__*/_jsx(
|
|
252
|
-
children: /*#__PURE__*/_jsx(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
252
|
+
children: /*#__PURE__*/_jsx(BlockletAutoCheckUpdateProvider, {
|
|
253
|
+
children: /*#__PURE__*/_jsx(AutoCheckUpdate, {
|
|
254
|
+
children: /*#__PURE__*/_jsx(StyledBadge, {
|
|
255
|
+
top: 1.2,
|
|
256
|
+
right: 0.4,
|
|
257
|
+
color: "error",
|
|
258
|
+
badgeContent: "",
|
|
259
|
+
variant: "dot",
|
|
260
|
+
invisible: !showUpdateDot,
|
|
261
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
262
|
+
disabled: loading || isInProgress(blocklet.status),
|
|
263
|
+
color: "secondary",
|
|
264
|
+
onClick: () => {
|
|
265
|
+
checkForUpdates();
|
|
266
|
+
},
|
|
267
|
+
"data-cy": "check-for-updates",
|
|
268
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
269
|
+
ml: 0.5,
|
|
270
|
+
mr: 0.5,
|
|
271
|
+
display: "flex",
|
|
272
|
+
children: loading ? /*#__PURE__*/_jsx(Spinner, {
|
|
273
|
+
size: 16
|
|
274
|
+
}) : /*#__PURE__*/_jsx(UpdateIcon, {
|
|
275
|
+
style: {
|
|
276
|
+
fontSize: '1em'
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
}), t('blocklet.component.checkUpdateTitle')]
|
|
280
|
+
})
|
|
278
281
|
})
|
|
279
282
|
})
|
|
280
283
|
})
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useContext } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import get from 'lodash/get';
|
|
5
4
|
import isEqual from 'lodash/isEqual';
|
|
6
5
|
import Box from '@mui/material/Box';
|
|
7
6
|
import Switch from '@mui/material/Switch';
|
|
@@ -9,14 +8,13 @@ import Divider from '@mui/material/Divider';
|
|
|
9
8
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
10
9
|
import Button from '@arcblock/ux/lib/Button';
|
|
11
10
|
import LoopIcon from '@mui/icons-material/Loop';
|
|
12
|
-
import { EVENTS } from '@abtnode/constant';
|
|
13
11
|
import { BLOCKLET_CONFIGURABLE_KEY, BLOCKLET_TENANT_MODES, SUPPORTED_LANGUAGES } from '@blocklet/constant';
|
|
14
12
|
import { getWhoCanAccess } from '@blocklet/meta/lib/util';
|
|
15
13
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
16
14
|
import FormTextInput from '../form/form-text-input';
|
|
17
15
|
import FormAutocompleteInput from '../form/form-autocomplete-input';
|
|
18
16
|
import { useNodeContext } from '../contexts/node';
|
|
19
|
-
import { isInstalling,
|
|
17
|
+
import { isInstalling, BlockletAdminRoles } from '../util';
|
|
20
18
|
import { enableDebug } from '../util/mode';
|
|
21
19
|
import Permission, { withPermission } from '../permission';
|
|
22
20
|
import ClearCache from '../clear-cache';
|
|
@@ -41,15 +39,11 @@ function BlockletEnvironment({
|
|
|
41
39
|
api,
|
|
42
40
|
inService,
|
|
43
41
|
prefix,
|
|
44
|
-
getSessionInHeader
|
|
45
|
-
ws: {
|
|
46
|
-
useSubscription
|
|
47
|
-
}
|
|
42
|
+
getSessionInHeader
|
|
48
43
|
} = useNodeContext();
|
|
49
44
|
const {
|
|
50
45
|
t
|
|
51
46
|
} = useContext(LocaleContext);
|
|
52
|
-
const [cpuCores, setCpuCores] = useState('');
|
|
53
47
|
const [loading, setLoading] = useState('');
|
|
54
48
|
const [showTransferOwner, setShowTransferOwner] = useState(false);
|
|
55
49
|
const whoCanAccess = getWhoCanAccess(blocklet);
|
|
@@ -68,12 +62,6 @@ function BlockletEnvironment({
|
|
|
68
62
|
const {
|
|
69
63
|
site
|
|
70
64
|
} = blocklet;
|
|
71
|
-
const clusterMode = get(blocklet.meta, 'capabilities.clusterMode', false);
|
|
72
|
-
useSubscription(EVENTS.NODE_RUNTIME_INFO, res => {
|
|
73
|
-
if (clusterMode) {
|
|
74
|
-
setCpuCores(get(res, 'cpu.physicalCores', ''));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
65
|
if (isInstalling(blocklet.status)) {
|
|
78
66
|
return null;
|
|
79
67
|
}
|
|
@@ -108,16 +96,6 @@ function BlockletEnvironment({
|
|
|
108
96
|
description: t('blocklet.config.copyrightYear'),
|
|
109
97
|
value: copyrightYear ? copyrightYear.value : ''
|
|
110
98
|
}];
|
|
111
|
-
if (clusterMode) {
|
|
112
|
-
const exist = blocklet.configs.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE);
|
|
113
|
-
const value = exist ? exist.value : cpuCores;
|
|
114
|
-
configurableEnvs.push({
|
|
115
|
-
key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,
|
|
116
|
-
description: t('blocklet.config.clusterSize'),
|
|
117
|
-
value,
|
|
118
|
-
cpuCores
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
99
|
const onPublicToStoreChange = async e => {
|
|
122
100
|
if (loading) {
|
|
123
101
|
return;
|
|
@@ -143,16 +121,6 @@ function BlockletEnvironment({
|
|
|
143
121
|
}
|
|
144
122
|
};
|
|
145
123
|
const onSubmitConfig = async (key, value) => {
|
|
146
|
-
if (key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE) {
|
|
147
|
-
const errMessage = isValidClusterSize({
|
|
148
|
-
value,
|
|
149
|
-
cpuCores
|
|
150
|
-
});
|
|
151
|
-
if (errMessage) {
|
|
152
|
-
Toast.error(errMessage);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
124
|
const params = [{
|
|
157
125
|
key,
|
|
158
126
|
value
|
|
@@ -1,74 +1,85 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-one-expression-per-line */
|
|
2
|
-
import { useContext } from 'react';
|
|
2
|
+
import { useContext, useEffect } from 'react';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import
|
|
4
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
|
6
6
|
import Link from '@mui/material/Link';
|
|
7
7
|
import InfoRow from '@arcblock/ux/lib/InfoRow';
|
|
8
8
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
|
+
import { useBlockletContext } from '../contexts/blocklet';
|
|
9
10
|
import { filesize } from '../util';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export default function BlockletDiskInfo({
|
|
12
|
-
blocklet,
|
|
13
13
|
...rest
|
|
14
14
|
}) {
|
|
15
15
|
const {
|
|
16
16
|
t
|
|
17
17
|
} = useContext(LocaleContext);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const {
|
|
19
|
+
blocklet,
|
|
20
|
+
loadingDiskInfo,
|
|
21
|
+
actions
|
|
22
|
+
} = useBlockletContext();
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
actions.refreshBlocklet({
|
|
25
|
+
showError: false,
|
|
26
|
+
attachDiskInfo: true
|
|
27
|
+
});
|
|
28
|
+
}, []); // eslint-disable-line
|
|
29
|
+
|
|
30
|
+
if (blocklet.diskInfo) {
|
|
31
|
+
const renderDiskInfo = (dir, size, handler) => /*#__PURE__*/_jsxs(Typography, {
|
|
32
|
+
children: [handler ?
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
/* eslint-disable-next-line no-script-url, jsx-a11y/anchor-is-valid */
|
|
35
|
+
_jsx(Link, {
|
|
36
|
+
style: {
|
|
37
|
+
cursor: 'pointer'
|
|
38
|
+
},
|
|
39
|
+
onClick: handler,
|
|
40
|
+
underline: "hover",
|
|
41
|
+
children: dir
|
|
42
|
+
}) : dir, ' ', /*#__PURE__*/_jsx("strong", {
|
|
43
|
+
children: size ? filesize(size) : 'empty'
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
const env = blocklet.environments.reduce((acc, x) => {
|
|
47
|
+
acc[x.key] = x.value;
|
|
48
|
+
return acc;
|
|
49
|
+
}, {});
|
|
50
|
+
const rows = [{
|
|
51
|
+
key: 'appDir',
|
|
52
|
+
name: t('blocklet.diskInfo.appDir'),
|
|
53
|
+
value: renderDiskInfo(env.BLOCKLET_APP_DIR, blocklet.diskInfo.app)
|
|
54
|
+
}, {
|
|
55
|
+
key: 'dataDir',
|
|
56
|
+
name: t('blocklet.diskInfo.dataDir'),
|
|
57
|
+
value: renderDiskInfo(env.BLOCKLET_DATA_DIR, blocklet.diskInfo.data)
|
|
58
|
+
}, {
|
|
59
|
+
key: 'logDir',
|
|
60
|
+
name: t('blocklet.diskInfo.logDir'),
|
|
61
|
+
value: renderDiskInfo(env.BLOCKLET_LOG_DIR, blocklet.diskInfo.log)
|
|
62
|
+
}, {
|
|
63
|
+
key: 'cacheDir',
|
|
64
|
+
name: t('blocklet.diskInfo.cacheDir'),
|
|
65
|
+
value: renderDiskInfo(env.BLOCKLET_CACHE_DIR, blocklet.diskInfo.cache)
|
|
66
|
+
}];
|
|
67
|
+
return /*#__PURE__*/_jsx(Div, {
|
|
68
|
+
component: "div",
|
|
69
|
+
...rest,
|
|
70
|
+
children: rows.map(row => /*#__PURE__*/_jsx(InfoRow, {
|
|
71
|
+
valueComponent: "div",
|
|
72
|
+
nameWidth: 120,
|
|
73
|
+
name: row.name,
|
|
74
|
+
children: row.value
|
|
75
|
+
}, row.key))
|
|
21
76
|
});
|
|
22
77
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
style: {
|
|
29
|
-
cursor: 'pointer'
|
|
30
|
-
},
|
|
31
|
-
onClick: handler,
|
|
32
|
-
underline: "hover",
|
|
33
|
-
children: dir
|
|
34
|
-
}) : dir, ' ', /*#__PURE__*/_jsx("strong", {
|
|
35
|
-
children: size ? filesize(size) : 'empty'
|
|
36
|
-
})]
|
|
37
|
-
});
|
|
38
|
-
const env = blocklet.environments.reduce((acc, x) => {
|
|
39
|
-
acc[x.key] = x.value;
|
|
40
|
-
return acc;
|
|
41
|
-
}, {});
|
|
42
|
-
const rows = [{
|
|
43
|
-
key: 'appDir',
|
|
44
|
-
name: t('blocklet.diskInfo.appDir'),
|
|
45
|
-
value: renderDiskInfo(env.BLOCKLET_APP_DIR, blocklet.diskInfo.app)
|
|
46
|
-
}, {
|
|
47
|
-
key: 'dataDir',
|
|
48
|
-
name: t('blocklet.diskInfo.dataDir'),
|
|
49
|
-
value: renderDiskInfo(env.BLOCKLET_DATA_DIR, blocklet.diskInfo.data)
|
|
50
|
-
}, {
|
|
51
|
-
key: 'logDir',
|
|
52
|
-
name: t('blocklet.diskInfo.logDir'),
|
|
53
|
-
value: renderDiskInfo(env.BLOCKLET_LOG_DIR, blocklet.diskInfo.log)
|
|
54
|
-
}, {
|
|
55
|
-
key: 'cacheDir',
|
|
56
|
-
name: t('blocklet.diskInfo.cacheDir'),
|
|
57
|
-
value: renderDiskInfo(env.BLOCKLET_CACHE_DIR, blocklet.diskInfo.cache)
|
|
58
|
-
}];
|
|
59
|
-
return /*#__PURE__*/_jsx(Div, {
|
|
60
|
-
component: "div",
|
|
61
|
-
...rest,
|
|
62
|
-
children: rows.map(row => /*#__PURE__*/_jsx(InfoRow, {
|
|
63
|
-
valueComponent: "div",
|
|
64
|
-
nameWidth: 120,
|
|
65
|
-
name: row.name,
|
|
66
|
-
children: row.value
|
|
67
|
-
}, row.key))
|
|
78
|
+
if (loadingDiskInfo) {
|
|
79
|
+
return /*#__PURE__*/_jsx(CircularProgress, {});
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
82
|
+
children: t('blocklet.diskInfo.empty')
|
|
68
83
|
});
|
|
69
84
|
}
|
|
70
|
-
BlockletDiskInfo.propTypes = {
|
|
71
|
-
blocklet: PropTypes.object.isRequired
|
|
72
|
-
};
|
|
73
|
-
BlockletDiskInfo.defaultProps = {};
|
|
74
85
|
const Div = styled(Typography)``;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { formatPerson } from '@blocklet/meta/lib/fix';
|
|
3
4
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
4
5
|
import Spinner from '@mui/material/CircularProgress';
|
|
5
6
|
import DialogContentText from '@mui/material/DialogContentText';
|
|
@@ -16,9 +17,10 @@ import Alert from '@mui/material/Alert';
|
|
|
16
17
|
import { getDisplayName } from '@blocklet/meta/lib/util';
|
|
17
18
|
import { useNodeContext } from '../contexts/node';
|
|
18
19
|
import { useSessionContext } from '../contexts/session';
|
|
19
|
-
import { formatError
|
|
20
|
+
import { formatError } from '../util';
|
|
20
21
|
import { getWalletType } from './util';
|
|
21
22
|
import DidAddress from '../did-address';
|
|
23
|
+
import BlockletOwnerInfo from './component/blocklet-owner-info';
|
|
22
24
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
25
|
export default function InstallFromUrl({
|
|
24
26
|
defaultUrl,
|
|
@@ -37,7 +39,8 @@ export default function InstallFromUrl({
|
|
|
37
39
|
const [loading, setLoading] = useState(false);
|
|
38
40
|
const [error, setError] = useState('');
|
|
39
41
|
const {
|
|
40
|
-
t
|
|
42
|
+
t,
|
|
43
|
+
locale
|
|
41
44
|
} = useLocaleContext();
|
|
42
45
|
const initMeta = {
|
|
43
46
|
dist: {}
|
|
@@ -134,7 +137,10 @@ export default function InstallFromUrl({
|
|
|
134
137
|
})
|
|
135
138
|
}, {
|
|
136
139
|
name: t('common.author'),
|
|
137
|
-
value:
|
|
140
|
+
value: meta.owner ? /*#__PURE__*/_jsx(BlockletOwnerInfo, {
|
|
141
|
+
owner: meta.owner,
|
|
142
|
+
locale: locale
|
|
143
|
+
}) : formatPerson(meta.author)
|
|
138
144
|
}, {
|
|
139
145
|
name: t('blocklet.dist.downloadLink'),
|
|
140
146
|
value: meta.dist.tarball
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
1
|
import styled from '@emotion/styled';
|
|
4
2
|
import classnames from 'classnames';
|
|
5
3
|
import pick from 'lodash/pick';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { useMemo } from 'react';
|
|
8
6
|
import Datatable from '@arcblock/ux/lib/Datatable';
|
|
9
7
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
10
|
-
import
|
|
8
|
+
import Box from '@mui/material/Box';
|
|
9
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
11
10
|
import { EmptyIcon } from '@arcblock/icons';
|
|
11
|
+
import { Alert } from '@mui/material';
|
|
12
12
|
import BlockletBundleAvatar from '../../bundle-avatar';
|
|
13
13
|
import StopBox from './stop-box';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { UNOWNED_DID, WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
|
|
2
|
-
import { Box, InputAdornment, TextField, Typography, Avatar, IconButton } from '@mui/material';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import styled from '@emotion/styled';
|
|
5
2
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
6
3
|
import Toast from '@arcblock/ux/lib/Toast/index';
|
|
7
|
-
import
|
|
8
|
-
import { Suspense, lazy, useRef } from 'react';
|
|
4
|
+
import styled from '@emotion/styled';
|
|
9
5
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import { Avatar, Box, IconButton, InputAdornment, TextField, Typography } from '@mui/material';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Suspense, lazy, useRef } from 'react';
|
|
9
|
+
import { useNavigate } from 'react-router-dom';
|
|
10
|
+
import { useNodeContext } from '../../../contexts/node';
|
|
11
|
+
import EmptySpinner from '../../../empty-spinner';
|
|
12
12
|
import usePromiseWindowOpen from '../../../hooks/use-promise-window-open';
|
|
13
13
|
import { formatError } from '../../../util';
|
|
14
|
-
import { useNodeContext } from '../../../contexts/node';
|
|
15
14
|
import useWantToConnectStore from '../hooks/use-want-to-connect-store';
|
|
16
|
-
import
|
|
15
|
+
import { createMessageId, waitGetConnectedByStudio } from '../utils/wait-connect';
|
|
16
|
+
import ConnectStoreButton from './connect-store-button';
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
const allowedFileExts = ['.webp', '.jpg', '.jpeg', '.png', '.gif', '.svg'];
|
|
19
19
|
const maxFileSize = 1024 * 1024 * 10; // 10 MB
|
|
@@ -72,8 +72,8 @@ function Branding({
|
|
|
72
72
|
Toast.error(t('blocklet.publish.errorTip.noTitle'));
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (!wantToConnectStore) {
|
|
76
|
-
Toast.error('
|
|
75
|
+
if (!wantToConnectStore?.url) {
|
|
76
|
+
Toast.error(t('blocklet.publish.noStoreSelected'));
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
const messageId = createMessageId();
|
|
@@ -348,6 +348,9 @@ function Branding({
|
|
|
348
348
|
});
|
|
349
349
|
uploaderScreenshotRef.current.close();
|
|
350
350
|
},
|
|
351
|
+
installerProps: {
|
|
352
|
+
disabled: true
|
|
353
|
+
},
|
|
351
354
|
plugins: ['ImageEditor'],
|
|
352
355
|
apiPathProps: {
|
|
353
356
|
uploader: uploadScreenshotPrefix,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
|
+
import { Icon } from '@iconify/react';
|
|
2
3
|
import AddIcon from '@mui/icons-material/Add';
|
|
3
4
|
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
4
5
|
import { Box, Button, ButtonGroup, CircularProgress, ClickAwayListener, Divider, Grow, IconButton, MenuItem, MenuList, Paper, Popper, Typography } from '@mui/material';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { Icon } from '@iconify/react';
|
|
7
7
|
import { useRef, useState } from 'react';
|
|
8
|
-
import Toast from '@arcblock/ux/lib/Toast';
|
|
9
8
|
import formatError from '@abtnode/util/lib/format-error';
|
|
10
|
-
import
|
|
11
|
-
import AddStore from '../../../store/add';
|
|
12
|
-
import { useNodeContext } from '../../../contexts/node';
|
|
9
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
13
10
|
import ConfirmDialog from '../../../confirm';
|
|
14
11
|
import { useBlockletContext } from '../../../contexts/blocklet';
|
|
12
|
+
import { useNodeContext } from '../../../contexts/node';
|
|
13
|
+
import { useSessionContext } from '../../../contexts/session';
|
|
14
|
+
import AddStore from '../../../store/add';
|
|
15
15
|
import ShortenLabel from '../../component/shorten-label';
|
|
16
16
|
import canDeleteStore from '../utils/can-delete-store';
|
|
17
17
|
import getStudioStoreList from '../utils/get-studio-store-list';
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
19
|
export default function ConnectStoreButton({
|
|
20
20
|
blocklet,
|
|
21
|
-
store,
|
|
21
|
+
store = {},
|
|
22
22
|
onChangeStore,
|
|
23
23
|
onClick,
|
|
24
24
|
disabled,
|
|
@@ -104,7 +104,7 @@ export default function ConnectStoreButton({
|
|
|
104
104
|
sx: {
|
|
105
105
|
mr: 0.5
|
|
106
106
|
}
|
|
107
|
-
}), `${t('common.connect')} ${store
|
|
107
|
+
}), `${t('common.connect')} ${store.name || ''}`]
|
|
108
108
|
}), /*#__PURE__*/_jsx(Button, {
|
|
109
109
|
size: "small",
|
|
110
110
|
"aria-controls": open ? 'split-button-menu' : undefined,
|
|
@@ -139,10 +139,11 @@ export default function ConnectStoreButton({
|
|
|
139
139
|
autoFocusItem: true,
|
|
140
140
|
sx: {
|
|
141
141
|
maxHeight: 300,
|
|
142
|
-
overflowY: 'auto'
|
|
142
|
+
overflowY: 'auto',
|
|
143
|
+
zIndex: 10
|
|
143
144
|
},
|
|
144
|
-
children: [storeList
|
|
145
|
-
selected: option.id === store
|
|
145
|
+
children: [storeList?.map(option => /*#__PURE__*/_jsxs(MenuItem, {
|
|
146
|
+
selected: option.id === store?.id,
|
|
146
147
|
sx: {
|
|
147
148
|
height: 56
|
|
148
149
|
},
|