From: Alexander Moisseev Date: Sun, 5 Aug 2018 10:07:59 +0000 (+0300) Subject: [Minor] Use query function to get maps X-Git-Tag: 1.8.0~312^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2398%2Fhead;p=thirdparty%2Frspamd.git [Minor] Use query function to get maps --- diff --git a/interface/js/app/config.js b/interface/js/app/config.js index b98aed4c30..19bc234eca 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -57,35 +57,6 @@ define(["jquery"], }); } - // @get map by id - function getMapById(rspamd, item) { - return $.ajax({ - dataType: "text", - url: "getmap", - jsonp: false, - beforeSend: function (xhr) { - xhr.setRequestHeader("Password", rspamd.getPassword()); - xhr.setRequestHeader("Map", item.map); - }, - error: function () { - rspamd.alertMessage("alert-error", "Cannot receive maps data"); - }, - success: function (text) { - var disabled = ""; - if ((item.editable === false || rspamd.read_only)) { - disabled = "disabled=\"disabled\""; - } - - $("#" + item.map).remove(); - $("
" + - "" + - "" + + "" + + "
").appendTo("#modalBody"); + + $("#modalTitle").html(item.uri); + $("#" + item.map).first().show(); + $("#modalDialog .progress").hide(); + $("#modalDialog").modal({backdrop: true, keyboard: "show", show: true}); + if (item.editable === false) { + $("#modalSave").hide(); + $("#modalSaveAll").hide(); + } else { + $("#modalSave").show(); + $("#modalSaveAll").show(); + } + }, + errorMessage: "Cannot receive maps data", + server: (checked_server === "All SERVERS") ? "local" : checked_server }); return false; }); diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 70f6fbfd5a..e983e40743 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -286,7 +286,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, tabClick("#status_nav"); } }); - tab_config.setup(ui); + tab_config.setup(ui, checked_server); tab_symbols.setup(ui); tab_upload.setup(ui); selData = tab_graph.setup();