39 lines
857 B
Go
39 lines
857 B
Go
package admin
|
|
|
|
import (
|
|
"embed"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
//go:embed web
|
|
var webFS embed.FS
|
|
|
|
func webHandler(c *gin.Context) {
|
|
data, err := webFS.ReadFile("web/cluster.html")
|
|
if err != nil {
|
|
c.String(http.StatusInternalServerError, "cluster.html: %v", err)
|
|
return
|
|
}
|
|
c.Data(http.StatusOK, "text/html; charset=utf-8", data)
|
|
}
|
|
|
|
func uploadsWebHandler(c *gin.Context) {
|
|
data, err := webFS.ReadFile("web/uploads.html")
|
|
if err != nil {
|
|
c.String(http.StatusInternalServerError, "uploads.html: %v", err)
|
|
return
|
|
}
|
|
c.Data(http.StatusOK, "text/html; charset=utf-8", data)
|
|
}
|
|
|
|
func submissionsWebHandler(c *gin.Context) {
|
|
data, err := webFS.ReadFile("web/submissions.html")
|
|
if err != nil {
|
|
c.String(http.StatusInternalServerError, "submissions.html: %v", err)
|
|
return
|
|
}
|
|
c.Data(http.StatusOK, "text/html; charset=utf-8", data)
|
|
}
|