fix: nil guard for QueryTodaySummary, correct remoteAddr comment and UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
viettranxandClaude Opus 4.6 committed 2026-03-04 23:25:34 +07:00
1 parent 9cb73ac132
commit b1d2e8982a
3 files changed
+5 -2

No files matched your search

+3
View File
@@ -265,6 +265,9 @@ func (qc *QuotaChecker) Usage(ctx context.Context) QuotaUsageResult {
// QueryTodaySummary fills today's aggregate stats into the result.
// Exported so QuotaMethods can call it directly when QuotaChecker is nil.
func QueryTodaySummary(ctx context.Context, db *sql.DB, result *QuotaUsageResult) {
if db == nil {
return
}
now := time.Now().UTC()
startOfDay := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC)
+1 -1
View File
@@ -26,7 +26,7 @@ type Client struct {
mu sync.Mutex
connectedAt time.Time // when the client connected
remoteAddr string // peer IP:port from websocket
remoteAddr string // peer IP (extracted from proxy headers or RemoteAddr)
// Browser pairing state
pairingCode string // 8-char code if pending approval
+1 -1
View File
@@ -621,7 +621,7 @@ export function OverviewPage() {
className={`border-b last:border-0 ${isYou ? "bg-muted/50" : ""}`}
>
<td className="py-2 pr-3 font-mono text-xs">
{c.remoteAddr.replace(/:\d+$/, "")}
{c.remoteAddr}
{isYou && (
<Badge
variant="info"