@abtnode/ux 1.16.26-beta-351de484 → 1.16.26-beta-63f52a83
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/app-avatar.js +7 -19
- package/es/blocklet/authentication/index.js +1 -3
- package/es/blocklet/authentication/oauth/apple.js +39 -15
- package/es/blocklet/authentication/oauth/auth0.js +18 -12
- package/es/blocklet/authentication/oauth/github.js +10 -9
- package/es/blocklet/authentication/oauth/google.js +10 -9
- package/es/blocklet/component/component-cell.js +201 -359
- package/es/blocklet/component/component-info-dialog.js +257 -0
- package/es/blocklet/component/index.js +14 -12
- package/es/blocklet/component/store-blocklet-list.js +3 -0
- package/es/blocklet/publish/connect-store-list.js +33 -4
- package/es/blocklet/publish/create-release.js +9 -4
- package/es/blocklet/status.js +13 -7
- package/es/locales/ar.js +19 -12
- package/es/locales/de.js +19 -12
- package/es/locales/en.js +18 -11
- package/es/locales/es.js +20 -13
- package/es/locales/fr.js +19 -12
- package/es/locales/hi.js +19 -12
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +19 -12
- package/es/locales/ja.js +19 -12
- package/es/locales/ko.js +19 -12
- package/es/locales/pt.js +19 -12
- package/es/locales/ru.js +19 -12
- package/es/locales/th.js +19 -12
- package/es/locales/vi.js +19 -12
- package/es/locales/zh-tw.js +28 -21
- package/es/locales/zh.js +27 -20
- package/lib/blocklet/app-avatar.js +7 -20
- package/lib/blocklet/authentication/index.js +1 -3
- package/lib/blocklet/authentication/oauth/apple.js +51 -28
- package/lib/blocklet/authentication/oauth/auth0.js +18 -16
- package/lib/blocklet/authentication/oauth/github.js +10 -13
- package/lib/blocklet/authentication/oauth/google.js +10 -13
- package/lib/blocklet/component/component-cell.js +209 -370
- package/lib/blocklet/component/component-info-dialog.js +253 -0
- package/lib/blocklet/component/index.js +14 -12
- package/lib/blocklet/component/store-blocklet-list.js +3 -0
- package/lib/blocklet/publish/connect-store-list.js +32 -3
- package/lib/blocklet/publish/create-release.js +9 -4
- package/lib/blocklet/status.js +14 -8
- package/lib/locales/ar.js +19 -12
- package/lib/locales/de.js +19 -12
- package/lib/locales/en.js +18 -11
- package/lib/locales/es.js +20 -13
- package/lib/locales/fr.js +19 -12
- package/lib/locales/hi.js +19 -12
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +19 -12
- package/lib/locales/ja.js +19 -12
- package/lib/locales/ko.js +19 -12
- package/lib/locales/pt.js +19 -12
- package/lib/locales/ru.js +19 -12
- package/lib/locales/th.js +19 -12
- package/lib/locales/vi.js +19 -12
- package/lib/locales/zh-tw.js +28 -21
- package/lib/locales/zh.js +27 -20
- package/package.json +17 -17
|
@@ -9,24 +9,15 @@ import RestartIcon from '@mui/icons-material/Replay';
|
|
|
9
9
|
import ReloadIcon from '@mui/icons-material/Autorenew';
|
|
10
10
|
import IconButton from '@mui/material/IconButton';
|
|
11
11
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
12
|
-
import Dialog from '@mui/material/Dialog';
|
|
13
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
14
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
15
12
|
import { Icon } from '@iconify/react';
|
|
16
|
-
import InfoRow from '@arcblock/ux/lib/InfoRow';
|
|
17
13
|
import Tooltip from '@mui/material/Tooltip';
|
|
18
14
|
import Box from '@mui/material/Box';
|
|
19
15
|
import normalizePathPrefix from '@abtnode/util/lib/normalize-path-prefix';
|
|
20
16
|
import { getComponentMissingConfigs, getDisplayName, isInProgress, hasStartEngine } from '@blocklet/meta/lib/util';
|
|
21
17
|
import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
|
|
22
18
|
import { useDeletingBlockletContext } from '../../contexts/deleting-blocklets';
|
|
23
|
-
import Tag from '../../tag';
|
|
24
19
|
import ComponentConfiguration from './configuration';
|
|
25
|
-
import { formatPerson, formatToDatetime } from '../../util';
|
|
26
|
-
import DidAddress from '../../did-address';
|
|
27
|
-
import BlockletSource from '../blocklet-source';
|
|
28
20
|
import BlockletStatus from '../status';
|
|
29
|
-
import BlockletVersion from '../version';
|
|
30
21
|
import Confirm from '../../confirm';
|
|
31
22
|
import BlockletBundleAvatar from '../bundle-avatar';
|
|
32
23
|
import BlockletMode from '../mode';
|
|
@@ -34,56 +25,9 @@ import DeleteComponent from './delete';
|
|
|
34
25
|
import StartComponent from './start';
|
|
35
26
|
import Line from './line';
|
|
36
27
|
import Actions from '../../actions';
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
return [{
|
|
43
|
-
name: t('common.name'),
|
|
44
|
-
value: engine.displayName
|
|
45
|
-
}, {
|
|
46
|
-
name: t('common.description'),
|
|
47
|
-
value: engine.description
|
|
48
|
-
}, {
|
|
49
|
-
name: t('common.version'),
|
|
50
|
-
value: /*#__PURE__*/_jsx(Tag, {
|
|
51
|
-
children: engine.version
|
|
52
|
-
})
|
|
53
|
-
}];
|
|
54
|
-
};
|
|
55
|
-
const getSourceInfo = blocklet => {
|
|
56
|
-
const {
|
|
57
|
-
source,
|
|
58
|
-
deployedFrom,
|
|
59
|
-
bundleSource
|
|
60
|
-
} = blocklet;
|
|
61
|
-
if (source) {
|
|
62
|
-
return {
|
|
63
|
-
source,
|
|
64
|
-
deployedFrom
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
if (!bundleSource) {
|
|
68
|
-
return {
|
|
69
|
-
source: 'upload',
|
|
70
|
-
deployedFrom
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (bundleSource.url) {
|
|
74
|
-
return {
|
|
75
|
-
source: 'url',
|
|
76
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.url) ? bundleSource.url[0] : bundleSource.url
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
if (bundleSource.store) {
|
|
80
|
-
return {
|
|
81
|
-
source: 'registry',
|
|
82
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.store) ? bundleSource.store[0] : bundleSource.store
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return {};
|
|
86
|
-
};
|
|
28
|
+
import ComponentInfoDialog from './component-info-dialog';
|
|
29
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
|
+
const isResource = component => !component?.meta?.group;
|
|
87
31
|
const getComponentName = (componentId, app) => {
|
|
88
32
|
const ids = componentId.split('/').slice(1);
|
|
89
33
|
let parent = app;
|
|
@@ -100,7 +44,6 @@ const getComponentName = (componentId, app) => {
|
|
|
100
44
|
}
|
|
101
45
|
return names.join(' / ');
|
|
102
46
|
};
|
|
103
|
-
const isPack = component => component?.meta?.group === 'pack';
|
|
104
47
|
export default function ComponentCell({
|
|
105
48
|
blocklet,
|
|
106
49
|
ancestors,
|
|
@@ -114,8 +57,7 @@ export default function ComponentCell({
|
|
|
114
57
|
app
|
|
115
58
|
}) {
|
|
116
59
|
const {
|
|
117
|
-
t
|
|
118
|
-
locale
|
|
60
|
+
t
|
|
119
61
|
} = useContext(LocaleContext);
|
|
120
62
|
const [componentInfo, setComponentInfo] = useState();
|
|
121
63
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
|
@@ -132,100 +74,6 @@ export default function ComponentCell({
|
|
|
132
74
|
}
|
|
133
75
|
const mountPoint = `/${blocklet.mountPoint || '/'}`.replace(/\/+/g, '/');
|
|
134
76
|
const href = getComponentUrl(mountPoint);
|
|
135
|
-
const renderRows = rows => rows.map(row => {
|
|
136
|
-
if (row.name === t('common.did') || row.name === t('blocklet.appId')) {
|
|
137
|
-
return /*#__PURE__*/_jsx(InfoRow, {
|
|
138
|
-
valueComponent: "div",
|
|
139
|
-
nameWidth: 120,
|
|
140
|
-
name: row.name,
|
|
141
|
-
nameFormatter: () => row.name,
|
|
142
|
-
children: row.value
|
|
143
|
-
}, row.name);
|
|
144
|
-
}
|
|
145
|
-
return /*#__PURE__*/_jsx(InfoRow, {
|
|
146
|
-
valueComponent: "div",
|
|
147
|
-
nameWidth: 120,
|
|
148
|
-
name: row.name,
|
|
149
|
-
children: row.value
|
|
150
|
-
}, row.name);
|
|
151
|
-
});
|
|
152
|
-
const sourceInfo = componentInfo ? getSourceInfo(componentInfo) : {};
|
|
153
|
-
const componentRows = componentInfo ? [{
|
|
154
|
-
name: t('common.name'),
|
|
155
|
-
value: getDisplayName(componentInfo, true)
|
|
156
|
-
}, {
|
|
157
|
-
name: t('common.version'),
|
|
158
|
-
value: /*#__PURE__*/_jsx(BlockletVersion, {
|
|
159
|
-
blocklet: componentInfo,
|
|
160
|
-
checkUpgrade: false
|
|
161
|
-
})
|
|
162
|
-
}, {
|
|
163
|
-
name: t('common.status'),
|
|
164
|
-
value: /*#__PURE__*/_jsx(BlockletStatus, {
|
|
165
|
-
status: status,
|
|
166
|
-
source: componentInfo.source,
|
|
167
|
-
progress: blocklet.progress
|
|
168
|
-
})
|
|
169
|
-
}, blocklet.status === 'running' ? {
|
|
170
|
-
name: t('blocklet.startedAt'),
|
|
171
|
-
value: formatToDatetime(blocklet.startedAt, locale)
|
|
172
|
-
} : null, blocklet.status !== 'running' ? {
|
|
173
|
-
name: t('blocklet.stoppedAt'),
|
|
174
|
-
value: formatToDatetime(blocklet.stoppedAt, locale)
|
|
175
|
-
} : null, blocklet.installedAt ? {
|
|
176
|
-
name: t('blocklet.installedAt'),
|
|
177
|
-
value: formatToDatetime(blocklet.installedAt, locale)
|
|
178
|
-
} : null, hasStartEngine(blocklet.meta) ? {
|
|
179
|
-
name: t('common.mountPoint'),
|
|
180
|
-
value: mountPoint
|
|
181
|
-
} : null, componentInfo.meta.group ? {
|
|
182
|
-
name: t('common.group'),
|
|
183
|
-
value: /*#__PURE__*/_jsx(Tag, {
|
|
184
|
-
type: "success",
|
|
185
|
-
children: componentInfo.meta.group
|
|
186
|
-
})
|
|
187
|
-
} : null, {
|
|
188
|
-
name: t('blocklet.overview.source'),
|
|
189
|
-
value: /*#__PURE__*/_jsx(BlockletSource, {
|
|
190
|
-
sourceInfo: sourceInfo,
|
|
191
|
-
blocklet: blocklet
|
|
192
|
-
})
|
|
193
|
-
}, {
|
|
194
|
-
name: t('blocklet.overview.deployedFrom'),
|
|
195
|
-
value: sourceInfo.deployedFrom || '-'
|
|
196
|
-
}, {
|
|
197
|
-
name: t('common.did'),
|
|
198
|
-
value: /*#__PURE__*/_jsx(DidAddress, {
|
|
199
|
-
did: componentInfo.meta.did,
|
|
200
|
-
showQrcode: true
|
|
201
|
-
})
|
|
202
|
-
}, {
|
|
203
|
-
name: t('common.author'),
|
|
204
|
-
value: formatPerson(componentInfo.meta.author)
|
|
205
|
-
}, {
|
|
206
|
-
name: t('common.engine'),
|
|
207
|
-
value: getEngineRows(componentInfo.engine, t).map(({
|
|
208
|
-
name,
|
|
209
|
-
value
|
|
210
|
-
}) => /*#__PURE__*/_jsx(InfoRow, {
|
|
211
|
-
style: {
|
|
212
|
-
marginBottom: 4
|
|
213
|
-
},
|
|
214
|
-
nameWidth: 120,
|
|
215
|
-
name: name,
|
|
216
|
-
children: value
|
|
217
|
-
}, name))
|
|
218
|
-
}, blocklet.dependents?.length ? {
|
|
219
|
-
name: t('common.dependents'),
|
|
220
|
-
value: /*#__PURE__*/_jsx(Box, {
|
|
221
|
-
children: blocklet.dependents.map(x => /*#__PURE__*/_jsx(Box, {
|
|
222
|
-
children: `${getComponentName(x.id, app)} ${x.required ? `(${t('common.required')})` : ''}`
|
|
223
|
-
}, x.id))
|
|
224
|
-
})
|
|
225
|
-
} : null, blocklet.meta.resources?.length ? {
|
|
226
|
-
name: t('common.resource'),
|
|
227
|
-
value: blocklet.meta.resources.join(', ')
|
|
228
|
-
} : null].filter(Boolean) : [];
|
|
229
77
|
const appInProgress = isInProgress(app.status);
|
|
230
78
|
const componentInProgress = isInProgress(blocklet.status);
|
|
231
79
|
let deleteDisabledTip = '';
|
|
@@ -240,226 +88,220 @@ export default function ComponentCell({
|
|
|
240
88
|
});
|
|
241
89
|
}
|
|
242
90
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
91
|
+
const handleRemove = async (...param) => {
|
|
92
|
+
setLoading(true);
|
|
93
|
+
try {
|
|
94
|
+
await onRemove(...param);
|
|
95
|
+
} catch {
|
|
96
|
+
// ignore
|
|
97
|
+
}
|
|
98
|
+
setLoading(false);
|
|
99
|
+
setShowDeleteConfirm(false);
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
102
|
+
children: [/*#__PURE__*/_jsxs(StyledComponentRow, {
|
|
255
103
|
display: "flex",
|
|
104
|
+
py: 2,
|
|
105
|
+
className: "component-item",
|
|
106
|
+
justifyContent: "flex-start",
|
|
256
107
|
alignItems: "center",
|
|
257
|
-
children: [/*#__PURE__*/
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
269
|
-
className: "component-version",
|
|
270
|
-
children: blocklet?.meta?.version
|
|
271
|
-
})]
|
|
108
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
109
|
+
pl: 2,
|
|
110
|
+
width: {
|
|
111
|
+
xs: 300,
|
|
112
|
+
md: 400
|
|
113
|
+
},
|
|
114
|
+
display: "flex",
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
children: [/*#__PURE__*/_jsx(BlockletBundleAvatar, {
|
|
117
|
+
blocklet: blocklet,
|
|
118
|
+
ancestors: ancestors
|
|
272
119
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
120
|
+
ml: "16px",
|
|
121
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
122
|
+
className: "component-header",
|
|
123
|
+
onClick: () => setComponentInfo(blocklet),
|
|
124
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
125
|
+
className: "component-name",
|
|
126
|
+
children: getDisplayName(blocklet, true)
|
|
127
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
128
|
+
className: "component-version",
|
|
129
|
+
children: blocklet?.meta?.version
|
|
130
|
+
})]
|
|
131
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
132
|
+
display: "flex",
|
|
133
|
+
alignItems: "center",
|
|
134
|
+
sx: {
|
|
135
|
+
mt: '2px',
|
|
136
|
+
ml: -0.5
|
|
282
137
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
children: /*#__PURE__*/_jsx(
|
|
301
|
-
|
|
138
|
+
children: [status !== 'unknown' && /*#__PURE__*/_jsx(BlockletStatus, {
|
|
139
|
+
style: {
|
|
140
|
+
marginLeft: 4
|
|
141
|
+
},
|
|
142
|
+
status: status,
|
|
143
|
+
source: blocklet.source,
|
|
144
|
+
progress: blocklet.progress
|
|
145
|
+
}), /*#__PURE__*/_jsx(BlockletMode, {
|
|
146
|
+
style: {
|
|
147
|
+
marginLeft: 4
|
|
148
|
+
},
|
|
149
|
+
mode: blocklet.mode || ''
|
|
150
|
+
}), !!blocklet.dependents?.length && /*#__PURE__*/_jsx(Tooltip, {
|
|
151
|
+
title: [`${t('common.dependents')}: `, blocklet.dependents.map(x => /*#__PURE__*/_jsx(Box, {
|
|
152
|
+
pl: 1,
|
|
153
|
+
children: `${getComponentName(x.id, app)} ${x.required ? `(${t('common.required')})` : ''}`
|
|
154
|
+
}, x.id))],
|
|
155
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
156
|
+
display: "flex",
|
|
157
|
+
color: "primary.main",
|
|
158
|
+
ml: 1,
|
|
159
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
160
|
+
icon: "octicon:package-dependents-16"
|
|
161
|
+
})
|
|
302
162
|
})
|
|
303
|
-
})
|
|
163
|
+
})]
|
|
304
164
|
})]
|
|
305
165
|
})]
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
flexGrow: "1",
|
|
316
|
-
children: /*#__PURE__*/_jsx("a", {
|
|
317
|
-
target: "_blank",
|
|
318
|
-
href: href,
|
|
319
|
-
rel: "noopener noreferrer",
|
|
320
|
-
title: href,
|
|
321
|
-
children: /*#__PURE__*/_jsx(Box, {
|
|
322
|
-
maxWidth: 400,
|
|
323
|
-
sx: {
|
|
324
|
-
color: 'secondary.main',
|
|
325
|
-
fontSize: 16,
|
|
326
|
-
px: 2
|
|
327
|
-
},
|
|
328
|
-
overflow: "hidden",
|
|
329
|
-
whiteSpace: "nowrap",
|
|
330
|
-
textOverflow: "ellipsis",
|
|
331
|
-
children: normalizePathPrefix(mountPoint)
|
|
332
|
-
})
|
|
333
|
-
})
|
|
334
|
-
}, mountPoint), /*#__PURE__*/_jsx("div", {
|
|
335
|
-
style: {
|
|
336
|
-
flex: 1
|
|
337
|
-
}
|
|
338
|
-
}), /*#__PURE__*/_jsxs(Box, {
|
|
339
|
-
display: "flex",
|
|
340
|
-
alignItems: "center",
|
|
341
|
-
children: [hasStartEngine(blocklet.meta) && /*#__PURE__*/_jsx(Tooltip, {
|
|
342
|
-
title: t('common.visit'),
|
|
166
|
+
}, blocklet), hasStartEngine(blocklet.meta) && /*#__PURE__*/_jsx(Box, {
|
|
167
|
+
sx: {
|
|
168
|
+
display: {
|
|
169
|
+
xs: 'none',
|
|
170
|
+
md: 'flex'
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
flexGrow: "1",
|
|
343
175
|
children: /*#__PURE__*/_jsx("a", {
|
|
344
176
|
target: "_blank",
|
|
345
177
|
href: href,
|
|
346
178
|
rel: "noopener noreferrer",
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
179
|
+
title: href,
|
|
180
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
181
|
+
maxWidth: 400,
|
|
182
|
+
sx: {
|
|
183
|
+
color: 'secondary.main',
|
|
184
|
+
fontSize: 16,
|
|
185
|
+
px: 2
|
|
186
|
+
},
|
|
187
|
+
overflow: "hidden",
|
|
188
|
+
whiteSpace: "nowrap",
|
|
189
|
+
textOverflow: "ellipsis",
|
|
190
|
+
children: normalizePathPrefix(mountPoint)
|
|
350
191
|
})
|
|
351
192
|
})
|
|
352
|
-
}), /*#__PURE__*/_jsx(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
193
|
+
}, mountPoint), /*#__PURE__*/_jsx("div", {
|
|
194
|
+
style: {
|
|
195
|
+
flex: 1
|
|
196
|
+
}
|
|
197
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
198
|
+
display: "flex",
|
|
199
|
+
alignItems: "center",
|
|
200
|
+
children: [hasStartEngine(blocklet.meta) && /*#__PURE__*/_jsx(Tooltip, {
|
|
201
|
+
title: t('common.visit'),
|
|
202
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
203
|
+
target: "_blank",
|
|
204
|
+
href: href,
|
|
205
|
+
rel: "noopener noreferrer",
|
|
364
206
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
365
|
-
onClick: open,
|
|
366
207
|
size: "small",
|
|
367
|
-
children: /*#__PURE__*/_jsx(
|
|
208
|
+
children: /*#__PURE__*/_jsx(LaunchIcon, {})
|
|
368
209
|
})
|
|
369
210
|
})
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
211
|
+
}), /*#__PURE__*/_jsx(ComponentConfiguration, {
|
|
212
|
+
blocklet: blocklet,
|
|
213
|
+
ancestors: ancestors,
|
|
214
|
+
children: ({
|
|
215
|
+
open
|
|
216
|
+
}) => /*#__PURE__*/_jsx(Tooltip, {
|
|
217
|
+
title: t('common.config'),
|
|
218
|
+
children: /*#__PURE__*/_jsx(StyledBadge, {
|
|
219
|
+
color: "error",
|
|
220
|
+
badgeContent: "",
|
|
221
|
+
variant: "dot",
|
|
222
|
+
invisible: !getComponentMissingConfigs(blocklet, ancestors[0]).length,
|
|
223
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
224
|
+
onClick: open,
|
|
225
|
+
size: "small",
|
|
226
|
+
children: /*#__PURE__*/_jsx(SettingsOutlinedIcon, {})
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
}, "config")
|
|
230
|
+
}), /*#__PURE__*/_jsx(StartComponent, {
|
|
231
|
+
blocklet: app,
|
|
232
|
+
component: blocklet,
|
|
233
|
+
onStart: onStart,
|
|
234
|
+
onStop: onStop,
|
|
235
|
+
disabled: !['starting', 'stopping'].includes(app.status) && isInProgress(app.status)
|
|
236
|
+
}), /*#__PURE__*/_jsx(Actions, {
|
|
237
|
+
"data-cy": "component-actions",
|
|
238
|
+
actions: [hasStartEngine(blocklet.meta) ? {
|
|
239
|
+
icon: /*#__PURE__*/_jsx(InfoOutlinedIcon, {}),
|
|
240
|
+
text: t('common.detail'),
|
|
241
|
+
onClick: () => {
|
|
242
|
+
setComponentInfo(blocklet);
|
|
243
|
+
}
|
|
244
|
+
} : null, !isResource(blocklet) && {
|
|
245
|
+
icon: /*#__PURE__*/_jsx(RestartIcon, {}),
|
|
246
|
+
text: t('common.restart'),
|
|
247
|
+
onClick: () => {
|
|
248
|
+
setConfirmSetting({
|
|
249
|
+
title: `${t('common.restart')} ${blocklet.meta.title}`,
|
|
250
|
+
description: t('blocklet.action.restartDescription'),
|
|
251
|
+
confirm: t('blocklet.action.confirmRestart'),
|
|
252
|
+
cancel: t('common.cancel'),
|
|
253
|
+
onConfirm: async () => {
|
|
254
|
+
setLoading(true);
|
|
255
|
+
await onRestart(blocklet);
|
|
256
|
+
setLoading(false);
|
|
257
|
+
},
|
|
258
|
+
onCancel: () => setConfirmSetting(null)
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
disabled: appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
262
|
+
}, !isResource(blocklet) && {
|
|
263
|
+
icon: /*#__PURE__*/_jsx(ReloadIcon, {}),
|
|
264
|
+
text: t('common.reload'),
|
|
265
|
+
onClick: async () => {
|
|
266
|
+
setLoading(true);
|
|
267
|
+
await onReload(blocklet);
|
|
268
|
+
setLoading(false);
|
|
269
|
+
},
|
|
270
|
+
disabled: loading || appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
271
|
+
}, {
|
|
272
|
+
icon: /*#__PURE__*/_jsx(DeleteIcon, {}),
|
|
273
|
+
text: t('common.delete'),
|
|
274
|
+
onClick: () => {
|
|
275
|
+
setShowDeleteConfirm(true);
|
|
276
|
+
},
|
|
277
|
+
disabled: appInProgress || componentInProgress || !!deleteDisabledTip,
|
|
278
|
+
tip: deleteDisabledTip
|
|
279
|
+
}].filter(Boolean)
|
|
280
|
+
})]
|
|
281
|
+
}, "actions")]
|
|
282
|
+
}, "group-not-gateway-box"), /*#__PURE__*/_jsx(Line, {}, "line"), /*#__PURE__*/_jsx(ComponentInfoDialog, {
|
|
283
|
+
componentInfo: componentInfo,
|
|
284
|
+
onClose: setComponentInfo,
|
|
285
|
+
blocklet: blocklet,
|
|
286
|
+
app: app,
|
|
287
|
+
depth: depth
|
|
288
|
+
}), /*#__PURE__*/_jsx(DeleteComponent, {
|
|
289
|
+
blocklet: app,
|
|
290
|
+
component: blocklet,
|
|
291
|
+
remove: handleRemove,
|
|
292
|
+
onCancel: () => setShowDeleteConfirm(false),
|
|
293
|
+
hideBtn: true,
|
|
294
|
+
showConfirm: showDeleteConfirm
|
|
295
|
+
}, "delete-component"), confirmSetting && /*#__PURE__*/_jsx(Confirm, {
|
|
296
|
+
title: confirmSetting.title,
|
|
297
|
+
description: confirmSetting.description,
|
|
298
|
+
confirm: confirmSetting.confirm,
|
|
299
|
+
cancel: confirmSetting.cancel,
|
|
300
|
+
params: confirmSetting.params,
|
|
301
|
+
onConfirm: confirmSetting.onConfirm,
|
|
302
|
+
onCancel: confirmSetting.onCancel
|
|
303
|
+
}, "confirm-setting")]
|
|
304
|
+
});
|
|
463
305
|
}
|
|
464
306
|
ComponentCell.propTypes = {
|
|
465
307
|
blocklet: PropTypes.object.isRequired,
|