Compare commits

..

No commits in common. "c50d17a49722f83b0120ce887a35a80c2787417a" and "48b19fbfd718fc7c3e00590428e44bc9a8373c5a" have entirely different histories.

4 changed files with 2 additions and 27 deletions

View File

@ -49,5 +49,5 @@ func main() {
- reboot/shutdown from web
- shutdown behavior
- user management + roles (admin, port-reboot, port-on, port-off, readonly, ..) + api key
- ups: username and password are required in webui
*/

View File

@ -1,18 +1,7 @@
package webui
import (
"path"
"github.com/spf13/viper"
"gopkg.in/macaron.v1"
)
import "gopkg.in/macaron.v1"
func backupPage(ctx *macaron.Context) {
ctx.HTML(200, "backup")
}
func backupDownload(ctx *macaron.Context) {
cfgFile := viper.ConfigFileUsed()
_, fileName := path.Split(cfgFile)
ctx.ServeFile(cfgFile, fileName)
}

View File

@ -33,7 +33,6 @@ func StartServer() {
m.Post("/ups", binding.Bind(UPSPostForm{}), upsPost)
m.Get("/syslog", syslogPage)
m.Get("/backup", backupPage)
m.Post("/backup", backupDownload)
m.Get("/json/status", jsonStatus)
m.Post("/json/outlet/:id/toggle", jsonOutletToggle)

View File

@ -25,19 +25,6 @@
</div>
<!-- /.box-header -->
<form class="form-horizontal" method="post">
<div class="box-body">
<div class="form-group">
<label for="port" class="col-sm-6 control-label">Configuration backup</label>
<div class="col-sm-6">
<button type="submit" class="btn btn-info" name="download">Download</button>
</div>
</div>
</div> <!-- /.box-body -->
</form>
</div>
</div>