Moved frontend package to be part of webgui in plugin format and renamed it to static for a better description of the package
This commit is contained in:
committed by
ncthompson
parent
fd49891632
commit
92daf9191b
@@ -38,13 +38,13 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/diebietse/invertergui/frontend"
|
||||
"github.com/diebietse/invertergui/mk2core"
|
||||
"github.com/diebietse/invertergui/mk2driver"
|
||||
"github.com/diebietse/invertergui/plugins/cli"
|
||||
"github.com/diebietse/invertergui/plugins/munin"
|
||||
"github.com/diebietse/invertergui/plugins/prometheus"
|
||||
"github.com/diebietse/invertergui/plugins/webui"
|
||||
"github.com/diebietse/invertergui/plugins/webui/static"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/tarm/serial"
|
||||
)
|
||||
@@ -70,7 +70,7 @@ func main() {
|
||||
mu := munin.NewMunin(core.NewSubscription())
|
||||
prometheus.NewPrometheus(core.NewSubscription())
|
||||
|
||||
http.Handle("/", frontend.NewStatic())
|
||||
http.Handle("/", static.New())
|
||||
http.Handle("/ws", http.HandlerFunc(gui.ServeHub))
|
||||
http.Handle("/munin", http.HandlerFunc(mu.ServeMuninHTTP))
|
||||
http.Handle("/muninconfig", http.HandlerFunc(mu.ServeMuninConfigHTTP))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package frontend
|
||||
package static
|
||||
|
||||
import (
|
||||
"github.com/rakyll/statik/fs"
|
||||
@@ -7,7 +7,8 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func NewStatic() http.Handler {
|
||||
// New exports the static part of the webgui that is served via statik
|
||||
func New() http.Handler {
|
||||
statikFs, err := fs.New()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@@ -1,7 +1,7 @@
|
||||
// Code generated by statik. DO NOT EDIT.
|
||||
|
||||
// Package statik contains static assets.
|
||||
package frontend
|
||||
package static
|
||||
|
||||
import (
|
||||
"github.com/rakyll/statik/fs"
|
||||
Reference in New Issue
Block a user