@abtnode/ux 1.16.44 → 1.16.45-beta-20250609-025419-7fd1f86c

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.
@@ -185,7 +185,8 @@ const useDidSpaceBackup = (backupEndpoint, backup) => {
185
185
  display: 'flex',
186
186
  alignItems: 'baseline',
187
187
  gap: 0.5,
188
- color: 'warning.main'
188
+ color: 'warning.main',
189
+ fontSize: 30
189
190
  },
190
191
  children: [t('storage.spaces.backup.noBackup'), /*#__PURE__*/_jsx(Tooltip, {
191
192
  title: t('storage.spaces.backup.noBackupTip'),
@@ -369,7 +370,8 @@ export default function BlockletOverview() {
369
370
  }, row.name);
370
371
  });
371
372
  const blockletStats = useRunningBlocklets(blocklet.children);
372
- const uptime = useUpTime(Number(extra?.value?.appRuntimeInfo?.uptime || 0), x => {
373
+ const appRuntimeUptime = Number(extra?.value?.appRuntimeInfo?.uptime || 0);
374
+ const uptime = useUpTime(appRuntimeUptime, x => {
373
375
  const options = {
374
376
  compact: true,
375
377
  verbose: true,
@@ -379,10 +381,10 @@ export default function BlockletOverview() {
379
381
  });
380
382
  const domains = useMemo(() => blocklet?.site?.domainAliases || [], [blocklet?.site?.domainAliases]);
381
383
  const customDomains = useMemo(() => domains.filter(domain => isCustomDomain(domain.value)), [domains]);
384
+ const customDomain = useCustomDomain(domains, customDomains);
382
385
  const passport = useMemo(() => extra?.value?.passport || {}, [extra?.value?.passport]);
383
386
  const user = useMemo(() => extra?.value?.user || {}, [extra?.value?.user]);
384
387
  const backupEndpoint = useMemo(() => getSpaceBackupEndpoint(blocklet?.environments), [blocklet?.environments]);
385
- const customDomain = useCustomDomain(domains, customDomains);
386
388
  const didSpaceBackup = useDidSpaceBackup(backupEndpoint, extra?.value?.backup);
387
389
  const getBlockletServiceUrl = (tab, subTab) => {
388
390
  return `${WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${tab}/${subTab}`;
@@ -401,6 +403,7 @@ export default function BlockletOverview() {
401
403
  }),
402
404
  url: inService ? getBlockletServiceUrl('overview', 'components') : getBlockletServerUrl('components')
403
405
  }, {
406
+ loading: extra?.loading,
404
407
  name: t('common.members'),
405
408
  value: `${formatNumber(user?.users || 0)}<small>${t('common.active')} ${formatNumber(user?.approvedUsers)}</small>`,
406
409
  icon: /*#__PURE__*/_jsx(Box, {
@@ -410,6 +413,7 @@ export default function BlockletOverview() {
410
413
  }),
411
414
  url: inService ? getBlockletServiceUrl('did-connect', 'members') : getBlockletServerUrl('members')
412
415
  }, {
416
+ loading: extra?.loading,
413
417
  name: t('team.member.passports'),
414
418
  value: `${formatNumber(passport?.passports || 0)}<small>${t('common.active')} ${formatNumber(passport?.activePassports)}</small>`,
415
419
  icon: /*#__PURE__*/_jsx(Box, {
@@ -419,6 +423,7 @@ export default function BlockletOverview() {
419
423
  }),
420
424
  url: inService ? getBlockletServiceUrl('did-connect', 'passports') : getBlockletServerUrl('passports')
421
425
  }, {
426
+ loading: extra?.loading,
422
427
  name: t('common.domains'),
423
428
  value: /*#__PURE__*/_jsxs(Box, {
424
429
  display: "flex",
@@ -432,8 +437,15 @@ export default function BlockletOverview() {
432
437
  }),
433
438
  url: inService ? getBlockletServiceUrl('website', 'domains') : getBlockletServerUrl('domains')
434
439
  }, {
440
+ loading: extra?.loading,
435
441
  name: t('common.uptime'),
436
- value: blocklet?.appRuntimeInfo?.uptime ? uptime : `${t('common.waiting')}...`,
442
+ value: appRuntimeUptime ? uptime : /*#__PURE__*/_jsx(Box, {
443
+ sx: {
444
+ fontSize: 28,
445
+ color: 'text.secondary'
446
+ },
447
+ children: `${t('common.waiting')}...`
448
+ }),
437
449
  icon: /*#__PURE__*/_jsx(Box, {
438
450
  component: Icon,
439
451
  icon: AccessTimeRoundedIcon,
@@ -448,6 +460,7 @@ export default function BlockletOverview() {
448
460
  sx: commonIconStyle
449
461
  })
450
462
  } : null, {
463
+ loading: extra?.loading,
451
464
  name: /*#__PURE__*/_jsxs(Box, {
452
465
  display: "flex",
453
466
  alignItems: "baseline",
@@ -4,6 +4,7 @@ import { Box, Link } from '@mui/material';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Icon } from '@iconify/react';
6
6
  import styled from '@emotion/styled';
7
+ import Skeleton from '@mui/material/Skeleton';
7
8
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
9
  export default function Metric({
9
10
  icon,
@@ -11,7 +12,8 @@ export default function Metric({
11
12
  name,
12
13
  url = '',
13
14
  animated = false,
14
- LinkComponent = Link
15
+ LinkComponent = Link,
16
+ loading = false
15
17
  }) {
16
18
  const renderIcon = () => {
17
19
  if (/*#__PURE__*/React.isValidElement(icon)) {
@@ -26,6 +28,33 @@ export default function Metric({
26
28
  }
27
29
  });
28
30
  };
31
+ if (loading) {
32
+ return /*#__PURE__*/_jsxs(Container, {
33
+ children: [icon && /*#__PURE__*/_jsx(Box, {
34
+ className: "metric__image",
35
+ children: /*#__PURE__*/_jsx(Skeleton, {
36
+ variant: "circular",
37
+ width: 32,
38
+ height: 32
39
+ })
40
+ }), /*#__PURE__*/_jsxs(Box, {
41
+ children: [/*#__PURE__*/_jsx(Skeleton, {
42
+ className: `metric__number ${animated ? 'metric__number--animated' : ''}`,
43
+ variant: "rounded",
44
+ width: 160,
45
+ height: "36px",
46
+ sx: {
47
+ mb: 1
48
+ }
49
+ }), /*#__PURE__*/_jsx(Skeleton, {
50
+ className: "metric__name",
51
+ variant: "rounded",
52
+ width: 80,
53
+ height: 20
54
+ })]
55
+ })]
56
+ });
57
+ }
29
58
  const metric = /*#__PURE__*/_jsxs(_Fragment, {
30
59
  children: [icon && /*#__PURE__*/_jsx(Box, {
31
60
  className: "metric__image",
@@ -61,14 +90,16 @@ Metric.propTypes = {
61
90
  name: PropTypes.string.isRequired,
62
91
  url: PropTypes.string,
63
92
  animated: PropTypes.bool,
64
- LinkComponent: PropTypes.elementType
93
+ LinkComponent: PropTypes.elementType,
94
+ loading: PropTypes.bool
65
95
  };
66
96
  Metric.defaultProps = {
67
97
  url: '',
68
98
  animated: false,
69
- LinkComponent: Link
99
+ LinkComponent: Link,
100
+ loading: false
70
101
  };
71
- const Container = styled('div')`
102
+ const Container = styled(Box)`
72
103
  border-left: 1px solid ${props => props.theme.palette.divider};
73
104
  padding: 10px 0 10px 16px;
74
105
  @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.44",
3
+ "version": "1.16.45-beta-20250609-025419-7fd1f86c",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,31 +25,31 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.44",
29
- "@abtnode/constant": "1.16.44",
30
- "@abtnode/docker-utils": "1.16.44",
31
- "@abtnode/util": "1.16.44",
28
+ "@abtnode/auth": "1.16.45-beta-20250609-025419-7fd1f86c",
29
+ "@abtnode/constant": "1.16.45-beta-20250609-025419-7fd1f86c",
30
+ "@abtnode/docker-utils": "1.16.45-beta-20250609-025419-7fd1f86c",
31
+ "@abtnode/util": "1.16.45-beta-20250609-025419-7fd1f86c",
32
32
  "@ahooksjs/use-url-state": "^3.5.1",
33
- "@arcblock/did": "1.20.13",
34
- "@arcblock/did-connect": "^2.13.61",
35
- "@arcblock/did-ext": "^1.20.13",
33
+ "@arcblock/did": "1.20.14",
34
+ "@arcblock/did-connect": "^2.13.62",
35
+ "@arcblock/did-ext": "^1.20.14",
36
36
  "@arcblock/did-motif": "^1.1.13",
37
- "@arcblock/icons": "^2.13.61",
38
- "@arcblock/nft-display": "^2.13.61",
39
- "@arcblock/react-hooks": "^2.13.61",
40
- "@arcblock/terminal": "^2.13.61",
41
- "@arcblock/ux": "^2.13.61",
42
- "@arcblock/validator": "1.20.13",
43
- "@blocklet/constant": "1.16.44",
44
- "@blocklet/did-domain-react": "^0.3.127",
45
- "@blocklet/did-space-react": "^1.0.57",
37
+ "@arcblock/icons": "^2.13.62",
38
+ "@arcblock/nft-display": "^2.13.62",
39
+ "@arcblock/react-hooks": "^2.13.62",
40
+ "@arcblock/terminal": "^2.13.62",
41
+ "@arcblock/ux": "^2.13.62",
42
+ "@arcblock/validator": "1.20.14",
43
+ "@blocklet/constant": "1.16.45-beta-20250609-025419-7fd1f86c",
44
+ "@blocklet/did-domain-react": "^0.3.130",
45
+ "@blocklet/did-space-react": "^1.0.58",
46
46
  "@blocklet/error": "^0.2.5",
47
- "@blocklet/js-sdk": "1.16.44",
48
- "@blocklet/launcher-layout": "^2.13.61",
49
- "@blocklet/list": "^0.16.54",
50
- "@blocklet/meta": "1.16.44",
51
- "@blocklet/theme": "^2.13.61",
52
- "@blocklet/ui-react": "^2.13.61",
47
+ "@blocklet/js-sdk": "1.16.45-beta-20250609-025419-7fd1f86c",
48
+ "@blocklet/launcher-layout": "^2.13.62",
49
+ "@blocklet/list": "^0.16.55",
50
+ "@blocklet/meta": "1.16.45-beta-20250609-025419-7fd1f86c",
51
+ "@blocklet/theme": "^2.13.62",
52
+ "@blocklet/ui-react": "^2.13.62",
53
53
  "@blocklet/uploader": "^0.1.95",
54
54
  "@emotion/react": "^11.10.4",
55
55
  "@emotion/styled": "^11.10.4",
@@ -64,9 +64,9 @@
64
64
  "@mui/styles": "^5.15.11",
65
65
  "@mui/x-date-pickers": "^6.19.0",
66
66
  "@mui/x-tree-view": "^6.17.0",
67
- "@ocap/client": "1.20.13",
68
- "@ocap/mcrypto": "1.20.13",
69
- "@ocap/util": "1.20.13",
67
+ "@ocap/client": "1.20.14",
68
+ "@ocap/mcrypto": "1.20.14",
69
+ "@ocap/util": "1.20.14",
70
70
  "@uiw/react-markdown-preview": "^5.1.1",
71
71
  "ahooks": "^3.7.8",
72
72
  "axios": "^1.7.9",
@@ -128,5 +128,5 @@
128
128
  "jest": "^29.7.0",
129
129
  "jest-environment-jsdom": "^29.7.0"
130
130
  },
131
- "gitHead": "a177f040e3e8da94311cec1395c8e8defae2da9e"
131
+ "gitHead": "0457b82da528653a1b903149ea1fb1966c31bee3"
132
132
  }