SNMP browser action buttons

This commit is contained in:
Jonathan 2023-02-28 15:26:42 +01:00
parent 78af41b700
commit d5cd9a0ab2
2 changed files with 37 additions and 29 deletions

View File

@ -613,7 +613,9 @@ function snmp_browser_create_modules(module_target, return_post = true) {
var oids = [];
id_check.forEach(function(product, index) {
var oid = $("#" + product)
.siblings("a")
.parent()
.parent()
.find("a")
.attr("href");
if (oid.indexOf('javascript: snmpGet("') != -1) {
oid = oid.replace('javascript: snmpGet("', "");
@ -657,23 +659,29 @@ function snmp_browser_create_modules(module_target, return_post = true) {
params["page"] = "include/ajax/snmp_browser.ajax";
params["snmp_extradata"] = snmp_data;
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub add"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub spinn");
$("#dialog_error").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").addClass(
"sub spinn"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("#dialog_error").on("dialogclose", function(event) {
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn"
);
$("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
});
$("#dialog_success").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
});
$.ajax({

View File

@ -111,7 +111,7 @@ $(document).on('DOMSubtreeModified', "#snmp_create_module", function() {
});
$(document).on("click", 'div#snmp_create_buttons > input', function (event) {
$(document).on("click", 'div#snmp_create_buttons > button', function (event) {
var source_button = this.name;
var target = "";
@ -264,8 +264,8 @@ function snmp_show_result_message(data) {
height: 300,
width: 500,
close: function(e, ui) {
$("input[name=create_modules_network_component]").removeClass("sub spinn");
$("input[name=create_modules_network_component]").addClass("sub add");
$("button[name=create_modules_network_component]").removeClass("sub spinn");
$("button[name=create_modules_network_component]").addClass("sub add");
},
overlay: {
opacity: 0.5,