chore: build and UI fixes

This commit is contained in:
2026-02-26 20:58:10 -05:00
parent 34a73f0f94
commit 1f0229461b
10 changed files with 17 additions and 18 deletions

View File

@ -178,7 +178,7 @@ const lastRefreshed = ref('')
async function loadStats() {
isLoading.value = true
try {
stats.value = await analyticsService.getStats()
stats.value = await analyticsService.getDashboardStats() || {}
lastRefreshed.value = new Date().toLocaleTimeString()
} catch (e) {
console.error('Error loading stats')

View File

@ -152,7 +152,7 @@ async function startService() {
// Throttling updates to save battery/bandwidth
if (now - lastUpdate.value >= minUpdateInterval) {
try {
await telemetryService.sendTelemetry({
await telemetryService.sendLocation({
latitude: position.coords.latitude,
longitude: position.coords.longitude,
speed: position.coords.speed || undefined,
@ -192,7 +192,7 @@ function stopService() {
localStorage.setItem('driver_in_service', 'false')
// Optionally notify backend that we are offline
telemetryService.sendTelemetry({
telemetryService.sendLocation({
latitude: 0,
longitude: 0,
status: 'offline'

View File

@ -1,11 +1,9 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useFavoritesStore } from '@/stores/favorites'
import { getImageUrl as utilGetImageUrl } from '@/utils/imageUrl'
const { t } = useI18n()
const router = useRouter()
const favoritesStore = useFavoritesStore()
const selectedFilter = ref('all')

View File

@ -5,7 +5,7 @@ import { businessService } from '@/services/businessService'
import { couponsService } from '@/services/couponsService'
import { shuttlesService } from '@/services/shuttlesService'
import { useAuthStore } from '@/stores/auth'
import { SUPABASE_URL, supabase } from '@/supabase'
import { supabase } from '@/supabase'
import type { Coupon, Business, Shuttle } from '@/types'
const route = useRoute()

View File

@ -4,10 +4,8 @@ import { useRouter } from 'vue-router'
import { useRouteStore } from '@/stores/route'
import { useTaxiStore } from '@/stores/taxi'
import { analyticsService } from '@/services/analyticsService'
import { useI18n } from 'vue-i18n'
import FavoriteButton from '@/components/FavoriteButton.vue'
const { t } = useI18n()
const router = useRouter()
const routeStore = useRouteStore()
const taxiStore = useTaxiStore()
@ -59,10 +57,7 @@ const correlimientos = computed(() => {
return Array.from(set).sort()
})
const getStatusClass = (status: string) => {
if (status === 'ACTIVE') return 'bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-400'
return 'bg-slate-100 dark:bg-zinc-800 text-slate-500 dark:text-zinc-400'
}
</script>
<template>

View File

@ -27,7 +27,7 @@ function getBusStatus(timeStr: string): 'departing' | 'ontime' | 'upcoming' {
const now = new Date()
const [h, m] = timeStr.split(':').map(Number)
const schedDate = new Date()
schedDate.setHours(h, m, 0, 0)
schedDate.setHours(h || 0, m || 0, 0, 0)
const diffMin = (schedDate.getTime() - now.getTime()) / 60000
if (diffMin >= 0 && diffMin <= 10) return 'departing'
if (diffMin > 10 && diffMin <= 60) return 'ontime'