diff options
author | Simon Rettberg | 2017-06-06 19:07:14 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-06-06 19:07:14 +0200 |
commit | dd058b606d935c5d4dd6b2d6cd44ec2088868b37 (patch) | |
tree | bd04010196064f19c32d2e0d9d672a4c65f09715 /modules-available/systemstatus/page.inc.php | |
parent | [translation] Fix warning (diff) | |
download | slx-admin-dd058b606d935c5d4dd6b2d6cd44ec2088868b37.tar.gz slx-admin-dd058b606d935c5d4dd6b2d6cd44ec2088868b37.tar.xz slx-admin-dd058b606d935c5d4dd6b2d6cd44ec2088868b37.zip |
[systemstatus] Show updated packages requiring reboot
Diffstat (limited to 'modules-available/systemstatus/page.inc.php')
-rw-r--r-- | modules-available/systemstatus/page.inc.php | 21 |
1 files changed, 13 insertions, 8 deletions
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() |