fixed management page

This commit is contained in:
grata
2023-04-28 13:42:43 +02:00
parent f9774055ad
commit 9c29285216
3 changed files with 14 additions and 8 deletions

View File

@@ -36,7 +36,7 @@
<input type="text" id="name" name="name" [(ngModel)]="newUser.name">
</div>
<div>
<label for="username">Email:</label>
<label for="username">Username:</label>
<input type="text" id="username" name="username" [(ngModel)]="newUser.username">
</div>
<div>
@@ -135,32 +135,32 @@
<form (submit)="addWaypoint(newWaypoint.name, newWaypoint.lat, newWaypoint.lon, newWaypoint.description, newWaypoint.image, newWaypoint.locationName)">
<div>
<label for="waypointName">Waypoint:</label>
<input type="text" id="waypointName" name="waypointName" [(ngModel)]="newLocation.location">
<input type="text" id="waypointName" name="waypointName" [(ngModel)]="newWaypoint.name">
</div>
<div>
<label for="waypointLat">Latitude:</label>
<input type="text" id="waypointLat" name="waypointLat" [(ngModel)]="newLocation.location">
<input type="text" id="waypointLat" name="waypointLat" [(ngModel)]="newWaypoint.lat">
</div>
<div>
<label for="waypointLon">Longitude:</label>
<input type="text" id="waypointLon" name="waypointLon" [(ngModel)]="newLocation.location">
<input type="text" id="waypointLon" name="waypointLon" [(ngModel)]="newWaypoint.lon">
</div>
<div>
<label for="description">Description:</label>
<input type="text" id="description" name="description" [(ngModel)]="newLocation.location">
<input type="text" id="description" name="description" [(ngModel)]="newWaypoint.description">
</div>
<div>
<label for="image">Image (Base64):</label>
<input type="text" id="image" name="image" [(ngModel)]="newLocation.location">
<input type="text" id="image" name="image" [(ngModel)]="newWaypoint.image">
</div>
<div>
<label for="locationName">Location Name:</label>
<select [(ngModel)]="newWaypoint.locationName" id="locationName">
<select [(ngModel)]="newWaypoint.locationName" id="locationName" name="locationName">
<option *ngFor="let location of locationList" [value]="location.location">{{ location.location }}</option>
</select>
</div>

View File

@@ -79,18 +79,24 @@ export class ManagementComponent implements OnInit, AfterViewInit, OnDestroy {
const newUser: User = {id, name, username: username, password: password};
this.userList.push(newUser);
this.showUserForm = false;
this.newUser = {id: 0, name: '', username: '', password: ''};
}
addLocation(name: string, region: string, lat: string, lon: string) {
const id = this.locationList.length + 1;
const newLocation: Location = {id, location: name, region: region, lat: lat, lon: lon};
this.locationList.push(newLocation);
this.showLocationForm = false;
this.newLocation = {id: 0, location: '', region: '', lat: '', lon: ''};
}
addWaypoint(name: string, lat: string, lon: string, description: string, image: string, locationName: string) {
console.log(locationName)
const id = this.waypointList.length + 1;
const newWaypoint: Waypoint = {id, name, lat: lat, lon: lon, description: description, image: image, locationName: locationName};
this.waypointList.push(newWaypoint);
this.showWaypointForm = false;
this.newWaypoint = {id: 0, name: '', lat: '', lon: '', description: '', image: '', locationName: ''};
}
openUserForm() {

View File

@@ -4,5 +4,5 @@
@tailwind utilities;
body{
overflow-y: hidden;
}