Testing:
https://dcache-demo.desy.de:2443
diff --git a/utils/dataTransfer/transferData.component.ts b/utils/dataTransfer/transferData.component.ts
index 8bd841d9..1070e809 100644
--- a/utils/dataTransfer/transferData.component.ts
+++ b/utils/dataTransfer/transferData.component.ts
@@ -43,14 +43,14 @@ export class EGIDataTransferComponent {
destinationAuthUser = "";
destinationAuthPass = "";
destinationPath = "";
- destinationOptions = properties.eoscDataTransferDestinations.map(dest => {return {"label": dest.destination, "value": dest}});
+ destinationOptions = null;//properties.eoscDataTransferDestinations.map(dest => {return {"label": dest.destination, "value": dest}});
selectedDestination:{ kind: string, destination: string, description: string, authType: 'token' | 'password' | 'keys',
canBrowse: boolean, transferWith: string} = null;
folders = {};
files = {};
downloadElements = null;
@Input() isOpen = false;
- @Input() selectedDestinationId = "dcache";
+ // @Input() selectedDestinationId = "dcache";
@ViewChild('egiTransferModal') egiTransferModal;
APIURL = properties.eoscDataTransferAPI;
status: "loading" | "success" | "errorParser" | "errorUser" | "errorTransfer" | "init" | "canceled" = "init";
@@ -82,15 +82,24 @@ export class EGIDataTransferComponent {
open(){
this.accessToken = COOKIE.getCookie("EGIAccessToken");
if(this.accessToken) {
- if (this.selectedDestinationId) {
- for (let option of this.destinationOptions) {
- if (this.selectedDestinationId == option.value.destination) {
- this.selectedDestination = option.value;
- }
+ // if (this.selectedDestinationId) {
+ // for (let option of this.destinationOptions) {
+ // if (this.selectedDestinationId == option.value.destination) {
+ // this.selectedDestination = option.value;
+ // }
+ // }
+ // } else {
+ // this.selectedDestination = this.destinationOptions[0].value;
+ // }
+
+ let headers = new HttpHeaders({'Authorization': 'Bearer '+this.accessToken});
+ this.subscriptions.push(this.http.get(this.APIURL + "/storage/types", {headers: headers}).subscribe(
+ (res: Array
) => {
+ this.destinationOptions = res.map(dest => {return {"label": dest.destination, "value": dest}});
+ this.selectedDestination = res[0];
}
- } else {
- this.selectedDestination = this.destinationOptions[0].value;
- }
+ ));
+
for (let doi of this.dois) {
this.sourceUrls.push(this.doiPrefix + doi);
@@ -129,7 +138,7 @@ export class EGIDataTransferComponent {
}
init(){
this.destinationPath = "";
- this.selectedDestination = this.destinationOptions[0].value;
+ // this.selectedDestination = this.destinationOptions[0].value;
this.selectedSourceUrl = this.sourceUrls[0];
this.message = null;
this.status = "init";