@cryptotaxi247 / netdata-1 / commits / 0237179b9

Show a warning if JavaScript is disabled #2422 (#4999)

George Moschovitis committed Dec 18, 2018 at 09:11 UTC 0237179b98ff8026985d74207f7207882c3ec73b
2 files changed +12 -4
web/gui/index.html
+11 -3
@@ -55,10 +55,16 @@
55 </head>
56
57 <body data-spy="scroll" data-target="#sidebar" data-offset="100">
58 - <div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
59 - netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>
58 + <div id="loadOverlay" class="loadOverlay" style="background-color: #fff; color: #888;">
59 + <div style="font-size: 3vh;">
60 + You must enable JavaScript in order to use Netdata!<br />
61 + You can do this in <a href="https://enable-javascript.com/" target="_blank">your browser settings</a>.
62 + </div>
63 </div>
64 <script type="text/javascript">
65 + // Cleanup JS warning.
66 + document.documentElement.style.overflowY = "scroll";
67 +
68 // Change the loadOverlay colors ASAP to match the theme.
69 let theme;
70 const hash = document.location.hash;
@@ -69,7 +75,9 @@
75 } else {
76 theme = localStorage.getItem('netdataTheme') || 'slate';
77 }
72 - document.getElementById('loadOverlay').style = theme == 'slate' ? "background-color: #272b30; color: #373b40;" : "background-color: #fff; color: #ddd;";
78 + const overlayEl = document.getElementById('loadOverlay');
79 + overlayEl.innerHTML = 'netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>';
80 + overlayEl.style = theme == 'slate' ? "background-color: #272b30; color: #373b40;" : "background-color: #fff; color: #ddd;";
81 </script>
82 <nav class="navbar navbar-default navbar-fixed-top" role="banner">
83 <div class="container">
web/gui/main.css
+1 -1
@@ -1,6 +1,6 @@
1 /* force the vertical window scrollbar */
2 html {
3 - overflow-y: scroll;
3 + overflow-y: hidden;
4 }
5
6 /* prevent body from hiding under the navbar */