Add wasabi to restore UI

This commit is contained in:
Girish Ramakrishnan
2019-07-30 10:42:18 -07:00
parent 0153e5212c
commit c5b9fccedb
2 changed files with 17 additions and 1 deletions

View File

@@ -73,6 +73,12 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
{ name: 'NL-AMS', value: 'https://s3.nl-ams.scw.cloud', region: 'nl-ams' }
];
$scope.wasabiRegions = [
{ name: 'EU Central 1', value: 'https://s3.eu-central-1.wasabisys.com' },
{ name: 'US East 1', value: 'https://s3.wasabisys.com' },
{ name: 'US West 1', value: 'https://s3.us-west-1.wasabisys.com' }
];
$scope.storageProvider = [
{ name: 'Amazon S3', value: 's3' },
{ name: 'DigitalOcean Spaces', value: 'digitalocean-spaces' },
@@ -82,6 +88,7 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
{ name: 'Minio', value: 'minio' },
{ name: 'Scaleway Object Storage', value: 'scaleway-objectstorage' },
{ name: 'S3 API Compatible (v4)', value: 's3-v4-compat' },
{ name: 'Wasabi', value: 'wasabi' }
];
$scope.formats = [
@@ -90,7 +97,8 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
];
$scope.s3like = function (provider) {
return provider === 's3' || provider === 'minio' || provider === 's3-v4-compat' || provider === 'exoscale-sos' || provider === 'digitalocean-spaces';
return provider === 's3' || provider === 'minio' || provider === 's3-v4-compat' || provider === 'exoscale-sos'
|| provider === 'digitalocean-spaces' || provider === 'wasabi' || provider === 'scaleway-objectstorage';
};
$scope.restore = function () {
@@ -121,6 +129,9 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
} else if (backupConfig.provider === 'exoscale-sos') {
backupConfig.region = 'us-east-1';
backupConfig.signatureVersion = 'v4';
} else if (backupConfig.provider === 'wasabi') {
backupConfig.region = 'us-east-1';
backupConfig.signatureVersion = 'v4';
} else if (backupConfig.provider === 'scaleway-objectstorage') {
backupConfig.region = $scope.scalewayRegions.find(function (x) { return x.value === $scope.endpoint; }).region;
backupConfig.signatureVersion = 'v4';