Add admin UI
Some checks failed
CI / Test (pull_request) Failing after 1m33s
CI / Lint (pull_request) Failing after 13s
CI / Build (pull_request) Has been skipped
CI / Security Scan (pull_request) Failing after 4m47s
CI / Build and Push Docker Image (pull_request) Has been skipped

This commit is contained in:
2026-03-05 23:08:34 +00:00
parent 667217e66b
commit 7025ec746c
31 changed files with 5905 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import (
"net/http"
"os"
"os/signal"
"runtime"
"syscall"
"time"
@@ -19,6 +20,7 @@ import (
_ "github.com/mattn/go-sqlite3"
"github.com/redis/go-redis/v9"
"github.com/ajac-zero/latticelm/internal/admin"
"github.com/ajac-zero/latticelm/internal/auth"
"github.com/ajac-zero/latticelm/internal/config"
"github.com/ajac-zero/latticelm/internal/conversation"
@@ -151,6 +153,19 @@ func main() {
mux := http.NewServeMux()
gatewayServer.RegisterRoutes(mux)
// Register admin endpoints if enabled
if cfg.Admin.Enabled {
buildInfo := admin.BuildInfo{
Version: "dev",
BuildTime: time.Now().Format(time.RFC3339),
GitCommit: "unknown",
GoVersion: runtime.Version(),
}
adminServer := admin.New(registry, convStore, cfg, logger, buildInfo)
adminServer.RegisterRoutes(mux)
logger.Info("admin UI enabled", slog.String("path", "/admin/"))
}
// Register metrics endpoint if enabled
if cfg.Observability.Enabled && cfg.Observability.Metrics.Enabled {
metricsPath := cfg.Observability.Metrics.Path