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