2017-11-16 18:07:27 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
|
|
import { ServerService } from '../../app/services/server.service';
|
2017-12-15 12:52:11 +01:00
|
|
|
import { DashboardService } from '../../app/services/dashboard/dashboard.service';
|
|
|
|
import { DashboardStatisticsModel } from '../models/dashboard/DashboardStatisticsModel';
|
|
|
|
import { JsonSerializer } from '../utilities/JsonSerializer';
|
2017-12-15 16:33:18 +01:00
|
|
|
import { DatasetListingComponent } from '../../app/datasets_new/dataset-listing.component';
|
2017-11-16 15:27:40 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'homepage',
|
|
|
|
templateUrl: './homepage.component.html',
|
|
|
|
styleUrls: ['./homepage.component.css'],
|
|
|
|
providers: []
|
|
|
|
})
|
2017-11-16 18:07:27 +01:00
|
|
|
export class HomepageComponent implements OnInit{
|
|
|
|
|
|
|
|
private userInfo: any;
|
2017-12-15 12:52:11 +01:00
|
|
|
private dashboardStatisticsData:DashboardStatisticsModel = new DashboardStatisticsModel();
|
|
|
|
|
|
|
|
constructor(private serverService: ServerService, private route: ActivatedRoute, private router: Router, private dashBoardService: DashboardService){
|
|
|
|
this.dashboardStatisticsData.totalDataManagementPlanCount = 0;
|
|
|
|
this.dashboardStatisticsData.totalDataSetCount = 0;
|
|
|
|
this.dashboardStatisticsData.totalProjectCount = 0;
|
2017-11-16 18:07:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-19 09:39:21 +01:00
|
|
|
ngOnInit() {
|
2017-12-15 12:52:11 +01:00
|
|
|
|
2017-12-18 14:24:10 +01:00
|
|
|
this.dashBoardService.getStatistics().subscribe(results =>{
|
2017-12-19 09:20:35 +01:00
|
|
|
//let data = results['payload'];
|
|
|
|
this.dashboardStatisticsData = new JsonSerializer<DashboardStatisticsModel>().fromJSONObject(results,DashboardStatisticsModel);
|
2017-12-15 12:52:11 +01:00
|
|
|
})
|
2017-11-16 18:07:27 +01:00
|
|
|
|
2017-12-14 17:43:57 +01:00
|
|
|
}
|
2017-11-16 18:07:27 +01:00
|
|
|
|
|
|
|
}
|