@abtnode/ux 1.8.65-beta-81d3340c → 1.8.65-beta-f7af64a4

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.
@@ -7,6 +7,7 @@ exports.default = BlockletAppAvatar;
7
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
9
9
  var _Avatar2 = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
10
+ var _constant = require("@blocklet/constant");
10
11
  var _useAppLogo = _interopRequireDefault(require("../hooks/use-app-logo"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  const _excluded = ["blocklet", "style", "size"];
@@ -41,10 +42,14 @@ function BlockletAppAvatar(_ref) {
41
42
  }
42
43
  });
43
44
  if (!blocklet.meta.logo) {
44
- imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar2.default, {
45
- did: blocklet.meta.did || '',
46
- responsive: true
47
- });
45
+ var _find;
46
+ const exist = (_find = (blocklet.configs || []).find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)) === null || _find === void 0 ? void 0 : _find.value;
47
+ if (!exist) {
48
+ imgEle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar2.default, {
49
+ did: blocklet.meta.did || '',
50
+ responsive: true
51
+ });
52
+ }
48
53
  }
49
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, _objectSpread(_objectSpread({
50
55
  variant: variant || 'square',
@@ -80,9 +80,7 @@ function BlockletEnvironment(_ref) {
80
80
  const {
81
81
  site
82
82
  } = blocklet;
83
- const {
84
- domainAliases
85
- } = site;
83
+ const domains = (0, _util2.sortDomains)(site === null || site === void 0 ? void 0 : site.domainAliases);
86
84
  const clusterMode = (0, _get.default)(blocklet.meta, 'capabilities.clusterMode', false);
87
85
  useSubscription(_constant.EVENTS.NODE_RUNTIME_INFO, res => {
88
86
  if (clusterMode) {
@@ -398,7 +396,7 @@ function BlockletEnvironment(_ref) {
398
396
  }
399
397
  })
400
398
  })]
401
- }), domainAliases.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
399
+ }), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
402
400
  display: "flex",
403
401
  alignItems: "center",
404
402
  justifyContent: "space-between",
@@ -460,7 +458,7 @@ function BlockletEnvironment(_ref) {
460
458
  })
461
459
  })
462
460
  })]
463
- }, domain.value)), !domainAliases.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
461
+ }, domain.value)), !domains.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
464
462
  mt: 4,
465
463
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
466
464
  children: t('common.empty')
@@ -99,7 +99,7 @@ const getEngineRows = (engine, t) => {
99
99
  }];
100
100
  };
101
101
  function BlockletOverview() {
102
- var _blocklet$settings;
102
+ var _blocklet$settings, _blocklet$site;
103
103
  const {
104
104
  t,
105
105
  locale
@@ -207,12 +207,7 @@ function BlockletOverview() {
207
207
  children: row.value
208
208
  }, row.name);
209
209
  });
210
- const {
211
- site
212
- } = blocklet;
213
- const {
214
- domainAliases = []
215
- } = site || {};
210
+ const domains = (0, _util2.sortDomains)((_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : _blocklet$site.domainAliases);
216
211
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, {
217
212
  component: "div",
218
213
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
@@ -231,7 +226,7 @@ function BlockletOverview() {
231
226
  severity: "warning",
232
227
  children: t('blocklet.router.noRunning')
233
228
  })
234
- }), domainAliases.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
229
+ }), domains.map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
235
230
  display: "flex",
236
231
  alignItems: "center",
237
232
  justifyContent: "space-between",
@@ -260,7 +255,7 @@ function BlockletOverview() {
260
255
  }
261
256
  })]
262
257
  })
263
- }, domain.value)), !domainAliases.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
258
+ }, domain.value)), !domains.length && (loadingRuntimeInfo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
264
259
  size: 16
265
260
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
266
261
  children: t('common.empty')
package/lib/locales/en.js CHANGED
@@ -892,6 +892,7 @@ module.exports = {
892
892
  passport: 'Passport',
893
893
  passports: 'Passports',
894
894
  lastLogin: 'Last Login',
895
+ lastLoginIp: 'Last Login IP',
895
896
  filter: 'Filter by',
896
897
  forbidLogin: 'Forbid Login',
897
898
  forbidLoginDescription: 'The user will not be able to connect to this application',
package/lib/locales/zh.js CHANGED
@@ -895,6 +895,7 @@ module.exports = {
895
895
  passport: '通行证',
896
896
  passports: '通行证',
897
897
  lastLogin: '上次登录',
898
+ lastLoginIp: '上次登陆 IP',
898
899
  filter: '条件筛选',
899
900
  forbidLogin: '禁止登录',
900
901
  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.updatedAt)
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/index.js CHANGED
@@ -40,7 +40,7 @@ exports.parseQuery = void 0;
40
40
  exports.patchJsxToLocale = patchJsxToLocale;
41
41
  exports.shouldCheckDomainStatus = void 0;
42
42
  exports.sleep = sleep;
43
- exports.validateDomain = exports.toSlotDomain = exports.stringSortHandlerAsc = void 0;
43
+ exports.validateDomain = exports.toSlotDomain = exports.stringSortHandlerAsc = exports.sortDomains = void 0;
44
44
  var _constant = require("@abtnode/constant");
45
45
  var _dayjs = _interopRequireDefault(require("dayjs"));
46
46
  require("moment/locale/zh-cn");
@@ -692,4 +692,25 @@ const getStoreList = _ref5 => {
692
692
  storeList
693
693
  };
694
694
  };
695
- exports.getStoreList = getStoreList;
695
+ exports.getStoreList = getStoreList;
696
+ const isDidDomainOrIpEchoDomain = domain => {
697
+ if (!domain) {
698
+ return false;
699
+ }
700
+ return domain.endsWith(_constant.DEFAULT_DID_DOMAIN) || domain.endsWith(_constant.DEFAULT_IP_DOMAIN_SUFFIX);
701
+ };
702
+ const sortDomains = domains => {
703
+ return (domains || []).sort((x, y) => {
704
+ if (isDidDomainOrIpEchoDomain(x.value) && isDidDomainOrIpEchoDomain(y.value)) {
705
+ return 0;
706
+ }
707
+ if (isDidDomainOrIpEchoDomain(x.value)) {
708
+ return 1;
709
+ }
710
+ if (isDidDomainOrIpEchoDomain(y.value)) {
711
+ return -1;
712
+ }
713
+ return 1;
714
+ });
715
+ };
716
+ exports.sortDomains = sortDomains;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.65-beta-81d3340c",
6
+ "version": "1.8.65-beta-f7af64a4",
7
7
  "description": "UX components shared across abtnode packages",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -21,18 +21,18 @@
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-81d3340c",
25
- "@abtnode/constant": "1.8.65-beta-81d3340c",
26
- "@abtnode/util": "1.8.65-beta-81d3340c",
24
+ "@abtnode/auth": "1.8.65-beta-f7af64a4",
25
+ "@abtnode/constant": "1.8.65-beta-f7af64a4",
26
+ "@abtnode/util": "1.8.65-beta-f7af64a4",
27
27
  "@arcblock/did-connect": "^2.4.66",
28
28
  "@arcblock/did-motif": "^1.1.10",
29
29
  "@arcblock/icons": "^2.4.66",
30
30
  "@arcblock/terminal": "^2.4.66",
31
31
  "@arcblock/ux": "^2.4.66",
32
- "@blocklet/constant": "1.8.65-beta-81d3340c",
32
+ "@blocklet/constant": "1.8.65-beta-f7af64a4",
33
33
  "@blocklet/launcher-layout": "^1.9.50",
34
34
  "@blocklet/list": "^0.10.47",
35
- "@blocklet/meta": "1.8.65-beta-81d3340c",
35
+ "@blocklet/meta": "1.8.65-beta-f7af64a4",
36
36
  "@blocklet/ui-react": "^2.4.66",
37
37
  "@emotion/react": "^11.10.4",
38
38
  "@emotion/styled": "^11.10.4",
@@ -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": "5a904b9192febd1d09a759d929ca4de639a50cd1"
89
+ "gitHead": "97607d6e12bf8508ac29ab6546110c4ae3b31a82"
90
90
  }