diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-09-14 13:57:49 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-11-21 22:54:21 +0000 |
commit | 28876bf46363116218c48021ddf556c53d5256f5 (patch) | |
tree | ad1f57f042af3f2fc69f6c1886bd8e491ee2e4fa /apps/files_external/js | |
parent | a1704c86233312c4574bc368b78b73fb6b605c2b (diff) | |
download | nextcloud-server-28876bf46363116218c48021ddf556c53d5256f5.tar.gz nextcloud-server-28876bf46363116218c48021ddf556c53d5256f5.zip |
Display applicable global storages in personal mount list
Diffstat (limited to 'apps/files_external/js')
-rw-r--r-- | apps/files_external/js/settings.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 9b048ba193f..c9badb2f728 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -820,6 +820,37 @@ MountConfigListView.prototype = _.extend({ loadStorages: function() { var self = this; + if (this._isPersonal) { + // load userglobal storages + $.ajax({ + type: 'GET', + url: OC.generateUrl('apps/files_external/userglobalstorages'), + contentType: 'application/json', + success: function(result) { + $.each(result, function(i, storageParams) { + storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash + var storageConfig = new self._storageConfigClass(); + _.extend(storageConfig, storageParams); + var $tr = self.newStorage(storageConfig); + + // userglobal storages must be at the top of the list + $tr.detach(); + self.$el.prepend($tr); + + var $authentication = $tr.find('.authentication'); + $authentication.text($authentication.find('select option:selected').text()); + + // userglobal storages do not expose configuration data + $tr.find('.configuration').text(t('files_external', 'Admin defined')); + + // disable any other inputs + $tr.find('.mountOptionsToggle, .remove').empty(); + $tr.find('input, select, button').attr('disabled', 'disabled'); + }); + } + }); + } + var url = this._storageConfigClass.prototype._url; $.ajax({ |