From f0d9e3f6668f811dc8812ce8ef75b7daad423db5 Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 27 Oct 2023 08:27:20 -0600 Subject: [PATCH] create UI --- cmd/clitest/index.html | 81 ++++++++++++++++++++++++++++++++++++++++++ cmd/clitest/main.go | 9 ++++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 cmd/clitest/index.html diff --git a/cmd/clitest/index.html b/cmd/clitest/index.html new file mode 100644 index 0000000..6fd5130 --- /dev/null +++ b/cmd/clitest/index.html @@ -0,0 +1,81 @@ + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + diff --git a/cmd/clitest/main.go b/cmd/clitest/main.go index cb3661b..e3f5f72 100644 --- a/cmd/clitest/main.go +++ b/cmd/clitest/main.go @@ -85,7 +85,6 @@ func main() { if predictionMonths, err := strconv.ParseInt(r.URL.Query().Get("predictionMonths"), 10, 16); err == nil && predictionMonths > 0 { window := time.Hour * 24.0 * 365.0 / 12.0 * time.Duration(predictionMonths) // TODO whatif - // TODO ana.Prediction prediction := make(ana.Prediction, 0) for _, spec := range r.URL.Query()["prediction"] { idx := strings.Index(spec, "=") @@ -154,6 +153,14 @@ func main() { default: http.NotFound(w, r) return + case "/ui": + f, err := os.Open("./index.html") + if err != nil { + panic(err) + } + defer f.Close() + io.Copy(w, f) + return case "/bal": for _, name := range names { currencyDateValue := nameCurrencyDateValue[name]