added pages
This commit is contained in:
7
src/backup_ui.go
Normal file
7
src/backup_ui.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "gopkg.in/macaron.v1"
|
||||
|
||||
func backupPage(ctx *macaron.Context) {
|
||||
ctx.HTML(200, "backup")
|
||||
}
|
||||
7
src/lan_ui.go
Normal file
7
src/lan_ui.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "gopkg.in/macaron.v1"
|
||||
|
||||
func lanPage(ctx *macaron.Context) {
|
||||
ctx.HTML(200, "lan")
|
||||
}
|
||||
7
src/syslog_ui.go
Normal file
7
src/syslog_ui.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "gopkg.in/macaron.v1"
|
||||
|
||||
func syslogPage(ctx *macaron.Context) {
|
||||
ctx.HTML(200, "syslog")
|
||||
}
|
||||
@@ -22,6 +22,9 @@ func upsPage(ctx *macaron.Context) {
|
||||
ctx.Data["upsmfr"] = upsVars["device.mfr"].Value
|
||||
ctx.Data["upsmodel"] = upsVars["device.model"].Value
|
||||
ctx.Data["upsserial"] = upsVars["device.serial"].Value
|
||||
ctx.Data["upsload"] = upsVars["ups.load"].Value
|
||||
ctx.Data["upscharge"] = upsVars["battery.charge"].Value
|
||||
|
||||
// }
|
||||
|
||||
ctx.HTML(200, "ups")
|
||||
|
||||
@@ -105,10 +105,13 @@ func startServer() {
|
||||
// m.Get("/", myHandler)
|
||||
|
||||
m.Get("/", statusPage)
|
||||
m.Get("/lan", lanPage)
|
||||
m.Get("/mqtt", mqttPage)
|
||||
m.Post("/mqtt", binding.Bind(MQTTPostForm{}), mqttPost)
|
||||
m.Get("/ups", upsPage)
|
||||
m.Post("/ups", binding.Bind(UPSPostForm{}), upsPost)
|
||||
m.Get("/syslog", syslogPage)
|
||||
m.Get("/backup", backupPage)
|
||||
m.Get("/json/status", jsonStatus)
|
||||
m.Post("/json/outlet/:id/toggle", jsonOutletToggle)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user