You've already forked nyx
mirror of
https://github.com/rls-moe/nyx
synced 2025-08-19 06:18:38 +00:00
Embedded Resources
This commit is contained in:
@@ -11,24 +11,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var riceConf = rice.Config{
|
||||
LocateOrder: []rice.LocateMethod{
|
||||
rice.LocateWorkingDirectory,
|
||||
rice.LocateEmbedded,
|
||||
rice.LocateAppended,
|
||||
},
|
||||
}
|
||||
|
||||
var box = riceConf.MustFindBox("http/admin/res/")
|
||||
|
||||
var (
|
||||
panelTmpl = template.New("admin/panel")
|
||||
loginTmpl = template.New("admin/login")
|
||||
statusTmpl = template.New("admin/status")
|
||||
)
|
||||
|
||||
func init() {
|
||||
func LoadTemplates() error {
|
||||
var err error
|
||||
box, err := rice.FindBox("res/")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
panelTmpl, err = panelTmpl.Parse(box.MustString("panel.html"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
55
http/admin/rice-box.go
Normal file
55
http/admin/rice-box.go
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user