add vfs to ui

This commit is contained in:
medcl 2020-12-30 23:11:49 +08:00
parent 75b4584e4f
commit 9d2d397bda
2 changed files with 4 additions and 2 deletions

3
.gitignore vendored
View File

@ -29,4 +29,5 @@ appveyor.yml
/bin
*.exe
web/.github/
web/report*
web/report*
log/

3
ui.go
View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
public "infini.sh/search-center/.public"
"net/http"
log "github.com/cihub/seelog"
@ -20,7 +21,7 @@ type UI struct {
func (h UI) InitUI() {
// vfs.RegisterFS(public.StaticFS{StaticFolder: h.config.UILocalPath, TrimLeftPath: h.config.UILocalPath , CheckLocalFirst: h.config.UILocalEnabled, SkipVFS: !h.config.UIVFSEnabled})
vfs.RegisterFS(public.StaticFS{StaticFolder: h.Config.UILocalPath, TrimLeftPath: h.Config.UILocalPath , CheckLocalFirst: h.Config.UILocalEnabled, SkipVFS: !h.Config.UIVFSEnabled})
ui.HandleUI("/", vfs.FileServer(vfs.VFS()))