scaleway-os: restore UI

This commit is contained in:
Girish Ramakrishnan
2019-06-21 11:06:50 -07:00
parent 50930ee609
commit 712883373a
2 changed files with 15 additions and 0 deletions

View File

@@ -67,6 +67,12 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
{ name: 'DE-FRA-1', value: 'https://sos-de-fra-1.exo.io' },
];
// https://www.scaleway.com/docs/object-storage-feature/
$scope.scalewayRegions = [
{ name: 'FR-PAR', value: 'https://s3.fr-par.scw.cloud', region: 'fr-par' }, // default
{ name: 'NL-AMS', value: 'https://s3.nl-ams.scw.cloud', region: 'nl-ams' }
];
$scope.storageProvider = [
{ name: 'Amazon S3', value: 's3' },
{ name: 'DigitalOcean Spaces', value: 'digitalocean-spaces' },
@@ -74,6 +80,7 @@ app.controller('RestoreController', ['$scope', '$http', 'Client', function ($sco
{ name: 'Filesystem', value: 'filesystem' },
{ name: 'Google Cloud Storage', value: 'gcs' },
{ name: 'Minio', value: 'minio' },
{ name: 'Scaleway Object Storage', value: 'scaleway-objectstorage' },
{ name: 'S3 API Compatible (v4)', value: 's3-v4-compat' },
];
@@ -114,6 +121,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 === 'scaleway-objectstorage') {
backupConfig.region = $scope.scalewayRegions.find(function (x) { return x.value === $scope.endpoint; }).region;
backupConfig.signatureVersion = 'v4';
} else if (backupConfig.provider === 'digitalocean-spaces') {
backupConfig.region = 'us-east-1';
}