From b6ab5dda0ac0ea6d38c954632f52214112d87768 Mon Sep 17 00:00:00 2001 From: Gyurix Date: Tue, 17 Sep 2024 14:54:54 +0200 Subject: [PATCH] show service update and up to date --- functions.php | 22 ++++++++++++++++++++++ scan.php | 6 ++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 4fe9668..b053908 100644 --- a/functions.php +++ b/functions.php @@ -158,6 +158,28 @@ function show_service($name, $containers) { echo $str; } +function show_service_update($name, $update, $uptodate) { + $str = '
'.$name."
"; + + $str .= '
'; + $update = trim($update); + $arr = explode(" ",$update); + foreach ($arr as $container) { + $str .= $container." - UPDATE AVAILABLE
"; + } + $str .= '
'; + + $str .= '
'; + $uptodate = trim($uptodate); + $arr = explode(" ",$uptodate); + foreach ($arr as $container) { + $str .= $container." - Already up to date
"; + } + $str .= '
'; + + echo $str; +} + // not in use function put_install_envs() { diff --git a/scan.php b/scan.php index f6f802b..3bbf77d 100644 --- a/scan.php +++ b/scan.php @@ -99,11 +99,9 @@ switch ($_GET["op"]) { if (!empty($arr)) { foreach ($arr as $key=>$data) { if ($key=="updates") { - if ($data["INSTALL_STATUS"]==2) echo "NEW"; - elseif ($data["INSTALL_STATUS"]==1) { + if ($data["INSTALL_STATUS"]==1) { foreach ($data["INSTALLED_SERVICES"] as $service_name => $object) { - //echo base64_decode($object["content"]); - show_service($service_name, $object["running"]); + show_service_update($service_name, $object["update"], $object["uptodate"]); } echo "
"; }