source: admin/WebConsole/jscripts/boot_grub4dos.js

qndtest
Last change on this file was 831de70, checked in by Irina Gómez <irinagomez@…>, 5 years ago

#802 #888 When the computer or repo propierties change, the console regenerate the PXE files for bios and uefi.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1// *************************************************************************************************************************************************
2// Libreria de scripts de Javascript
3// Autor: Alberto García Padilla (Universidad de Málaga)
4// Fecha Creación: 2012
5// Fecha Última modificación: Mayo-2012
6// Nombre del fichero: boot_grub4dos.js
7// Descripción :
8//              Este fichero implementa las funciones javascript del fichero boot_grub4dos.php
9// *************************************************************************************************************************************************
10//________________________________________________________________________________________________________
11// Se utiliza en los botones in y out de las columnas
12// Permite mover los equipos seleccionados desde una columna a otra
13function move(fbox, tbox) {
14        var arrFbox = new Array();
15        var arrTbox = new Array();
16        var arrLookup = new Array();
17        var i;
18        for (i = 0; i < tbox.options.length; i++) {
19                arrLookup[tbox.options[i].text] = tbox.options[i].value;
20                arrTbox[i] = tbox.options[i].text;
21        }
22        var fLength = 0;
23        var tLength = arrTbox.length;
24        for(i = 0; i < fbox.options.length; i++) {
25                arrLookup[fbox.options[i].text] = fbox.options[i].value;
26                if (fbox.options[i].selected && fbox.options[i].value != "") {
27                        arrTbox[tLength] = fbox.options[i].text;
28                        tLength++;
29                }
30                else {
31                        arrFbox[fLength] = fbox.options[i].text;
32                        fLength++;
33                  }
34                }
35        arrFbox.sort();
36        arrTbox.sort();
37                fbox.length = 0;
38                tbox.length = 0;
39        var c;
40
41for(c = 0; c < arrFbox.length; c++) {
42var no = new Option();
43no.value = arrLookup[arrFbox[c]];
44no.text = arrFbox[c];
45fbox[c] = no;
46}
47
48for(c = 0; c < arrTbox.length; c++) {
49var no = new Option();
50no.value = arrLookup[arrTbox[c]];
51no.text = arrTbox[c];
52tbox[c] = no;
53    }
54}
55// Se utiliza al enviar el formulario
56// Asigna como valor del campo listOfItems un listado
57// con las correspodendencias nombre plantilla - nombre equipo.
58// Version 1.1.1 - Se identifica plantilla y equipo como necesita la función createBootMode (#802 #888)
59function allSelect()
60{
61    var saveString = "";
62    // seleccionamos cada uno de los select
63    var input = document.getElementsByTagName('select');
64
65    for(var i=0; i<input.length; i++){
66        // quitamos L inicial
67        patron = "L";
68        parm = input[i].name;
69        parm = parm.replace(patron,'');
70
71        for (j=0;j<input[i].length;j++) {
72            saveString = saveString + parm + '|' + input[i].options[j].text + ';';
73        }
74    }
75    document.forms[0].listOfItems.value = saveString;
76}
Note: See TracBrowser for help on using the repository browser.