{% extends 'base.html.twig' %} {% import 'components/datalogger_tabs.html.twig' as tabs %} {% block title %}Trips - Dashboard{% endblock %} {% block content %} {% if datalogger is defined %} {{ tabs.renderTabs(datalogger, app.request.attributes.get('_route')) }} {% endif %}
{% if statistics and (statistics.error is not defined) %}

Trip-Statistiken (letzte {{ hours }} Stunden)

{% set totalTrips = statistics.total_trips ?? statistics.trip_count ?? (trips is iterable ? trips|length : null) %} {% set avgSpeed = statistics.avg_speed_kmh ?? statistics.avg_speed_simple_kmh ?? null %} {% set maxSpeed = statistics.max_speed_kmh ?? null %} {% set totalDistance = statistics.total_distance_km ?? statistics.avg_trip_distance_km ?? null %} {% set avgDurationMin = statistics.avg_trip_duration_minutes ?? statistics.duration_minutes ?? null %} {% set totalDurationH = statistics.total_duration_hours ?? null %} {% if totalTrips is not null %}
{{ totalTrips }} Anzahl Trips
{% endif %} {% if avgSpeed is not null %}
{{ avgSpeed|number_format(1) }} km/h Ø Geschwindigkeit
{% endif %} {% if maxSpeed is not null %}
{{ maxSpeed|number_format(1) }} km/h Max. Geschwindigkeit
{% endif %} {% if totalDistance is not null %}
{{ totalDistance|number_format(2) }} km Distanz
{% endif %} {% if avgDurationMin is not null %}
{{ avgDurationMin|number_format(1) }} min Ø Trip-Dauer
{% endif %} {% if totalDurationH is not null %}
{{ totalDurationH|number_format(2) }} h Gesamtdauer
{% endif %}
{% endif %}

Trip-Liste (letzte {{ hours }} Stunden, max. {{ limit }})

{% if trips.error is defined %}
Fehler: {{ trips.error }}
{% elseif trips is iterable and trips|length > 0 %}
{% for trip in trips %}
Trip #{{ trip.id ?? trip.trip_id ?? 'N/A' }}
{% set tripId = trip.id ?? trip.trip_id ?? null %} {% if tripId %} Details {% endif %}
Start {% set startTime = trip.start_datetime ?? trip.start_time ?? trip.start ?? '-' %} {% if startTime is iterable and startTime is not same as('') and startTime is not same as([]) %} {{ startTime|json_encode }} {% elseif startTime is not iterable and startTime matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ startTime|round|date('d.m.Y H:i:s') }} {% else %} {{ startTime }} {% endif %}
Ende {% set endTime = trip.end_datetime ?? trip.end_time ?? trip.end ?? '-' %} {% if endTime is iterable and endTime is not same as('') and endTime is not same as([]) %} {{ endTime|json_encode }} {% elseif endTime is not iterable and endTime matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ endTime|round|date('d.m.Y H:i:s') }} {% else %} {{ endTime }} {% endif %}
Dauer {% set duration = trip.duration_minutes ?? trip.duration ?? '-' %} {% if duration is iterable and duration is not same as('') and duration is not same as([]) %} {{ duration|json_encode }} {% elseif duration is not iterable and duration matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ duration|number_format(1) }} min {% else %} {{ duration }} {% endif %}
Distanz {% set distance = trip.total_distance_km ?? trip.distance ?? '-' %} {% if distance is iterable and distance is not same as('') and distance is not same as([]) %} {{ distance|json_encode }} {% elseif distance is not iterable and distance matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ distance|number_format(2) }} km {% else %} {{ distance }} {% endif %}
{% endfor %}
{% else %}

Keine Trips verfügbar

{% endif %}
{% endblock %} {% block javascripts %} {% endblock %}