source: admin/WebConsole/asistentes/jscripts/asistentes.js @ cd95622

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 cd95622 was 3b3043b, checked in by adv <adv@…>, 14 years ago

version 1.0.1 #270 #390 validado formulario alta/modificacion objeto imagen

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2008 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[eb3e2b8]1// ***********************************************************************************************************
2// Libreria de scripts de Javascript
3// Autor:
4// Fecha Creación: 2011
5// Fecha Última modificación: enero-2011
6// Nombre del fichero: asistentes.js
7// Descripción :
8//              Este fichero implementa las funciones javascript del fichero AsistentesEjecutarScripts.php (Comandos)
9// ***********************************************************************************************************
10
11function codeCloneRemotePartition(form){
[62ccd9b]12switch (form.idmetodo.value)
13{
14        case "MULTICAST":
15                protocol="MULTICAST " + form.mcastpuerto.value  + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " ";
16                break;
17        case "UNICAST":
18                protocol="UNICAST " +  form.ucastport.value + ":" + form.ucastclient.value + " ";
19                break;
20}
21//form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " 1 " + form.PartOrigen.value + "  " + form.mcastpuerto.value  + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " 1 " + form.PartOrigen.value + " " + form.tool.value + " " + form.compresor.value;
[eb9424f]22form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + "  " + protocol  + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value;
[62ccd9b]23
[eb3e2b8]24}
25
26function codeDeployImage(form){
27switch (form.idmetodo.value)
28{
29        case "MULTICAST":
30                protocol="MULTICAST " + form.mcastpuerto.value  + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " ";
31                break;
32        case "TORRENT":
33                protocol=" TORRENT " +  form.modp2p.value + ":" + form.timep2p.value;
34                break;
[3b3043b]35        case "UNICAST":
36                protocol=" UNICAST";
37                break;
[eb3e2b8]38}
39//form.codigo.value="deployImage REPO /";
[3b3043b]40if (form.modo[0].checked)
41{
42        form.codigo.value="deployImage REPO /" + form.idimagen.value + " 1 " + form.idparticion.value + " " + protocol  ;
43}
44else
45{
46        form.codigo.value="updateCache REPO /" + form.idimagen.value + ".img" + " " + protocol  ;
47}
48
[eb3e2b8]49}
50
51function codeParticionado(form){
52var value1;
53var value2;
54var value3;
55var precache;
56if (form.check1.checked) {
57        if (form.part1.value == "CUSTOM" ) {value1 = form.part1custom.value}
58        else {value1 = form.part1.value};
59        if (form.size1.value == "CUSTOM")  {value1 += ":" + form.size1custom.value}
60        else {value1 += ":" + form.size1.value};
61}
62else
63{
[f1de548]64   value1 = "EMPTY:0"
[eb3e2b8]65}
66if (form.check2.checked) {
67        if (form.part2.value == "CUSTOM" ) {value2 = form.part2custom.value}
68        else {value2 = form.part2.value};
69        if (form.size2.value == "CUSTOM")  {value2 += ":" + form.size2custom.value}
70        else {value2 += ":" + form.size2.value};
71}
72else
73{
[f1de548]74   value2 = "EMPTY:0"
[eb3e2b8]75}
76if (form.check3.checked) {
77        if (form.part3.value == "CUSTOM" ) {value3 = form.part3custom.value}
78        else {value3 = form.part3.value};
79        if (form.size3.value == "CUSTOM")  {value3 += ":" + form.size3custom.value}
80        else {value3 += ":" + form.size3.value};
81}
82else
83{
[f1de548]84   value3 = "EMPTY:0"
[eb3e2b8]85}
86
87if (form.size4.value == "0") {
88precache="ogUnmountCache \n ogUnmountAll 1 \n sizecache=`ogGetPartitionSize 1 4` \n ogDeletePartitionTable 1  \n ogUpdatePartitionTable 1 \n initCache $sizecache ";
89//alert(precache);
90}
91else
92{
[1ec9b7a]93        if (form.size4.value == "CUSTOM") 
94        {
95                cachesize = form.size4custom.value;
96        }
97        else
98        {
99                cachesize = form.size4.value;
100        }
101        precache="ogUnmountCache \n ogUnmountAll 1 \n ogDeletePartitionTable 1  \n ogUpdatePartitionTable 1 \n initCache "  + cachesize + " ";
102        //alert(precache);
[eb3e2b8]103}
104
105
106form.codigo.value="\
107" + precache + " \n \
108ogListPartitions 1 \n \
109ogCreatePartitions 1 " + value1 + " " + value2 + " " + value3 + " \n \
110ogSetPartitionActive 1 1 \n \
111ogUpdatePartitionTable 1 \n \
112ogListPartitions 1 \n";
113}
Note: See TracBrowser for help on using the repository browser.