Skip to content

Commit

Permalink
Improved data sheet
Browse files Browse the repository at this point in the history
AaronClaydon committed Nov 7, 2024
1 parent d0ec363 commit 68b04ad
Showing 2 changed files with 25 additions and 12 deletions.
29 changes: 18 additions & 11 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -27,22 +27,28 @@

<div class="sm:grid sm:h-32 sm:grid-flow-row sm:gap-3 sm:grid-cols-3 mt-2">
<Stat-Card
title="Realtime Trips Currently Tracked" :value="this.stats?.ActiveRealtimeJourneys.Current.toLocaleString('en', {useGrouping:true})"
@click="openVehicleTrackInfoSheet()"
title="Realtime Trips Currently Tracked" :value="this.stats?.realtimejourneys.stats.current.toLocaleString('en', {useGrouping:true})"
@click="openDetailedStatsSheet('realtimejourneys')"
/>
<Stat-Card
class="mt-2 sm:mt-0" title="Stops" :value="this.stats?.stops.stats.total.toLocaleString('en', {useGrouping:true})"
@click="openDetailedStatsSheet('stops')"
/>
<Stat-Card
class="mt-2 sm:mt-0" title="Services" :value="this.stats?.services.stats.total.toLocaleString('en', {useGrouping:true})"
@click="openDetailedStatsSheet('services')"
/>
<Stat-Card class="mt-2 sm:mt-0" title="Stops" :value="this.stats?.Stops.toLocaleString('en', {useGrouping:true})" />
<Stat-Card class="mt-2 sm:mt-0" title="Services" :value="this.stats?.Services.toLocaleString('en', {useGrouping:true})" />
</div>

<vue-bottom-sheet ref="vehiclesTrackedInfoSheet" maxHeight="380" class="relative">
<vue-bottom-sheet ref="detailedStatsSheet" maxHeight="380" class="relative">
<div v-if="true" class="px-4" style="min-height: 380px">
<PageTitle paddingStyle="pb-1">Transport Types</PageTitle>
<div v-for="(count, mode) in this.stats?.ActiveRealtimeJourneys?.TransportTypes">
<div v-for="(count, mode) in this.stats?.[this.detailedStatsSheetContent].stats.transporttypes">
{{ mode }} - {{ count }}
</div>

<PageTitle paddingStyle="py-1">Datasources</PageTitle>
<div v-for="(count, datasource) in this.stats?.ActiveRealtimeJourneys?.Datasources">
<div v-for="(count, datasource) in this.stats?.[this.detailedStatsSheetContent].stats.datasources">
{{ datasource }} - {{ count }}
</div>
</div>
@@ -74,18 +80,19 @@ export default {
data () {
return {
stats: undefined,
detailedStatsSheetContent: 'realtimejourneys',
refreshTimer: undefined
}
},
methods: {
openVehicleTrackInfoSheet() {
console.log("CUM")
this.$refs.vehiclesTrackedInfoSheet.open()
openDetailedStatsSheet(viewName) {
this.detailedStatsSheetContent = viewName
this.$refs.detailedStatsSheet.open()
},
getStats() {
axios
.get(`${API.URL}/core/stats`)
.get(`${API.URL}/stats/calculated`)
.then(response => {
this.stats = response.data
})
8 changes: 7 additions & 1 deletion src/views/Journeys/View.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,13 @@
<div v-if="loadingJourney">Loading...</div>
<div v-else class="h-full">
<h1 class="py-2 text-xl font-medium leading-tight text-gray-900 dark:text-gray-200">
<DepartureTypeIcon :journey="journey"/> {{ journey.DestinationDisplay }}
<DepartureTypeIcon :journey="journey"/>
<span v-if="journey.DestinationDisplay != ''" class="pl-1">
{{ journey.DestinationDisplay }}
</span>
<span v-else class="pl-1">
{{ this.journeyPoints[this.journeyPoints.length-1].stop.PrimaryName }}
</span>
</h1>

<div>

0 comments on commit 68b04ad

Please sign in to comment.