changes
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {CookieService} from "ngx-cookie-service";
|
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {homeTranslations, listTranslations, managementTranslations} from "./interface/translations";
|
import {homeTranslations, listTranslations, managementTranslations} from "./interface/translations";
|
||||||
import {TranslateService} from "./service/language/translate.service";
|
import {TranslateService} from "./service/language/translate.service";
|
||||||
import {ReadTranslateJsonService} from "./service/language/readTranslateJson.service";
|
import {ReadTranslateJsonService} from "./service/language/readTranslateJson.service";
|
||||||
|
import {cookieService} from "./service/cookie.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.css']
|
styleUrls: ['./app.component.css']
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit{
|
export class AppComponent implements OnInit {
|
||||||
title = 'm-152';
|
title = 'm-152';
|
||||||
|
|
||||||
homeTranslations: homeTranslations = {} as homeTranslations;
|
homeTranslations: homeTranslations = {} as homeTranslations;
|
||||||
@@ -19,7 +19,7 @@ export class AppComponent implements OnInit{
|
|||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private cookieService: CookieService,
|
private cookieService: cookieService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private readTranslationJsonService: ReadTranslateJsonService,
|
private readTranslationJsonService: ReadTranslateJsonService,
|
||||||
@@ -33,10 +33,7 @@ export class AppComponent implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearAllCookies() {
|
clearAllCookies() {
|
||||||
const allCookies = this.cookieService.getAll();
|
this.cookieService.deleteUsername();
|
||||||
for (const cookieName in allCookies) {
|
|
||||||
this.cookieService.delete(cookieName);
|
|
||||||
}
|
|
||||||
this.router.navigate(['/login']);
|
this.router.navigate(['/login']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<th>{{ translations.username }}</th>
|
<th>{{ translations.username }}</th>
|
||||||
<th>{{translations.password}}</th>
|
<th>{{translations.password}}</th>
|
||||||
<th>admin</th>
|
<th>admin</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
<td>{{ user.password }}</td>
|
<td>{{ user.password }}</td>
|
||||||
<td *ngIf="user.admin==false">No</td>
|
<td *ngIf="user.admin==false">No</td>
|
||||||
<td *ngIf="user.admin==true">Yes</td>
|
<td *ngIf="user.admin==true">Yes</td>
|
||||||
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -97,6 +97,24 @@ export class ManagementComponent implements OnInit {
|
|||||||
this.showWaypointForm = false;
|
this.showWaypointForm = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteLocation(id: number) {
|
||||||
|
this.locationService.deleteLocation(id).subscribe(location => {
|
||||||
|
this.locations?.splice(this.locations?.indexOf(location), 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteWaypoint(id: number) {
|
||||||
|
this.waypointService.deleteWaypoint(id).subscribe(waypoint => {
|
||||||
|
this.waypoints?.splice(this.waypoints?.indexOf(waypoint), 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteUser(id: number) {
|
||||||
|
this.userService.deleteUser(id).subscribe(user => {
|
||||||
|
this.users?.splice(this.users?.indexOf(user), 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
openUserForm() {
|
openUserForm() {
|
||||||
this.showUserForm = true;
|
this.showUserForm = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user