Update: Docker dev + logout on frontend
This commit is contained in:
parent
03fbbb4114
commit
0d6fde6aba
4 changed files with 15 additions and 6 deletions
|
|
@ -57,9 +57,9 @@ services:
|
|||
frontend:
|
||||
container_name: frontend
|
||||
build: ./frontend
|
||||
command: ng serve --host 0.0.0.0
|
||||
command: npm start
|
||||
volumes:
|
||||
- ./frontend/src:/data/frontend/
|
||||
- ./frontend:/data/frontend
|
||||
- ./frontend/node_modules:/data/frontend/node_modules
|
||||
ports:
|
||||
- "4200:4200"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
FROM node:current-alpine
|
||||
FROM node:current-slim
|
||||
WORKDIR /data/frontend
|
||||
COPY ["package.json", "package-lock.json*", "./"]
|
||||
COPY . .
|
||||
RUN npm install --NODE_ENV
|
||||
RUN npm install -g @angular/cli
|
||||
COPY . .
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"start": "ng serve --host 0.0.0.0",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {ProfilService} from "../../services/profil/profil.service";
|
||||
import {MessageService} from "../../services/message/message.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
|
|
@ -10,14 +11,22 @@ export class NavbarComponent implements OnInit
|
|||
{
|
||||
@Input() pour = "login";
|
||||
|
||||
constructor(private profilService: ProfilService) { }
|
||||
constructor(private profilService: ProfilService, private messageService: MessageService) { }
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
onDeconnexion(): void
|
||||
{
|
||||
this.messageService
|
||||
.delete('logout')
|
||||
.subscribe(retour => this.onDeconnexionCallback(retour), err => this.onDeconnexionCallback(err));
|
||||
this.profilService.setId(-1);
|
||||
this.profilService.setIsAdmin(false);
|
||||
}
|
||||
|
||||
onDeconnexionCallback(retour: any): void
|
||||
{
|
||||
if(retour.status !== "success") console.log(retour);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue