[Git][NTPsec/ntpsec][master] ntpclients/ntpviz.py: More (invisible) styling changes.

Gary E. Miller (@garyedmundsmiller) gitlab at mg.gitlab.com
Thu Jul 10 04:12:08 UTC 2025



Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
d293a7aa by James Browning at 2025-07-09T21:11:31-07:00
ntpclients/ntpviz.py: More (invisible) styling changes.

- - - - -


1 changed file:

- ntpclients/ntpviz.py


Changes:

=====================================
ntpclients/ntpviz.py
=====================================
@@ -391,7 +391,7 @@ class VizStats(ntp.statfiles.NTPStats):
 
         self.table = '''\
 <tr>
- <td style="text-align:left;">%s</td>
+ <td>%s</td>
 </tr>
 ''' % self.table
 
@@ -1568,15 +1568,17 @@ Python by ESR, concept and gnuplot code by Dan Drown.
         # fit in 1388x768 browser
         # in 2016 this is 42% of all browsers
         args.img_size = '1340,720'
+    img_w, img_h = args.img_size.split(',')
 
     # figure out plot image file extension
-    term_map = {'gif': '.gif',
-                'jpeg': '.jpg',
-                'pngcairo': '.png',
-                'png': '.png',
-                'svg': '.svg',
-                'webp': '.webp',
-               }
+    term_map = {
+        'gif': '.gif',
+        'jpeg': '.jpg',
+        'pngcairo': '.png',
+        'png': '.png',
+        'svg': '.svg',
+        'webp': '.webp',
+    }
     if args.terminal in term_map:
         args.img_ext = term_map[args.terminal]
     else:
@@ -1787,6 +1789,9 @@ thead {
 tbody tr {
     vertical-align: top;
 }
+tbody td:first-child {
+    text-align: left;
+}
 tbody tr:nth-child(6n+4),
 tbody tr:nth-child(6n+5),
 tbody tr:nth-child(6n+6) {
@@ -1799,12 +1804,19 @@ tbody tr:nth-child(6n+6) {
 .section .site-title:visited {
     color: #000000;
 }
+.graph {
+    border: 0;
+    width: %(img_w)spx;
+    height: %(img_h)spx
+}
 </style>
 </head>
 <body>
 <div style="width:910px">
 <a href='https://www.ntpsec.org/'>
-<img src="ntpsec-logo.png" alt="NTPsec" style="float:left;margin:20px 70px;">
+<img src="ntpsec-logo.png" alt="NTPsec"
+    style="float:left;margin:20px 70px;border:0;width:64px;height:74px"
+>
 </a>
 <div>
 <h1 style="margin-bottom:10px;">%(title)s</h1>
@@ -1942,14 +1954,13 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
 </div>
 <div style="float:left;margin-left:350px;">
     <a href="https://validator.w3.org/nu/">
-    <img src="https://www.w3.org/html/logo/downloads/HTML5_Logo_32.png"
-        alt="html 5">
+        <img src="https://www.w3.org/html/logo/downloads/HTML5_Logo_32.png"
+            alt="html 5" style="border:0;width:32px;height:32px">
     </a>
   
     <a href="https://jigsaw.w3.org/css-validator/check/referer">
-        <img style="border:0;width:88px;height:31px"
-            src="https://jigsaw.w3.org/css-validator/images/vcss"
-            alt="Valid CSS!" />
+        <img src="https://jigsaw.w3.org/css-validator/images/vcss"
+            alt="Valid CSS!" style="border:0;width:88px;height:31px">
     </a>
 </div>
 <div style="clear:both;"></div>
@@ -1957,7 +1968,8 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
 </body>
 </html>
 '''
-    imagewrapper = "<img src='%%s%s' alt='%%s plot'>\n" % args.img_ext
+    imagewrapper = ("<img src='%%s%s' alt='%%s plot' class='graph'>\n" %
+                    args.img_ext)
 
     # buffer the index.html output so the index.html is not empty
     # during the run



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/d293a7aaa2672e6b32613e6bd86142f0ac05479c

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/d293a7aaa2672e6b32613e6bd86142f0ac05479c
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20250710/20fd0c90/attachment-0001.htm>


More information about the vc mailing list