From a5a972e2f41c9f79938f4779027c62eebeb45704 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 22 Oct 2024 19:51:01 -0500 Subject: [PATCH] allow trigger of saving the config Signed-off-by: Jeff Carr --- http.go | 14 ++++++++++++++ main.go | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/http.go b/http.go index b8f8758..961ca2b 100644 --- a/http.go +++ b/http.go @@ -44,9 +44,23 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } if tmp == "/favicon.ico" { + // w.Header().Set("Content-Type", "image/svg+xml") + w.Header().Set("Content-Type", "image/png") writeFile(w, "ipv6.png") 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" { b, s := clusterHealthy() if b { diff --git a/main.go b/main.go index b7cf954..0ba073a 100644 --- a/main.go +++ b/main.go @@ -30,8 +30,7 @@ func main() { } readConfigFile() - // readHypervisorFile("hypervisor") - writeConfigFile() + // writeConfigFile() // initialize the grid as unstable me.unstable = time.Now()