diff options
author | moisseev <moiseev@mezonplus.ru> | 2020-10-01 15:01:51 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2020-10-01 15:01:51 +0300 |
commit | 1779fc31f6db9f6250d5302bad5b86094c1e18e1 (patch) | |
tree | 68cea2bcde8accbb9b59eb792eeb753b0c4fcb1e /interface | |
parent | ae709edc11e19f1fa834782c023b0dd2cd552797 (diff) | |
download | rspamd-1779fc31f6db9f6250d5302bad5b86094c1e18e1.tar.gz rspamd-1779fc31f6db9f6250d5302bad5b86094c1e18e1.zip |
[WebUI] Avoid error messages on connect
in read-only mode
Reported by: @nwhisper via Telegram group
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/rspamd.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 475f0404f..c3356c7e4 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -258,6 +258,10 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_ } function displayUI() { + // In many browsers local storage can only store string. + // So when we store the boolean true or false, it actually stores the strings "true" or "false". + ui.read_only = sessionStorage.getItem("read_only") === "true"; + ui.query("auth", { success: function (neighbours_status) { $("#selSrv").empty(); @@ -270,15 +274,12 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_ $('#selSrv [value="' + e.name + '"]').prop("disabled", true); } }); - tab_selectors.displayUI(ui); + if (!ui.read_only) tab_selectors.displayUI(ui); }, errorMessage: "Cannot get server status", server: "All SERVERS" }); - // In many browsers local storage can only store string. - // So when we store the boolean true or false, it actually stores the strings "true" or "false". - ui.read_only = sessionStorage.getItem("read_only") === "true"; if (ui.read_only) { $(".ro-disable").attr("disabled", true); $(".ro-hide").hide(); |