@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
|
@@ -16,24 +16,15 @@ var _Replay = _interopRequireDefault(require("@mui/icons-material/Replay"));
|
|
|
16
16
|
var _Autorenew = _interopRequireDefault(require("@mui/icons-material/Autorenew"));
|
|
17
17
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
18
18
|
var _Delete = _interopRequireDefault(require("@mui/icons-material/Delete"));
|
|
19
|
-
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
20
|
-
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
21
|
-
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
22
19
|
var _react2 = require("@iconify/react");
|
|
23
|
-
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
24
20
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
25
21
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
26
22
|
var _normalizePathPrefix = _interopRequireDefault(require("@abtnode/util/lib/normalize-path-prefix"));
|
|
27
23
|
var _util = require("@blocklet/meta/lib/util");
|
|
28
24
|
var _SettingsOutlined = _interopRequireDefault(require("@mui/icons-material/SettingsOutlined"));
|
|
29
25
|
var _deletingBlocklets = require("../../contexts/deleting-blocklets");
|
|
30
|
-
var _tag = _interopRequireDefault(require("../../tag"));
|
|
31
26
|
var _configuration = _interopRequireDefault(require("./configuration"));
|
|
32
|
-
var _util2 = require("../../util");
|
|
33
|
-
var _didAddress = _interopRequireDefault(require("../../did-address"));
|
|
34
|
-
var _blockletSource = _interopRequireDefault(require("../blocklet-source"));
|
|
35
27
|
var _status = _interopRequireDefault(require("../status"));
|
|
36
|
-
var _version = _interopRequireDefault(require("../version"));
|
|
37
28
|
var _confirm = _interopRequireDefault(require("../../confirm"));
|
|
38
29
|
var _bundleAvatar = _interopRequireDefault(require("../bundle-avatar"));
|
|
39
30
|
var _mode = _interopRequireDefault(require("../mode"));
|
|
@@ -41,58 +32,14 @@ var _delete = _interopRequireDefault(require("./delete"));
|
|
|
41
32
|
var _start = _interopRequireDefault(require("./start"));
|
|
42
33
|
var _line = _interopRequireDefault(require("./line"));
|
|
43
34
|
var _actions = _interopRequireDefault(require("../../actions"));
|
|
35
|
+
var _componentInfoDialog = _interopRequireDefault(require("./component-info-dialog"));
|
|
44
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
45
37
|
var _templateObject, _templateObject2;
|
|
46
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
39
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return [{
|
|
53
|
-
name: t('common.name'),
|
|
54
|
-
value: engine.displayName
|
|
55
|
-
}, {
|
|
56
|
-
name: t('common.description'),
|
|
57
|
-
value: engine.description
|
|
58
|
-
}, {
|
|
59
|
-
name: t('common.version'),
|
|
60
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
|
|
61
|
-
children: engine.version
|
|
62
|
-
})
|
|
63
|
-
}];
|
|
64
|
-
};
|
|
65
|
-
const getSourceInfo = blocklet => {
|
|
66
|
-
const {
|
|
67
|
-
source,
|
|
68
|
-
deployedFrom,
|
|
69
|
-
bundleSource
|
|
70
|
-
} = blocklet;
|
|
71
|
-
if (source) {
|
|
72
|
-
return {
|
|
73
|
-
source,
|
|
74
|
-
deployedFrom
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
if (!bundleSource) {
|
|
78
|
-
return {
|
|
79
|
-
source: 'upload',
|
|
80
|
-
deployedFrom
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
if (bundleSource.url) {
|
|
84
|
-
return {
|
|
85
|
-
source: 'url',
|
|
86
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.url) ? bundleSource.url[0] : bundleSource.url
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
if (bundleSource.store) {
|
|
90
|
-
return {
|
|
91
|
-
source: 'registry',
|
|
92
|
-
deployedFrom: deployedFrom || Array.isArray(bundleSource.store) ? bundleSource.store[0] : bundleSource.store
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return {};
|
|
40
|
+
const isResource = component => {
|
|
41
|
+
var _component$meta;
|
|
42
|
+
return !(component !== null && component !== void 0 && (_component$meta = component.meta) !== null && _component$meta !== void 0 && _component$meta.group);
|
|
96
43
|
};
|
|
97
44
|
const getComponentName = (componentId, app) => {
|
|
98
45
|
const ids = componentId.split('/').slice(1);
|
|
@@ -110,12 +57,8 @@ const getComponentName = (componentId, app) => {
|
|
|
110
57
|
}
|
|
111
58
|
return names.join(' / ');
|
|
112
59
|
};
|
|
113
|
-
const isPack = component => {
|
|
114
|
-
var _component$meta;
|
|
115
|
-
return (component === null || component === void 0 || (_component$meta = component.meta) === null || _component$meta === void 0 ? void 0 : _component$meta.group) === 'pack';
|
|
116
|
-
};
|
|
117
60
|
function ComponentCell(_ref) {
|
|
118
|
-
var _blocklet$dependents, _blocklet$meta
|
|
61
|
+
var _blocklet$dependents, _blocklet$meta, _blocklet$dependents2;
|
|
119
62
|
let {
|
|
120
63
|
blocklet,
|
|
121
64
|
ancestors,
|
|
@@ -129,8 +72,7 @@ function ComponentCell(_ref) {
|
|
|
129
72
|
app
|
|
130
73
|
} = _ref;
|
|
131
74
|
const {
|
|
132
|
-
t
|
|
133
|
-
locale
|
|
75
|
+
t
|
|
134
76
|
} = (0, _react.useContext)(_context.LocaleContext);
|
|
135
77
|
const [componentInfo, setComponentInfo] = (0, _react.useState)();
|
|
136
78
|
const [showDeleteConfirm, setShowDeleteConfirm] = (0, _react.useState)(false);
|
|
@@ -147,109 +89,12 @@ function ComponentCell(_ref) {
|
|
|
147
89
|
}
|
|
148
90
|
const mountPoint = "/".concat(blocklet.mountPoint || '/').replace(/\/+/g, '/');
|
|
149
91
|
const href = getComponentUrl(mountPoint);
|
|
150
|
-
const renderRows = rows => rows.map(row => {
|
|
151
|
-
if (row.name === t('common.did') || row.name === t('blocklet.appId')) {
|
|
152
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
153
|
-
valueComponent: "div",
|
|
154
|
-
nameWidth: 120,
|
|
155
|
-
name: row.name,
|
|
156
|
-
nameFormatter: () => row.name,
|
|
157
|
-
children: row.value
|
|
158
|
-
}, row.name);
|
|
159
|
-
}
|
|
160
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
161
|
-
valueComponent: "div",
|
|
162
|
-
nameWidth: 120,
|
|
163
|
-
name: row.name,
|
|
164
|
-
children: row.value
|
|
165
|
-
}, row.name);
|
|
166
|
-
});
|
|
167
|
-
const sourceInfo = componentInfo ? getSourceInfo(componentInfo) : {};
|
|
168
|
-
const componentRows = componentInfo ? [{
|
|
169
|
-
name: t('common.name'),
|
|
170
|
-
value: (0, _util.getDisplayName)(componentInfo, true)
|
|
171
|
-
}, {
|
|
172
|
-
name: t('common.version'),
|
|
173
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_version.default, {
|
|
174
|
-
blocklet: componentInfo,
|
|
175
|
-
checkUpgrade: false
|
|
176
|
-
})
|
|
177
|
-
}, {
|
|
178
|
-
name: t('common.status'),
|
|
179
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
|
|
180
|
-
status: status,
|
|
181
|
-
source: componentInfo.source,
|
|
182
|
-
progress: blocklet.progress
|
|
183
|
-
})
|
|
184
|
-
}, blocklet.status === 'running' ? {
|
|
185
|
-
name: t('blocklet.startedAt'),
|
|
186
|
-
value: (0, _util2.formatToDatetime)(blocklet.startedAt, locale)
|
|
187
|
-
} : null, blocklet.status !== 'running' ? {
|
|
188
|
-
name: t('blocklet.stoppedAt'),
|
|
189
|
-
value: (0, _util2.formatToDatetime)(blocklet.stoppedAt, locale)
|
|
190
|
-
} : null, blocklet.installedAt ? {
|
|
191
|
-
name: t('blocklet.installedAt'),
|
|
192
|
-
value: (0, _util2.formatToDatetime)(blocklet.installedAt, locale)
|
|
193
|
-
} : null, (0, _util.hasStartEngine)(blocklet.meta) ? {
|
|
194
|
-
name: t('common.mountPoint'),
|
|
195
|
-
value: mountPoint
|
|
196
|
-
} : null, componentInfo.meta.group ? {
|
|
197
|
-
name: t('common.group'),
|
|
198
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tag.default, {
|
|
199
|
-
type: "success",
|
|
200
|
-
children: componentInfo.meta.group
|
|
201
|
-
})
|
|
202
|
-
} : null, {
|
|
203
|
-
name: t('blocklet.overview.source'),
|
|
204
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockletSource.default, {
|
|
205
|
-
sourceInfo: sourceInfo,
|
|
206
|
-
blocklet: blocklet
|
|
207
|
-
})
|
|
208
|
-
}, {
|
|
209
|
-
name: t('blocklet.overview.deployedFrom'),
|
|
210
|
-
value: sourceInfo.deployedFrom || '-'
|
|
211
|
-
}, {
|
|
212
|
-
name: t('common.did'),
|
|
213
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
214
|
-
did: componentInfo.meta.did,
|
|
215
|
-
showQrcode: true
|
|
216
|
-
})
|
|
217
|
-
}, {
|
|
218
|
-
name: t('common.author'),
|
|
219
|
-
value: (0, _util2.formatPerson)(componentInfo.meta.author)
|
|
220
|
-
}, {
|
|
221
|
-
name: t('common.engine'),
|
|
222
|
-
value: getEngineRows(componentInfo.engine, t).map(_ref2 => {
|
|
223
|
-
let {
|
|
224
|
-
name,
|
|
225
|
-
value
|
|
226
|
-
} = _ref2;
|
|
227
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
228
|
-
style: {
|
|
229
|
-
marginBottom: 4
|
|
230
|
-
},
|
|
231
|
-
nameWidth: 120,
|
|
232
|
-
name: name,
|
|
233
|
-
children: value
|
|
234
|
-
}, name);
|
|
235
|
-
})
|
|
236
|
-
}, (_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length ? {
|
|
237
|
-
name: t('common.dependents'),
|
|
238
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
239
|
-
children: blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
240
|
-
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
241
|
-
}, x.id))
|
|
242
|
-
})
|
|
243
|
-
} : null, (_blocklet$meta$resour = blocklet.meta.resources) !== null && _blocklet$meta$resour !== void 0 && _blocklet$meta$resour.length ? {
|
|
244
|
-
name: t('common.resource'),
|
|
245
|
-
value: blocklet.meta.resources.join(', ')
|
|
246
|
-
} : null].filter(Boolean) : [];
|
|
247
92
|
const appInProgress = (0, _util.isInProgress)(app.status);
|
|
248
93
|
const componentInProgress = (0, _util.isInProgress)(blocklet.status);
|
|
249
94
|
let deleteDisabledTip = '';
|
|
250
95
|
if (appInProgress || componentInProgress || depth === 1 && deletingComponents.includes(blocklet.meta.did)) {
|
|
251
96
|
deleteDisabledTip = t('blocklet.component.tip.stopBlocklet');
|
|
252
|
-
} else if ((_blocklet$
|
|
97
|
+
} else if ((_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length) {
|
|
253
98
|
const requires = blocklet.dependents.filter(x => x.required);
|
|
254
99
|
if (requires.length) {
|
|
255
100
|
const names = requires.map(x => getComponentName(x.id, app));
|
|
@@ -258,229 +103,223 @@ function ComponentCell(_ref) {
|
|
|
258
103
|
});
|
|
259
104
|
}
|
|
260
105
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
106
|
+
const handleRemove = async function handleRemove() {
|
|
107
|
+
setLoading(true);
|
|
108
|
+
try {
|
|
109
|
+
await onRemove(...arguments);
|
|
110
|
+
} catch (_unused) {
|
|
111
|
+
// ignore
|
|
112
|
+
}
|
|
113
|
+
setLoading(false);
|
|
114
|
+
setShowDeleteConfirm(false);
|
|
115
|
+
};
|
|
116
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledComponentRow, {
|
|
273
118
|
display: "flex",
|
|
119
|
+
py: 2,
|
|
120
|
+
className: "component-item",
|
|
121
|
+
justifyContent: "flex-start",
|
|
274
122
|
alignItems: "center",
|
|
275
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
287
|
-
className: "component-version",
|
|
288
|
-
children: blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version
|
|
289
|
-
})]
|
|
123
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
124
|
+
pl: 2,
|
|
125
|
+
width: {
|
|
126
|
+
xs: 300,
|
|
127
|
+
md: 400
|
|
128
|
+
},
|
|
129
|
+
display: "flex",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bundleAvatar.default, {
|
|
132
|
+
blocklet: blocklet,
|
|
133
|
+
ancestors: ancestors
|
|
290
134
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
135
|
+
ml: "16px",
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
137
|
+
className: "component-header",
|
|
138
|
+
onClick: () => setComponentInfo(blocklet),
|
|
139
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
140
|
+
className: "component-name",
|
|
141
|
+
children: (0, _util.getDisplayName)(blocklet, true)
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
143
|
+
className: "component-version",
|
|
144
|
+
children: blocklet === null || blocklet === void 0 || (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version
|
|
145
|
+
})]
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
147
|
+
display: "flex",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
sx: {
|
|
150
|
+
mt: '2px',
|
|
151
|
+
ml: -0.5
|
|
307
152
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
153
|
+
children: [status !== 'unknown' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_status.default, {
|
|
154
|
+
style: {
|
|
155
|
+
marginLeft: 4
|
|
156
|
+
},
|
|
157
|
+
status: status,
|
|
158
|
+
source: blocklet.source,
|
|
159
|
+
progress: blocklet.progress
|
|
160
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_mode.default, {
|
|
161
|
+
style: {
|
|
162
|
+
marginLeft: 4
|
|
163
|
+
},
|
|
164
|
+
mode: blocklet.mode || ''
|
|
165
|
+
}), !!((_blocklet$dependents2 = blocklet.dependents) !== null && _blocklet$dependents2 !== void 0 && _blocklet$dependents2.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
166
|
+
title: ["".concat(t('common.dependents'), ": "), blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
167
|
+
pl: 1,
|
|
168
|
+
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
169
|
+
}, x.id))],
|
|
170
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
171
|
+
display: "flex",
|
|
172
|
+
color: "primary.main",
|
|
173
|
+
ml: 1,
|
|
174
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
175
|
+
icon: "octicon:package-dependents-16"
|
|
176
|
+
})
|
|
320
177
|
})
|
|
321
|
-
})
|
|
178
|
+
})]
|
|
322
179
|
})]
|
|
323
180
|
})]
|
|
324
|
-
})
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
flexGrow: "1",
|
|
334
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
335
|
-
target: "_blank",
|
|
336
|
-
href: href,
|
|
337
|
-
rel: "noopener noreferrer",
|
|
338
|
-
title: href,
|
|
339
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
340
|
-
maxWidth: 400,
|
|
341
|
-
sx: {
|
|
342
|
-
color: 'secondary.main',
|
|
343
|
-
fontSize: 16,
|
|
344
|
-
px: 2
|
|
345
|
-
},
|
|
346
|
-
overflow: "hidden",
|
|
347
|
-
whiteSpace: "nowrap",
|
|
348
|
-
textOverflow: "ellipsis",
|
|
349
|
-
children: (0, _normalizePathPrefix.default)(mountPoint)
|
|
350
|
-
})
|
|
351
|
-
})
|
|
352
|
-
}, mountPoint), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
353
|
-
style: {
|
|
354
|
-
flex: 1
|
|
355
|
-
}
|
|
356
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
357
|
-
display: "flex",
|
|
358
|
-
alignItems: "center",
|
|
359
|
-
children: [(0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
360
|
-
title: t('common.visit'),
|
|
181
|
+
}, blocklet), (0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
182
|
+
sx: {
|
|
183
|
+
display: {
|
|
184
|
+
xs: 'none',
|
|
185
|
+
md: 'flex'
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
alignItems: "center",
|
|
189
|
+
flexGrow: "1",
|
|
361
190
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
362
191
|
target: "_blank",
|
|
363
192
|
href: href,
|
|
364
193
|
rel: "noopener noreferrer",
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
194
|
+
title: href,
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
196
|
+
maxWidth: 400,
|
|
197
|
+
sx: {
|
|
198
|
+
color: 'secondary.main',
|
|
199
|
+
fontSize: 16,
|
|
200
|
+
px: 2
|
|
201
|
+
},
|
|
202
|
+
overflow: "hidden",
|
|
203
|
+
whiteSpace: "nowrap",
|
|
204
|
+
textOverflow: "ellipsis",
|
|
205
|
+
children: (0, _normalizePathPrefix.default)(mountPoint)
|
|
368
206
|
})
|
|
369
207
|
})
|
|
370
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
children: _ref3 => {
|
|
374
|
-
let {
|
|
375
|
-
open
|
|
376
|
-
} = _ref3;
|
|
377
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
378
|
-
title: t('common.config'),
|
|
379
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
380
|
-
color: "error",
|
|
381
|
-
badgeContent: "",
|
|
382
|
-
variant: "dot",
|
|
383
|
-
invisible: !(0, _util.getComponentMissingConfigs)(blocklet, ancestors[0]).length,
|
|
384
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
385
|
-
onClick: open,
|
|
386
|
-
size: "small",
|
|
387
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsOutlined.default, {})
|
|
388
|
-
})
|
|
389
|
-
})
|
|
390
|
-
}, "config");
|
|
208
|
+
}, mountPoint), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
209
|
+
style: {
|
|
210
|
+
flex: 1
|
|
391
211
|
}
|
|
392
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
213
|
+
display: "flex",
|
|
214
|
+
alignItems: "center",
|
|
215
|
+
children: [(0, _util.hasStartEngine)(blocklet.meta) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
216
|
+
title: t('common.visit'),
|
|
217
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
218
|
+
target: "_blank",
|
|
219
|
+
href: href,
|
|
220
|
+
rel: "noopener noreferrer",
|
|
221
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
222
|
+
size: "small",
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Launch.default, {})
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_configuration.default, {
|
|
227
|
+
blocklet: blocklet,
|
|
228
|
+
ancestors: ancestors,
|
|
229
|
+
children: _ref2 => {
|
|
230
|
+
let {
|
|
231
|
+
open
|
|
232
|
+
} = _ref2;
|
|
233
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
234
|
+
title: t('common.config'),
|
|
235
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
236
|
+
color: "error",
|
|
237
|
+
badgeContent: "",
|
|
238
|
+
variant: "dot",
|
|
239
|
+
invisible: !(0, _util.getComponentMissingConfigs)(blocklet, ancestors[0]).length,
|
|
240
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
241
|
+
onClick: open,
|
|
242
|
+
size: "small",
|
|
243
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsOutlined.default, {})
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
}, "config");
|
|
405
247
|
}
|
|
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
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
onConfirm: confirmSetting.onConfirm,
|
|
482
|
-
onCancel: confirmSetting.onCancel
|
|
483
|
-
}, "confirm-setting")];
|
|
248
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_start.default, {
|
|
249
|
+
blocklet: app,
|
|
250
|
+
component: blocklet,
|
|
251
|
+
onStart: onStart,
|
|
252
|
+
onStop: onStop,
|
|
253
|
+
disabled: !['starting', 'stopping'].includes(app.status) && (0, _util.isInProgress)(app.status)
|
|
254
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_actions.default, {
|
|
255
|
+
"data-cy": "component-actions",
|
|
256
|
+
actions: [(0, _util.hasStartEngine)(blocklet.meta) ? {
|
|
257
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoOutlined.default, {}),
|
|
258
|
+
text: t('common.detail'),
|
|
259
|
+
onClick: () => {
|
|
260
|
+
setComponentInfo(blocklet);
|
|
261
|
+
}
|
|
262
|
+
} : null, !isResource(blocklet) && {
|
|
263
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Replay.default, {}),
|
|
264
|
+
text: t('common.restart'),
|
|
265
|
+
onClick: () => {
|
|
266
|
+
setConfirmSetting({
|
|
267
|
+
title: "".concat(t('common.restart'), " ").concat(blocklet.meta.title),
|
|
268
|
+
description: t('blocklet.action.restartDescription'),
|
|
269
|
+
confirm: t('blocklet.action.confirmRestart'),
|
|
270
|
+
cancel: t('common.cancel'),
|
|
271
|
+
onConfirm: async () => {
|
|
272
|
+
setLoading(true);
|
|
273
|
+
await onRestart(blocklet);
|
|
274
|
+
setLoading(false);
|
|
275
|
+
},
|
|
276
|
+
onCancel: () => setConfirmSetting(null)
|
|
277
|
+
});
|
|
278
|
+
},
|
|
279
|
+
disabled: appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
280
|
+
}, !isResource(blocklet) && {
|
|
281
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autorenew.default, {}),
|
|
282
|
+
text: t('common.reload'),
|
|
283
|
+
onClick: async () => {
|
|
284
|
+
setLoading(true);
|
|
285
|
+
await onReload(blocklet);
|
|
286
|
+
setLoading(false);
|
|
287
|
+
},
|
|
288
|
+
disabled: loading || appInProgress || componentInProgress || blocklet.status !== 'running'
|
|
289
|
+
}, {
|
|
290
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Delete.default, {}),
|
|
291
|
+
text: t('common.delete'),
|
|
292
|
+
onClick: () => {
|
|
293
|
+
setShowDeleteConfirm(true);
|
|
294
|
+
},
|
|
295
|
+
disabled: appInProgress || componentInProgress || !!deleteDisabledTip,
|
|
296
|
+
tip: deleteDisabledTip
|
|
297
|
+
}].filter(Boolean)
|
|
298
|
+
})]
|
|
299
|
+
}, "actions")]
|
|
300
|
+
}, "group-not-gateway-box"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_line.default, {}, "line"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentInfoDialog.default, {
|
|
301
|
+
componentInfo: componentInfo,
|
|
302
|
+
onClose: setComponentInfo,
|
|
303
|
+
blocklet: blocklet,
|
|
304
|
+
app: app,
|
|
305
|
+
depth: depth
|
|
306
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_delete.default, {
|
|
307
|
+
blocklet: app,
|
|
308
|
+
component: blocklet,
|
|
309
|
+
remove: handleRemove,
|
|
310
|
+
onCancel: () => setShowDeleteConfirm(false),
|
|
311
|
+
hideBtn: true,
|
|
312
|
+
showConfirm: showDeleteConfirm
|
|
313
|
+
}, "delete-component"), confirmSetting && /*#__PURE__*/(0, _jsxRuntime.jsx)(_confirm.default, {
|
|
314
|
+
title: confirmSetting.title,
|
|
315
|
+
description: confirmSetting.description,
|
|
316
|
+
confirm: confirmSetting.confirm,
|
|
317
|
+
cancel: confirmSetting.cancel,
|
|
318
|
+
params: confirmSetting.params,
|
|
319
|
+
onConfirm: confirmSetting.onConfirm,
|
|
320
|
+
onCancel: confirmSetting.onCancel
|
|
321
|
+
}, "confirm-setting")]
|
|
322
|
+
});
|
|
484
323
|
}
|
|
485
324
|
ComponentCell.propTypes = {
|
|
486
325
|
blocklet: _propTypes.default.object.isRequired,
|