From 47e58213a2825d7571946f8d6088653ea3c12c5b Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Tue, 12 May 2020 19:34:47 +0100 Subject: [PATCH] add dsnetreport shortcode --- README.md | 3 ++- etc/dsnetreport.html | 54 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 etc/dsnetreport.html diff --git a/README.md b/README.md index e62d65e..1f0f36a 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,8 @@ consumed by a web service or DNS integration script, for instance. The report contains no sensitive information. At one site I use it together with [hugo](https://gohugo.io/) [shortcodes](https://gohugo.io/templates/shortcode-templates/) to generate a -network overview page. +network overview page. The shortcode file is included in this repository under +`etc/`. "PrivateKey": "uC+xz3v1mfjWBHepwiCgAmPebZcY+EdhaHAvqX2r7U8=", diff --git a/etc/dsnetreport.html b/etc/dsnetreport.html new file mode 100644 index 0000000..e30ae38 --- /dev/null +++ b/etc/dsnetreport.html @@ -0,0 +1,54 @@ + +{{ $report := $.Site.Data.dsnetreport }} + +{{ with $report }} + + + + + + + + + + + + + + + {{ range $report.Peers }} + {{ if .Dormant }} + + {{ else }} + + {{ end }} + + + {{ if .Online }} + + + {{ else }} + + + {{ end }} + + + + + + + + + {{ end }} + +
+ {{ $report.PeersOnline }} of {{ $report.PeersTotal }} devices connected +
HostnameStatusIPOwnerDescriptionUpDown
{{ .Hostname }}onlineoffline{{ .IP }}{{ .Owner }}{{ .Description }}{{ .ReceiveBytesSI }}{{ .TransmitBytesSI }}
+{{ else }} + +
+    
+        /etc/dsnetreport.json not found or empty
+    
+
+{{ end }}