Get real mailbox size from dovecot
- Add mail.GetQuota() using doveadm quota get - Fix UserWithQuota response struct - Fix frontend NaN display with Unknown fallback - Update field names to camelCase (usedQuota)
This commit is contained in:
parent
16b6d9df60
commit
c5a9149220
3 changed files with 68 additions and 5 deletions
|
|
@ -4,9 +4,8 @@
|
|||
interface User {
|
||||
id: number;
|
||||
email: string;
|
||||
domain_id: number;
|
||||
quota: number;
|
||||
used_quota: number;
|
||||
usedQuota?: number;
|
||||
}
|
||||
|
||||
let users = $state<User[]>([]);
|
||||
|
|
@ -85,7 +84,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
function formatQuota(bytes: number): string {
|
||||
function formatQuota(bytes: number | undefined | null): string {
|
||||
if (bytes === undefined || bytes === null || isNaN(bytes)) return 'Unknown';
|
||||
if (bytes === 0) return 'Default';
|
||||
if (bytes < 1024) return bytes + ' B';
|
||||
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
<tr>
|
||||
<td>{user.email}</td>
|
||||
<td>{formatQuota(user.quota)}</td>
|
||||
<td>{formatQuota(user.used_quota)}</td>
|
||||
<td>{formatQuota(user.usedQuota)}</td>
|
||||
<td>
|
||||
<button class="danger" onclick={() => deleteUser(user.id)}>Delete</button>
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue