Commit 75e68ddd authored by Jie Yuan's avatar Jie Yuan
Browse files

make table component clickable everywhere

parent 3c3d52ce
......@@ -81,17 +81,17 @@
<tbody>
<tr *ngFor="let serverData of activeServerList">
<td >{{serverData.siteName}}</td>
<td (click)=onClick(serverData) >{{serverData.siteName}}</td>
<!--<td >{{serverData.siteUrl}}</td>--->
<td >{{serverData.siteCountry}}</td>
<td >{{serverData.siteUrl}}</td>
<td (click)=onClick(serverData) >{{serverData.siteCountry}}</td>
<td (click)=onClick(serverData) >{{serverData.siteUrl}}</td>
<td ><button *ngIf="serverData.siteNoOfHosts > 0" type="button" class="btn-xs" (click)="onHostsSelected(serverData)">
{{serverData.siteNoOfHosts}}
</button></td>
<td > {{serverData.siteNoOfServices}} </td>
<td> {{serverData.lastUpdateOn}} </td>
<td (click)=onClick(serverData) > {{serverData.siteNoOfServices}} </td>
<td (click)=onClick(serverData) > {{serverData.lastUpdateOn}} </td>
</tbody>
</table>
......
......@@ -369,6 +369,21 @@ public dynamicSortWithBlankStrings( property: string, sortAsc?: boolean) {
};
}
onClick(serverData: SiteShort) {
console.log('click on table');
this.siteService.getASite(serverData.siteName)
.then(
(asite: Site) => {
sessionStorage.setItem('currentSelectedSite', JSON.stringify(asite) );
this.router.navigate(['/dashboard/site'], { relativeTo: this.route });
}
).catch(
error => {
console.log('Error while loading sites ');
console.log(error);
}
);
}
private sortDscBySiteName() {
......
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