From a468716e27d71c49457a48ef8416357ab0144ca7 Mon Sep 17 00:00:00 2001 From: bruno-roberto Date: Sun, 25 Sep 2022 23:11:28 -0300 Subject: [PATCH] Dash --- .../src/app/insight/insight.component.html | 29 +++++++------ .../main/src/app/insight/insight.component.ts | 43 ++++++++++++------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/frontend/main/src/app/insight/insight.component.html b/frontend/main/src/app/insight/insight.component.html index f84ef4b..936871e 100644 --- a/frontend/main/src/app/insight/insight.component.html +++ b/frontend/main/src/app/insight/insight.component.html @@ -3,13 +3,9 @@
-
- -

10

- - -

New Registers Packages

- +
+

New packages

+
@@ -22,14 +18,15 @@
-

+

12%

Bounce Rate

+
- More info + More info
@@ -37,8 +34,10 @@

12%

-

4

-

User Registrations

+ +

{{countClient}}

+

Registered Users

+
@@ -51,13 +50,13 @@

4

-

40

+

{{countVisitors/2}}

Visitors

- More info + More info
@@ -83,6 +82,7 @@

+
@@ -152,7 +152,8 @@

21 22 23 - 24 + 24 diff --git a/frontend/main/src/app/insight/insight.component.ts b/frontend/main/src/app/insight/insight.component.ts index c293e1d..25ce337 100644 --- a/frontend/main/src/app/insight/insight.component.ts +++ b/frontend/main/src/app/insight/insight.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { RctQtComponent } from '../rct-qt/rct-qt.component'; import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; @Component({ selector: 'app-insight', @@ -9,11 +10,31 @@ import { HttpClient } from '@angular/common/http'; styleUrls: ['./insight.component.css'] }) export class InsightComponent implements OnInit { - count: any; - constructor(private router:Router) { } + readonly TMSLoginAPI: string = "http://localhost:8080/user/countClients" + + readonly apiURL:string = "http://localhost:8080/user/countVisitors" + + countClient!: number + countVisitors!: number + + constructor(private router:Router, private http:HttpClient) { + + } ngOnInit(): void { + + this.http.get(this.TMSLoginAPI) + .subscribe((resultado:any) => { + this.countClient=resultado + }); + + this.http.get(this.apiURL) + .subscribe((resultado:any) => { + this.countVisitors=resultado + }); + + } register(){ @@ -24,21 +45,13 @@ export class InsightComponent implements OnInit { this.router.navigateByUrl('users') } + // countClients() { + // this.http.get(`${this.TMSLoginAPI}/countClients`).subscribe(resultado => console.log(resultado)); + // return ; - // public get countVisitors() : any { - // return this.countVisitors // } - - // contador(){ - // this.countVisitors - // console.log(this.countVisitors); - + // countVisitors(){ + // this.http.get(`${this.apiURL}/countVisitors`).subscribe(resultado => console.log(resultado)); // } - - - - - - }