summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/propiedades
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-10-16 16:13:59 +0000
committerramon <ramongomez@us.es>2017-10-16 16:13:59 +0000
commitd610135c9b6ee43d13bce5e5b6e4ce51c59a3648 (patch)
tree49dfaaf3a3b39f4741a559322060113587fd7e56 /admin/WebConsole/propiedades
parent4073d146fec96ca89608a8e54ca2a6e5a25332ae (diff)
#810: Convertir datos a bytes para ruta REST {{{/repository/images}}}; propiedades de repositorio convierte tamaƱos a valor legible.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5463 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/propiedades')
-rw-r--r--admin/WebConsole/propiedades/propiedades_repositorios.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/admin/WebConsole/propiedades/propiedades_repositorios.php b/admin/WebConsole/propiedades/propiedades_repositorios.php
index ee97f047..d809dfea 100644
--- a/admin/WebConsole/propiedades/propiedades_repositorios.php
+++ b/admin/WebConsole/propiedades/propiedades_repositorios.php
@@ -10,6 +10,7 @@
// **********************************************************************************************************
include_once("../includes/ctrlacc.php");
include_once("../includes/opciones.php");
+include_once("../includes/comunes.php");
include_once("../includes/CreaComando.php");
include_once("../clases/AdoPhp.php");
include_once("../idiomas/php/".$idioma."/propiedades_repositorios_".$idioma.".php");
@@ -52,11 +53,11 @@ if($apiKeyRepo != ""){
$result = multiRequest($repo);
if ($result[0]['code'] === 200) {
$result = json_decode($result[0]['data']);
- $repodir=$result->directory;
- $totalrepo=$result->disk->total;
- $ocupadorepo=$result->disk->used;
- $librerepo=$result->disk->free;
- $porcentajerepo=$result->disk->percent;
+ $repodir = $result->directory;
+ $totalrepo = humanSize($result->disk->total);
+ $librerepo = humanSize($result->disk->free);
+ $ocupadorepo = humanSize($result->disk->total - $result->disk->free);
+ $porcentajerepo = 100 - floor(100 * $result->disk->$free / $result->disk->$total);
$repoOus = $result->ous;
$repoImages = $result->images;
$repoWithApi = true;
@@ -158,27 +159,27 @@ if($apiKeyRepo != ""){
<?php if ($repoWithApi) { ?>
<TR>
- <TH align=center width=125>&nbsp;<?echo $TbMsg[11]?>&nbsp;</TD>
- <TH align=center width=120>&nbsp;<?echo $TbMsg[12]?>&nbsp;</TD>
- <TH align=center width=120>&nbsp;<?echo $TbMsg[13]?>&nbsp;</TD>
- <TH align=center width=101>&nbsp;<?echo $TbMsg[14]?>&nbsp;</TD>
+ <TH align=center width=125>&nbsp;<?php echo $TbMsg[11]?>&nbsp;</TD>
+ <TH align=center width=120>&nbsp;<?php echo $TbMsg[12]?>&nbsp;</TD>
+ <TH align=center width=120>&nbsp;<?php echo $TbMsg[13]?>&nbsp;</TD>
+ <TH align=center width=101>&nbsp;<?php echo $TbMsg[14]?>&nbsp;</TD>
</TR>
<TR>
- <TD align=center width=125>&nbsp;<?echo $totalrepo?>&nbsp;</TD>
- <TD align=center width=120>&nbsp;<?echo $ocupadorepo?>&nbsp;</TD>
- <TD align=center width=120>&nbsp;<?echo $librerepo?>&nbsp;</TD>
- <TD align=center width=101>&nbsp;<?echo $porcentajerepo?>&nbsp;</TD>
+ <TD align=center width=125>&nbsp;<?php echo $totalrepo?>&nbsp;</TD>
+ <TD align=center width=120>&nbsp;<?php echo $ocupadorepo?>&nbsp;</TD>
+ <TD align=center width=120>&nbsp;<?php echo $librerepo?>&nbsp;</TD>
+ <TD align=center width=101>&nbsp;<?php echo "$porcentajerepo %" ?>&nbsp;</TD>
</TR>
<?php
- // Si tenemos informacion del repositorio remoto, mostramos las imagenes
- if($repoWithApi == true && is_array($repoImages)){
+ // Si tenemos informacion del repositorio remoto, mostramos las imagenes
+ if($repoWithApi == true && is_array($repoImages)){
echo "<tr class='tabla_listados_sin'><th colspan='4'>".$TbMsg['MSG_CONTENT']." $repodir</th></tr>\n";
echo "<tr><td>".$TbMsg['MSG_IMAGE']." (".$TbMsg['MSG_TYPE'].")</td><td>".$TbMsg['MSG_SIZEBYTES']."</td><td>".$TbMsg['MSG_MODIFIED']."</td><td>".$TbMsg['MSG_PERMISSIONS']."</td></tr>\n";
foreach($repoImages as $image){
echo "<tr class='tabla_listados_sin'>";
echo "<td>".$image->name." (".$image->type.")</td>";
- echo "<td>".$image->size."</td>";
+ echo "<td>".humanSize($image->size)."</td>";
echo "<td>".$image->modified."</td>";
echo "<td>".$image->mode."</td>";
echo "</tr>\n";