refactor: 🎨

This commit is contained in:
steev 2025-01-09 02:07:48 +01:00
parent 5381a78d4a
commit d2baaacbc8
3 changed files with 43 additions and 16 deletions

View File

@ -119,7 +119,7 @@ class GPXHandler:
def getTracksInTime(self, start, end): def getTracksInTime(self, start, end):
tracks = self.__dbSession.query(Track).filter(Track.start.between(start, end)).all() tracks = self.__dbSession.query(Track).filter(Track.date.between(start, end)).all()
track_list = [ track_list = [
{ {

View File

@ -58,14 +58,37 @@ export default defineComponent({
<template> <template>
<!-- Das ref-Attribut gibt den Container für die Karte an --> <!-- Das ref-Attribut gibt den Container für die Karte an -->
<div ref="mapDiv" style="width: 100vw; height: 80vh; overflow: hidden;"></div> <div ref="mapDiv" style="width: 70vw; height: 75vh; overflow: hidden;"></div>
<br>
<div class="overflow-x-auto" style="width: 70vw;">
<table class="table">
<!-- head -->
<thead>
<tr>
<th>track name</th>
<th>driver</th>
<th>vehicle</th>
<th>distance Color</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
<tr class="bg-base-200">
<th>1</th>
<td>Cy Ganderton</td>
<td>Quality Control Specialist</td>
<td>Blue</td>
</tr>
</tbody>
</table>
</div>
</template> </template>
<style scoped> <style scoped>
/* Verhindert, dass die Karte über den Bildschirm hinausgeht */ /* Verhindert, dass die Karte über den Bildschirm hinausgeht */
#mapDiv { #mapDiv {
width: 100vw; /* Volle Breite des Viewports */ width: 100vw; /* Volle Breite des Viewports */
height: 80vh; /* Volle Höhe des Viewports */ height: 70vh; /* Volle Höhe des Viewports */
margin: 0; /* Keine Margen */ margin: 0; /* Keine Margen */
padding: 0; /* Keine Auffüllung */ padding: 0; /* Keine Auffüllung */
overflow: hidden; /* Verhindert ungewolltes Überlaufen */ overflow: hidden; /* Verhindert ungewolltes Überlaufen */

View File

@ -68,13 +68,7 @@ export default defineComponent({
if (response.ok) { if (response.ok) {
// Wenn die Antwort OK ist, die Daten verarbeiten // Wenn die Antwort OK ist, die Daten verarbeiten
mapData.value = await response.json(); mapData.value = await response.json();
console.log("GeoJSON-Daten erfolgreich geladen", mapData.value);
// Überprüfe, ob die Antwort die richtigen Daten enthält
if (mapData.value && mapData.value.features && mapData.value.features.length > 0) {
console.log("GeoJSON-Daten erfolgreich geladen", mapData.value);
} else {
console.log("Keine GeoJSON-Daten in der Antwort.");
}
} else { } else {
console.log(await response.text()); console.log(await response.text());
} }
@ -113,6 +107,11 @@ export default defineComponent({
headers.set('Content-Type', 'application/json') headers.set('Content-Type', 'application/json')
headers.set('Accept', 'application/json') headers.set('Accept', 'application/json')
showMap.value = false;
showCloud.value = true;
search.value = false;
showUpload.value = false;
const request: RequestInfo = new Request("http://localhost:5000/track?start=" + startSearchDate.value + "&end=" + endSearchDate.value, { const request: RequestInfo = new Request("http://localhost:5000/track?start=" + startSearchDate.value + "&end=" + endSearchDate.value, {
method: "GET", method: "GET",
headers: headers headers: headers
@ -176,19 +175,19 @@ export default defineComponent({
<li v-for="track in tracks"> <a v-on:click="loadTrack(track.id)"> {{ track.name }} </a> </li> <li v-for="track in tracks"> <a v-on:click="loadTrack(track.id)"> {{ track.name }} </a> </li>
</ul> </ul>
</div> </div>
<div style="width: 62%; margin-left: 30%;"> <div style="width: 70%; margin-left: 5%;">
<PointCloud v-if="showCloud && !search"></PointCloud> <PointCloud style="border-radius: 10px;" v-if="showCloud && !search"></PointCloud>
</div> </div>
<div v-if="!showMap && !showCloud && search" style="margin-left: 20%; display:flex;"> <div v-if="!showMap && !showCloud && search" style="margin-left: 20%; display:flex;">
<div> <div>
start time start time
<VueDatePicker v-model="startSearchDate"> Search From </VueDatePicker> <input class="datepicker" type="date" id="birthday" name="birthday" v-model="startSearchDate">
</div> </div>
<div style="margin-left: 5%;"> <div style="margin-left: 5%;">
end time end time
<VueDatePicker v-model="endSearchDate"> Search To </VueDatePicker> <input class="datepicker" type="date" id="birthday" name="birthday" v-model="endSearchDate">
</div> </div>
<button class="btn btn-success" v-on:click="" style="margin-left: 5%; height:60px; width:120px;">Search</button> <button v-on:click="searchTracks" class="btn btn-success" style="margin-left: 5%; height:60px; width:120px;">Search</button>
</div> </div>
<div v-if="showMap && !search && !showCloud"> <div v-if="showMap && !search && !showCloud">
<Map :geoJsonData="mapData" <Map :geoJsonData="mapData"
@ -197,4 +196,9 @@ export default defineComponent({
</div> </div>
</template> </template>
<style scoped></style> <style scoped>
input.datePicker {
padding: 5px;
border-radius: 5px;;
}
</style>