File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import (
2121 "github.com/xos/serverstatus/pkg/mygin"
2222 "github.com/xos/serverstatus/pkg/utils"
2323 "github.com/xos/serverstatus/proto"
24- "github.com/xos/serverstatus/resource"
2524 "github.com/xos/serverstatus/service/rpc"
2625 "github.com/xos/serverstatus/service/singleton"
2726)
@@ -36,14 +35,16 @@ func ServeWeb(port uint) *http.Server {
3635 r .Use (natGateway )
3736 tmpl := template .New ("" ).Funcs (funcMap )
3837 var err error
39- tmpl , err = tmpl .ParseFS (resource .TemplateFS , "template/**/*.html" )
38+ // 直接用本地模板目录
39+ tmpl , err = tmpl .ParseGlob ("resource/template/**/*.html" )
4040 if err != nil {
4141 panic (err )
4242 }
4343 tmpl = loadThirdPartyTemplates (tmpl )
4444 r .SetHTMLTemplate (tmpl )
4545 r .Use (mygin .RecordPath )
46- r .StaticFS ("/static" , http .FS (resource .StaticFS ))
46+ // 直接用本地静态资源目录
47+ r .Static ("/static" , "resource/static" )
4748 routers (r )
4849 page404 := func (c * gin.Context ) {
4950 mygin .ShowErrorPage (c , mygin.ErrInfo {
You can’t perform that action at this time.
0 commit comments