[Pkg-owncloud-commits] [owncloud] 23/83: Fixed storage stats to be based on current directory

David Prévot taffit at moszumanska.debian.org
Wed Dec 18 13:05:26 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch 5.0
in repository owncloud.

commit 5e6ea1565af95298a7cae39df561aa01d74b4862
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Nov 6 10:55:19 2013 +0100

    Fixed storage stats to be based on current directory
    
    Previously, the storage statistics were always for the root dir.
    This means that the upload button would always show the limit for the
    root dir, even when uploading to a shared dir or external storage.
    
    This fix adds a "dir" argument to getstoragestats.php.
    
    Partial backport of 31181e4348b9af2625cf4d6ad38cf4cd81db3c1f
---
 apps/files/ajax/getstoragestats.php | 8 +++++++-
 apps/files/js/files.js              | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 7a2b642..573179e 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -3,7 +3,13 @@
 // only need filesystem apps
 $RUNTIME_APPTYPES = array('filesystem');
 
+$dir = '/';
+
+if (isset($_GET['dir'])) {
+	$dir = $_GET['dir'];
+}
+
 OCP\JSON::checkLoggedIn();
 
 // send back json
-OCP\JSON::success(array('data' => \OCA\files\lib\Helper::buildFileStorageStatistics('/')));
+OCP\JSON::success(array('data' => \OCA\files\lib\Helper::buildFileStorageStatistics($dir)));
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index d8aca4d..1e523e8 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -523,7 +523,8 @@ $(document).ready(function() {
 
 	// file space size sync
 	function update_storage_statistics() {
-		$.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
+		var currentDir = $('#dir').val() || '/';
+		$.getJSON(OC.filePath('files','ajax','getstoragestats.php?dir=' + encodeURIComponent(currentDir)),function(response) {
 			Files.updateMaxUploadFilesize(response);
 		});
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list