commit 25c7f05: [WebUI] Add `Enable JS` warning
moisseev
moiseev at mezonplus.ru
Sun Jul 26 19:07:10 UTC 2020
Author: moisseev
Date: 2020-07-26 20:28:36 +0300
URL: https://github.com/rspamd/rspamd/commit/25c7f0536578ed62a0ff58493494ddf8bc74f969 (refs/pull/3453/head)
[WebUI] Add `Enable JS` warning
---
interface/index.html | 9 +++++++--
interface/js/main.js | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/interface/index.html b/interface/index.html
index efb6138fb..742db46df 100644
--- a/interface/index.html
+++ b/interface/index.html
@@ -72,13 +72,18 @@
</form>
</nav>
-<div class="notification-area"></div>
+<div class="notification-area">
+ <noscript>
+ <div class="alert alert-error"><strong>Please enable JavaScript</strong></div>
+ </noscript>
+</div>
<div id="preloader" class="container-fluid">
- <div id="loading" class="position-absolute align-items-center my-3 text-primary blinking">
+ <div id="loading" class="position-absolute align-items-center my-3 text-primary blinking d-none">
<div class="spinner-border align-middle" role="status" aria-hidden="true"></div>
<strong class="ml-3">Loading...</strong>
</div>
+ <script>document.getElementById("loading").classList.remove("d-none");</script>
<div class="row position-absolute w-100 h-100 align-items-center text-center">
<img class="img-fluid mh-100 mx-auto" src="./img/rspamd_logo_navbar.png" alt="Rspamd" />
</div>
diff --git a/interface/js/main.js b/interface/js/main.js
index 7c6bb6851..87d4f384c 100644
--- a/interface/js/main.js
+++ b/interface/js/main.js
@@ -46,6 +46,7 @@ define("d3.global", ["d3"], function (d3global) { // eslint-disable-line strict
// Notify user on module loading failure
requirejs.onError = function (e) {
"use strict";
+ document.getElementById("loading").classList.add("d-none");
document.getElementsByClassName("notification-area")[0].innerHTML =
"<div class=\"alert alert-error\">" +
"<strong>Module loading error: " + e.requireType + ", module: " + e.requireModules + "</strong>" +
More information about the Commits
mailing list