latency: Show "Default Gateway" in headline for gateway
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Oct 2016 21:04:19 +0000 (23:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Oct 2016 21:04:19 +0000 (23:04 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/plugins/latency.py

index 0ef70eb..43ae475 100644 (file)
@@ -107,7 +107,13 @@ class GraphTemplateLatency(base.GraphTemplate):
        @property
        def graph_title(self):
                _ = self.locale.translate
-               return _("Latency to %s") % self.object.hostname
+
+               if self.object.hostname == "gateway":
+                       hostname = _("Default Gateway")
+               else:
+                       hostname = self.object.hostname
+
+               return _("Latency to %s") % hostname
 
        @property
        def graph_vertical_label(self):