From dd058b606d935c5d4dd6b2d6cd44ec2088868b37 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 6 Jun 2017 19:07:14 +0200 Subject: [systemstatus] Show updated packages requiring reboot --- modules-available/systemstatus/page.inc.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'modules-available/systemstatus/page.inc.php') diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php index a8deeecb..f7ec7022 100644 --- a/modules-available/systemstatus/page.inc.php +++ b/modules-available/systemstatus/page.inc.php @@ -59,17 +59,22 @@ class Page_SystemStatus extends Page protected function ajaxDmsdUsers() { $ret = Download::asStringPost('http://127.0.0.1:9080/status/fileserver', false, 2, $code); + $args = array(); if ($code != 200) { - Header('HTTP/1.1 502 Internal Server Error'); - die('Internal Server Wurst'); - } - $data = @json_decode($ret, true); - if (is_array($data)) { - $ret = 'Uploads: ' . $data['activeUploads'] . ', Downloads: ' . $data['activeDownloads']; + $args['dmsd_error'] = true; } else { - $ret = '???'; + $data = @json_decode($ret, true); + if (is_array($data)) { + $args['uploads'] = $data['activeUploads']; + $args['downloads'] = $data['activeDownloads']; + } + } + if (file_exists('/run/reboot-required.pkgs')) { + $lines = file('/run/reboot-required.pkgs', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + $lines = array_unique($lines); + $args['packages'] = implode(', ', $lines); } - die($ret); + echo Render::parse('ajax-reboot', $args); } protected function ajaxDiskStat() -- cgit v1.2.3-55-g7522