diff options
author | albertogp <albertogp@uma.es> | 2021-04-27 21:37:56 +0200 |
---|---|---|
committer | albertogp <albertogp@uma.es> | 2021-05-04 13:07:50 +0200 |
commit | 00cf45421042d623dc0602b82f925823abaddcd5 (patch) | |
tree | 62056e685dd45858a9fde1b677336ce6c46ae6c1 /admin/WebConsole | |
parent | 56c079ad5c48e367f8c37d901de72c1e38f5a104 (diff) |
"#ID-1037 Preparando todos los ficheros para versión 1.2.1"
Diffstat (limited to 'admin/WebConsole')
-rw-r--r-- | admin/WebConsole/includes/pintaParticiones.php | 78 | ||||
-rw-r--r-- | admin/WebConsole/varios/menucliente.php | 29 |
2 files changed, 101 insertions, 6 deletions
diff --git a/admin/WebConsole/includes/pintaParticiones.php b/admin/WebConsole/includes/pintaParticiones.php index 02c0f570..d3ad98bb 100644 --- a/admin/WebConsole/includes/pintaParticiones.php +++ b/admin/WebConsole/includes/pintaParticiones.php @@ -66,11 +66,31 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) $aviso=""; foreach($diskConfigs as $disk => $diskConfig){ $disk = (int)$disk; - echo'<tr height="16">'.chr(13); - echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.'</td>'.chr(13); - +// agp ============================================================================= + // Actualizamos la base de datos en el campo + $cmd->texto="SELECT tdisk + FROM ordenadores_particiones + WHERE idordenador='$idordenadores' + AND numdisk='$disk' + AND numpar=0"; - + $rs=new Recordset; + $rs->Comando=&$cmd; + if (!$rs->Abrir()) return; // Error al abrir recordset + $rs->Primero(); + while (!$rs->EOF){ + $tipodisk = $rs->campos["tdisk"]; + $rs->Siguiente(); + } +// agp ============================================================================= + echo'<tr height="16">'.chr(13); +// agp ============================================================================= + if ($tipodisk=="NVM"){ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span style="color: red"><strong>( '.$tipodisk.'e )</span></td>'.chr(13); + }else{ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span><strong>( '.$tipodisk.' )</span></td>'.chr(13); + } +// agp ============================================================================= $auxCfg=explode("@",$diskConfig); // Crea lista de particiones for($i=0;$i<sizeof($auxCfg);$i++){ $auxKey=explode(";",$auxCfg[$i]); // Toma clave de configuracion @@ -240,8 +260,31 @@ function pintaParticionesRestaurarImagen($cmd,$configuraciones,$idordenadores,$c foreach($diskConfigs as $disk => $diskConfig){ $disk = (int)$disk; +// agp ============================================================================= + // Actualizamos la base de datos en el campo + $cmd->texto="SELECT tdisk + FROM ordenadores_particiones + WHERE idordenador='$idordenadores' + AND numdisk='$disk' + AND numpar=0"; + + $rs=new Recordset; + $rs->Comando=&$cmd; + if (!$rs->Abrir()) return; // Error al abrir recordset + $rs->Primero(); + while (!$rs->EOF){ + $tipodisk = $rs->campos["tdisk"]; + $rs->Siguiente(); + } +// agp ============================================================================= echo'<tr height="16">'.chr(13); - echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.'</td>'.chr(13); +// agp ============================================================================= + if ($tipodisk=="NVM"){ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span style="color: red"><strong>( '.$tipodisk.'e )</span></td>'.chr(13); + }else{ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span><strong>( '.$tipodisk.' )</span></td>'.chr(13); + } +// agp ============================================================================= $auxCfg=explode("@",$diskConfig); // Crea lista de particiones for($i=0;$i<sizeof($auxCfg);$i++){ @@ -439,8 +482,31 @@ function pintaParticionesRestaurarImagenSincronizacion1($cmd,$configuraciones,$i foreach($diskConfigs as $disk => $diskConfig){ $disk = (int)$disk; +// agp ============================================================================= + // Actualizamos la base de datos en el campo + $cmd->texto="SELECT tdisk + FROM ordenadores_particiones + WHERE idordenador='$idordenadores' + AND numdisk='$disk' + AND numpar=0"; + + $rs=new Recordset; + $rs->Comando=&$cmd; + if (!$rs->Abrir()) return; // Error al abrir recordset + $rs->Primero(); + while (!$rs->EOF){ + $tipodisk = $rs->campos["tdisk"]; + $rs->Siguiente(); + } +// agp ============================================================================= echo'<tr height="16">'.chr(13); - echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.'</td>'.chr(13); +// agp ============================================================================= + if ($tipodisk=="NVM"){ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span style="color: red"><strong>( '.$tipodisk.'e )</span></td>'.chr(13); + }else{ + echo '<td colspan="'.$columns.'" style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #D4D0C8;"> '.$TbMsg["DISK"].' '.$disk.' - <span><strong>( '.$tipodisk.' )</span></td>'.chr(13); + } +// agp ============================================================================= $auxCfg=explode("@",$diskConfig); // Crea lista de particiones for($i=0;$i<sizeof($auxCfg);$i++){ diff --git a/admin/WebConsole/varios/menucliente.php b/admin/WebConsole/varios/menucliente.php index b1c07c94..9c6d8cd1 100644 --- a/admin/WebConsole/varios/menucliente.php +++ b/admin/WebConsole/varios/menucliente.php @@ -47,6 +47,35 @@ else{ $UrlPaginaIconos=dirname($UrlPagina)."/images/iconos"; $codeHtml=""; //________________________________________________________________________________________________________ + //agp Tomamos el tipo de disco DISK o NVM +//________________________________________________________________________________________________________ + // Leemos el fichero que contiene la información de discos + $nom_fich = "/opt/opengnsys/log/clients/".$iph.".tdisk.txt"; + $cont_fich = file_get_contents($nom_fich);//echo $cont_fich; + // quitamos 2 ultimos caracteres (espacio y ;) + $cont_fich = substr($cont_fich, 0, -2); + $disk_l=explode(";",$cont_fich); + + for($i=0;$i<count($disk_l);$i++){ + // Obtenemos los 3 primeros caracteres del disco + $dcar=substr($disk_l[$i], 0, 3); + // Comprobamos si los 2 primeros caracteres son DISCOS ejemp: 1:0 , 2:0 , 3:0 + if ( $dcar == $i.":0"){ + // Obtenemos el último campo DISK - NVM + $disko_enc = explode(":",$disk_l[$i]); + $NUMDISK=$dcar2[0]; + $TIPODISK=$disko_enc[7]; + // Actualizamos la base de datos en el campo + $cmd->texto="UPDATE ordenadores_particiones + SET tdisk='".$TIPODISK."' + WHERE idordenador=(SELECT idordenador + FROM ordenadores + WHERE ip='".$iph."') + AND numdisk='".$NUMDISK."'"; + $resul=$cmd->Ejecutar(); + } + } +//________________________________________________________________________________________________________ //agp $nombre_archivo = "/opt/opengnsys/log/clients/".$iph.".cache.txt"; $contenidofichero = file_get_contents($nombre_archivo); |