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");
$("button[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 + "]").removeClass(
"sub spinn"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("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 = "";
@ -254,55 +254,55 @@ function snmp_show_result_message(data) {
var dato = JSON.parse(data);
if (dato.length !== 0) {
$("#error_text").text("");
$("#error_text").text("");
if (dato[0] === -1) {
$("#dialog_no_agents_selected").dialog({
if (dato[0] === -1) {
$("#dialog_no_agents_selected").dialog({
resizable: true,
draggable: true,
modal: true,
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,
background: "black"
opacity: 0.5,
background: "black"
}
});
} else {
$("#error_text").text("");
});
} else {
$("#error_text").text("");
dato.forEach(function (valor, indice, array) {
dato.forEach(function (valor, indice, array) {
$("#error_text").append("<br/>" + valor);
});
$("#dialog_error").dialog({
});
$("#dialog_error").dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
opacity: 0.5,
background: "black"
}
});
}
});
}
} else {
$("#dialog_success").dialog({
$("#dialog_success").dialog({
resizable: true,
draggable: true,
modal: true,
height: 250,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
opacity: 0.5,
background: "black"
}
});
});
}
}
/**