Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/main/src/app/body/body.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<div class="media">
<div class="media-body">
<h3 class="dropdown-item-title">
Titulo
Relatório: Aniversantes do dia
<span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
</h3>
<p class="text-sm">Descrição</p>
<p class="text-sm">Parabéns:</p>
<p class="text-sm text-muted">
<i class="far fa-clock mr-1"></i> Quando...
<i class="far fa-clock mr-1" *ngFor="let aniversariante of birthnow; let i = index;">{{aniversariante}}</i>
</p>
</div>
</div>
Expand All @@ -34,12 +34,12 @@ <h3 class="dropdown-item-title">
<div class="media">
<div class="media-body">
<h3 class="dropdown-item-title">
Titulo
Relatório: Aniversariantes do mês
<span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
</h3>
<p class="text-sm">Descrição</p>
<p class="text-sm">{{birthmonth}}</p>
<p class="text-sm text-muted">
<i class="far fa-clock mr-1"></i> Quando...
<i class="far fa-clock mr-1"></i>
</p>
</div>
</div>
Expand Down
31 changes: 29 additions & 2 deletions frontend/main/src/app/body/body.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { LoginComponent } from '../login/login.component';
import { LoginserviceService } from '../loginservice.service';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';

@Component({
selector: 'app-body',
Expand All @@ -9,11 +12,31 @@ import { LoginserviceService } from '../loginservice.service';
})
export class BodyComponent implements OnInit {

constructor(public loginService:LoginserviceService) { }
readonly APIBirthNow: string = "http://localhost:8080/user/birthnow"

readonly APIBirthMonth: string = "http://localhost:8080/user/birthmonth"

birthnow! : string
birthmonth! : string
aniversariantes!: Array<any>
id!: number
nome!: string
email!: string
birth!: Date
document!: string

constructor(public loginService:LoginserviceService, private router:Router, private http:HttpClient) { }

ngOnInit(): void {
this.http.get(this.APIBirthNow)
.subscribe((resultado:any) => {
this.birthnow = resultado
});


this.http.get(this.APIBirthMonth)
.subscribe((resultado:any) => {
this.birthmonth=resultado
});

}

Expand All @@ -23,4 +46,8 @@ export class BodyComponent implements OnInit {

}

aniversariante(){
this.aniversariantes.push ({id: this.id ,nome: this.nome, email: this.email, birth: this.birth, document: this.document})
}

}
3 changes: 2 additions & 1 deletion frontend/main/src/app/insight/insight.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h3>{{countPackages}}</h3>

<div class="small-box bg-gradient-yellow">
<div class="inner">
<h3>12<sup style="font-size: 20px">%</sup></h3>
<h3>{{countBounce}}<sup style="font-size: 20px">%</sup></h3>
<p>Bounce Rate</p>

</div>
Expand Down Expand Up @@ -288,3 +288,4 @@ <h3 class="card-title">
</div>

</div>

17 changes: 9 additions & 8 deletions frontend/main/src/app/insight/insight.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ export class InsightComponent implements OnInit {
readonly APICountVisits:string = "http://localhost:8080/user/countVisitors"

readonly APICountPackages:string = "http://localhost:8080/quote/go"

readonly APICountBounce:string = "http://localhost:8080/user/bounce"

countClient!: number
countVisitors!: number
countPackages!:number
countBounce!:number

constructor(private router:Router, private http:HttpClient) {

Expand All @@ -42,6 +45,12 @@ export class InsightComponent implements OnInit {
this.countPackages=response
})

this.http.get(this.APICountBounce)
.subscribe((response:any)=>{
this.countBounce=response
})


}

register(){
Expand All @@ -52,13 +61,5 @@ export class InsightComponent implements OnInit {
this.router.navigateByUrl('users')
}

// countClients() {
// this.http.get(`${this.TMSLoginAPI}/countClients`).subscribe(resultado => console.log(resultado));
// return ;

// }
// countVisitors(){
// this.http.get(`${this.apiURL}/countVisitors`).subscribe(resultado => console.log(resultado));
// }

}