summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roseh.moe.go10
-rw-r--r--static/tohru.webpbin0 -> 55554 bytes
-rw-r--r--templates/wormhole-success.html.template8
3 files changed, 17 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index 19d6109..abafa2e 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -252,6 +252,12 @@ func (c wormholeConn) wormholeCopy(ctx context.Context, hole string) error {
return nil
}
+var (
+ //go:embed templates/wormhole-success.html.template
+ wormholeSuccessTemplateString string
+ wormholeSuccessTemplate = template.Must(template.Must(outlineTemplate.Clone()).New("body").Parse(wormholeSuccessTemplateString)).Lookup("outline")
+)
+
func wormholeSend(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
reader, err := r.MultipartReader()
@@ -271,7 +277,9 @@ func wormholeSend(w http.ResponseWriter, r *http.Request) {
if err := (wormholeConn{done: make(chan struct{}), r: part}).wormholeCopy(ctx, hole); err != nil {
http.Error(w, fmt.Sprintf("Error during copy: %s", err), http.StatusServiceUnavailable)
}
- fmt.Fprintf(w, "uploaded!")
+ if err := wormholeSuccessTemplate.Execute(w, nil); err != nil {
+ log.Printf("Warning: wormholeSend: %s", err)
+ }
return
}
http.Error(w, "file not found", http.StatusBadRequest)
diff --git a/static/tohru.webp b/static/tohru.webp
new file mode 100644
index 0000000..ce0c686
--- /dev/null
+++ b/static/tohru.webp
Binary files differ
diff --git a/templates/wormhole-success.html.template b/templates/wormhole-success.html.template
new file mode 100644
index 0000000..8df614e
--- /dev/null
+++ b/templates/wormhole-success.html.template
@@ -0,0 +1,8 @@
+{{define "head"}}<title>Uploaded!</title>{{end}}
+
+<div style="display:flex;justify-content:center">
+ <div>
+ <p style="display:flex;justify-content:center">Uploaded!</p>
+ <img src="/static/tohru.webp" alt="An energetic dragon maid">
+ </div>
+</div>