Versión 1.0.2: asistente particionado muestra el tamaño libre del menor disco (modifica #341)

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2277 a21b9725-9963-47de-94b9-378ad31fedc9
remotes/github/debian-pkg
ramon 2011-08-08 10:53:01 +00:00
parent 344d6e7aca
commit a71cfe2994
7 changed files with 203 additions and 104 deletions

View File

@ -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>
</html>

View File

@ -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);
}
@ -397,11 +401,11 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc)
// Mostrar información del disco, si se ha obtenido.
if (!empty ($disksize)) {
echo'<tr height="16">'.chr(13);
echo'<td align="center"&nbsp;>'.$TbMsg[35].'&nbsp;</td>'.chr(13);
echo'<td align="center">&nbsp;'.$TbMsg[35].'&nbsp;</td>'.chr(13);
echo'<td></td>'.chr(13);
echo'<td></td>'.chr(13);
echo'<td></td>'.chr(13);
echo'<td align="right">&nbsp;'.$disksize.'&nbsp;</td>'.chr(13);
echo'<td name="disksize" id="disksize" align="right">&nbsp;'.$disksize.'&nbsp;</td>'.chr(13);
echo'<td></td>'.chr(13);
echo'<td></td>'.chr(13);
echo'</tr>'.chr(13);

View File

@ -1,77 +1,78 @@
<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&oacute;n </TD>
<TD > Tipo </TD>
<TD > Tama&ntilde;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&oacute;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\') {
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="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" >'. 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&oacute;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>
<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&oacute;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>
</select>
<br>
<select name="part3custom" id="part3custom" style="WIDTH:220" disabled="true" >
<?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?>
</select></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>
<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>
<br >
<INPUT type="text" style="width:100" name="size3custom" value="0" disabled="true"></TD>
</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&oacute;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&ntilde;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>

View File

@ -111,3 +111,68 @@ ogSetPartitionActive 1 1 \n \
ogUpdatePartitionTable 1 \n \
ogListPartitions 1 \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");
if (partCheck.checked) {
partType.disabled=false;
partSize.disabled=false;
if (partType.options[partType.selectedIndex].value == "CUSTOM") {
partTypeCustom.disabled=false;
}
//if (partType.options[partType.selectedIndex].value == "EXTENDED") {
// document.getElementById("logicas").style.visibility="visible";
//}
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 (partType.options[partType.selectedIndex].value == "EXTENDED") {
// document.getElementById("logicas").style.visibility="hidden";
//}
}
calculateFreeDisk(form);
}
// Código para calcular el espacio libre del disco.
function calculateFreeDisk(form, npart) {
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.
}
}

View File

@ -46,4 +46,10 @@ $TbMsg[32]='Tamaño de partición';
$TbMsg[33]='Nombre de la Imagen ';
$TbMsg[34]='Perfil software';
$TbMsg[35]='Disco';
$TbMsg[36]='Particiones Primarias';
$TbMsg[37]='Particiones L&oacute;gicas';
$TbMsg[38]='Menor espacio libre (KB)';
$TbMsg[39]='Personalizar';
$TbMsg[40]='Sin modificar tama&ntilde;o';
$TbMsg[41]='Generar Instrucci&oacute;n OG';
?>

View File

@ -29,21 +29,27 @@ $TbMsg[17]="Perfil Hardware";
$TbMsg[18]="DESAGRUPAR SEGÚN VALORES DISTINTOS DE:";
$TbMsg[19]="Datos a suministrar";
$TbMsg[20]='Partición';
$TbMsg[21]='S.O. Instalado';
$TbMsg[22]='Tamaño';
$TbMsg[23]='Datos de configuración';
$TbMsg[24]='Tipo';
$TbMsg[25]='Imagen';
$TbMsg[26]='Perfil Software';
$TbMsg[27]='S.F.';
$TbMsg[28]='Ninguno';
$TbMsg[29]='Desconocido';
$TbMsg[20]='Partition';
$TbMsg[21]='Installed OS';
$TbMsg[22]='Size (KB)';
$TbMsg[23]='Configuration Data';
$TbMsg[24]='Type';
$TbMsg[25]='Image';
$TbMsg[26]='Software Profile';
$TbMsg[27]='Filesys';
$TbMsg[28]='None';
$TbMsg[29]='Unknown';
$TbMsg[30]='Sistema de Ficheros';
$TbMsg[31]='Nombre del S.O.';
$TbMsg[32]='Tamaño de partición';
$TbMsg[33]='Nombre de la Imagen ';
$TbMsg[34]='Perfil software';
$TbMsg[30]='Filesystem';
$TbMsg[31]='OS name';
$TbMsg[32]='Partition Size';
$TbMsg[33]='Image Name';
$TbMsg[34]='Software Profile';
$TbMsg[35]='Disk';
$TbMsg[36]='Primary Partitions';
$TbMsg[37]='Logical Partitions';
$TbMsg[38]='Menor espacio libre (KB)';
$TbMsg[39]='Customize';
$TbMsg[40]='Sin modificar tama&ntilde;o';
$TbMsg[41]='Generate Instruction';
?>

View File

@ -6,33 +6,33 @@
//________________________________________________________________________________________________________
$TbMsg=array();
$TbMsg[0]='Configuraciones';
$TbMsg[1]='Ámbito';
$TbMsg[1]='&Aacute;mbito';
$TbMsg[2]="Aulas";
$TbMsg[3]="Grupo de Ordenadores";
$TbMsg[4]="Ordenadores";
$TbMsg[5]="Nombre";
$TbMsg[6]="Ubicación";
$TbMsg[7]="Cañón";
$TbMsg[6]="Ubicaci&oacute;n";
$TbMsg[7]="Ca&ntilde;&oacute;n";
$TbMsg[8]="Pizarra";
$TbMsg[9]="Puestos";
$TbMsg[10]="URL Imagen";
$TbMsg[11]="Menú";
$TbMsg[11]="Men&uacute;";
$TbMsg[12]="Comentarios";
$TbMsg[13]="Ordenadores";
$TbMsg[14]="Nombre";
$TbMsg[15]="Dirección IP";
$TbMsg[16]="Dirección MAC";
$TbMsg[15]="Direcci&oacute;n IP";
$TbMsg[16]="Direcci&oacute;n MAC";
$TbMsg[17]="Perfil Hardware";
$TbMsg[18]="DESAGRUPAR SEGÚN VALORES DISTINTOS DE:";
$TbMsg[18]="DESAGRUPAR SEG&Uacute;N VALORES DISTINTOS DE:";
$TbMsg[19]="Datos a suministrar";
$TbMsg[20]='Partición';
$TbMsg[20]='Partici&oacute;n';
$TbMsg[21]='S.O. Instalado';
$TbMsg[22]='Tamaño';
$TbMsg[23]='Datos de configuración';
$TbMsg[22]='Tama&ntilde;o (KB)';
$TbMsg[23]='Datos de configuraci&oacute;n';
$TbMsg[24]='Tipo';
$TbMsg[25]='Imagen';
$TbMsg[26]='Perfil Software';
@ -42,8 +42,14 @@ $TbMsg[29]='Desconocido';
$TbMsg[30]='Sistema de Ficheros';
$TbMsg[31]='Nombre del S.O.';
$TbMsg[32]='Tamaño de partición';
$TbMsg[32]='Tama&ntilde;o de partici&oacute;n';
$TbMsg[33]='Nombre de la Imagen ';
$TbMsg[34]='Perfil software';
$TbMsg[35]='Disco';
$TbMsg[36]='Particiones Primarias';
$TbMsg[37]='Particiones L&oacute;gicas';
$TbMsg[38]='Menor espacio libre (KB)';
$TbMsg[39]='Personalizar';
$TbMsg[40]='Sin modificar tama&ntilde;o';
$TbMsg[41]='Generar Instrucci&oacute;n OG';
?>