diff options
author | Simon Rettberg | 2015-09-16 10:38:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-16 10:38:35 +0200 |
commit | c4389a9ab63e9c9641da6a8dd3ec4f8c61a92b98 (patch) | |
tree | 6ef4c25bc676b55c67e76333dfc7125bc73356b5 | |
parent | [backup/restore] Add options to select what to restore (diff) | |
download | slx-admin-c4389a9ab63e9c9641da6a8dd3ec4f8c61a92b98.tar.gz slx-admin-c4389a9ab63e9c9641da6a8dd3ec4f8c61a92b98.tar.xz slx-admin-c4389a9ab63e9c9641da6a8dd3ec4f8c61a92b98.zip |
[systemstatus] Show active uploads/downloads
-rw-r--r-- | modules/systemstatus.inc.php | 16 | ||||
-rw-r--r-- | templates/systemstatus/_page.html | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/modules/systemstatus.inc.php b/modules/systemstatus.inc.php index 46bab5b6..0106ab9d 100644 --- a/modules/systemstatus.inc.php +++ b/modules/systemstatus.inc.php @@ -49,6 +49,22 @@ class Page_SystemStatus extends Page echo "Action $action not known in " . get_class(); } } + + protected function ajaxDmsdUsers() + { + $ret = Download::asStringPost('http://127.0.0.1:9080/status/fileserver', false, 2, $code); + 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']; + } else { + $ret = '???'; + } + die($ret); + } protected function ajaxDiskStat() { diff --git a/templates/systemstatus/_page.html b/templates/systemstatus/_page.html index 79024ad6..546a827b 100644 --- a/templates/systemstatus/_page.html +++ b/templates/systemstatus/_page.html @@ -70,6 +70,7 @@ <label><input type="checkbox" name="confirm" value="yep"> {{lang_iAmSure}}</label> <button class="btn btn-warning btn-xs" type="submit">Reboot</button> </form> + <div id="dmsd-users"></div> </div> </div> </div> @@ -112,5 +113,6 @@ loadContent('#dmsd-log', '?do=SystemStatus&action=DmsdLog'); loadContent('#netstat', '?do=SystemStatus&action=Netstat'); loadContent('#pslist', '?do=SystemStatus&action=PsList'); + loadContent('#dmsd-users', '?do=SystemStatus&action=DmsdUsers'); }, 500); </script> |