diff options
Diffstat (limited to 'machine.go')
| -rw-r--r-- | machine.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -43,7 +43,7 @@ func handleMachine(r *http.Request, w http.ResponseWriter, hostname string, data am := new(zoopb.Machine) am.Hostname = newm.Hostname am.Memory = newm.Memory - me.machines2.Append(am) + // me.machines2.Append(am) me.machines.Append(newm) log.Info("new machine", am.Hostname, am.Memory) return @@ -59,7 +59,7 @@ func handleMachine(r *http.Request, w http.ResponseWriter, hostname string, data fmt.Fprintln(w, "apt update") m.Upgrade = false } else { - fmt.Fprintln(w, "upgrade") + fmt.Fprintln(w, "good") } // log.Info("update machine protobuf", hostname) updateMachine(newm) @@ -75,8 +75,12 @@ func updateMachine(u *zoopb.Machine) string { if m == nil { log.Info("adding new machine", u.Hostname) me.machines.Append(u) - log.Info("save machines pb file here...") - me.machines2.ConfigSave() + if me.zood == nil { + // do nothing. window has not been opened + } else { + me.zood.doMachinesUpgradeTable(me.machines) + } + saveMachineState() return "new" } // log.Info("updating machine", m.Hostname) |
