@abtnode/ux 1.16.6-beta-4ea1eb90 → 1.16.6-beta-eaa4d39d
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/overview.js +57 -15
- package/lib/locales/en.js +3 -1
- package/lib/locales/zh.js +3 -1
- package/package.json +13 -13
package/lib/blocklet/overview.js
CHANGED
|
@@ -4,29 +4,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = BlockletOverview;
|
|
7
|
-
var
|
|
7
|
+
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _Alert = _interopRequireDefault(require("@mui/material/Alert"));
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
13
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
15
|
+
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
16
|
+
var _base = require("@abtnode/util/lib/base32");
|
|
17
|
+
var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
|
|
16
18
|
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
17
|
-
var _util = require("@blocklet/meta/lib/util");
|
|
18
19
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
19
|
-
var
|
|
20
|
+
var _Tag = _interopRequireDefault(require("@arcblock/ux/lib/Tag"));
|
|
21
|
+
var _util = require("@blocklet/meta/lib/util");
|
|
22
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
23
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
20
24
|
var _blocklet = require("../contexts/blocklet");
|
|
21
25
|
var _node = require("../contexts/node");
|
|
22
|
-
var _util2 = require("../util");
|
|
23
26
|
var _didAddress = _interopRequireDefault(require("../did-address"));
|
|
24
|
-
var
|
|
27
|
+
var _util2 = require("../util");
|
|
28
|
+
var _expiration = _interopRequireDefault(require("./component/expiration"));
|
|
25
29
|
var _domainStatus = _interopRequireDefault(require("./router/domain-status"));
|
|
30
|
+
var _status = _interopRequireDefault(require("./status"));
|
|
26
31
|
var _types = require("./types");
|
|
27
|
-
var _expiration = _interopRequireDefault(require("./component/expiration"));
|
|
28
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
33
|
var _templateObject, _templateObject2;
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
37
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
38
|
function DomainLink(_ref) {
|
|
@@ -90,6 +96,8 @@ function BlockletOverview() {
|
|
|
90
96
|
info: nodeInfo,
|
|
91
97
|
inService
|
|
92
98
|
} = (0, _node.useNodeContext)();
|
|
99
|
+
const [showAllDomains, setShowAllDomains] = (0, _react.useState)(false);
|
|
100
|
+
const [showAllDIDs, setShowAllDIDs] = (0, _react.useState)(false);
|
|
93
101
|
const {
|
|
94
102
|
blocklet,
|
|
95
103
|
loadingRuntimeInfo
|
|
@@ -111,9 +119,18 @@ function BlockletOverview() {
|
|
|
111
119
|
})
|
|
112
120
|
} : null, (migratedFrom === null || migratedFrom === void 0 ? void 0 : migratedFrom.length) > 1 ? {
|
|
113
121
|
name: t('blocklet.alsoKnownAs'),
|
|
114
|
-
value:
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
value: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
123
|
+
children: [(showAllDIDs ? migratedFrom.slice(1) : migratedFrom.slice(1, 2)).map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
124
|
+
did: x.appDid
|
|
125
|
+
})), migratedFrom.length > 2 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
126
|
+
style: {
|
|
127
|
+
marginLeft: '18px'
|
|
128
|
+
},
|
|
129
|
+
endIcon: showAllDIDs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}),
|
|
130
|
+
onClick: () => setShowAllDIDs(!showAllDIDs),
|
|
131
|
+
children: showAllDIDs ? t('common.collapseAll') : t('blocklet.router.showAllDIDs')
|
|
132
|
+
})]
|
|
133
|
+
})
|
|
117
134
|
} : null, {
|
|
118
135
|
name: t('common.name'),
|
|
119
136
|
value: (0, _util.getDisplayName)(blocklet, true)
|
|
@@ -165,6 +182,10 @@ function BlockletOverview() {
|
|
|
165
182
|
}
|
|
166
183
|
const renderRows = rows => rows.map(row => {
|
|
167
184
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
185
|
+
style: {
|
|
186
|
+
display: 'flex',
|
|
187
|
+
alignItems: 'flex-start'
|
|
188
|
+
},
|
|
168
189
|
valueComponent: "div",
|
|
169
190
|
nameWidth: 120,
|
|
170
191
|
name: row.name,
|
|
@@ -173,6 +194,17 @@ function BlockletOverview() {
|
|
|
173
194
|
}, row.name);
|
|
174
195
|
});
|
|
175
196
|
const domains = (0, _util2.sortDomains)((_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : _blocklet$site.domainAliases);
|
|
197
|
+
const displayDomains = [];
|
|
198
|
+
const hiddenDomains = [];
|
|
199
|
+
const pidBase32 = (0, _base.encode)(blocklet.appPid);
|
|
200
|
+
domains.forEach(domain => {
|
|
201
|
+
const value = domain.value || '';
|
|
202
|
+
if (value.endsWith(nodeInfo.didDomain || 'did.abtnet.io') && !value.startsWith(pidBase32)) {
|
|
203
|
+
hiddenDomains.push(domain);
|
|
204
|
+
} else {
|
|
205
|
+
displayDomains.push(domain);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
176
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, {
|
|
177
209
|
component: "div",
|
|
178
210
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
@@ -191,7 +223,7 @@ function BlockletOverview() {
|
|
|
191
223
|
severity: "warning",
|
|
192
224
|
children: t('blocklet.router.noRunning')
|
|
193
225
|
})
|
|
194
|
-
}), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
226
|
+
}), (showAllDomains ? domains : displayDomains).map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
195
227
|
display: "flex",
|
|
196
228
|
alignItems: "center",
|
|
197
229
|
justifyContent: "space-between",
|
|
@@ -220,7 +252,17 @@ function BlockletOverview() {
|
|
|
220
252
|
}
|
|
221
253
|
})]
|
|
222
254
|
})
|
|
223
|
-
}, domain.value)),
|
|
255
|
+
}, domain.value)), hiddenDomains.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
256
|
+
style: {
|
|
257
|
+
marginLeft: '20px',
|
|
258
|
+
marginTop: '12px'
|
|
259
|
+
},
|
|
260
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
261
|
+
endIcon: showAllDomains ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}),
|
|
262
|
+
onClick: () => setShowAllDomains(!showAllDomains),
|
|
263
|
+
children: showAllDomains ? t('common.collapseAll') : t('blocklet.router.showAllDomains')
|
|
264
|
+
})
|
|
265
|
+
}), !domains.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
224
266
|
size: 16
|
|
225
267
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
|
|
226
268
|
children: t('common.empty')
|
package/lib/locales/en.js
CHANGED
|
@@ -529,7 +529,9 @@ module.exports = {
|
|
|
529
529
|
urlInaccessible: 'It may be due to network reasons, the address is temporarily inaccessible',
|
|
530
530
|
noAccessibleUrl: 'No accessible URL',
|
|
531
531
|
domainLockTooltip: 'The system generated Domain cannot be edited.',
|
|
532
|
-
urlLockTooltip: 'The system generated URL Path cannot be edited.'
|
|
532
|
+
urlLockTooltip: 'The system generated URL Path cannot be edited.',
|
|
533
|
+
showAllDomains: 'Show all domains',
|
|
534
|
+
showAllDIDs: 'Show all DIDs'
|
|
533
535
|
},
|
|
534
536
|
export: {
|
|
535
537
|
title: 'Export Blocklet',
|
package/lib/locales/zh.js
CHANGED
|
@@ -536,7 +536,9 @@ module.exports = {
|
|
|
536
536
|
urlInaccessible: '可能因为网络的原因,该地址暂时无法访问',
|
|
537
537
|
noAccessibleUrl: '没有可访问的地址',
|
|
538
538
|
domainLockTooltip: '无法编辑由系统生成的 域名',
|
|
539
|
-
urlLockTooltip: '无法编辑由系统生成的 URL 路径'
|
|
539
|
+
urlLockTooltip: '无法编辑由系统生成的 URL 路径',
|
|
540
|
+
showAllDomains: '显示所有域名',
|
|
541
|
+
showAllDIDs: '显示所有 DID'
|
|
540
542
|
},
|
|
541
543
|
export: {
|
|
542
544
|
title: '导出 Blocklet',
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.6-beta-
|
|
6
|
+
"version": "1.16.6-beta-eaa4d39d",
|
|
7
7
|
"description": "UX components shared across abtnode packages",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@abtnode/auth": "1.16.6-beta-
|
|
26
|
-
"@abtnode/constant": "1.16.6-beta-
|
|
27
|
-
"@abtnode/util": "1.16.6-beta-
|
|
28
|
-
"@arcblock/did-connect": "^2.5.
|
|
25
|
+
"@abtnode/auth": "1.16.6-beta-eaa4d39d",
|
|
26
|
+
"@abtnode/constant": "1.16.6-beta-eaa4d39d",
|
|
27
|
+
"@abtnode/util": "1.16.6-beta-eaa4d39d",
|
|
28
|
+
"@arcblock/did-connect": "^2.5.30",
|
|
29
29
|
"@arcblock/did-motif": "^1.1.10",
|
|
30
|
-
"@arcblock/icons": "^2.5.
|
|
31
|
-
"@arcblock/react-hooks": "^2.5.
|
|
32
|
-
"@arcblock/terminal": "^2.5.
|
|
33
|
-
"@arcblock/ux": "^2.5.
|
|
34
|
-
"@blocklet/constant": "1.16.6-beta-
|
|
30
|
+
"@arcblock/icons": "^2.5.30",
|
|
31
|
+
"@arcblock/react-hooks": "^2.5.30",
|
|
32
|
+
"@arcblock/terminal": "^2.5.30",
|
|
33
|
+
"@arcblock/ux": "^2.5.30",
|
|
34
|
+
"@blocklet/constant": "1.16.6-beta-eaa4d39d",
|
|
35
35
|
"@blocklet/launcher-layout": "2.0.32",
|
|
36
36
|
"@blocklet/list": "^0.11.18",
|
|
37
|
-
"@blocklet/meta": "1.16.6-beta-
|
|
38
|
-
"@blocklet/ui-react": "^2.5.
|
|
37
|
+
"@blocklet/meta": "1.16.6-beta-eaa4d39d",
|
|
38
|
+
"@blocklet/ui-react": "^2.5.30",
|
|
39
39
|
"@emotion/react": "^11.10.4",
|
|
40
40
|
"@emotion/styled": "^11.10.4",
|
|
41
41
|
"@iconify/react": "^4.0.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"@babel/preset-react": "^7.18.6",
|
|
91
91
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "0d2ab99f67109e989f8182fc70bc3ee9fa430585"
|
|
94
94
|
}
|