-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from cvazquezlos/dev
Dev
- Loading branch information
Showing
34 changed files
with
577 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, OnDestroy} from '@angular/core'; | ||
|
||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: 'app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
export class AppComponent implements OnDestroy { | ||
|
||
constructor() { | ||
localStorage.clear(); | ||
} | ||
|
||
ngOnDestroy() { | ||
console.log('Killing proccesses...'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
<div class="wrapper"> | ||
<app-admin-header></app-admin-header> | ||
|
||
<app-admin-sidebar></app-admin-sidebar> | ||
|
||
<div class="content-wrapper"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
|
||
<footer class="main-footer "> | ||
<footer class="main-footer"> | ||
<strong>Copyright © 2017 <a href="/">BREMS</a>.</strong> Todos los derechos reservados. | ||
</footer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
import {SessionService} from '../../service/session.service'; | ||
import {UserService} from '../../service/user.service'; | ||
|
||
@Component({ | ||
templateUrl: './admin.component.html' | ||
}) | ||
export class AdminComponent { | ||
export class AdminComponent implements OnInit { | ||
|
||
constructor(private sessionService: SessionService) { | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
25 changes: 0 additions & 25 deletions
25
frontend/src/app/component/admin/dashboard/dashboard.component.spec.ts
This file was deleted.
Oops, something went wrong.
11 changes: 8 additions & 3 deletions
11
frontend/src/app/component/admin/dashboard/dashboard.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import {Router} from '@angular/router'; | ||
|
||
import {SessionService} from '../../../service/session.service'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.css'] | ||
templateUrl: 'dashboard.component.html' | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
constructor(private router: Router, private sessionService: SessionService) { } | ||
|
||
ngOnInit() { | ||
if (!this.sessionService.checkCredentials()) { | ||
this.router.navigate(["/login"]); | ||
} | ||
} | ||
|
||
} |
35 changes: 0 additions & 35 deletions
35
frontend/src/app/component/admin/header/header.component.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
frontend/src/app/component/admin/header/header.component.spec.ts
This file was deleted.
Oops, something went wrong.
28 changes: 23 additions & 5 deletions
28
frontend/src/app/component/admin/header/header.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import {IMG_URL} from "../../../util"; | ||
import {DomSanitizer} from '@angular/platform-browser'; | ||
import {ADMIN_IMG_URL} from '../../../util'; | ||
|
||
import {User} from '../../../model/user.model'; | ||
|
||
import {FileService} from '../../../service/file.service'; | ||
import {UserService} from '../../../service/user.service'; | ||
|
||
@Component({ | ||
selector: 'app-admin-header', | ||
templateUrl: 'header.component.html', | ||
styleUrls: ['header.component.css'] | ||
templateUrl: 'header.component.html' | ||
}) | ||
export class HeaderComponent implements OnInit { | ||
|
||
public imgLogo = IMG_URL + "logo.png"; | ||
imgLogo = ADMIN_IMG_URL + 'logo.png'; | ||
user: User; | ||
userImage: any; | ||
|
||
constructor() { } | ||
constructor(private fileService: FileService, private sanitizer: DomSanitizer, private userService: UserService) { } | ||
|
||
ngOnInit() { | ||
console.log(Number(localStorage.getItem('id'))); | ||
this.userService.getUser(Number(localStorage.getItem('id'))).subscribe( | ||
user => this.user = user, | ||
error => console.log("Fail trying to get user information.") | ||
); | ||
this.fileService.getUserFile(Number(localStorage.getItem('id'))).subscribe( | ||
data => { | ||
let dataRecieved: string[] = data.split('"'); | ||
this.userImage = 'data:image/png;base64,' + dataRecieved[3]; | ||
}, | ||
error => console.log("Fail trying to charge " + this.user.name + " image.") | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.