From 7ffc3cc960c5fbff556384decd69bca1ee23ccc0 Mon Sep 17 00:00:00 2001 From: aidencao Date: Thu, 11 Apr 2024 17:17:11 +0800 Subject: [PATCH] refactor(dcellar-web-ui): update sp-meta field --- .../src/modules/bucket/components/SPSelector/OptionItem.tsx | 2 +- .../src/modules/pricing-calculator/components/SPFreeQuota.tsx | 2 +- apps/dcellar-web-ui/src/modules/pricing-calculator/index.tsx | 4 ++-- apps/dcellar-web-ui/src/store/slices/sp.ts | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/dcellar-web-ui/src/modules/bucket/components/SPSelector/OptionItem.tsx b/apps/dcellar-web-ui/src/modules/bucket/components/SPSelector/OptionItem.tsx index 61f11c4d..ff44facf 100644 --- a/apps/dcellar-web-ui/src/modules/bucket/components/SPSelector/OptionItem.tsx +++ b/apps/dcellar-web-ui/src/modules/bucket/components/SPSelector/OptionItem.tsx @@ -75,7 +75,7 @@ export const OptionItem = memo(function OptionItem({ {meta && meta.FreeReadQuota ? formatBytes(meta.FreeReadQuota) : '--'} - {meta && meta.FreeMonthlyQuota ? formatBytes(meta.FreeMonthlyQuota) : '--'} + {meta && meta.MonthlyFreeQuota ? formatBytes(meta.MonthlyFreeQuota) : '--'} {access && spLatency ? `${spLatency}ms` : '--'} diff --git a/apps/dcellar-web-ui/src/modules/pricing-calculator/components/SPFreeQuota.tsx b/apps/dcellar-web-ui/src/modules/pricing-calculator/components/SPFreeQuota.tsx index 846a796e..1286eb72 100644 --- a/apps/dcellar-web-ui/src/modules/pricing-calculator/components/SPFreeQuota.tsx +++ b/apps/dcellar-web-ui/src/modules/pricing-calculator/components/SPFreeQuota.tsx @@ -72,7 +72,7 @@ export const SPFreeQuota = ({ sps }: SPFreeQuotaProps) => { - {!item.freeMonthlyQuota ? '--' : formatBytes(item.freeMonthlyQuota)} + {!item.monthlyFreeQuota ? '--' : formatBytes(item.monthlyFreeQuota)} {!item.freeQuota ? '--' : formatBytes(item.freeQuota)} diff --git a/apps/dcellar-web-ui/src/modules/pricing-calculator/index.tsx b/apps/dcellar-web-ui/src/modules/pricing-calculator/index.tsx index dd301661..20d1f755 100644 --- a/apps/dcellar-web-ui/src/modules/pricing-calculator/index.tsx +++ b/apps/dcellar-web-ui/src/modules/pricing-calculator/index.tsx @@ -25,7 +25,7 @@ import { export type TQuotaSP = { name: string; freeQuota: string; - freeMonthlyQuota: string; + monthlyFreeQuota: string; operatorAddress: string; }; const DEFAULT_GAS_FEE = '0.000006'; @@ -86,7 +86,7 @@ export const PriceCalculator = () => { operatorAddress: item.operatorAddress, name: item?.description?.moniker, freeQuota: String(keySpMeta[item.operatorAddress]?.FreeReadQuota || ''), - freeMonthlyQuota: String(keySpMeta[item.operatorAddress]?.FreeMonthlyQuota || ''), + monthlyFreeQuota: String(keySpMeta[item.operatorAddress]?.MonthlyFreeQuota || ''), }; }); setSps(fullSps); diff --git a/apps/dcellar-web-ui/src/store/slices/sp.ts b/apps/dcellar-web-ui/src/store/slices/sp.ts index 026cad37..15cd370b 100644 --- a/apps/dcellar-web-ui/src/store/slices/sp.ts +++ b/apps/dcellar-web-ui/src/store/slices/sp.ts @@ -26,8 +26,7 @@ export type SpRecommendMeta = { Description: string; Endpoint: string; FreeReadQuota: number; - // todo add monthly quota - FreeMonthlyQuota: number; + MonthlyFreeQuota: number; Latency: number; ReadPrice: string; SPAddress: string;