source: admin/WebConsole/jscripts/consolaremota.js @ a1d39fe

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since a1d39fe was a1d39fe, checked in by Ramón M. Gómez <ramongomez@…>, 6 years ago

#834: Revert some JavaScript? strict comparisons

Undoes some strict comparisons added in the commit a7406f2 because it
is necessary to compare different data types

  • Property mode set to 100644
File size: 1.9 KB
Line 
1var sw=0;
2var ambito;
3//______________________________________________________________________________________________________
4function confirmar()
5{
6        ambito=document.fdatos.ambito.value;
7        if(ambito==AMBITO_ORDENADORES){
8                var diveco=document.getElementById("diveco"); // Contenedor de salida de código
9                diveco.innerHTML="&nbsp"; //
10        }
11        var Obtcmd=document.getElementById("comando");
12        var cmd=Obtcmd.value;
13        conmuta("visible");
14        sw=1;
15        enviaMsg(cmd);
16}
17//______________________________________________________________________________________________________
18function enviaMsg(cmd)
19{
20        var idambito=document.fdatos.idambito.value;
21        var litambito=document.fdatos.litambito.value;
22        ambito=document.fdatos.ambito.value;
23
24        switch(sw){
25                case 1:
26                        var urlRetorno="resultadocmd";
27                        var wurl="ecoconsola.php";
28                        var prm="idambito="+idambito+"&ambito="+ambito+"&comando="+cmd+"&sw="+sw;
29                        break;
30                case 2:
31                        var urlRetorno="resultadoeco";
32                        var wurl="ecoconsola.php";
33                        var prm="idambito="+idambito+"&ambito="+ambito+"&sw="+sw;
34                        break;
35        }
36        CallPage(wurl,prm,urlRetorno,"POST");
37}
38//______________________________________________________________________________________________________
39function resultadocmd(resul){
40        if(resul==1){ // Si todo va bien se llama a la función que recupera elfichero de eco
41                //alert(TbMsg[1])
42                if(ambito===AMBITO_ORDENADORES){
43                        sw=2;
44                        enviaMsg(null);
45                }
46        }
47        else
48                alert(TbMsg[0])
49}
50//______________________________________________________________________________________________________
51function resultadoeco(resul){
52        if(resul.length>0){
53                var diveco=document.getElementById("diveco");
54                diveco.innerHTML="<PRE>"+resul+"</PRE>";
55                conmuta("hidden");
56        }
57        setTimeout("enviaMsg()",5000);         
58}
59//______________________________________________________________________________________________________
60function conmuta(estado){
61        var layavi=document.getElementById("layer_aviso");
62        if(layavi)
63                layavi.style.visibility=estado;
64}
Note: See TracBrowser for help on using the repository browser.