Remove old legacy "setup" web interface

This commit is contained in:
gmemstr 2017-12-04 07:36:07 -08:00
parent 63df507c13
commit 15232d24a9
2 changed files with 0 additions and 63 deletions

View file

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pogo Setup</title>
<link rel="stylesheet" href="/assets/setup.css">
</head>
<body>
<h1>Let's get Pogo setup</h1>
<form action="setup" method="post" class="setupform">
<label for="podcastname">Podcast Name</label>
<input type="text" id="podcastname" name="podcastname">
<label for="podcasthost">Podcast Host</label>
<input type="text" id="podcasthost" name="podcasthost">
<label for="podcastemail">Podcast Email</label>
<input type="text" id="podcastemail" name="podcastemail">
<label for="podcastdescription">Podcast Description</label>
<textarea name="" id="podcastdescription" name="podcastdescription" cols="75" rows="5"></textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>

View file

@ -122,10 +122,6 @@ func Init() *mux.Router {
admin.ListUsers(),
)).Methods("GET")
r.Handle("/setup", Handle(
serveSetup(),
)).Methods("GET", "POST")
return r
}
@ -244,32 +240,3 @@ func adminHandler() common.Handler {
return common.ReadAndServeFile("assets/web/admin.html", w)
}
}
// Serve setup.html and config parameters
func serveSetup() common.Handler {
return func(rc *common.RouterContext, w http.ResponseWriter, r *http.Request) *common.HTTPError {
if r.Method == "GET" {
return common.ReadAndServeFile("assets/web/setup.html", w)
}
r.ParseMultipartForm(32 << 20)
// Parse form and convert to JSON
cnf := NewConfig{
strings.Join(r.Form["podcastname"], ""), // Podcast name
strings.Join(r.Form["podcasthost"], ""), // Podcast host
strings.Join(r.Form["podcastemail"], ""), // Podcast host email
"", // Podcast image
"", // Podcast location
"", // Podcast location
}
b, err := json.Marshal(cnf)
if err != nil {
panic(err)
}
ioutil.WriteFile("assets/config/config.json", b, 0644)
w.Write([]byte("Done"))
return nil
}
}