From 464a5961f08044d9cd79a370c10dabd52f7fd1e5 Mon Sep 17 00:00:00 2001 From: devinxl <94832688+devinxl@users.noreply.github.com> Date: Thu, 16 May 2024 17:15:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(dcellar-web-ui):=20introduce=20activities?= =?UTF-8?q?=20feature=20for=20bucket,=20object=E2=80=A6=20(#380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(dcellar-web-ui): introduce activities feature for bucket, object and group * fix(dcellar-web-ui): text case error * refactor(dcellar-web-ui): the transfer in style & toolbox style * feat(dcellar-web-ui): add discord and release note link * feat(dcellar-web-ui): introduce the stop upload feature (#385) * feat(dcellar-web-ui): introduce the stop upload feature * fix(dcellar-web-ui): the uploading name text ellispsis * fix(dcellar-web-ui): change the stop status icon * feat(dcellar-web-ui): introduce activities feature for bucket, object and group * fix(dcellar-web-ui): text case error * refactor(dcellar-web-ui): the transfer in style & toolbox style * feat(dcellar-web-ui): add discord and release note link * feat(dcellar-web-ui): introduce the stop upload feature * refactor(dcellar-web-ui): remove rerandunt codes * docs(dcellar-web-ui): update changelog --- apps/dcellar-web-ui/src/facade/bucket.ts | 9 +++++++++ .../modules/bucket/components/DetailBucketOperation.tsx | 2 ++ apps/dcellar-web-ui/src/store/slices/bucket.ts | 2 ++ 3 files changed, 13 insertions(+) diff --git a/apps/dcellar-web-ui/src/facade/bucket.ts b/apps/dcellar-web-ui/src/facade/bucket.ts index 91023133..8a79cec4 100644 --- a/apps/dcellar-web-ui/src/facade/bucket.ts +++ b/apps/dcellar-web-ui/src/facade/bucket.ts @@ -482,4 +482,13 @@ export const cancelMigrateBucket = async ( if (!tx) return [null, error1]; return broadcastTx({ tx: tx, address: params.operator, connector }); +} + +export const getBucketActivities = async (id: string): Promise => { + const url = `/api/tx/list/by_bucket/${id}`; + + const [result] = await axios.get<{ result: Activity[] }>(url).then(resolve, commonFault); + if (!result) return []; + + return result.data.result || []; }; diff --git a/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx b/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx index 63cf8687..2d003c24 100644 --- a/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx +++ b/apps/dcellar-web-ui/src/modules/bucket/components/DetailBucketOperation.tsx @@ -13,6 +13,7 @@ import { TBucket, setupBucketActivity, BucketOperationsType, + setupBucketActivity, } from '@/store/slices/bucket'; import { selectBucketSp } from '@/store/slices/sp'; import { convertObjectKey } from '@/utils/common'; @@ -44,6 +45,7 @@ import { useMount, useUnmount } from 'ahooks'; import { DEFAULT_TAG } from '@/components/common/ManageTags'; import { Activities } from '@/components/Activities'; import { BucketStatus } from '@bnb-chain/greenfield-js-sdk'; +import { Activities } from '@/components/Activities'; export const Label = ({ children }: PropsWithChildren) => ( diff --git a/apps/dcellar-web-ui/src/store/slices/bucket.ts b/apps/dcellar-web-ui/src/store/slices/bucket.ts index 6a7f66ff..8993fa9c 100644 --- a/apps/dcellar-web-ui/src/store/slices/bucket.ts +++ b/apps/dcellar-web-ui/src/store/slices/bucket.ts @@ -19,6 +19,8 @@ import { convertObjectKey } from '@/utils/common'; import { Activity } from './object'; import { numberToHex } from 'viem'; import { BucketStatus as BucketStatusEnum } from '@bnb-chain/greenfield-js-sdk'; +import { Activity } from './object'; +import { numberToHex } from 'viem'; export type BucketOperationsType = | 'detail'