@abtnode/ux 1.8.65-beta-5405baf2 → 1.8.65-beta-bfcc12ce
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/storage.js +23 -5
- package/lib/locales/en.js +1 -7
- package/lib/locales/zh.js +1 -7
- package/lib/team/members/index.js +8 -0
- package/lib/team/members/member.js +4 -1
- package/lib/util/mode.js +11 -0
- package/package.json +14 -14
package/lib/blocklet/storage.js
CHANGED
|
@@ -29,7 +29,21 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
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
31
|
function Storage() {
|
|
32
|
-
var _blocklet$environment;
|
|
32
|
+
var _localStorage$getItem, _blocklet$environment;
|
|
33
|
+
const options = [
|
|
34
|
+
// TODO: 测试用,上线后才需删除
|
|
35
|
+
{
|
|
36
|
+
value: (_localStorage$getItem = localStorage.getItem('test-spaces')) !== null && _localStorage$getItem !== void 0 && _localStorage$getItem.startsWith('http') ? localStorage.getItem('test-spaces') : 'https://bbqazi2fhuczchrlggs4njj2bucbvnwjjm2xlq6yk6i.did.abtnet.io',
|
|
37
|
+
label: 'test spaces'
|
|
38
|
+
}, {
|
|
39
|
+
value: 'https://storage.staging.abtnet.io/app',
|
|
40
|
+
label: 'staging spaces'
|
|
41
|
+
}, {
|
|
42
|
+
value: 'https://service.didspaces.com/app',
|
|
43
|
+
label: 'prod spaces'
|
|
44
|
+
}];
|
|
45
|
+
const [didSpacesUrl, setDidSpacesUrl] = (0, _react.useState)(options[0].value);
|
|
46
|
+
|
|
33
47
|
/** @type {{ api: import('@abtnode/client').ABTNodeClient }} */
|
|
34
48
|
const {
|
|
35
49
|
api
|
|
@@ -44,7 +58,6 @@ function Storage() {
|
|
|
44
58
|
blocklet
|
|
45
59
|
} = (0, _blocklet.useBlockletContext)();
|
|
46
60
|
const [endpoint, setEndpoint] = (0, _react.useState)(((_blocklet$environment = blocklet.environments.find(e => e.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)) === null || _blocklet$environment === void 0 ? void 0 : _blocklet$environment.value) || '');
|
|
47
|
-
const [didSpacesUrl, setDidSpacesUrl] = (0, _react.useState)('https://storage.staging.abtnet.io/app');
|
|
48
61
|
const [isLoading, setIsLoading] = (0, _react.useState)(false);
|
|
49
62
|
const {
|
|
50
63
|
appDid
|
|
@@ -130,9 +143,9 @@ function Storage() {
|
|
|
130
143
|
} = event.target;
|
|
131
144
|
if ((0, _lodash.isEmpty)(value)) {
|
|
132
145
|
setErrorMessage(t('storage.didSpaces.addressCannotEmpty', locale));
|
|
133
|
-
|
|
134
|
-
setErrorMessage(null);
|
|
146
|
+
return;
|
|
135
147
|
}
|
|
148
|
+
setErrorMessage(null);
|
|
136
149
|
setDidSpacesUrl(value);
|
|
137
150
|
};
|
|
138
151
|
const onBackup = async () => {
|
|
@@ -173,6 +186,7 @@ function Storage() {
|
|
|
173
186
|
}, [appName, locale, t]);
|
|
174
187
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
175
188
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StorageUrlTextField, {
|
|
189
|
+
select: true,
|
|
176
190
|
sx: {
|
|
177
191
|
marginTop: '20px'
|
|
178
192
|
},
|
|
@@ -199,7 +213,11 @@ function Storage() {
|
|
|
199
213
|
},
|
|
200
214
|
children: endpoint ? t('storage.didSpaces.reAuthorization') : t('storage.didSpaces.goToAuthorization')
|
|
201
215
|
})
|
|
202
|
-
}
|
|
216
|
+
},
|
|
217
|
+
children: options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
218
|
+
value: option.value,
|
|
219
|
+
children: option.label
|
|
220
|
+
}, option.value))
|
|
203
221
|
}), endpoint && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
204
222
|
color: "text.secondary",
|
|
205
223
|
sx: {
|
package/lib/locales/en.js
CHANGED
|
@@ -280,13 +280,6 @@ module.exports = {
|
|
|
280
280
|
installFromMarket: 'Install New Blocklets',
|
|
281
281
|
installFromUrl: 'Install From Url',
|
|
282
282
|
installFromCreate: 'Create Blocklet',
|
|
283
|
-
restoreFromSpaces: 'Restore from Spaces',
|
|
284
|
-
restoreFromSpacesForm: {
|
|
285
|
-
endpoint: 'Spaces endpoint',
|
|
286
|
-
blockletSecretKey: "blocklet's secret key",
|
|
287
|
-
restore: 'Restore',
|
|
288
|
-
successfully: 'Restored successfully'
|
|
289
|
-
},
|
|
290
283
|
installedAt: 'Installed At',
|
|
291
284
|
internal: 'Internal',
|
|
292
285
|
startedAt: 'Started At',
|
|
@@ -892,6 +885,7 @@ module.exports = {
|
|
|
892
885
|
passport: 'Passport',
|
|
893
886
|
passports: 'Passports',
|
|
894
887
|
lastLogin: 'Last Login',
|
|
888
|
+
lastLoginIp: 'Last Login IP',
|
|
895
889
|
filter: 'Filter by',
|
|
896
890
|
forbidLogin: 'Forbid Login',
|
|
897
891
|
forbidLoginDescription: 'The user will not be able to connect to this application',
|
package/lib/locales/zh.js
CHANGED
|
@@ -286,13 +286,6 @@ module.exports = {
|
|
|
286
286
|
installFromMarket: '从应用商店安装',
|
|
287
287
|
installFromUrl: '通过 URL 安装',
|
|
288
288
|
installFromCreate: '创建基石程序',
|
|
289
|
-
restoreFromSpaces: '从 Spaces 还原',
|
|
290
|
-
restoreFromSpacesForm: {
|
|
291
|
-
endpoint: 'Spaces 端点',
|
|
292
|
-
blockletSecretKey: 'blocklet 的私钥',
|
|
293
|
-
restore: '还原',
|
|
294
|
-
successfully: '还原成功'
|
|
295
|
-
},
|
|
296
289
|
installedAt: '安装时间',
|
|
297
290
|
internal: '内部',
|
|
298
291
|
startedAt: '启动时间',
|
|
@@ -895,6 +888,7 @@ module.exports = {
|
|
|
895
888
|
passport: '通行证',
|
|
896
889
|
passports: '通行证',
|
|
897
890
|
lastLogin: '上次登录',
|
|
891
|
+
lastLoginIp: '上次登陆 IP',
|
|
898
892
|
filter: '条件筛选',
|
|
899
893
|
forbidLogin: '禁止登录',
|
|
900
894
|
forbidLoginDescription: '该成员将无法登录此应用',
|
|
@@ -259,6 +259,14 @@ function MemberList(_ref2) {
|
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
+
}, {
|
|
263
|
+
label: t('team.member.lastLoginIp'),
|
|
264
|
+
name: 'lastLoginIp',
|
|
265
|
+
options: {
|
|
266
|
+
customBodyRender: e => {
|
|
267
|
+
return e || '-';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
262
270
|
}, {
|
|
263
271
|
label: t('common.actions'),
|
|
264
272
|
name: '',
|
|
@@ -122,7 +122,10 @@ function Member(_ref) {
|
|
|
122
122
|
value: user.approved ? t('common.yes') : t('common.no')
|
|
123
123
|
}, {
|
|
124
124
|
name: t('team.member.lastLogin'),
|
|
125
|
-
value: (0, _util.formatToDatetime)(user.
|
|
125
|
+
value: (0, _util.formatToDatetime)(user.lastLoginAt)
|
|
126
|
+
}, {
|
|
127
|
+
name: t('team.member.lastLoginIp'),
|
|
128
|
+
value: user.lastLoginIp || ''
|
|
126
129
|
}, {
|
|
127
130
|
name: t('common.createdAt'),
|
|
128
131
|
value: (0, _util.formatToDatetime)(user.createdAt)
|
package/lib/util/mode.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAlphaMode = void 0;
|
|
7
|
+
/* eslint-disable import/prefer-default-export */
|
|
8
|
+
|
|
9
|
+
// 当前模式是 内测模式 吗? @see: https://developer.aliyun.com/article/572525
|
|
10
|
+
const isAlphaMode = localStorage.getItem('enableAlphaMode') === 'true';
|
|
11
|
+
exports.isAlphaMode = isAlphaMode;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.65-beta-
|
|
6
|
+
"version": "1.8.65-beta-bfcc12ce",
|
|
7
7
|
"description": "UX components shared across abtnode packages",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@abtnode/auth": "1.8.65-beta-
|
|
25
|
-
"@abtnode/constant": "1.8.65-beta-
|
|
26
|
-
"@abtnode/util": "1.8.65-beta-
|
|
27
|
-
"@arcblock/did-connect": "^2.4.
|
|
24
|
+
"@abtnode/auth": "1.8.65-beta-bfcc12ce",
|
|
25
|
+
"@abtnode/constant": "1.8.65-beta-bfcc12ce",
|
|
26
|
+
"@abtnode/util": "1.8.65-beta-bfcc12ce",
|
|
27
|
+
"@arcblock/did-connect": "^2.4.71",
|
|
28
28
|
"@arcblock/did-motif": "^1.1.10",
|
|
29
|
-
"@arcblock/icons": "^2.4.
|
|
30
|
-
"@arcblock/terminal": "^2.4.
|
|
31
|
-
"@arcblock/ux": "^2.4.
|
|
32
|
-
"@blocklet/constant": "1.8.65-beta-
|
|
33
|
-
"@blocklet/launcher-layout": "^1.9.
|
|
34
|
-
"@blocklet/list": "^0.10.
|
|
35
|
-
"@blocklet/meta": "1.8.65-beta-
|
|
36
|
-
"@blocklet/ui-react": "^2.4.
|
|
29
|
+
"@arcblock/icons": "^2.4.71",
|
|
30
|
+
"@arcblock/terminal": "^2.4.71",
|
|
31
|
+
"@arcblock/ux": "^2.4.71",
|
|
32
|
+
"@blocklet/constant": "1.8.65-beta-bfcc12ce",
|
|
33
|
+
"@blocklet/launcher-layout": "^1.9.58",
|
|
34
|
+
"@blocklet/list": "^0.10.50",
|
|
35
|
+
"@blocklet/meta": "1.8.65-beta-bfcc12ce",
|
|
36
|
+
"@blocklet/ui-react": "^2.4.71",
|
|
37
37
|
"@emotion/react": "^11.10.4",
|
|
38
38
|
"@emotion/styled": "^11.10.4",
|
|
39
39
|
"@iconify/react": "^4.0.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"@babel/preset-react": "^7.18.6",
|
|
87
87
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f6a56512275a55feecf2f3953542ea98777a08f2"
|
|
90
90
|
}
|