Code

Added support for simple SVG graphs for metrics.
[sysdb/webui.git] / server / server.go
index 33a2536f3b6fd491604cea59dbde8099460d91cc..59c1e4215a468bea1a3a36813eafc97014bfac99 100644 (file)
@@ -104,6 +104,7 @@ func New(cfg Config) (*Server, error) {
        s.mux = map[string]handler{
                "images": s.static,
                "style":  s.static,
+               "graph":  s.graph,
        }
        return s, nil
 }
@@ -317,6 +318,10 @@ func (s *Server) query(cmd string) (interface{}, error) {
                        var host sysdb.Host
                        err = proto.Unmarshal(m, &host)
                        res = host
+               case proto.Timeseries:
+                       var ts sysdb.Timeseries
+                       err = proto.Unmarshal(m, &ts)
+                       res = ts
                default:
                        return nil, fmt.Errorf("Unsupported data type %d", t)
                }