diff options
Diffstat (limited to 'modules-available/systemstatus/page.inc.php')
-rw-r--r-- | modules-available/systemstatus/page.inc.php | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php index b9fef0fd..f7ec7022 100644 --- a/modules-available/systemstatus/page.inc.php +++ b/modules-available/systemstatus/page.inc.php @@ -29,6 +29,14 @@ class Page_SystemStatus extends Page if (is_array($this->rebootTask) && isset($this->rebootTask['id'])) { $data['rebootTask'] = $this->rebootTask['id']; } + $tabs = array('DmsdLog', 'Netstat', 'PsList', 'LdadpLog', 'LighttpdLog'); + $data['tabs'] = array(); + foreach ($tabs as $tab) { + $data['tabs'][] = array( + 'type' => $tab, + 'name' => Dictionary::translate('tab_' . $tab) + ); + } Render::addTemplate('_page', $data); } @@ -51,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() |