From: Michael Tremer Date: Sat, 4 Dec 2021 16:16:49 +0000 (+0000) Subject: analytics: Convert more pages to tabbed view X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3908d508529a2227ba49d00a05d308685e77938a;p=people%2Fms%2Fwestferry.git analytics: Convert more pages to tabbed view Signed-off-by: Michael Tremer --- diff --git a/src/westferry/handlers/analytics.py b/src/westferry/handlers/analytics.py index 1bb932e..3cc4b1c 100644 --- a/src/westferry/handlers/analytics.py +++ b/src/westferry/handlers/analytics.py @@ -145,39 +145,39 @@ class AnalyticsSystemOverviewHandler(AnalyticsSystemBaseHandler): url = r"/analytics/system" title = N_("System") - def get(self): - self.render("base.html") + def initialize(self): + _ = self.locale.translate + + tab = self.tabs.add_tab("loadavg", _("Load Average")) + tab.add_graph("loadavg") class AnalyticsSystemProcessorsHandler(AnalyticsSystemBaseHandler): url = r"/analytics/system/processors" title = N_("Processors") - def get(self): + def initialize(self): _ = self.locale.translate - graphs = [ - ui.graphs.Graph(self, "processor"), - ui.graphs.Graph(self, "processor-temperature"), - ui.graphs.Graph(self, "cpufreq"), - ui.graphs.Graph(self, "loadavg"), - ] + tab = self.tabs.add_tab("usage", _("Usage")) + tab.add_graph("processor") - self.render_graphs(graphs) + tab = self.tabs.add_tab("frequency", _("Frequency")) + tab.add_graph("cpufreq") + + tab = self.tabs.add_tab("temperature", _("Temperature")) + tab.add_graph("processor-temperature") class AnalyticsSystemMemoryHandler(AnalyticsSystemBaseHandler): url = r"/analytics/system/memory" title = N_("Memory") - def get(self): + def initialize(self): _ = self.locale.translate - graphs = [ - ui.graphs.Graph(self, "memory"), - ] - - self.render_graphs(graphs) + tab = self.tabs.add_tab("usage", _("Usage")) + tab.add_graph("memory") class AnalyticsSystemTemperaturesHandler(AnalyticsSystemBaseHandler):