diff --git a/web/src/routes/users/+page.svelte b/web/src/routes/users/+page.svelte index a6430df..4c55d8d 100644 --- a/web/src/routes/users/+page.svelte +++ b/web/src/routes/users/+page.svelte @@ -127,58 +127,88 @@ {@const username = row.username ?? ''} {@const pairs = ipServerPairsByUser[username] ?? []} - - - - {row.username} - - - -
- {#each row.links?.tls ?? [] as link (link)} - - {/each} - {#each row.links?.secure ?? [] as link (link)} - - {/each} -
-
- {formatMiB(row.total_megabytes ?? 0)} - - {#if (row.active_unique_ips ?? 0) > 0} - {row.active_unique_ips} - {#if row.max_unique_ips != null} - / {row.max_unique_ips} - {/if} - {:else} - — - {/if} - - - {row.data_quota_bytes != null ? formatBytes(row.data_quota_bytes) : '—'} - - - {row.expiration_rfc3339 - ? new Date(row.expiration_rfc3339).toLocaleString() - : '—'} - -
- - {#if pairs.length > 0} - {#each pairs as pair (pair.ip + '|' + pair.server)} + {#if pairs.length === 0} + + + + {row.username} + + + +
+ {#each row.links?.tls ?? [] as link (link)} + + {/each} + {#each row.links?.secure ?? [] as link (link)} + + {/each} +
+
+ {formatMiB(row.total_megabytes ?? 0)} + + + {row.data_quota_bytes != null ? formatBytes(row.data_quota_bytes) : '—'} + + + {row.expiration_rfc3339 ? new Date(row.expiration_rfc3339).toLocaleString() : '—'} + +
+ {:else} + {#each pairs as pair, idx (pair.ip + '|' + pair.server)} -   -   -   + + + {row.username} + + + + {#if idx === 0} +
+ {#each row.links?.tls ?? [] as link (link)} + + {/each} + {#each row.links?.secure ?? [] as link (link)} + + {/each} +
+ {:else} +   + {/if} +
+ + {#if idx === 0} + {formatMiB(row.total_megabytes ?? 0)} + {:else} +   + {/if} + {pair.ip} - {pair.server} -   -   + + {#if idx === 0} + {row.data_quota_bytes != null ? formatBytes(row.data_quota_bytes) : '—'} + {:else} +   + {/if} + + + {#if idx === 0} + {row.expiration_rfc3339 ? new Date(row.expiration_rfc3339).toLocaleString() : '—'} + {:else} +   + {/if} +
{/each} {/if}