]> source.dussan.org Git - nextcloud-server.git/commitdiff
Introduce async status checking
authorRobin McCorkell <rmccorkell@karoshi.org.uk>
Fri, 20 Mar 2015 09:48:14 +0000 (09:48 +0000)
committerRobin McCorkell <rmccorkell@karoshi.org.uk>
Fri, 20 Mar 2015 09:48:14 +0000 (09:48 +0000)
apps/files_external/js/settings.js
apps/files_external/lib/config.php
apps/files_external/templates/settings.php

index ef64d087884cbea0dcf99520d216f58447a79d45..9e4d026980f54daec78c56d14f35a8a3b4673478 100644 (file)
@@ -437,6 +437,7 @@ MountConfigListView.prototype = {
         * @param {int} [options.userListLimit] page size in applicable users dropdown
         */
        initialize: function($el, options) {
+               var self = this;
                this.$el = $el;
                this._isPersonal = ($el.data('admin') !== true);
                if (this._isPersonal) {
@@ -474,6 +475,10 @@ MountConfigListView.prototype = {
 
                addSelect2(this.$el.find('tr:not(#addMountPoint) .applicableUsers'), this._userListLimit);
 
+               this.$el.find('tr:not(#addMountPoint)').each(function(i, tr) {
+                       self.recheckStorageConfig($(tr));
+               });
+
                this._initEvents();
        },
 
@@ -537,7 +542,6 @@ MountConfigListView.prototype = {
                        $tr.find('.mountPoint input').val(this._suggestMountPoint(selected));
                }
                $tr.addClass(backendClass);
-               $tr.find('.status').append('<span></span>');
                $tr.find('.backend').data('class', backendClass);
                var configurations = this._allBackends;
                var $td = $tr.find('td.configuration');
index 884e596bdd491371ae51d32bc0ded26024f590ba..85a93a779ae088f57b84b8f7cdf45cec9a0e9636 100644 (file)
@@ -352,8 +352,7 @@ class OC_Mount_Config {
                                                'backend' => $backends[$mount['class']]['backend'],
                                                'priority' => $mount['priority'],
                                                'options' => $mount['options'],
-                                               'applicable' => array('groups' => array($group), 'users' => array()),
-                                               'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
+                                               'applicable' => array('groups' => array($group), 'users' => array())
                                        );
                                        if (isset($mount['id'])) {
                                                $config['id'] = (int)$mount['id'];
@@ -395,8 +394,7 @@ class OC_Mount_Config {
                                                'backend' => $backends[$mount['class']]['backend'],
                                                'priority' => $mount['priority'],
                                                'options' => $mount['options'],
-                                               'applicable' => array('groups' => array(), 'users' => array($user)),
-                                               'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
+                                               'applicable' => array('groups' => array(), 'users' => array($user))
                                        );
                                        if (isset($mount['id'])) {
                                                $config['id'] = (int)$mount['id'];
@@ -445,8 +443,7 @@ class OC_Mount_Config {
                                        // Remove '/uid/files/' from mount point
                                        'mountpoint' => substr($mountPoint, strlen($uid) + 8),
                                        'backend' => $backEnds[$mount['class']]['backend'],
-                                       'options' => $mount['options'],
-                                       'status' => self::getBackendStatus($mount['class'], $mount['options'], true)
+                                       'options' => $mount['options']
                                );
                                if (isset($mount['id'])) {
                                        $config['id'] = (int)$mount['id'];
index 3368b96a1227dd498f3449c2aefee8917af6ea47..4866d177634e345df6b1890a9d175a6716f6f89b 100644 (file)
@@ -17,9 +17,7 @@
                <?php foreach ($_['mounts'] as $mount): ?>
                        <tr <?php print_unescaped(isset($mount['mountpoint']) ? 'class="'.OC_Util::sanitizeHTML($mount['class']).'"' : 'id="addMountPoint"'); ?> data-id="<?php p($mount['id']) ?>">
                                <td class="status">
-                               <?php if (isset($mount['status'])): ?>
-                                       <span class="<?php p(($mount['status'] === \OC_Mount_Config::STATUS_SUCCESS) ? 'success' : 'error'); ?>"></span>
-                               <?php endif; ?>
+                                       <span></span>
                                </td>
                                <td class="mountPoint"><input type="text" name="mountPoint"
                                                                                          value="<?php p(isset($mount['mountpoint']) ? $mount['mountpoint'] : ''); ?>"