|
|
@ -2,9 +2,6 @@ package weed_server |
|
|
|
|
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"encoding/base64" |
|
|
|
"fmt" |
|
|
|
"github.com/skip2/go-qrcode" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
@ -72,12 +69,6 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var qrImageString string |
|
|
|
img, err := qrcode.Encode(fmt.Sprintf("http://%s:%d%s", fs.option.Host, fs.option.Port, r.URL.Path), qrcode.Medium, 128) |
|
|
|
if err == nil { |
|
|
|
qrImageString = base64.StdEncoding.EncodeToString(img) |
|
|
|
} |
|
|
|
|
|
|
|
ui.StatusTpl.Execute(w, struct { |
|
|
|
Path string |
|
|
|
Breadcrumbs []ui.Breadcrumb |
|
|
@ -85,7 +76,6 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
Limit int |
|
|
|
LastFileName string |
|
|
|
ShouldDisplayLoadMore bool |
|
|
|
QrImage string |
|
|
|
}{ |
|
|
|
path, |
|
|
|
ui.ToBreadcrumb(path), |
|
|
@ -93,6 +83,5 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
limit, |
|
|
|
lastFileName, |
|
|
|
shouldDisplayLoadMore, |
|
|
|
qrImageString, |
|
|
|
}) |
|
|
|
} |