ui improovements
This commit is contained in:
parent
1dce9fb0e8
commit
950139010e
7 changed files with 67 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ func (a *App) routes() http.Handler {
|
|||
mux.HandleFunc("/api/workspaces", a.withAuth(a.handleWorkspaces))
|
||||
mux.HandleFunc("/api/projects", a.withAuth(a.handleProjects))
|
||||
mux.HandleFunc("/api/projects/", a.withAuth(a.handleProjectSubroutes))
|
||||
mux.HandleFunc("/api/caddy/config", a.withAuth(a.handleCaddyConfig))
|
||||
mux.HandleFunc("/api/webhooks/deploy/", a.handleDeployWebhook)
|
||||
return loggingMiddleware(mux)
|
||||
}
|
||||
|
|
@ -268,3 +269,16 @@ func (a *App) handleProjectLogs(w http.ResponseWriter, r *http.Request, user Use
|
|||
}
|
||||
writeJSON(w, http.StatusOK, map[string]any{"lines": lines, "logs": logs})
|
||||
}
|
||||
|
||||
func (a *App) handleCaddyConfig(w http.ResponseWriter, r *http.Request, _ User) {
|
||||
if r.Method != http.MethodGet {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
cfg, err := a.fetchCaddyConfig(r.Context())
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadGateway)
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, cfg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue