diff --git a/dashboard.py b/dashboard.py index fc32386..a9d136f 100644 --- a/dashboard.py +++ b/dashboard.py @@ -21,7 +21,23 @@ class Dashboard: self.widgets = [] for w in d["widgets"]: if w["type"] == "timeseries": - self.widgets.append(TimeSeries(w)) + # XXX - currently just a copy of the gauge code, + # but I want to add support for timeseries graphs with + # multiple series later so this will change + if w.get("multi"): + ts_list = LTS.find(w["data"][0]) + for ts in ts_list: + tso = LTS(id=ts) + if not tso.data: + log.warning("%s has no data: Skipping", tso.id) + continue + if tso.data[-1][0] < time.time() - 86400: + log.info("%s too old; Skipping", tso.id) + continue + w1 = {**w, "data": [ts]} + self.widgets.append(TimeSeries(w1)) + else: + self.widgets.append(TimeSeries(w)) elif w["type"] == "gauge": if w.get("multi"): ts_list = LTS.find(w["data"][0])