更新资源列表接口,调整相关数据结构,优化页面布局和样式

This commit is contained in:
2025-05-19 11:04:40 +08:00
parent 52c0184482
commit 9652181fe4
14 changed files with 105 additions and 230 deletions

View File

@@ -206,24 +206,24 @@ export default function Extract(props: ExtractProps) {
<SelectItem
key={`${resource.id}`} value={String(resource.id)} className={`p-3`}>
<div className={`flex flex-col gap-2 w-72`}>
{resource.type === 1 && resource.pss.type === 1 && (<>
{resource.type === 1 && resource.short.type === 1 && (<>
<div className={`flex gap-2 items-center bg-green-50 w-fit px-2 py-1 rounded-md text-sm`}>
<Timer size={20}/>
<span>{name(resource)}</span>
</div>
<div className={`flex justify-between gap-2 text-xs text-weak`}>
<span>{format(resource.pss.expire, 'yyyy-MM-dd HH:mm')}</span>
<span>{intlFormatDistance(resource.pss.expire, new Date())}</span>
<span>{format(resource.short.expire, 'yyyy-MM-dd HH:mm')}</span>
<span>{intlFormatDistance(resource.short.expire, new Date())}</span>
</div>
</>)}
{resource.type === 1 && resource.pss.type === 2 && (<>
{resource.type === 1 && resource.short.type === 2 && (<>
<div className={`flex gap-2 items-center bg-blue-50 w-fit px-2 py-1 rounded-md text-sm`}>
<Box size={20}/>
<span>{name(resource)}</span>
</div>
<div className={`flex justify-between gap-2 text-xs text-weak`}>
<span>{resource.pss.used} / {resource.pss.quota}</span>
<span> {resource.pss.quota - resource.pss.used}</span>
<span>{resource.short.used} / {resource.short.quota}</span>
<span> {resource.short.quota - resource.short.used}</span>
</div>
</>)}
</div>