1
0

Added deleted page to show if file was successfully deleted.

This commit is contained in:
Alexander Andreev 2023-05-21 20:21:41 +04:00
parent cb1dd51750
commit 15dd184106
Signed by: Arav
GPG Key ID: D22A817D95815393
3 changed files with 13 additions and 0 deletions

View File

@ -210,6 +210,7 @@ func (h *UploadHandlers) Delete(w http.ResponseWriter, r *http.Request) {
h.logDelete.Printf("| %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, saltedHash, r.UserAgent())
w.WriteHeader(http.StatusNoContent)
web.Deleted(utils.MainSite(r.Host), site)
}
func NotFound(w http.ResponseWriter, r *http.Request) {

View File

@ -0,0 +1,11 @@
extends base.jade
block header
h1 Deleted
block body
:go:func Deleted(mainSite, site string)
section
h2 File was successfully deleted.
center
a(href="/") Back to index page

View File

@ -8,6 +8,7 @@ import (
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/index.jade
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/nospace.jade
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/deleted.jade
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/uploaded.jade
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/error404.jade