Skip to content

Commit

Permalink
Introduce async status checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin McCorkell committed Mar 20, 2015
1 parent e5e3092 commit c37913b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 5 additions & 1 deletion apps/files_external/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
},

Expand Down Expand Up @@ -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');
Expand Down
9 changes: 3 additions & 6 deletions apps/files_external/lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ public static function getSystemMountPoints() {
'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'];
Expand Down Expand Up @@ -395,8 +394,7 @@ public static function getSystemMountPoints() {
'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'];
Expand Down Expand Up @@ -445,8 +443,7 @@ public static function getPersonalMountPoints() {
// 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'];
Expand Down
4 changes: 1 addition & 3 deletions apps/files_external/templates/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : ''); ?>"
Expand Down

0 comments on commit c37913b

Please sign in to comment.