29 lines
633 B
Go
29 lines
633 B
Go
package main
|
|
|
|
import (
|
|
templates2 "git.wamblee.org/converge/pkg/server/ui"
|
|
"net/http"
|
|
)
|
|
|
|
func pageHandler(w http.ResponseWriter, r *http.Request) {
|
|
access := getConvergeAccess(r)
|
|
|
|
switch r.URL.Path {
|
|
case "":
|
|
fallthrough
|
|
case "/":
|
|
fallthrough
|
|
case "index.html":
|
|
templates2.AboutTab().Render(r.Context(), w)
|
|
// TODO use contexts later.
|
|
case "usage.html":
|
|
templates2.UsageTab(access).Render(r.Context(), w)
|
|
case "downloads.html":
|
|
templates2.DownloadsTab().Render(r.Context(), w)
|
|
case "sessions.html":
|
|
templates2.SessionsTab(nil, nil, access.Location).Render(r.Context(), w)
|
|
default:
|
|
http.NotFound(w, r)
|
|
}
|
|
}
|