diff options
author | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
commit | c3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch) | |
tree | 96fce1db6bf64fee2845d3a48abcbe07d9937562 /admin/WebConsole/asistentes | |
parent | 4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff) |
Congelar versión 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/asistentes')
4 files changed, 384 insertions, 139 deletions
diff --git a/admin/WebConsole/asistentes/AsistenteParticionado.php b/admin/WebConsole/asistentes/AsistenteParticionado.php index de1b5f72..3483ab9b 100644 --- a/admin/WebConsole/asistentes/AsistenteParticionado.php +++ b/admin/WebConsole/asistentes/AsistenteParticionado.php @@ -59,7 +59,18 @@ $xajax->printJavascript('../xajax/'); </head> -<body> +<body onload=" + var disks=document.getElementsByName('disksize'); + var min=null; + for (var i=0; i<disks.length; i++) { + var val=parseInt(disks[i].textContent); + if (min==null || val<min) { + min=val; + } + } + document.getElementById('minsize').value=min; + document.getElementById('freedisk').value=min; +"> <? switch($ambito){ case $AMBITO_CENTROS : @@ -111,10 +122,10 @@ switch($ambito){ ?> <tr> - <th colspan="5"><INPUT TYPE="button" NAME="GenerarInstruccion" Value="Generar InstruccionOG" onClick="codeParticionado(this.form)"> </th> - <td><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td> + <th><input type="button" name="GenerarInstruccion" Value="<?php echo $TbMsg[41];?>" onclick="codeParticionado(this.form)" /> </th> + <td colspan="2"><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td> </tr> - </table> + </table> </form> <? @@ -133,4 +144,4 @@ switch($ambito){ </body> -</html>
\ No newline at end of file +</html> diff --git a/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php b/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php index 360c8948..ff06b3b7 100644 --- a/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php +++ b/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php @@ -298,17 +298,18 @@ function htmlForm_typepart($cmd,$numpar) - - - - -function htmlForm_typepartnotcacheEngine10() +function htmlForm_typepartnotcacheEngine10($npart) { $SelectHtml=""; +if ($npart == 4) { + $SelectHtml.='<OPTION value="CACHE"> CACHE </OPTION>'; +} $SelectHtml.='<OPTION value="FAT12"> FAT12 </OPTION>'; $SelectHtml.='<OPTION value="FAT16"> FAT16 </OPTION>'; $SelectHtml.='<OPTION value="FAT32"> FAT32 </OPTION>'; +$SelectHtml.='<OPTION value="HFAT32"> Hidden FAT32 </OPTION>'; $SelectHtml.='<OPTION value="NTFS"> NTFS </OPTION>'; +$SelectHtml.='<OPTION value="HNTFS"> Hidden NTFS </OPTION>'; #$SelectHtml.='<OPTION value="EXT2"> EXT2 </OPTION>'; #$SelectHtml.='<OPTION value="EXT3"> EXT3 </OPTION>'; $SelectHtml.='<OPTION value="EXT4"> LINUX:EXT[2:3:4] </OPTION>'; @@ -319,6 +320,9 @@ $SelectHtml.='<OPTION value="XFS"> XFS </OPTION>'; $SelectHtml.='<OPTION value="JFS"> JFS </OPTION>'; $SelectHtml.='<OPTION value="LINUX-RAID"> LINUX-RAID </OPTION>'; $SelectHtml.='<OPTION value="LINUX-LVM"> LINUX-LVM </OPTION>'; +if ($npart <= 4) { + $SelectHtml.='<OPTION value="EXTENDED"> EXTENDED </OPTION>'; +} return($SelectHtml); } @@ -362,9 +366,13 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) $auxCfg=split("@",$configuraciones); // Crea lista de particiones for($i=0;$i<sizeof($auxCfg);$i++){ - $auxKey=split(";",$auxCfg[$i]); // Toma clave de configuracion - for($k=0;$k<$conKeys;$k++){ // Busca los literales para las claves de esa partición - if($tbKeys[$k]["cfg"]==$auxCfg[$i]){ // Claves encontradas + $auxKey=split(";",$auxCfg[$i]); // Toma clave de configuracion + for($k=0;$k<$conKeys;$k++){ // Busca los literales para las claves de esa partición + if($tbKeys[$k]["cfg"]==$auxCfg[$i]){ // Claves encontradas + if ($tbKeys[$k]["numpar"] == 0) { // Info del disco (umpart=0) + $disksize = tomaTamano($tbKeys[$k]["numpar"],$idordenadores); + } + else { // Información de partición (numpart>0) echo'<TR height=16>'.chr(13); echo'<TD align=center> '.$tbKeys[$k]["numpar"].' </TD>'.chr(13); echo'<TD align=center> '.$tbKeys[$k]["tipopar"].' </TD>'.chr(13); @@ -376,7 +384,7 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) echo '<TD align=center> '.tomaNombresSO($tbKeys[$k]["numpar"],$idordenadores).' </TD>'.chr(13); //echo'<TD align=rigth> '.formatomiles($tbKeys[$k]["tamano"]).' </TD>'.chr(13); - echo'<TD align=center> '.tomaTamano($tbKeys[$k]["numpar"],$idordenadores).' </TD>'.chr(13); + echo'<TD align=right> '.tomaTamano($tbKeys[$k]["numpar"],$idordenadores).' </TD>'.chr(13); //echo'<TD> '.$tbKeys[$k]["imagen"].' </TD>'.chr(13); echo'<TD align=center> '.tomaImagenes($tbKeys[$k]["numpar"],$idordenadores).' </TD>'.chr(13); @@ -388,8 +396,21 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) break; } } + } } + // Mostrar información del disco, si se ha obtenido. + if (!empty ($disksize)) { + echo'<tr height="16">'.chr(13); + echo'<td align="center"> '.$TbMsg[35].' </td>'.chr(13); + echo'<td></td>'.chr(13); + echo'<td></td>'.chr(13); + echo'<td></td>'.chr(13); + echo'<td name="disksize" id="disksize" align="right"> '.$disksize.' </td>'.chr(13); + echo'<td></td>'.chr(13); + echo'<td></td>'.chr(13); + echo'</tr>'.chr(13); + } echo '<TR height=5><TD colspan='.$colums.' style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #FFFFFF;"> </TD></TR>'; } -?>
\ No newline at end of file +?> diff --git a/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php b/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php index 48476243..46207e15 100644 --- a/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php +++ b/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php @@ -1,77 +1,126 @@ +<tr> +<td> +<table id="primarias"> +<caption><?php echo $TbMsg[36]?></caption> +<tr> +<td><?php echo $TbMsg[20]?></td> +<td><?php echo $TbMsg[24]?></td> +<td><?php echo $TbMsg[22]?></td> +</tr> -<TR> -<TD > Partición </TD> -<TD > Tipo </TD> -<TD > Tamaño KB </TD> -</TR> - -<TR> -<TD > <input type="checkbox" name="check1" value="check1" onclick="if (this.form.check1.checked) { this.form.part1.disabled=false; this.form.size1.disabled=false; if (this.form.part1.options[this.form.part1.selectedIndex].value == 'CUSTOM') { this.form.part1custom.disabled=false } if (this.form.size1.options[this.form.size1.selectedIndex].value == 'CUSTOM') { this.form.size1custom.disabled=false } } else { this.form.part1.disabled=true; this.form.size1.disabled=true; this.form.part1custom.disabled=true; this.form.size1custom.disabled=true }" /> <br> Partición 1 </TD> -<TD> -<select name="part1" id="part1" style="WIDTH:220" disabled="true" onclick="if (this.form.part1.options[this.form.part1.selectedIndex].value == 'CUSTOM') { this.form.part1custom.disabled=false } else { this.form.part1custom.disabled=true }" > - <?php echo ''. htmlForm_typepart($cmd,1) .''; ?> - <option value="CUSTOM"> Personalizar </option> +<?php +for ($p=1; $p<4; $p++) { + echo ' +<tr> +<td> +<input type="checkbox" name="check'.$p.'" value="check'.$p.'" onclick="clickPartitionCheckbox(this.form, '.$p.');" /> '.$TbMsg[20].' '.$p.'</td> +<td> +<select name="part'.$p.'" id="part'.$p.'" style="width:220" disabled="true" onclick=" + //if (this.form.part'.$p.'.options[this.form.part'.$p.'.selectedIndex].value == \'CUSTOM\') { + if (this.options[this.selectedIndex].value == \'CUSTOM\') { + this.form.part'.$p.'custom.disabled=false; + } else { + this.form.part'.$p.'custom.disabled=true; + } +" onchange="checkExtendedPartition(form);">' + .htmlForm_typepart($cmd,$p).' + <option value="CUSTOM"> '.$TbMsg[39].' </option> </select> <br> -<select name="part1custom" id="part1custom" style="WIDTH:220" disabled="true" > - <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?> -</select></TD> - -<TD><select name="size1" id="size1" style="WIDTH:220" disabled="true" onclick="if (this.form.size1.options[this.form.size1.selectedIndex].value == 'CUSTOM') { this.form.size1custom.disabled=false } else { this.form.size1custom.disabled=true }" > - <?php echo ''. htmlForm_sizepart($cmd,1) .''; ?> - <option value="CUSTOM"> Personalizar </option> +<select name="part'.$p.'custom" id="part'.$p.'custom" style="width:220" disabled="true" onchange="checkExtendedPartition(form);">'. htmlForm_typepartnotcacheEngine10($p) .'</select> +</td> +<td> +<select name="size'.$p.'" id="size'.$p.'" style="width:220" disabled="true" onclick=" + if (this.form.size'.$p.'.options[this.form.size'.$p.'.selectedIndex].value == \'CUSTOM\') { + this.form.size'.$p.'custom.disabled=false; + } else { + this.form.size'.$p.'custom.disabled=true; + } +" onchange="calculateFreeDisk(this.form);">' + .htmlForm_sizepart($cmd,$p).' + <option value="CUSTOM"> '.$TbMsg[39].'</option> </select> -<br > -<INPUT type="text" style="width:100" name="size1custom" value="0" disabled="true"></TD> -</TR> +<br /> +<input type="text" style="width:100" name="size'.$p.'custom" value="0" disabled="true" onchange="calculateFreeDisk(this.form);" /> +</td> +</tr> + '; +} +?> -<TR> -<TD > <input type="checkbox" name="check2" value="check2" onclick="if (this.form.check2.checked) { this.form.part2.disabled=false; this.form.size2.disabled=false; if (this.form.part2.options[this.form.part2.selectedIndex].value == 'CUSTOM') { this.form.part2custom.disabled=false } if (this.form.size2.options[this.form.size2.selectedIndex].value == 'CUSTOM') { this.form.size2custom.disabled=false } } else { this.form.part2.disabled=true; this.form.size2.disabled=true; this.form.part2custom.disabled=true; this.form.size2custom.disabled=true }" /> <br> Partición 2 </TD> -<TD><select name="part2" id="part2" style="WIDTH:220" disabled="true" onclick="if (this.form.part2.options[this.form.part2.selectedIndex].value == 'CUSTOM') { this.form.part2custom.disabled=false } else { this.form.part2custom.disabled=true }" > - <?php echo ''. htmlForm_typepart($cmd,2) .''; ?> - <option value="CUSTOM"> Personalizar </option> +<tr> +<td><input type="checkbox" name="check4" value="check4" onclick="clickPartitionCheckbox(this.form, 4);" /> <?php echo $TbMsg[20].' '.$p;?> </td> +<td><input type="label" readonly size="8" name="part4" disabled="true" value="CACHE" /></td> +<td><select name="size4" id="size4" style="width:220" disabled="true" onclick="if (this.form.size4.options[this.form.size4.selectedIndex].value == 'CUSTOM') { this.form.size4custom.disabled=false } else { this.form.size4custom.disabled=true }" onchange="calculateFreeDisk(this.form);" /> + <option value="0"> <?php echo $TbMsg[40];?> </option> + <?php echo ''. htmlForm_sizepart($cmd,4) .''; ?> + <option value="CUSTOM"> <?php echo $TbMsg[39];?> </option> </select> -<br> -<select name="part2custom" id="part2custom" style="WIDTH:220" disabled="true" > - <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?> -</select></TD> +<br /> +<input type="text" style="width:100" name="size4custom" value="0" disabled="true" onchange="calculateFreeDisk(this.form);" /></td> +</tr> -<TD><select name="size2" id="size2" style="WIDTH:220" disabled="true" onclick="if (this.form.size2.options[this.form.size2.selectedIndex].value == 'CUSTOM') { this.form.size2custom.disabled=false } else { this.form.size2custom.disabled=true }" > - <?php echo ''. htmlForm_sizepart($cmd,2) .''; ?> - <option value="CUSTOM"> Personalizar </option> -</select> -<br > -<INPUT type="text" style="width:100" name="size2custom" value="0" disabled="true"></TD> -</TR> +</table> +</td> + +<td> +<table id="logicas" style="visibility:hidden"> +<caption><?php echo $TbMsg[37]?></caption> +<tr> +<td><?php echo $TbMsg[20]?></td> +<td><?php echo $TbMsg[24]?></td> +<td><?php echo $TbMsg[22]?></td> +</tr> -<TR> -<TD > <input type="checkbox" name="check3" value="check3" onclick="if (this.form.check3.checked) { this.form.part3.disabled=false; this.form.size3.disabled=false; if (this.form.part3.options[this.form.part3.selectedIndex].value == 'CUSTOM') { this.form.part3custom.disabled=false } if (this.form.size3.options[this.form.size3.selectedIndex].value == 'CUSTOM') { this.form.size3custom.disabled=false } } else { this.form.part3.disabled=true; this.form.size3.disabled=true; this.form.part3custom.disabled=true; this.form.size3custom.disabled=true }" /> <br> Partición 3 </TD> -<TD><select name="part3" id="part3" style="WIDTH:220" disabled="true" onclick="if (this.form.part3.options[this.form.part3.selectedIndex].value == 'CUSTOM') { this.form.part3custom.disabled=false } else { this.form.part3custom.disabled=true }" > - <?php echo ''. htmlForm_typepart($cmd,3) .''; ?> - <option value="CUSTOM"> Personalizar </option> +<?php +for ($p=5; $p<=9; $p++) { + echo ' +<tr> +<td> +<input type="checkbox" name="check'.$p.'" value="check'.$p.'" onclick="clickPartitionCheckbox(this.form, '.$p.');" /> '.$TbMsg[20].' '.$p.'</td> +<td> +<select name="part'.$p.'" id="part'.$p.'" style="width:220" disabled="true" onclick=" + if (this.form.part'.$p.'.options[this.form.part'.$p.'.selectedIndex].value == \'CUSTOM\') { + this.form.part'.$p.'custom.disabled=false; + } else { + this.form.part'.$p.'custom.disabled=true; + } +">'. htmlForm_typepart($cmd,$p). ' + <option value="CUSTOM"> '.$TbMsg[39].' </option> </select> <br> -<select name="part3custom" id="part3custom" style="WIDTH:220" disabled="true" > - <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?> -</select></TD> - -<TD><select name="size3" id="size3" style="WIDTH:220" disabled="true" onclick="if (this.form.size3.options[this.form.size3.selectedIndex].value == 'CUSTOM') { this.form.size3custom.disabled=false } else { this.form.size3custom.disabled=true }" > - <?php echo ''. htmlForm_sizepart($cmd,3) .''; ?> - <option value="CUSTOM"> Personalizar </option> +<select name="part'.$p.'custom" id="part'.$p.'custom" style="width:220" disabled="true" >'. htmlForm_typepartnotcacheEngine10($p) .'</select> +</td> +<td> +<select name="size'.$p.'" id="size'.$p.'" style="width:220" disabled="true" onclick=" + if (this.form.size'.$p.'.options[this.form.size'.$p.'.selectedIndex].value == \'CUSTOM\') { + this.form.size'.$p.'custom.disabled=false; + } else { + this.form.size'.$p.'custom.disabled=true; + } +" onchange="calculateFreeDisk(this.form);" +">'.htmlForm_sizepart($cmd,$p).' + <option value="CUSTOM"> '.$TbMsg[39].'</option> </select> -<br > -<INPUT type="text" style="width:100" name="size3custom" value="0" disabled="true"></TD> -</TR> +<br /> +<input type="text" style="width:100" name="size'.$p.'custom" value="0" disabled="true" /> +</td> +</tr> + '; +} +?> + +</table> +</td> + +</tr> + +<tr> +<th> +<input type="hidden" id="minsize" /> +<?php echo $TbMsg[38];?>: <input type="text" id="freedisk" width="15" disabled="true" /> +</th> +</tr> + -<TR> -<TD > <input type="checkbox" name="check4" value="check4" onclick="if (this.form.check4.checked) { this.form.part4.disabled=false; this.form.size4.disabled=false; if (this.form.size4.options[this.form.size4.selectedIndex].value == 'CUSTOM') { this.form.size4custom.disabled=false } } else { this.form.part4.disabled=true; this.form.size4.disabled=true; this.form.size4.options[0].selected=true; }" /> <br> Partición 4 </TD> -<TD> <INPUT type="label" readonly size="8" name="part4" disabled="true" value="CACHE"></TD> -<TD><select name="size4" id="size4" style="WIDTH:220" disabled="true" onclick="if (this.form.size4.options[this.form.size4.selectedIndex].value == 'CUSTOM') { this.form.size4custom.disabled=false } else { this.form.size4custom.disabled=true }" > - <option value="0"> Sin modificar tamaño </option> - <?php echo ''. htmlForm_sizepart($cmd,4) .''; ?> - <option value="CUSTOM"> Personalizar </option> -</select> -<br > -<INPUT type="text" style="width:100" name="size4custom" value="0" disabled="true"></TD> -</TR> diff --git a/admin/WebConsole/asistentes/jscripts/asistentes.js b/admin/WebConsole/asistentes/jscripts/asistentes.js index 0ecbe87a..f1a296ec 100644 --- a/admin/WebConsole/asistentes/jscripts/asistentes.js +++ b/admin/WebConsole/asistentes/jscripts/asistentes.js @@ -19,8 +19,12 @@ switch (form.idmetodo.value) break; } //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; -form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value; - +command="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value; +form.codigo.value="\ +echo \"[0] iniciando " + command + " \" | tee -a $OGLOGFILE $OGLOGSESSION \n " + +command + " | tee -a $OGLOGCOMMAND \n "; +//cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value + " | tee -a $OGLOGCOMMAND \n"; +//form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value; } function codeDeployImage(form){ @@ -39,75 +43,235 @@ switch (form.idmetodo.value) //form.codigo.value="deployImage REPO /"; if (form.modo[0].checked) { - form.codigo.value="deployImage REPO /" + form.idimagen.value + " 1 " + form.idparticion.value + " " + protocol ; + command="deployImage REPO /" + form.idimagen.value + " 1 " + form.idparticion.value + " " + protocol ; + form.codigo.value="\ +echo [0] iniciando " + command +" | tee -a $OGLOGSESSION \n \ " + +command + " | tee -a $OGLOGCOMMAND"; + //form.codigo.value="deployImage REPO /" + form.idimagen.value + " 1 " + form.idparticion.value + " " + protocol ; } else { - form.codigo.value="updateCache REPO /" + form.idimagen.value + ".img" + " " + protocol ; + command="updateCache REPO /" + form.idimagen.value + ".img" + " " + protocol ; + form.codigo.value="\ +echo [0] iniciando " + command +" | tee -a $OGLOGSESSION \n \ " + +command + " | tee -a $OGLOGCOMMAND"; + //form.codigo.value="updateCache REPO /" + form.idimagen.value + ".img" + " " + protocol ; } } -function codeParticionado(form){ -var value1; -var value2; -var value3; -var precache; -if (form.check1.checked) { - if (form.part1.value == "CUSTOM" ) {value1 = form.part1custom.value} - else {value1 = form.part1.value}; - if (form.size1.value == "CUSTOM") {value1 += ":" + form.size1custom.value} - else {value1 += ":" + form.size1.value}; -} -else -{ - value1 = "EMPTY:0" -} -if (form.check2.checked) { - if (form.part2.value == "CUSTOM" ) {value2 = form.part2custom.value} - else {value2 = form.part2.value}; - if (form.size2.value == "CUSTOM") {value2 += ":" + form.size2custom.value} - else {value2 += ":" + form.size2.value}; -} -else -{ - value2 = "EMPTY:0" -} -if (form.check3.checked) { - if (form.part3.value == "CUSTOM" ) {value3 = form.part3custom.value} - else {value3 = form.part3.value}; - if (form.size3.value == "CUSTOM") {value3 += ":" + form.size3custom.value} - else {value3 += ":" + form.size3.value}; -} -else -{ - value3 = "EMPTY:0" -} +function codeParticionado (form) { + var partCode=""; + var logicalCode=""; + var cacheCode; + var cacheSize; + var extended=false; -if (form.size4.value == "0") { -precache="ogUnmountCache \n ogUnmountAll 1 \n sizecache=`ogGetPartitionSize 1 4` \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache $sizecache "; -//alert(precache); -} -else -{ - if (form.size4.value == "CUSTOM") - { - cachesize = form.size4custom.value; + for (var nPart=1; nPart<4; nPart++) { + var partCheck=eval("form.check"+nPart); + if (partCheck.checked) { + var partType=eval("form.part"+nPart); + if (partType.value == "CUSTOM" ) { + var partTypeCustom=eval("form.part"+nPart+"custom"); + partCode += " " + partTypeCustom.value; + if (partTypeCustom.value == "EXTENDED") { + extended=true; + } + } else { + partCode += " " + partType.value; + if (partType.value == "EXTENDED") { + extended=true; + } + } + var partSize=eval("form.size"+nPart); + if (partSize.value == "CUSTOM" ) { + var partSizeCustom=eval("form.size"+nPart+"custom"); + partCode += ":" + partSizeCustom.value; + } else { + partCode += ":" + partSize.value; + } + } else { + partCode += " EMPTY:0"; + } + } + if (form.check4.checked) { + if (form.size4.value == "0") { + //cacheCode = " ogUnmountCache \n ogUnmountAll 1 \n sizecache=`ogGetPartitionSize 1 4` \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache $sizecache "; + cacheCode="\ + echo \"[20] detectando tamaño de la cache\" | tee -a $OGLOGSESSION \n \ + sizecache=`ogGetPartitionSize 1 4` \n \ + echo \"[30] borrando y actualizando tabla particiones disco 1\" | tee -a $OGLOGSESSION \n \ + ogDeletePartitionTable 1 \n \ + ogUpdatePartitionTable 1 | tee -a $OGLOGCOMMAND \n \ + echo \"[50] Activando cache\" | tee -a $OGLOGSESSION \n \ + initCache $sizecache &>/dev/null | tee -a $OGLOGCOMMAND \n "; + } else { + if (form.size4.value == "CUSTOM") { + cacheSize = form.size4custom.value; + } else { + cacheSize = form.size4.value; + } + //cacheCode = " ogUnmountCache \n ogUnmountAll 1 \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache " + cacheSize; + cacheCode="\ + echo \"[30] borrando y actualizando tabla particiones disco 1\" | tee -a $OGLOGSESSION \n \ + ogDeletePartitionTable 1 \n \ + ogUpdatePartitionTable 1 \n \ + echo \"[50] Activando cache\" | tee -a $OGLOGSESSION \n \ + initCache " + cacheSize + " &>/dev/null | tee -a $OGLOGCOMMAND"; + } + } else { + //cacheCode = " ogUnmountCache \n ogUnmountAll 1 \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 "; + cacheCode="\ + echo \"[30] borrando y actualizando tabla particiones disco 1\" | tee -a $OGLOGSESSION \n \ + ogDeletePartitionTable 1 \n \ + ogUpdatePartitionTable 1 \n"; + partCode += " EMPTY:0"; + } + if (extended) { + var lastLogical=5; + for (var nPart=9; nPart>5; nPart--) { + if (eval ("form.check"+nPart+".checked")) { + lastLogical = nPart; + break; + } + } + for (var nPart=5; nPart<=lastLogical; nPart++) { + var partCheck=eval("form.check"+nPart); + if (partCheck.checked) { + var partType=eval("form.part"+nPart); + if (partType.value == "CUSTOM" ) { + var partTypeCustom=eval("form.part"+nPart+"custom"); + logicalCode += " " + partTypeCustom.value; + } else { + logicalCode += " " + partType.value; + } + var partSize=eval("form.size"+nPart); + if (partSize.value == "CUSTOM" ) { + var partSizeCustom=eval("form.size"+nPart+"custom"); + logicalCode += ":" + partSizeCustom.value; + } else { + logicalCode += ":" + partSize.value; + } + } else { + logicalCode += " EMPTY:0"; + } + } + partCode += logicalCode; } - else - { - cachesize = form.size4.value; - } - precache="ogUnmountCache \n ogUnmountAll 1 \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache " + cachesize + " "; - //alert(precache); -} - +// form.codigo.value="\ +//" + cacheCode + " \n \ +//ogListPartitions 1 \n \ +//ogCreatePartitions 1 " + partCode + " \n \ +//ogSetPartitionActive 1 1 \n \ +//ogUpdatePartitionTable 1 \n \ +//ogListPartitions 1 \n"; form.codigo.value="\ -" + precache + " \n \ -ogListPartitions 1 \n \ -ogCreatePartitions 1 " + value1 + " " + value2 + " " + value3 + " \n \ +echo \"[0] iniciando particionado\" | tee -a $OGLOGSESSION $OGLOGFILE \n \ +echo \"[10] desmontando cache y particiones del disco 1\" | tee -a $OGLOGSESSION \n \ +ogUnmountCache \n \ +ogUnmountAll 1 \n \ +" + cacheCode + " \n \ +echo \"[60] Listando tabla particiones 1\" | tee -a $OGLOGSESSION \n \ +ogListPartitions 1 | tee -a $OGLOGCOMMAND $OGLOGSESSION \n \ +echo \"[70] Creando tabla particiones " + partCode + " \" | tee -a $OGLOGSESSION \n \ +ogCreatePartitions 1 " + partCode + " | tee -a $OGLOGCOMMAND \n \ +echo \"[80] Activando primera particion del disco 1\" | tee -a $OGLOGSESSION \n \ ogSetPartitionActive 1 1 \n \ +echo \"[100] Listando la nueva tabla particiones 1\" | tee -a $OGLOGSESSION $OGLOGFILE \n \ ogUpdatePartitionTable 1 \n \ -ogListPartitions 1 \n"; +ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \ +ogListPartitions 1 | tee -a $OGLOGCOMMAND $OGLOGSESSION $OGLOGFILE \n"; + +} + + +// Código de pulsación de selección de partición. +function clickPartitionCheckbox(form, npart) { + var partCheck=eval("form.check"+npart); + var partType=eval("form.part"+npart); + var partSize=eval("form.size"+npart); + var partTypeCustom=eval("form.part"+npart+"custom"); + var partSizeCustom=eval("form.size"+npart+"custom"); + var freeDisk=document.getElementById("freedisk"); + var logical=document.getElementById("logicas"); + if (partCheck.checked) { + partType.disabled=false; + partSize.disabled=false; + if (partType.options[partType.selectedIndex].value == "CUSTOM") { + partTypeCustom.disabled=false; + } + if (partSize.options[partSize.selectedIndex].value == "CUSTOM") { + partSizeCustom.disabled=false; + } else { + partSizeCustom.disabled=true; + } + } else { + partType.disabled=true; + partSize.disabled=true; + partTypeCustom.disabled=true; + partSizeCustom.disabled=true; + } + if (npart <= 4) { + checkExtendedPartition(form); + calculateFreeDisk(form); + } } + + +// Código para calcular el espacio libre del disco. +function calculateFreeDisk(form) { + var freeDisk=document.getElementById("freedisk"); + freeDisk.value=form.minsize.value; + for (npart=1; npart<=4; npart++) { + var partCheck=eval("form.check"+npart); + var partSize=eval("form.size"+npart); + var partSizeCustom=eval("form.size"+npart+"custom"); + if (partCheck.checked) { + if (partSize.options[partSize.selectedIndex].value == "CUSTOM") { + freeDisk.value -= parseInt(partSizeCustom.value); + } else { + freeDisk.value -= parseInt(partSize.options[partSize.selectedIndex].value); + } + } + } + if (parseInt(freeDisk.value) < 0) { + freeDisk.style.fontWeight = "bold"; + freeDisk.style.fontStyle = "italic"; + } else { + freeDisk.style.fontWeight = "normal"; + freeDisk.style.fontStyle = "normal"; + } + if (form.size4.value == 0) { + freeDisk.value += " (- cache)"; // Aviso de caché sin modificar. + } +} + +// Código para comprobar si hay partición extendida activa para mostrar las lógicas. +function checkExtendedPartition(form) { + var logical=document.getElementById("logicas"); + var visible=false; + for (npart=1; npart<4; npart++) { + var partCheck=eval("form.check"+npart); + var partType=eval("form.part"+npart); + var partTypeCustom=eval("form.part"+npart+"custom"); + if (partCheck.checked) { + partType.style.fontWeight = "normal"; + partTypeCustom.style.fontWeight = "normal"; + if (partType.value == "EXTENDED") { + visible=true; + partType.style.fontWeight = "bold"; + } + if (partType.value == "CUSTOM" && partTypeCustom.value == "EXTENDED") { + visible=true; + partTypeCustom.style.fontWeight = "bold"; + } + } + } + if (visible) { + logical.style.visibility="visible"; + } else { + logical.style.visibility="hidden"; + } +} + |