return e.options[e.selectedIndex].value;
};
+ ui.getServer = function () {
+ const checked_server = ui.getSelector("selSrv");
+ return (checked_server === "All SERVERS") ? "local" : checked_server;
+ };
+
/**
* @param {string} url - A string containing the URL to which the request is sent
* @param {Object} [options] - A set of key/value pairs that configure the Ajax request. All settings are optional.
"use strict";
const ui = {};
- ui.getActions = function getActions(checked_server) {
+ ui.getActions = function getActions() {
common.query("actions", {
success: function (data) {
$("#actionsFormField").empty();
$("#actionsFormField").html(
items.map((e) => e.html).join(""));
},
- server: (checked_server === "All SERVERS") ? "local" : checked_server
+ server: common.getServer()
});
};
}
};
- ui.getMaps = function (checked_server) {
+ ui.getMaps = function () {
const $listmaps = $("#listMaps");
$listmaps.closest(".card").hide();
common.query("maps", {
$tbody.appendTo($listmaps);
$listmaps.closest(".card").show();
},
- server: (checked_server === "All SERVERS") ? "local" : checked_server
+ server: common.getServer()
});
};
// Modal form for maps
$(document).on("click", "[data-bs-toggle=\"modal\"]", function () {
- const checked_server = common.getSelector("selSrv");
const item = $(this).data("item");
common.query("getmap", {
headers: {
$("#modalDialog").modal("show");
},
errorMessage: "Cannot receive maps data",
- server: (checked_server === "All SERVERS") ? "local" : checked_server
+ server: common.getServer()
});
return false;
});
break;
case "#configuration_nav":
require(["app/config"], (module) => {
- module.getActions(checked_server);
- module.getMaps(checked_server);
+ module.getActions();
+ module.getMaps();
});
break;
case "#symbols_nav":
- require(["app/symbols"], (module) => module.getSymbols(checked_server));
+ require(["app/symbols"], (module) => module.getSymbols());
break;
case "#scan_nav":
require(["app/upload"]);
));
}
- function get_server() {
- const checked_server = common.getSelector("selSrv");
- return (checked_server === "All SERVERS") ? "local" : checked_server;
- }
-
function checkMsg(data) {
const selector = $("#selectorsSelArea").val();
common.query("plugins/selectors/check_message?selector=" + encodeURIComponent(selector), {
common.alertMessage("alert-error", "Unexpected error processing message");
}
},
- server: get_server()
+ server: common.getServer()
});
}
toggle_form_group_class("valid", "invalid");
}
},
- server: get_server()
+ server: common.getServer()
});
} else {
$("#selectorsSelArea").removeClass("is-valid is-invalid");
const json = neighbours_status[0].data;
build_table_from_json(json, "#selectorsTable-" + list);
},
- server: get_server()
+ server: common.getServer()
});
}
return [items, distinct_groups];
}
// @get symbols into modal form
- ui.getSymbols = function (checked_server) {
+ ui.getSymbols = function () {
clear_altered();
common.query("symbols", {
success: function (json) {
}
});
},
- server: (checked_server === "All SERVERS") ? "local" : checked_server
+ server: common.getServer()
});
};
$("#updateSymbols").on("click", (e) => {
e.preventDefault();
clear_altered();
- const checked_server = common.getSelector("selSrv");
common.query("symbols", {
success: function (data) {
const [items] = process_symbols_data(data[0].data);
common.tables.symbols.rows.load(items);
},
- server: (checked_server === "All SERVERS") ? "local" : checked_server
+ server: common.getServer()
});
});
});
}
- function get_server() {
- const checked_server = common.getSelector("selSrv");
- return (checked_server === "All SERVERS") ? "local" : checked_server;
- }
-
// @upload text
function scanText(data, headers) {
common.query("checkv2", {
common.alertMessage("alert-error", "Cannot tokenize message: no text data");
}
},
- server: get_server()
+ server: common.getServer()
});
}
common.alertMessage("alert-error", "Unexpected error processing message");
}
},
- server: get_server()
+ server: common.getServer()
});
}