This commit is contained in:
raohaotian 2025-04-13 00:32:30 +08:00
parent 946969b503
commit 240f122edb
2 changed files with 27 additions and 3 deletions

View File

@ -12,6 +12,8 @@ interface DashboardContextType {
isDistinctUploadIPsLoading: boolean;
shareCodeList: ShareCodeResponse[];
isShareCodeListLoading: boolean;
deletedData: { totalSize?: number; resourceCount?: number; };
isDeletedLoading: boolean;
}
interface ShareCodeResourcesSizeByDateRange {
totalSize: number;
@ -45,6 +47,7 @@ export const DashboardProvider = ({ children }: { children: React.ReactNode }) =
createdAt: 'desc',
},
})
const {data:deletedData , isLoading:isDeletedLoading} = api.shareCode.getAllreadlyDeletedShareCodes.useQuery()
return <>
<DashboardContext.Provider value={{
shareCodeAll,
@ -56,7 +59,9 @@ export const DashboardProvider = ({ children }: { children: React.ReactNode }) =
distinctUploadIPs,
isDistinctUploadIPsLoading,
shareCodeList,
isShareCodeListLoading
isShareCodeListLoading,
deletedData,
isDeletedLoading
}}>
{children}
</DashboardContext.Provider>

View File

@ -7,7 +7,7 @@ const { Title, Text } = Typography;
export default function Board() {
const { shareCodeAll, shareCodeToday, shareCodeYesterday,
isShareCodeAllLoading, isShareCodeTodayLoading, isShareCodeYesterdayLoading,
distinctUploadIPs, isDistinctUploadIPsLoading } = useDashboardContext();
distinctUploadIPs, isDistinctUploadIPsLoading,deletedData,isDeletedLoading } = useDashboardContext();
const [serverUptime, setServerUptime] = useState('');
useEffect(() => {
const calculateTimeDifference = () => {
@ -133,6 +133,25 @@ export default function Board() {
</div>
</DashboardCard>
</Col>
{/* 删除状态卡片 */}
{/* <Col xs={24} sm={12} md={6}>
<DashboardCard
title={
<div className="flex items-center">
<CheckCircleOutlined style={{ marginRight: 8, fontSize: 16 }} />
</div>
}
className="h-full"
>
<div className="flex flex-col h-full justify-between py-2">
<Statistic value={isDeletedLoading ? 0 : `${deletedData.resourceCount}`} />
<div className="text-gray-500 text-sm mt-2">
: {isDeletedLoading? 0 : `${(deletedData.totalSize / 1024 / 1024 / 1024).toFixed(2)}GB`}
</div>
</div>
</DashboardCard>
</Col> */}
</Row>
</>
}