Add remount button for mountlike backup configs
This commit is contained in:
@@ -811,6 +811,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.remountBackupStorage = function (callback) {
|
||||
post('/api/v1/backups/remount', {}, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getSupportConfig = function (callback) {
|
||||
get('/api/v1/settings/support_config', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
|
||||
@@ -428,7 +428,8 @@
|
||||
"location": "Location",
|
||||
"endpoint": "Endpoint",
|
||||
"format": "Storage Format",
|
||||
"configure": "Configure"
|
||||
"configure": "Configure",
|
||||
"remount": "Remount Storage"
|
||||
},
|
||||
"schedule": {
|
||||
"title": "Schedule and Retention",
|
||||
|
||||
@@ -440,8 +440,9 @@
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-show="user.role === 'owner'" ng-click="configureBackup.show()">{{ 'backups.location.configure' | tr }}</button>
|
||||
<button class="btn btn-outline btn-default pull-right" ng-show="user.role === 'owner' && mountlike(backupConfig.provider)" ng-disabled="remount.busy" ng-click="remount.submit()"><i class="fa fa-circle-notch fa-spin" ng-show="remount.busy"></i> {{ 'backups.location.remount' | tr }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -190,6 +190,31 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
return tmp ? tmp.name : '';
|
||||
};
|
||||
|
||||
$scope.remount = {
|
||||
busy: false,
|
||||
error: null,
|
||||
|
||||
submit: function () {
|
||||
if (!$scope.mountlike($scope.backupConfig.provider)) return;
|
||||
|
||||
$scope.remount.busy = true;
|
||||
$scope.remount.error = null;
|
||||
|
||||
Client.remountBackupStorage(function (error) {
|
||||
if (error) {
|
||||
console.error('Failed to remount backup storage.', error);
|
||||
$scope.remount.error = error.message;
|
||||
}
|
||||
|
||||
// give the backend some time
|
||||
$timeout(function () {
|
||||
$scope.remount.busy = false;
|
||||
getBackupConfig();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.createBackup = {
|
||||
busy: false,
|
||||
percent: 0,
|
||||
|
||||
@@ -70,7 +70,7 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat
|
||||
$timeout(function () {
|
||||
volume.remounting = false;
|
||||
refreshVolumes(function (error) { if (error) console.error('Failed to refresh volume states.', error); });
|
||||
}, 3000);
|
||||
}, 2000);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user