Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-10-16 15:22:47 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-11-17 10:30:51 +0300
commite051ef1d686721e8ccbedab9ee92b5876f206800 (patch)
tree3e847ec1349006697dcaf490d91b2674ba24fcca /core/src
parent7afe12eccbc2bbe9c7d59fd615708da2e0273f41 (diff)
Fetch quota with files propfind
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/files/client.js7
-rw-r--r--core/src/files/fileinfo.js2
2 files changed, 9 insertions, 0 deletions
diff --git a/core/src/files/client.js b/core/src/files/client.js
index b4bbb5814a5..4e606f4f5ac 100644
--- a/core/src/files/client.js
+++ b/core/src/files/client.js
@@ -82,6 +82,7 @@ import escapeHTML from 'escape-html'
Client.PROPERTY_GETCONTENTLENGTH = '{' + Client.NS_DAV + '}getcontentlength'
Client.PROPERTY_ISENCRYPTED = '{' + Client.NS_DAV + '}is-encrypted'
Client.PROPERTY_SHARE_PERMISSIONS = '{' + Client.NS_OCS + '}share-permissions'
+ Client.PROPERTY_QUOTA_AVAILABLE_BYTES = '{' + Client.NS_DAV + '}quota-available-bytes'
Client.PROTOCOL_HTTP = 'http'
Client.PROTOCOL_HTTPS = 'https'
@@ -120,6 +121,7 @@ import escapeHTML from 'escape-html'
* File sizes
*/
[Client.NS_DAV, 'getcontentlength'],
+ [Client.NS_DAV, 'quota-available-bytes'],
/**
* Preview availability
*/
@@ -397,6 +399,11 @@ import escapeHTML from 'escape-html'
data.mountType = mounTypeProp
}
+ const quotaAvailableBytes = props['{' + Client.NS_DAV + '}quota-available-bytes']
+ if (!_.isUndefined(quotaAvailableBytes)) {
+ data.quotaAvailableBytes = quotaAvailableBytes
+ }
+
// extend the parsed data using the custom parsers
_.each(this._fileInfoParsers, function(parserFunction) {
_.extend(data, parserFunction(response, data) || {})
diff --git a/core/src/files/fileinfo.js b/core/src/files/fileinfo.js
index cfa8702c0a8..19baad5a2d7 100644
--- a/core/src/files/fileinfo.js
+++ b/core/src/files/fileinfo.js
@@ -139,6 +139,8 @@
* @type int
*/
sharePermissions: null,
+
+ quotaAvailableBytes: -1,
}
if (!OC.Files) {