rht
This commit is contained in:
parent
946969b503
commit
240f122edb
|
@ -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>
|
||||
|
|
|
@ -7,13 +7,13 @@ 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 = () => {
|
||||
const now = new Date();
|
||||
const targetDate = new Date('2025-04-09T15:00:00');
|
||||
const diffMs = now.getTime()- targetDate.getTime();
|
||||
const diffMs = now.getTime() - targetDate.getTime();
|
||||
|
||||
// 如果是负数,表示目标日期已过
|
||||
if (diffMs < 0) {
|
||||
|
@ -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>
|
||||
</>
|
||||
}
|
Loading…
Reference in New Issue