From 2593e35fb1f9c08b7fcd4ea98775d54f1ea9d367 Mon Sep 17 00:00:00 2001 From: Mathias Petermann Date: Sun, 9 Apr 2023 12:34:11 +0200 Subject: [PATCH] Add update info to serverinfo api call Signed-off-by: Mathias Petermann --- lib/SystemStatistics.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/SystemStatistics.php b/lib/SystemStatistics.php index e415895e..18cedac2 100644 --- a/lib/SystemStatistics.php +++ b/lib/SystemStatistics.php @@ -56,6 +56,11 @@ public function getSystemStatistics(): array { $memoryUsage = $this->os->getMemory(); return [ 'version' => $this->config->getSystemValue('version'), + 'update' => [ + 'available' => count(json_decode($this->config->getAppValue('core', 'lastupdateResult'))) > 0 ? 'yes' : 'no', + 'available_version' => json_decode($this->config->getAppValue('core', 'lastupdateResult'), true)['version'] , + 'lastupdatedat' => (int) $this->config->getAppValue('core', 'lastupdatedat'), + ], 'theme' => $this->config->getSystemValue('theme', 'none'), 'enable_avatars' => $this->config->getSystemValue('enable_avatars', true) ? 'yes' : 'no', 'enable_previews' => $this->config->getSystemValue('enable_previews', true) ? 'yes' : 'no',