mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 23:17:57 +08:00
fix master static resource display problem
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
_ "github.com/chrislusf/seaweedfs/weed/statik"
|
_ "github.com/chrislusf/seaweedfs/weed/statik"
|
||||||
statik "github.com/rakyll/statik/fs"
|
statik "github.com/rakyll/statik/fs"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverStats *stats.ServerStats
|
var serverStats *stats.ServerStats
|
||||||
@@ -198,3 +199,8 @@ func handleStaticResources(defaultMux *http.ServeMux) {
|
|||||||
defaultMux.Handle("/favicon.ico", http.FileServer(statikFS))
|
defaultMux.Handle("/favicon.ico", http.FileServer(statikFS))
|
||||||
defaultMux.Handle("/seaweedfsstatic/", http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
|
defaultMux.Handle("/seaweedfsstatic/", http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleStaticResources2(r *mux.Router) {
|
||||||
|
r.Handle("/favicon.ico", http.FileServer(statikFS))
|
||||||
|
r.PathPrefix("/seaweedfsstatic/").Handler(http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
|
||||||
|
}
|
||||||
|
@@ -69,6 +69,7 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
|
|||||||
|
|
||||||
ms.guard = security.NewGuard(whiteList, secureKey)
|
ms.guard = security.NewGuard(whiteList, secureKey)
|
||||||
|
|
||||||
|
handleStaticResources2(r)
|
||||||
r.HandleFunc("/", ms.uiStatusHandler)
|
r.HandleFunc("/", ms.uiStatusHandler)
|
||||||
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
|
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
|
||||||
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))
|
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))
|
||||||
|
Reference in New Issue
Block a user