From deb1cebecab9f87f2f98bd3aa51f176289d6f4e4 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 11 May 2018 16:13:56 +0200 Subject: [PATCH] Show warning modal window when change snmp or satellite module name - #2251 --- .../godmode/agentes/configurar_agente.php | 74 +++++++++++++++++- .../images/icono-warning-triangulo.png | Bin 0 -> 2036 bytes 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 pandora_console/images/icono-warning-triangulo.png diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 5cf8e8a03d..186a5e33aa 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1264,7 +1264,6 @@ if ($update_module || $create_module) { if ($update_module) { $id_agent_module = (int) get_parameter ('id_agent_module'); - $values = array ( 'id_agente_modulo' => $id_agent_module, 'descripcion' => $description, @@ -1895,10 +1894,81 @@ switch ($tab) { var wizard_tab_showed = 0; $(document).ready (function () { + + $('body').append('
'); // Control the tab and subtab hover. When mouse leave one, // check if is hover the other before hide the subtab $('.agent_wizard_tab').hover(agent_wizard_tab_show, agent_wizard_tab_hide); - + + $('#module_form').submit(function() { + + var aget_id_os = ''; + + if('' != $('#text-name').val() && + '' == 19){ + + event.preventDefault(); + + $("#dialog").dialog({ + resizable: true, + draggable: true, + modal: true, + height: 220, + width: 600, + title: 'Changing the module name of a satellite agent', + open: function(){ + $('#dialog').html('

Warning
The names of the modules of a satellite should not be
altered manually. Unless you are absolutely certain of
the process, do not alter these names.

'); + }, + buttons: [{ + text: "Ok", + click: function() { + $('#module_form').submit(); + } + }, + { + text: "Cancel", + click: function() { + $( this ).dialog( "close" ); + return false; + } + }] + }); + + } + + var module_type_snmp = ''; + + if('' != $('#text-name').val() && ( + module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){ + + event.preventDefault(); + + $("#dialog").dialog({ + resizable: true, + draggable: true, + modal: true, + height: 260, + width: 600, + title: 'Changing snmp module name', + open: function(){ + $('#dialog').html('

Warning
If you change the name of this module, various features
associated with this module, such as network maps,
interface graphs or other network modules, may no longer
work. If you are not completely sure of the process, please
do not change the name of the module.

'); + }, + buttons: [{ + text: "Ok", + click: function() { + $('#module_form').submit(); + } + }, + { + text: "Cancel", + click: function() { + $( this ).dialog( "close" ); + return false; + } + }] + }); + } + }); }); // Set the position and width of the subtab diff --git a/pandora_console/images/icono-warning-triangulo.png b/pandora_console/images/icono-warning-triangulo.png new file mode 100644 index 0000000000000000000000000000000000000000..e81f83bdade2405e6c58584b93e5e68f71ded1a0 GIT binary patch literal 2036 zcmV7fKy*Wll%!)=My4p1uvid)B~|{Xs*ivMf+9zNP!UCukD#uG zTf(Au7bAHQ<1>B>0hxJ- zB%hooqcl(;rMBFU&#-?lC*hL1Pl`|Q)-nIyZ^Y*t;(M|90D8ZZkON6h!Z=#*#Pw8& z^#v%OFmmaWmxO^95Z$0)(LPI(Z%FF8lK}#OMa~9BVjA6)wpbWx=nEJq96pT?fB+g+ zh~~{zXsvOc9?fGW8hfN4xpsoKK^=x%%s_{#6mUp40%NIRNO*?GBI^RsLxzLeGo+Ti z)XYbW1L+ZJdx()ro>0Km+M}n3n5f{90zw{PWLF^Ayn>c=3Ii51#0=Y@4-gX3I86k` z(gM21474Rji#lUI(Cqbe^9=eBEe${bsRKM@d4`f^FM$pgIuIb$E|Lb5$nnVkZx_k+ z49S5VNMi!`Vbk6%h**uuiVg(j)W$$Za}C zYBm-J+C#|6Oo3sD0%GSih7zeOLeQj|s1r3*!h_Xb>35nzewc=97lonB`!>KNM%llarWU3a1Exkx%QKrC9FE|9l89*kjd_r~CW|KTh zDx-DVw=$qmtoCEJ@6TweqmYsNO`xCMeQugBlpE+*lP;mUi!xv@Qtz7So@3vLT?f}6 z-DF((-jGvDWt{x`?qlg23^Ecj6lMy0H9#A*38U@%qpSv~GC}(`&`=HOHqS5)$TXG? z4AlvSGIu^lA^Vu}=2^a6`koJa`UEgdf(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