Commit e44a27a7 authored by Jie Yuan's avatar Jie Yuan
Browse files

add eosc sites to sidebar

parent 65582293
......@@ -57,6 +57,26 @@
</li>
<li class="collapsibleList" (click)="onEOSCListSelected()">
<div class="collapsible-header" data-toggle="collapse" data-target="#collapseEOSC" aria-expanded="true" aria-controls="collapseEOSC">
EOSC Sites
</div>
<div id="collapseEOSC" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<li class="bold serverItemList" *ngFor="let nameEOSC of nameListEOSC" routerLinkActive="active">
<a class="waves-effect waves-teal" (click)="onServerNameSelected(nameEOSC)">{{nameEOSC}}</a>
</li>
</div>
</div>
</li>
</ul>
</div>
......@@ -23,6 +23,7 @@ export class SidebarComponent implements OnInit, AfterViewInit , DoCheck {
serversListGOCDB: Site[];
nameListDPMT: string[];
nameListGOCDB: string[];
nameListEOSC: string[];
userLogged: boolean;
actions1 = new EventEmitter<string|MaterializeAction>();
......@@ -152,6 +153,25 @@ export class SidebarComponent implements OnInit, AfterViewInit , DoCheck {
console.log('from sidebar update ,authenticated');
}
/** Fetch all the servers from EOSC **/
const sessionData2 = sessionStorage.getItem('SiteNameListEOSC');
if ( sessionData2 !== null) {
const list = JSON.parse(sessionData2);
this.nameListEOSC = list;
} else {
this.siteService.getSiteNameListFromSource('eosc')
.then((nameList: string[]) => {
this.nameListEOSC = nameList;
}
).catch((error) => {
console.log('Loading server list from eosc: ', error);
this.nameListEOSC= [];
});
console.log('from sidebar update ,authenticated');
}
}
}
......@@ -250,6 +270,12 @@ export class SidebarComponent implements OnInit, AfterViewInit , DoCheck {
sessionStorage.setItem('currentSiteShortSource', 'all');
}
onEOSCListSelected(){
console.log('correct, eosc');
sessionStorage.setItem('currentSiteSource', 'eosc');
sessionStorage.setItem('currentSiteShortSource', 'eosc');
}
private _toggleOpened(): void {
this._opened = !this._opened;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment