summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes
diff options
context:
space:
mode:
authoralbertogp <albertogp@uma.es>2021-05-04 13:26:45 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-05-26 17:29:42 +0200
commitc17ffa5d032a82e8eca61481dd8a8adb8b3fc5b1 (patch)
tree0823cbb3a597b80ae7317f3802fb557d3bd88faf /admin/WebConsole/includes
parent29c2c73e14d90cfa803b21765c1dc6dc8a7252ad (diff)
#1037 Add disk type
To help users choosing which preparation a computer needs according to its disk type, this commit: * Adds cloning engine support to retrieve disk type data from the computer when refreshing disks partition schema. * Adds WebConsole support to read disk type data from the database and show it on partition drawing. See also commits with #1037 in ogClient and ogServer repo. Co-authored-by: Javier Sánchez Parra <jsanchez@soleta.eu>
Diffstat (limited to 'admin/WebConsole/includes')
-rw-r--r--admin/WebConsole/includes/pintaParticiones.php58
1 files changed, 49 insertions, 9 deletions
diff --git a/admin/WebConsole/includes/pintaParticiones.php b/admin/WebConsole/includes/pintaParticiones.php
index 02c0f570..c789298d 100644
--- a/admin/WebConsole/includes/pintaParticiones.php
+++ b/admin/WebConsole/includes/pintaParticiones.php
@@ -2,6 +2,30 @@
include_once("../idiomas/php/".$idioma."/pintaParticiones_".$idioma.".php");
+function draw_disk_type($cmd, $computer_id, $disk)
+{
+ $cmd->texto = "SELECT disk_type " .
+ "FROM ordenadores_particiones " .
+ "WHERE idordenador=$computer_id " .
+ "AND numdisk=$disk " .
+ "AND numpar=0";
+
+ $rs = new Recordset;
+ $rs->Comando=&$cmd;
+ if (!$rs->Abrir()) return;
+ $rs->Primero();
+ $disk_type = $rs->campos["disk_type"];
+ syslog(LOG_ERR, print_r("test".$disk_type,true));
+
+ if ($disk_type=="NVM")
+ $html = ' - <span style="color: red"><strong>( ' . $disk_type .
+ 'e )</span>';
+ else
+ $html = ' - <span><strong>( ' . $disk_type . ' )</span>';
+
+ return $html;
+}
+
/**
* Separa las distintas configuraciones de una cadena por disco.
* Ej. 1;0;1@1;1;7@1;2;131@2;0;1@2;1;7
@@ -66,11 +90,15 @@ 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;">&nbsp;'.$TbMsg["DISK"].'&nbsp;'.$disk.'</td>'.chr(13);
+ echo '<tr height="16">'.chr(13);
+
+ $html_disk_type = draw_disk_type($cmd, $idordenadores, $disk);
+ echo '<td colspan="' . $columns . '" style="BORDER-TOP: " .
+ "#999999 1px solid;BACKGROUND-COLOR: #D4D0C8;">&nbsp;' .
+ $TbMsg["DISK"] . '&nbsp;' . $disk . $html_disk_type .
+ '</td>'.chr(13);
-
$auxCfg=explode("@",$diskConfig); // Crea lista de particiones
for($i=0;$i<sizeof($auxCfg);$i++){
$auxKey=explode(";",$auxCfg[$i]); // Toma clave de configuracion
@@ -240,9 +268,15 @@ function pintaParticionesRestaurarImagen($cmd,$configuraciones,$idordenadores,$c
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;">&nbsp;'.$TbMsg["DISK"].'&nbsp;'.$disk.'</td>'.chr(13);
-
+
+ echo '<tr height="16">'.chr(13);
+
+ $html_disk_type = draw_disk_type($cmd, $idordenadores, $disk);
+ echo '<td colspan="' . $columns . '" style="BORDER-TOP: " .
+ "#999999 1px solid;BACKGROUND-COLOR: #D4D0C8;">&nbsp;' .
+ $TbMsg["DISK"] . '&nbsp;' . $disk . $html_disk_type .
+ '</td>'.chr(13);
+
$auxCfg=explode("@",$diskConfig); // Crea lista de particiones
for($i=0;$i<sizeof($auxCfg);$i++){
$auxKey=explode(";",$auxCfg[$i]); // Toma clave de configuracion
@@ -439,9 +473,15 @@ function pintaParticionesRestaurarImagenSincronizacion1($cmd,$configuraciones,$i
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;">&nbsp;'.$TbMsg["DISK"].'&nbsp;'.$disk.'</td>'.chr(13);
-
+
+ echo '<tr height="16">'.chr(13);
+
+ $html_disk_type = draw_disk_type($cmd, $idordenadores, $disk);
+ echo '<td colspan="' . $columns . '" style="BORDER-TOP: " .
+ "#999999 1px solid;BACKGROUND-COLOR: #D4D0C8;">&nbsp;' .
+ $TbMsg["DISK"] . '&nbsp;' . $disk . $html_disk_type .
+ '</td>'.chr(13);
+
$auxCfg=explode("@",$diskConfig); // Crea lista de particiones
for($i=0;$i<sizeof($auxCfg);$i++){
$auxKey=explode(";",$auxCfg[$i]); // Toma clave de configuracion