From ea7b3163d10d6b2395327195a340f28e927c2cf3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 11 Apr 2022 23:44:55 +0200 Subject: [PATCH] gluon-status-page: Code clarification and formatting --- .../lib/gluon/status-page/view/status-page.html | 8 ++++---- .../lib/gluon/status-page/www/static/status-page.js | 2 +- package/gluon-status-page/javascript/status-page.js | 12 +++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index c489294a..15ce0a79 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -231,10 +231,10 @@ <% for _, radio in ipairs(radios) do -%> - - - - + + + + <%- end %>
<%| radio.name %><%| translatef('Channel %u', radio.channel) %>
<%| radio.name %><%| translatef('Channel %u', radio.channel) %>
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js b/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js index 6427c749..20fde64e 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js @@ -1 +1 @@ -"use strict";!function(){var r=JSON.parse(document.body.getAttribute("data-translations"));function i(t,e){return t.toFixed(e).replace(/\./,r["."])}function a(t,e){e--;for(var n=t;10<=n&&0e[0]||t[1]e[1]?1:0}),t=t[0][2],t&&!/^fe80:/i.test(t)?t:void 0}return t.wireless&&((g=a.insertCell()).textContent="-",g.setAttribute("data-label",r.children[Object.keys(s).length+1].textContent),(m=a.insertCell()).textContent="-",m.setAttribute("data-label",r.children[Object.keys(s).length+2].textContent),(p=a.insertCell()).textContent="-",p.setAttribute("data-label",r.children[Object.keys(s).length+3].textContent),v=A(e),t.signalgraph.addSignal(v)),a.onmouseenter=function(){a.classList.add("highlight"),v&&(v.highlight=!0)},a.onmouseleave=function(){a.classList.remove("highlight"),v&&(v.highlight=!1)},y(),{get_hostname:function(){return l.textContent},get_addr:function(){return o},update_nodeinfo:function(t){var e,n,i,r,a;(o=w(t.network.addresses))&&("span"===l.nodeName.toLowerCase()&&(e=l,l=document.createElement("a"),e.parentNode.replaceChild(l,e)),l.href="http://["+o+"]/"),l.textContent=t.hostname,x&&t.location&&(e=x.latitude,n=x.longitude,i=t.location.latitude,t=t.location.longitude,r=Math.PI/180,a=(i*=r)-(e*=r),t=(t*=r)-(n*=r),r=Math.sin(a/2)*Math.sin(a/2)+Math.sin(t/2)*Math.sin(t/2)*Math.cos(e)*Math.cos(i),n=6372.8*(2*Math.asin(Math.sqrt(r))),m.textContent=Math.round(1e3*n)+" m"),y()},update_mesh:function(n){Object.keys(s).forEach(function(t){var e=s[t];e.td.textContent=n[t]+e.suffix}),y()},update_wifi:function(t){g.textContent=t.signal,p.textContent=Math.round(t.inactive/1e3)+" s",a.classList.toggle("inactive",200e[0]||t[1]e[1]?1:0}),t=t[0][2],t&&!/^fe80:/i.test(t)?t:void 0}return t.wireless&&((g=c.insertCell()).textContent="-",g.setAttribute("data-label",a.children[Object.keys(l).length+1].textContent),(m=c.insertCell()).textContent="-",m.setAttribute("data-label",a.children[Object.keys(l).length+2].textContent),(p=c.insertCell()).textContent="-",p.setAttribute("data-label",a.children[Object.keys(l).length+3].textContent),v=A(e),t.signalgraph.addSignal(v)),c.onmouseenter=function(){c.classList.add("highlight"),v&&(v.highlight=!0)},c.onmouseleave=function(){c.classList.remove("highlight"),v&&(v.highlight=!1)},y(),{get_hostname:function(){return s.textContent},get_addr:function(){return o},update_nodeinfo:function(t){var e,n,i,r,a;(o=E(t.network.addresses))&&("span"===s.nodeName.toLowerCase()&&(e=s,s=document.createElement("a"),e.parentNode.replaceChild(s,e)),s.href="http://["+o+"]/"),s.textContent=t.hostname,x&&t.location&&(e=x.latitude,n=x.longitude,i=t.location.latitude,t=t.location.longitude,r=Math.PI/180,a=(i*=r)-(e*=r),t=(t*=r)-(n*=r),r=Math.sin(a/2)*Math.sin(a/2)+Math.sin(t/2)*Math.sin(t/2)*Math.cos(e)*Math.cos(i),n=6372.8*(2*Math.asin(Math.sqrt(r))),m.textContent=Math.round(1e3*n)+" m"),y()},update_mesh:function(n){Object.keys(l).forEach(function(t){var e=l[t];e.td.textContent=n[t]+e.suffix}),y()},update_wifi:function(t){g.textContent=t.signal,p.textContent=Math.round(t.inactive/1e3)+" s",c.classList.toggle("inactive",200