mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 12:14:40 +00:00
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:
1 parent
9cb73ac132
commit
b1d2e8982a
3 files changed
+5
-2
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user