create UI

This commit is contained in:
bel
2023-10-27 08:27:20 -06:00
parent ea733f560c
commit f0d9e3f666
2 changed files with 89 additions and 1 deletions

View File

@@ -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]