Display date instead of timestamp at admin panel

This commit is contained in:
Aelita4 2023-12-26 20:54:37 +01:00
parent 0d4a187bed
commit 1a76f8d5f3
Signed by: Aelita4
GPG Key ID: E44490C2025906C1
1 changed files with 2 additions and 2 deletions

View File

@ -31,8 +31,8 @@ const type = {
<td>{type[token.type] ?? `Other`}</td>
<td>{token.username}</td>
<td>{token.entropy}</td>
<td>{token.createdAt.getTime()}</td>
<td>{token.expiresAt?.getTime() ?? "null"}</td>
<td>{token.createdAt.toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ")}</td>
<td>{token.expiresAt?.toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ") ?? "null"}</td>
<td>{token.createdFrom}</td>
<td>{token.expiresAt !== null && Date.now() > token.expiresAt.getTime() ? <span style="color: red;">Expired {Math.floor((Date.now() - token.expiresAt.getTime()) / 1000 / 60)} minutes ago</span> : Date.now() < token.createdAt.getTime() ? <span style="color: cyan;">TimeTravelException (check in {Math.floor((token.createdAt.getTime() - Date.now()) / 1000 / 60)} minutes)</span> : <span style="color: lime;">Valid for{token.expiresAt === null ? "ever" : ` ${Math.floor((token.expiresAt.getTime() - Date.now()) / 1000 / 60)} minutes`}</span>}</td>
</tr>)}