add restart button

This commit is contained in:
Harvey Tindall
2021-01-31 19:01:20 +00:00
parent 456ef556b1
commit 90c6cee780
5 changed files with 19 additions and 2 deletions
+8
View File
@@ -1330,6 +1330,14 @@ func (app *appContext) GetLanguages(gc *gin.Context) {
gc.JSON(200, resp)
}
func (app *appContext) restart(gc *gin.Context) {
app.info.Println("Restarting...")
err := app.Restart()
if err != nil {
app.err.Printf("Couldn't restart, try restarting manually. (%s)", err)
}
}
func (app *appContext) ServeLang(gc *gin.Context) {
page := gc.Param("page")
lang := strings.Replace(gc.Param("file"), ".json", "", 1)