allow trigger of saving the config

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-22 19:51:01 -05:00
parent 525362fcc7
commit a5a972e2f4
2 changed files with 15 additions and 2 deletions

14
http.go
View File

@ -44,9 +44,23 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
} }
if tmp == "/favicon.ico" { if tmp == "/favicon.ico" {
// w.Header().Set("Content-Type", "image/svg+xml")
w.Header().Set("Content-Type", "image/png")
writeFile(w, "ipv6.png") writeFile(w, "ipv6.png")
return return
} }
if tmp == "/goReference.svg" {
w.Header().Set("Content-Type", "image/svg+xml")
writeFile(w, "goReference.svg")
return
}
if tmp == "/writeconfig" {
writeConfigFile()
return
}
if tmp == "/uptime" { if tmp == "/uptime" {
b, s := clusterHealthy() b, s := clusterHealthy()
if b { if b {

View File

@ -30,8 +30,7 @@ func main() {
} }
readConfigFile() readConfigFile()
// readHypervisorFile("hypervisor") // writeConfigFile()
writeConfigFile()
// initialize the grid as unstable // initialize the grid as unstable
me.unstable = time.Now() me.unstable = time.Now()