Reflect last commit changes to web

This commit is contained in:
simon987 2019-02-16 19:54:23 -05:00
parent 71e05ecdd6
commit 16ffeb30f9
10 changed files with 20 additions and 19 deletions

View File

@ -17,8 +17,8 @@ export class AuthService {
private router: Router) {
this.apiService.getAccountDetails()
.subscribe((data: any) => {
this.account = data.manager;
this.logged = data.logged_in;
this.account = data.content.manager;
this.logged = data.content.logged_in;
})
}
@ -28,7 +28,7 @@ export class AuthService {
() => {
this.apiService.getAccountDetails()
.subscribe((data: any) => {
this.account = data.manager;
this.account = data.content.manager;
this.logged = true;
this.router.navigateByUrl("/account");
})
@ -61,7 +61,7 @@ export class AuthService {
this.apiService.getAccountDetails()
.subscribe((data: any) => {
this.logged = true;
this.account = data.manager;
this.account = data.content.manager;
this.router.navigateByUrl("/account");
}),
error => {

View File

@ -38,7 +38,7 @@ export class CreateProjectComponent implements OnInit {
this.apiService.createProject(this.project).subscribe(
data => {
this.router.navigateByUrl("/project/" + data["id"]);
this.router.navigateByUrl("/project/" + data["content"]["id"]);
},
error => {
console.log(error.error.message);

View File

@ -46,7 +46,7 @@ export class LogsComponent implements OnInit {
private getLogs(level: number) {
this.apiService.getLogs(level).subscribe(
data => {
this.data.data = _.map(data["logs"], (entry) => {
this.data.data = _.map(data["content"]["logs"], (entry) => {
return <LogEntry>{
message: entry.message,
timestamp: moment.unix(entry.timestamp).format("YYYY-MM-DD HH:mm:ss"),

View File

@ -57,7 +57,7 @@ export class ManagerListComponent implements OnInit {
private getManagers() {
this.apiService.getAllManagers()
.subscribe(data => {
this.data.data = data["managers"]
this.data.data = data["content"]["managers"]
},
error => {
if (error && (error.status == 401 || error.status == 403)) {

View File

@ -61,7 +61,7 @@ export class ProjectDashboardComponent implements OnInit {
this.apiService.getMonitoringSnapshots(60, this.projectId)
.subscribe((data: any) => {
this.snapshots = data.snapshots;
this.snapshots = data.content.snapshots;
this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => {
return b.time_stamp - a.time_stamp
})[0] : null;
@ -99,7 +99,7 @@ export class ProjectDashboardComponent implements OnInit {
this.apiService.getAssigneeStats(this.projectId)
.subscribe((data: any) => {
this.assignees = data.assignees;
this.assignees = data.content.assignees;
let colors = this.assignees.map(() => {
return this.colors.random[Math.floor(Math.random() * this.colors.random.length)]
});
@ -305,11 +305,11 @@ export class ProjectDashboardComponent implements OnInit {
private getProject() {
this.apiService.getProject(this.projectId).subscribe((data: any) => {
this.project = data.project;
this.project = data.content.project;
this.apiService.getMonitoringSnapshots(60, this.projectId)
.subscribe((data: any) => {
this.snapshots = data.snapshots;
this.snapshots = data.content.snapshots;
this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => {
return b.time_stamp - a.time_stamp
})[0] : null;
@ -323,7 +323,7 @@ export class ProjectDashboardComponent implements OnInit {
this.apiService.getAssigneeStats(this.projectId)
.subscribe((data: any) => {
this.assignees = data.assignees;
this.assignees = data.content.assignees;
this.setupAssigneesPie();
});
})

View File

@ -25,7 +25,8 @@ export class ProjectListComponent implements OnInit {
}
getProjects() {
this.apiService.getProjects().subscribe(data => this.projects = data["projects"]);
this.apiService.getProjects().subscribe(data =>
this.projects = data["content"]["projects"]);
}
}

View File

@ -48,14 +48,14 @@ export class ProjectPermsComponent implements OnInit {
private getProject() {
this.apiService.getProject(this.projectId).subscribe(data => {
this.project = data["project"]
this.project = data["content"]["project"]
})
}
private getProjectAccesses() {
this.apiService.getProjectAccess(this.projectId).subscribe(
data => {
this.accesses = data["accesses"]
this.accesses = data["content"]["accesses"]
},
error => {
if (error && (error.status == 401 || error.status == 403)) {

View File

@ -22,7 +22,7 @@ export class ProjectSelectComponent implements OnInit {
loadProjectList() {
this.apiService.getProjects().subscribe(data => {
this.projectList = data["projects"]
this.projectList = data["content"]["projects"]
})
}
}

View File

@ -30,7 +30,7 @@ export class UpdateProjectComponent implements OnInit {
private getProject() {
this.apiService.getProject(this.projectId).subscribe(data => {
this.project = data["project"];
this.project = data["content"]["project"];
this.selectedProject = <Project>{id: this.project.chain}
})
}

View File

@ -22,8 +22,8 @@ export class WorkerDashboardComponent implements OnInit {
public refresh() {
this.apiService.getWorkerStats()
.subscribe((data: any) => {
this.updateChart(data.stats)
.subscribe(data => {
this.updateChart(data["content"]["stats"])
}
)
}