Modernized the plugin
Implemented fixes from Gitlab issues from Marc Hagen & Trent Robinson (https://gitlab.com/jackgreyhat/librenms-speedtest/-/issues/2) and fixes from m0nsieur Psych0 (https://gitlab.com/jackgreyhat/librenms-speedtest/-/issues/6) I added support for darkmode, this is done by generating the graphs with white text, then using CSS to invert the image, for light mode users. I also moved branding PNGs to vectors for higher resolutions I will not be opening a PR at https://gitlab.com/jackgreyhat/librenms-speedtest as this seems to have been abbandoned.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<html>
|
||||
|
||||
<style>html .panel-body img,html .panel-body img.img-responsive,html div#overDiv table tbody tr td table tbody tr td font .overlib-contents img{filter:invert(1)}html.tw-dark .panel-body img,html.tw-dark .panel-body img.img-responsive,html.tw-dark div#overDiv table tbody tr td table tbody tr td font .overlib-contents img{filter:none!important}</style>
|
||||
<body>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body ">
|
||||
<img src="plugins/Speedtest/images/speedtest-logo.png" title="Speedtest Logo" class="device-icon-header pull-left" style="max-height:25px;height:100%;margin-top:8px">
|
||||
<img src="plugins/Speedtest/images/speedtest-logo.svg" title="Speedtest Logo" class="device-icon-header pull-left" style="max-height:25px;height:100%;margin-top:8px">
|
||||
<div class="pull-left" style="margin-top: 5px;">
|
||||
<span style="font-size: 12px;font-weight: bold">Last used Speedtest server:</span><br />
|
||||
<span style="font-size: 12px;"><?php require_once("plugins/Speedtest/tmp/speedtest-server");?></span>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<img src="plugins/Speedtest/images/ookla-logo.png" title="Ookla Logo" style="max-height: 50px">
|
||||
<img src="plugins/Speedtest/images/ookla-logo.svg" title="Ookla Logo" style="max-height: 50px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,16 +22,16 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-day.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-bandwidth-day.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-day.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-bandwidth-day.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-week.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-bandwidth-week.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-week.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-bandwidth-week.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-month.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-bandwidth-month.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-month.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-bandwidth-month.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-year.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-bandwidth-year.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-bandwidth-year.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-bandwidth-year.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,16 +41,16 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-day.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-latency-day.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-day.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-latency-day.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-week.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-latency-week.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-week.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-latency-week.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-month.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-latency-month.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-month.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-latency-month.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-year.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="lazy img-responsive" data-original="plugins/Speedtest/png/speedtest-latency-year.png" style="border: 0" /></a>
|
||||
<a onmouseover="return overlib('<div class=\'overlib-contents\'><img src=\'plugins/Speedtest/png/speedtest-latency-year.png\' style=\'border:0;\' /></div>',FGCOLOR,'#ffffff', BGCOLOR, '#e5e5e5', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#555555', TEXTCOLOR, '#3e3e3e',WRAP,HAUTO,VAUTO); " onmouseout="return nd();"><img class="img-responsive" src="plugins/Speedtest/png/speedtest-latency-year.png" style="border: 0" loading="lazy"/></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user