Browse Source

Merge pull request #3502 from moisseev/webui

[WebUI] Avoid error messages on connect
pull/3505/head
Vsevolod Stakhov 5 years ago
committed by GitHub
parent
commit
6a57ff6f5f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      interface/js/app/rspamd.js

9
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();

Loading…
Cancel
Save