]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't recheck config automatically when there are a large number of storages 31381/head
authorRobin Appelman <robin@icewind.nl>
Mon, 28 Feb 2022 16:02:17 +0000 (17:02 +0100)
committerRobin Appelman (Rebase PR Action) <robin@icewind.nl>
Thu, 17 Mar 2022 16:29:35 +0000 (16:29 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/js/settings.js

index 6bef914acf8273a2004a0abd9484e81f40e1b563..01c2c3bc95341438f4f2640f43cfd6b5d25660ee 100644 (file)
@@ -989,15 +989,21 @@ MountConfigListView.prototype = _.extend({
                        url: OC.generateUrl(url),
                        contentType: 'application/json',
                        success: function(result) {
+                               result = Object.values(result);
                                var onCompletion = jQuery.Deferred();
                                var $rows = $();
-                               Object.values(result).forEach(function(storageParams) {
+                               result.forEach(function(storageParams) {
                                        storageParams.mountPoint = (storageParams.mountPoint === '/')? '/' : storageParams.mountPoint.substr(1); // trim leading slash
                                        var storageConfig = new self._storageConfigClass();
                                        _.extend(storageConfig, storageParams);
                                        var $tr = self.newStorage(storageConfig, onCompletion, true);
 
-                                       self.recheckStorageConfig($tr);
+                                       // don't recheck config automatically when there are a large number of storages
+                                       if (result.length < 20) {
+                                               self.recheckStorageConfig($tr);
+                                       } else {
+                                               self.updateStatus($tr, StorageConfig.Status.INDETERMINATE, t('files_external', 'Automatic status checking is disabled due to the large number of configured storages, click to check status'));
+                                       }
                                        $rows = $rows.add($tr);
                                });
                                addSelect2($rows.find('.applicableUsers'), this._userListLimit);