1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 07:56:37 +01:00

fix: fixes download link not working (#2274)

This commit is contained in:
Amir Raminfar
2023-06-27 13:25:51 -07:00
committed by GitHub
parent 657e6314c0
commit 6e394bad19
4 changed files with 4 additions and 4 deletions

View File

@@ -20,7 +20,7 @@
</div>
</div>
</a>
<a class="dropdown-item" :href="`${base}/api/logs/download?id=${container.id}&host=${sessionHost}`">
<a class="dropdown-item" :href="`${base}/api/logs/download/${sessionHost}/${container.id}`">
<div class="level is-justify-content-start">
<div class="level-left">
<div class="level-item">

View File

@@ -16,7 +16,7 @@
"scripts": {
"watch:frontend": "vite --open http://localhost:3100/",
"watch:backend": "LIVE_FS=true DEV=true DOZZLE_ADDR=localhost:3100 reflex -c .reflex",
"dev": "concurrently \"npm:watch:*\"",
"dev": "concurrently --kill-others \"npm:watch:*\"",
"build": "vite build",
"preview": "LIVE_FS=true DOZZLE_ADDR=localhost:3100 reflex -c .reflex",
"release": "bumpp",

View File

@@ -21,7 +21,7 @@ import (
)
func (h *handler) downloadLogs(w http.ResponseWriter, r *http.Request) {
id := r.URL.Query().Get("id")
id := chi.URLParam(r, "id")
container, err := h.clientFromRequest(r).FindContainer(id)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)

View File

@@ -63,7 +63,7 @@ func createRouter(h *handler) *chi.Mux {
r.Group(func(r chi.Router) {
r.Use(authorizationRequired)
r.Get("/api/logs/stream/{host}/{id}", h.streamLogs)
r.Get("/api/logs/download/{host}/{id}", h.downloadLogs) //TODO
r.Get("/api/logs/download/{host}/{id}", h.downloadLogs)
r.Get("/api/logs/{host}/{id}", h.fetchLogsBetweenDates)
r.Get("/api/events/stream", h.streamEvents)
r.Get("/logout", h.clearSession)