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

View File

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

View File

@ -46,7 +46,7 @@ export class LogsComponent implements OnInit {
private getLogs(level: number) { private getLogs(level: number) {
this.apiService.getLogs(level).subscribe( this.apiService.getLogs(level).subscribe(
data => { data => {
this.data.data = _.map(data["logs"], (entry) => { this.data.data = _.map(data["content"]["logs"], (entry) => {
return <LogEntry>{ return <LogEntry>{
message: entry.message, message: entry.message,
timestamp: moment.unix(entry.timestamp).format("YYYY-MM-DD HH:mm:ss"), 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() { private getManagers() {
this.apiService.getAllManagers() this.apiService.getAllManagers()
.subscribe(data => { .subscribe(data => {
this.data.data = data["managers"] this.data.data = data["content"]["managers"]
}, },
error => { error => {
if (error && (error.status == 401 || error.status == 403)) { 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) this.apiService.getMonitoringSnapshots(60, this.projectId)
.subscribe((data: any) => { .subscribe((data: any) => {
this.snapshots = data.snapshots; this.snapshots = data.content.snapshots;
this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => { this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => {
return b.time_stamp - a.time_stamp return b.time_stamp - a.time_stamp
})[0] : null; })[0] : null;
@ -99,7 +99,7 @@ export class ProjectDashboardComponent implements OnInit {
this.apiService.getAssigneeStats(this.projectId) this.apiService.getAssigneeStats(this.projectId)
.subscribe((data: any) => { .subscribe((data: any) => {
this.assignees = data.assignees; this.assignees = data.content.assignees;
let colors = this.assignees.map(() => { let colors = this.assignees.map(() => {
return this.colors.random[Math.floor(Math.random() * this.colors.random.length)] return this.colors.random[Math.floor(Math.random() * this.colors.random.length)]
}); });
@ -305,11 +305,11 @@ export class ProjectDashboardComponent implements OnInit {
private getProject() { private getProject() {
this.apiService.getProject(this.projectId).subscribe((data: any) => { this.apiService.getProject(this.projectId).subscribe((data: any) => {
this.project = data.project; this.project = data.content.project;
this.apiService.getMonitoringSnapshots(60, this.projectId) this.apiService.getMonitoringSnapshots(60, this.projectId)
.subscribe((data: any) => { .subscribe((data: any) => {
this.snapshots = data.snapshots; this.snapshots = data.content.snapshots;
this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => { this.lastSnapshot = this.snapshots ? this.snapshots.sort((a, b) => {
return b.time_stamp - a.time_stamp return b.time_stamp - a.time_stamp
})[0] : null; })[0] : null;
@ -323,7 +323,7 @@ export class ProjectDashboardComponent implements OnInit {
this.apiService.getAssigneeStats(this.projectId) this.apiService.getAssigneeStats(this.projectId)
.subscribe((data: any) => { .subscribe((data: any) => {
this.assignees = data.assignees; this.assignees = data.content.assignees;
this.setupAssigneesPie(); this.setupAssigneesPie();
}); });
}) })

View File

@ -25,7 +25,8 @@ export class ProjectListComponent implements OnInit {
} }
getProjects() { 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() { private getProject() {
this.apiService.getProject(this.projectId).subscribe(data => { this.apiService.getProject(this.projectId).subscribe(data => {
this.project = data["project"] this.project = data["content"]["project"]
}) })
} }
private getProjectAccesses() { private getProjectAccesses() {
this.apiService.getProjectAccess(this.projectId).subscribe( this.apiService.getProjectAccess(this.projectId).subscribe(
data => { data => {
this.accesses = data["accesses"] this.accesses = data["content"]["accesses"]
}, },
error => { error => {
if (error && (error.status == 401 || error.status == 403)) { if (error && (error.status == 401 || error.status == 403)) {

View File

@ -22,7 +22,7 @@ export class ProjectSelectComponent implements OnInit {
loadProjectList() { loadProjectList() {
this.apiService.getProjects().subscribe(data => { 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() { private getProject() {
this.apiService.getProject(this.projectId).subscribe(data => { this.apiService.getProject(this.projectId).subscribe(data => {
this.project = data["project"]; this.project = data["content"]["project"];
this.selectedProject = <Project>{id: this.project.chain} this.selectedProject = <Project>{id: this.project.chain}
}) })
} }

View File

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