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:
Nicholas Thompson
2019-03-22 15:18:06 +02:00
committed by ncthompson
parent fd49891632
commit 92daf9191b
9 changed files with 6 additions and 5 deletions

View File

@@ -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))

View File

@@ -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)

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -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"