diff --git a/web/src/routes/users/+page.svelte b/web/src/routes/users/+page.svelte index 4c55d8d..5eff9d3 100644 --- a/web/src/routes/users/+page.svelte +++ b/web/src/routes/users/+page.svelte @@ -1,11 +1,11 @@
@@ -117,101 +86,51 @@ Имя Ссылки Трафик - IP - сервер - Квота + Активных IP Истекает - {#each rows as row (row.username)} - {@const username = row.username ?? ''} - {@const pairs = ipServerPairsByUser[username] ?? []} - - {#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} + {#each rows as row (row.username ?? '')} + openUser(row.username)}> + {row.username} + +
+ {#each row.links?.tls ?? [] as link (link)} + + {/each} + {#each row.links?.secure ?? [] as link (link)} + + {/each} +
+
+ {formatMiB(row.total_megabytes ?? 0)} + + {row.active_unique_ips ?? 0} + {#if row.max_unique_ips != null} + / {row.max_unique_ips} + {/if} + + + {row.expiration_rfc3339 ? new Date(row.expiration_rfc3339).toLocaleString() : '—'} + +
{/each}
diff --git a/web/src/routes/users/[username]/+page.svelte b/web/src/routes/users/[username]/+page.svelte index aa9f0b3..c1fc902 100644 --- a/web/src/routes/users/[username]/+page.svelte +++ b/web/src/routes/users/[username]/+page.svelte @@ -1,29 +1,50 @@
@@ -125,4 +154,73 @@ {/each} + + + IP и подключения + active/recent с серверами и Geo/ASN (если доступно) + + + {#if ipErr} + + Ошибка IP данных + {ipErr} + + {/if} + + + + + IP + Серверы + Geo / ASN + + + + {#if ipsForUser.length === 0} + + + Нет активных IP + + + {:else} + {#each ipsForUser as ip (ip.ip ?? '')} + + {ip.ip} + + active: {((ip.active_on_servers ?? []).filter(Boolean) as string[]).join(', ') || '—'} + {#if (ip.recent_on_servers?.length ?? 0) > 0} +
+ recent: {(ip.recent_on_servers ?? []).filter(Boolean).join(', ')} + {/if} + {#if ip.primary_server} +
+ primary: {ip.primary_server} + {/if} +
+ +
+
+ {flagEmoji(ip.country_code ?? undefined)} + {ip.country_code ?? '—'} + {#if ip.city_name} + · {ip.city_name} + {/if} +
+ {#if ip.asn != null} +
+ AS{ip.asn} + {ip.as_organization ?? ''} +
+ {:else} +
ASN: —
+ {/if} +
+
+
+ {/each} + {/if} +
+
+
+
{/if}