Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cmd/server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
version: '3.8'

services:
ccnexus:
build:
context: .
dockerfile: Dockerfile
context: ../..
dockerfile: cmd/server/Dockerfile
container_name: ccnexus
restart: unless-stopped
ports:
Expand Down
22 changes: 20 additions & 2 deletions cmd/server/webui/api/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,26 @@ func (h *Handler) handleStatsSummary(w http.ResponseWriter, r *http.Request) {
return
}

stats := h.proxy.GetStats()
WriteSuccess(w, stats)
totalRequests, endpointStats := h.proxy.GetStats().GetStats()

// Calculate totals
totalErrors := 0
var totalInputTokens int64 = 0
var totalOutputTokens int64 = 0

for _, stats := range endpointStats {
totalErrors += stats.Errors
totalInputTokens += int64(stats.InputTokens)
totalOutputTokens += int64(stats.OutputTokens)
Comment on lines +26 to +27
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential type conversion issue: InputTokens and OutputTokens are being cast to int64, but if the source type is already int64 or larger, this is redundant. If they are smaller types (like int or int32), the conversion is correct, but without seeing the stats structure definition, this could indicate a type mismatch. Consider verifying that the source types match the target types to avoid unnecessary conversions or potential overflow issues.

Copilot uses AI. Check for mistakes.
}

WriteSuccess(w, map[string]interface{}{
"TotalRequests": totalRequests,
"TotalErrors": totalErrors,
"TotalInputTokens": totalInputTokens,
"TotalOutputTokens": totalOutputTokens,
"Endpoints": endpointStats,
})
}

// handleStatsDaily returns today's statistics
Expand Down
30 changes: 30 additions & 0 deletions cmd/server/webui/ui/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
color: #1e40af;
}

.badge-primary {
background-color: #dbeafe;
color: #1e40af;
}
Comment on lines +119 to +122
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge-primary class is duplicated with identical styling to the existing badge-info class (lines 114-117). This creates unnecessary code duplication. Consider reusing the existing badge-info class or creating a shared base class if different badge types are needed in the future.

Copilot uses AI. Check for mistakes.

/* Status indicators */
.status-indicator {
display: inline-block;
Expand Down Expand Up @@ -395,3 +400,28 @@
.toggle-switch input:checked + .toggle-slider:before {
transform: translateX(20px);
}

/* Copy button */
.btn-icon {
background: none;
border: none;
cursor: pointer;
padding: 0.25rem;
font-size: 1rem;
color: var(--text-secondary);
transition: color 0.2s;
margin-left: 0.5rem;
}

.btn-icon:hover {
color: var(--primary-color);
}

/* Drag and drop styles */
.table tbody tr[draggable="true"] {
transition: opacity 0.2s, border-top 0.2s;
}

.table tbody tr[draggable="true"]:active {
cursor: grabbing;
}
Loading
Loading