Allow optional endpoint in s3 settings ui

Part of #123
This commit is contained in:
Johannes Zellner
2016-12-07 10:33:58 +01:00
parent 816911d071
commit 01631e0477
2 changed files with 8 additions and 0 deletions

View File

@@ -124,6 +124,11 @@
<p class="has-error text-center" ng-show="configureBackup.error">{{ configureBackup.error.generic }}</p>
<!-- S3 -->
<div class="form-group" ng-class="{ 'has-error': configureBackup.error.endpoint }">
<label class="control-label" for="inputConfigureBackupEndpoint">Endpoint (optional)</label>
<input type="text" class="form-control" ng-model="configureBackup.endpoint" id="inputConfigureBackupEndpoint" name="endpoint" ng-disabled="configureBackup.busy" placeholder="leave empty if using AWS S3">
</div>
<div class="form-group" ng-class="{ 'has-error': configureBackup.error.bucket }">
<label class="control-label" for="inputConfigureBackupBucket">Bucket name</label>
<input type="text" class="form-control" ng-model="configureBackup.bucket" id="inputConfigureBackupBucket" name="bucket" ng-disabled="configureBackup.busy" required autofocus>

View File

@@ -275,6 +275,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
accessKeyId: '',
secretAccessKey: '',
region: '',
endpoint: '',
show: function () {
$scope.configureBackup.error = {};
@@ -285,6 +286,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.configureBackup.region = $scope.backupConfig.region;
$scope.configureBackup.accessKeyId = $scope.backupConfig.accessKeyId;
$scope.configureBackup.secretAccessKey = $scope.backupConfig.secretAccessKey;
$scope.configureBackup.endpoint = $scope.backupConfig.endpoint;
$('#configureBackupModal').modal('show');
},
@@ -302,6 +304,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
};
if ($scope.configureBackup.region) backupConfig.region = $scope.configureBackup.region;
if ($scope.configureBackup.endpoint) backupConfig.endpoint = $scope.configureBackup.endpoint;
Client.setBackupConfig(backupConfig, function (error) {
$scope.configureBackup.busy = false;