gadget-bot / gadget-bot/gadget

Admin UI: Dashboard page

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
2
Forks
2
Avg merge
21d 49m
Merged PRs (30d)
1

Description

Parent: #69
Depends on: #70, #72

## Scope

### Handler (`GET /admin/`)
**File:** `admin/handlers.go`

```go
type DashboardData struct {
PageTitle string
ActivePage string
MentionRouteCount int
ChannelRouteCount int
SlashCommandCount int
TotalRouteCount int
UserCount int64
GroupCount int64
Uptime string // formatted as "3d 14h 22m"
GoVersion string // runtime.Version()
BotUID string
}
```

**Data sources:**
- Route counts: `len(router.MentionRoutes)`, `len(router.ChannelMessageRoutes)`, `len(router.SlashCommandRoutes)` — direct field access, no DB query
- User count: `db.Model(&models.User{}).Count(&userCount)` — single COUNT query
- Group count: `db.Model(&models.Group{}).Count(&groupCount)` — single COUNT query
- Uptime: `time.Since(startedAt)` formatted as human-readable duration
- Go version: `runtime.Version()`
- Bot UID: `router.BotUID`

### Template (`templates/pages/dashboard.html`)
- Card grid layout (2-3 columns on desktop, 1 on mobile)
- Each card shows a label + large numeric value
- Cards: Mention Routes, Channel Routes, Slash Commands, Total Routes, Users, Groups
- Info section: Uptime, Go Version, Bot UID

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with admin/handlers.go and templates/pages/dashboard.html, then review the dependencies on issues #70 and #72. Implement the GET /admin/ handler using the listed route, database, runtime, uptime, and bot data sources, and add the specified responsive cards and information section. Done means the dashboard shows all listed values in the requested layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, html
Domain
backend, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.