|
@@ -113,6 +113,10 @@ func (s *Manager) HandleOPGServing(w http.ResponseWriter, r *http.Request, share
|
|
|
|
|
|
fs := filesystem.GetFileSize(shareEntry.FileRealPath)
|
|
|
shareMeta := filepath.Ext(shareEntry.FileRealPath) + " / " + filesystem.GetFileDisplaySize(fs, 2)
|
|
|
+ if isDir(shareEntry.FileRealPath) {
|
|
|
+ fs, fc := filesystem.GetDirctorySize(shareEntry.FileRealPath, false)
|
|
|
+ shareMeta = strconv.Itoa(fc) + " items / " + filesystem.GetFileDisplaySize(fs, 2)
|
|
|
+ }
|
|
|
|
|
|
if len([]rune(filename)) > 20 {
|
|
|
//Split into lines
|
|
@@ -176,7 +180,7 @@ func (s *Manager) HandleOPGServing(w http.ResponseWriter, r *http.Request, share
|
|
|
}
|
|
|
|
|
|
resizedThumb := resize.Resize(250, 0, thumb, resize.Lanczos3)
|
|
|
- draw.Draw(resultopg, resultopg.Bounds(), resizedThumb, image.Point{-(resultopg.Bounds().Dx() - resizedThumb.Bounds().Dx() - 90), -60}, draw.Src)
|
|
|
+ draw.Draw(resultopg, resultopg.Bounds(), resizedThumb, image.Point{-(resultopg.Bounds().Dx() - resizedThumb.Bounds().Dx() - 90), -60}, draw.Over)
|
|
|
}
|
|
|
|
|
|
w.Header().Set("Content-Type", "image/jpeg") // <-- set the content-type header
|
|
@@ -548,6 +552,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
|
|
|
t := fasttemplate.New(string(content), "{{", "}}")
|
|
|
s := t.ExecuteString(map[string]interface{}{
|
|
|
"hostname": s.options.HostName,
|
|
|
+ "host": r.Host,
|
|
|
"reqid": id,
|
|
|
"mime": "application/x-directory",
|
|
|
"size": filesystem.GetFileDisplaySize(fsize, 2),
|