mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-04 03:54:58 +01:00
Adds html5 download and changes mimetype
This commit is contained in:
@@ -9,7 +9,12 @@
|
||||
<container-stat :stat="container.stat" :state="container.state"></container-stat>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<a class="button is-small is-outlined" id="download" :href="`${base}/api/logs/download?id=${container.id}`">
|
||||
<a
|
||||
class="button is-small is-outlined"
|
||||
id="download"
|
||||
:href="`${base}/api/logs/download?id=${container.id}`"
|
||||
download
|
||||
>
|
||||
<span class="icon">
|
||||
<icon name="save"></icon>
|
||||
</span>
|
||||
|
||||
@@ -131,7 +131,7 @@ func (h *handler) downloadLogs(w http.ResponseWriter, r *http.Request) {
|
||||
from := time.Unix(container.Created, 0)
|
||||
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%v.log.gz", container.ID))
|
||||
w.Header().Set("Content-Type", "application/octet-stream")
|
||||
w.Header().Set("Content-Type", "application/gzip")
|
||||
zw := gzip.NewWriter(w)
|
||||
defer zw.Close()
|
||||
zw.Name = fmt.Sprintf("%v.log", container.ID)
|
||||
|
||||
Reference in New Issue
Block a user