rht
This commit is contained in:
parent
946969b503
commit
240f122edb
|
@ -12,6 +12,8 @@ interface DashboardContextType {
|
||||||
isDistinctUploadIPsLoading: boolean;
|
isDistinctUploadIPsLoading: boolean;
|
||||||
shareCodeList: ShareCodeResponse[];
|
shareCodeList: ShareCodeResponse[];
|
||||||
isShareCodeListLoading: boolean;
|
isShareCodeListLoading: boolean;
|
||||||
|
deletedData: { totalSize?: number; resourceCount?: number; };
|
||||||
|
isDeletedLoading: boolean;
|
||||||
}
|
}
|
||||||
interface ShareCodeResourcesSizeByDateRange {
|
interface ShareCodeResourcesSizeByDateRange {
|
||||||
totalSize: number;
|
totalSize: number;
|
||||||
|
@ -45,6 +47,7 @@ export const DashboardProvider = ({ children }: { children: React.ReactNode }) =
|
||||||
createdAt: 'desc',
|
createdAt: 'desc',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
const {data:deletedData , isLoading:isDeletedLoading} = api.shareCode.getAllreadlyDeletedShareCodes.useQuery()
|
||||||
return <>
|
return <>
|
||||||
<DashboardContext.Provider value={{
|
<DashboardContext.Provider value={{
|
||||||
shareCodeAll,
|
shareCodeAll,
|
||||||
|
@ -56,7 +59,9 @@ export const DashboardProvider = ({ children }: { children: React.ReactNode }) =
|
||||||
distinctUploadIPs,
|
distinctUploadIPs,
|
||||||
isDistinctUploadIPsLoading,
|
isDistinctUploadIPsLoading,
|
||||||
shareCodeList,
|
shareCodeList,
|
||||||
isShareCodeListLoading
|
isShareCodeListLoading,
|
||||||
|
deletedData,
|
||||||
|
isDeletedLoading
|
||||||
}}>
|
}}>
|
||||||
{children}
|
{children}
|
||||||
</DashboardContext.Provider>
|
</DashboardContext.Provider>
|
||||||
|
|
|
@ -7,7 +7,7 @@ const { Title, Text } = Typography;
|
||||||
export default function Board() {
|
export default function Board() {
|
||||||
const { shareCodeAll, shareCodeToday, shareCodeYesterday,
|
const { shareCodeAll, shareCodeToday, shareCodeYesterday,
|
||||||
isShareCodeAllLoading, isShareCodeTodayLoading, isShareCodeYesterdayLoading,
|
isShareCodeAllLoading, isShareCodeTodayLoading, isShareCodeYesterdayLoading,
|
||||||
distinctUploadIPs, isDistinctUploadIPsLoading } = useDashboardContext();
|
distinctUploadIPs, isDistinctUploadIPsLoading,deletedData,isDeletedLoading } = useDashboardContext();
|
||||||
const [serverUptime, setServerUptime] = useState('');
|
const [serverUptime, setServerUptime] = useState('');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const calculateTimeDifference = () => {
|
const calculateTimeDifference = () => {
|
||||||
|
@ -133,6 +133,25 @@ export default function Board() {
|
||||||
</div>
|
</div>
|
||||||
</DashboardCard>
|
</DashboardCard>
|
||||||
</Col>
|
</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>
|
</Row>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
Loading…
Reference in New Issue