support skynet

This commit is contained in:
2020-02-04 19:37:46 +01:00
parent aea57286d9
commit 3ebf9785da
20 changed files with 852 additions and 611 deletions

View File

@@ -95,3 +95,45 @@ func (wc *WebController) adminGlobalsForm(td *TemplateData, r *http.Request) (f
}
return f
}
// func (wc *WebController) adminFileDeleteForm(td *TemplateData, r *http.Request) (f Form) {
// if isAdmin, err := td.PixelAPI.UserIsAdmin(); err != nil {
// td.Title = err.Error()
// return Form{Title: td.Title}
// } else if !isAdmin.IsAdmin {
// td.Title = ";)"
// return Form{Title: td.Title}
// }
// td.Title = "Admin file removal"
// f = Form{
// Name: "admin_file_removal",
// Title: td.Title,
// PreFormHTML: template.HTML("<p>Paste any pixeldrain file links in here to remove them</p>"),
// Fields: []Field{
// {
// Name: "files",
// Label: "Files to delete",
// Type: FieldTypeTextarea,
// },
// },
// BackLink: "/admin",
// SubmitLabel: "Submit",
// }
// if f.ReadInput(r) {
// filesText := f.FieldVal("files")
// // Get all links from the text
// strings.Index(filesText, "/u/")
// if len(f.SubmitMessages) == 0 {
// // Request was a success
// f.SubmitSuccess = true
// f.SubmitMessages = []template.HTML{template.HTML(
// fmt.Sprintf("Success! %d values updated", successfulUpdates),
// )}
// }
// }
// return f
// }