basic status page, move config into data dir

This commit is contained in:
Carl Pearson
2024-10-17 05:44:41 -06:00
parent 57ba3767d1
commit 38689752bd
11 changed files with 130 additions and 65 deletions

28
handlers/status.go Normal file
View File

@@ -0,0 +1,28 @@
package handlers
import (
"net/http"
"github.com/labstack/echo/v4"
"ytdlp-site/ffmpeg"
"ytdlp-site/ytdlp"
)
func StatusGet(c echo.Context) error {
ytdlpStdout, _, err := ytdlp.Run("--version")
if err != nil {
log.Errorln(err)
}
ffmpegStdout, _, err := ffmpeg.Ffmpeg("-version")
if err != nil {
log.Errorln(err)
}
return c.Render(http.StatusOK, "status.html", map[string]interface{}{
"ytdlp": string(ytdlpStdout),
"ffmpeg": string(ffmpegStdout),
"Footer": MakeFooter(),
})
}