added support for yadownloader
This commit is contained in:
parent
f80b016ef0
commit
8dcd72d3b8
@ -2,6 +2,11 @@
|
||||
<div>
|
||||
<header-bar showMenu showLogo>
|
||||
<search /> <title />
|
||||
<action
|
||||
icon="storage"
|
||||
:label="$t('yadownloader')"
|
||||
@action="redirect"
|
||||
/>
|
||||
<action
|
||||
class="search-button"
|
||||
icon="search"
|
||||
@ -437,6 +442,10 @@ export default {
|
||||
document.removeEventListener("drop", this.drop);
|
||||
},
|
||||
methods: {
|
||||
redirect(){
|
||||
let url = "/downloader";
|
||||
window.location.href = url;
|
||||
},
|
||||
...mapMutations(["updateUser", "addSelected"]),
|
||||
base64: function (name) {
|
||||
return window.btoa(unescape(encodeURIComponent(name)));
|
||||
|
||||
13
http/http.go
13
http/http.go
@ -2,12 +2,14 @@ package http
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/storage"
|
||||
downloader "github.com/shiningw/yadownloader/http"
|
||||
)
|
||||
|
||||
type modifyRequest struct {
|
||||
@ -85,5 +87,16 @@ func NewHandler(
|
||||
public.PathPrefix("/dl").Handler(monkey(publicDlHandler, "/api/public/dl/")).Methods("GET")
|
||||
public.PathPrefix("/share").Handler(monkey(publicShareHandler, "/api/public/share/")).Methods("GET")
|
||||
|
||||
settings, err := store.Settings.Get()
|
||||
if err != nil {
|
||||
log.Fatalf("ERROR: couldn't get settings: %v\n", err)
|
||||
}
|
||||
|
||||
data := &downloader.Data{
|
||||
Settings: settings,
|
||||
Server: server,
|
||||
}
|
||||
downloader.RegisterRoutes(r, data)
|
||||
|
||||
return stripPrefix(server.BaseURL, r), nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user