Limpieza
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
OK
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"stop_order": 0,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "Parada Parque Boquete",
|
|
||||||
"latitude": 8.7764706,
|
|
||||||
"longitude": -82.4324993
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 1,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Supermercado Rey",
|
|
||||||
"latitude": 8.7688041,
|
|
||||||
"longitude": -82.4332474
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 2,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Entrada Volcancito",
|
|
||||||
"latitude": 8.7569716,
|
|
||||||
"longitude": -82.4317303
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 3,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Villa La Paz",
|
|
||||||
"latitude": 8.7543505,
|
|
||||||
"longitude": -82.4316283
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 4,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Terpel Alto Boquete",
|
|
||||||
"latitude": 8.7520024,
|
|
||||||
"longitude": -82.4318432
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 5,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Mini Super Alto Dorado",
|
|
||||||
"latitude": 8.7500574,
|
|
||||||
"longitude": -82.4320427
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 6,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. BTA",
|
|
||||||
"latitude": 8.7451912,
|
|
||||||
"longitude": -82.4324671
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 7,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Plaza San Francisco",
|
|
||||||
"latitude": 8.7382538,
|
|
||||||
"longitude": -82.4330994
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 8,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Escuela Alto Boquete",
|
|
||||||
"latitude": 8.7321499,
|
|
||||||
"longitude": -82.4336354
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 9,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. 10",
|
|
||||||
"latitude": 8.729323,
|
|
||||||
"longitude": -82.4340776
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 10,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. 11",
|
|
||||||
"latitude": 8.7275817,
|
|
||||||
"longitude": -82.4348154
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 11,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. MercaMax",
|
|
||||||
"latitude": 8.7255787,
|
|
||||||
"longitude": -82.4359451
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 12,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Seminario",
|
|
||||||
"latitude": 8.7218976,
|
|
||||||
"longitude": -82.4379503
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 13,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. Instituto Guadalupano",
|
|
||||||
"latitude": 8.7197081,
|
|
||||||
"longitude": -82.4391483
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stop_order": 14,
|
|
||||||
"bus_stops": {
|
|
||||||
"name": "P. UNACHI Boquete",
|
|
||||||
"latitude": 8.7165669,
|
|
||||||
"longitude": -82.4408624
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@ -1 +0,0 @@
|
|||||||
OK
|
|
||||||
Binary file not shown.
@ -1,149 +0,0 @@
|
|||||||
import re
|
|
||||||
|
|
||||||
with open('src/views/TaxiView.vue', 'r', encoding='utf-8') as f:
|
|
||||||
text = f.read()
|
|
||||||
|
|
||||||
# Just extract the content using regex
|
|
||||||
template_match = re.search(r'<template>(.*?)</template>\s*<style', text, re.DOTALL)
|
|
||||||
if template_match:
|
|
||||||
template_content = template_match.group(1)
|
|
||||||
|
|
||||||
# Split by tabs
|
|
||||||
tab1_match = re.search(r'<!-- TAB 1: LOCAL TAXIS -->(.*?)<!-- TAB 2: INTERCITY SHUTTLES -->', template_content, re.DOTALL)
|
|
||||||
tab2_match = re.search(r'<!-- TAB 2: INTERCITY SHUTTLES -->(.*?)</div>\s*$', template_content, re.DOTALL)
|
|
||||||
|
|
||||||
if tab1_match and tab2_match:
|
|
||||||
tab1_code = tab1_match.group(1)
|
|
||||||
tab2_code = tab2_match.group(1)
|
|
||||||
|
|
||||||
# Clean up the `<template v-if="currentTab === 'local'">` wrapper
|
|
||||||
tab1_code = re.sub(r'<template v-if="currentTab === \'local\'">', '', tab1_code)
|
|
||||||
tab1_code = re.sub(r'</template>\s*$', '', tab1_code.strip())
|
|
||||||
|
|
||||||
tab2_code = re.sub(r'<template v-else>', '', tab2_code)
|
|
||||||
tab2_code = re.sub(r'</template>\s*$', '', tab2_code.strip())
|
|
||||||
|
|
||||||
# Read style
|
|
||||||
style_match = re.search(r'<style scoped>(.*?)</style>', text, re.DOTALL)
|
|
||||||
style_content = style_match.group(1) if style_match else ""
|
|
||||||
|
|
||||||
# Create TaxisLocales.vue
|
|
||||||
taxis_script = """<script setup lang="ts">
|
|
||||||
import { onMounted, ref, computed } from 'vue'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useTaxiStore } from '@/stores/taxi'
|
|
||||||
import { analyticsService } from '@/services/analyticsService'
|
|
||||||
import type { Taxi } from '@/types'
|
|
||||||
import FavoriteButton from '@/components/FavoriteButton.vue'
|
|
||||||
import { getImageUrl } from '@/utils/imageUrl'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
|
||||||
const taxiStore = useTaxiStore()
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const selectedZone = ref('all')
|
|
||||||
const selectedShift = ref('all')
|
|
||||||
const onlyEnglish = ref(false)
|
|
||||||
|
|
||||||
const corregimientos = ['all', 'Boquete', 'David - Boquete', 'Boquete - David', 'Aeropuerto - Boquete']
|
|
||||||
const shifts = ['all', 'dia', 'tarde', 'noche']
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'TaxisLocales' })
|
|
||||||
if(taxiStore.taxis.length === 0) {
|
|
||||||
await taxiStore.loadTaxis()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const filteredTaxis = computed(() => {
|
|
||||||
return taxiStore.taxis.filter(taxi => {
|
|
||||||
const matchesZone = selectedZone.value === 'all' || taxi.corregimiento === selectedZone.value
|
|
||||||
const matchesShift = selectedShift.value === 'all' || taxi.shift === selectedShift.value
|
|
||||||
const matchesEnglish = !onlyEnglish.value || taxi.english_speaking
|
|
||||||
return matchesZone && matchesShift && matchesEnglish
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const handleCall = (taxi: Taxi) => {
|
|
||||||
analyticsService.logEvent({
|
|
||||||
event_name: 'taxi_click',
|
|
||||||
item_id: taxi.owner_name,
|
|
||||||
properties: {
|
|
||||||
action: 'call',
|
|
||||||
taxi_id: taxi.id,
|
|
||||||
plate: taxi.license_plate
|
|
||||||
}
|
|
||||||
})
|
|
||||||
window.location.href = `tel:${taxi.phone_number}`
|
|
||||||
}
|
|
||||||
|
|
||||||
function getShiftLabel(shift: string) {
|
|
||||||
if (shift === 'dia') return t('taxi.dayShift')
|
|
||||||
if (shift === 'tarde') return t('taxi.afternoonShift')
|
|
||||||
if (shift === 'noche') return t('taxi.nightShift')
|
|
||||||
return shift
|
|
||||||
}
|
|
||||||
</script>"""
|
|
||||||
|
|
||||||
with open('src/views/transporte/TaxisLocales.vue', 'w', encoding='utf-8') as f:
|
|
||||||
f.write(taxis_script + f"\n<template>\n <div class=\"taxis-locales\">\n{tab1_code}\n </div>\n</template>\n\n<style scoped>\n{style_content}\n</style>")
|
|
||||||
|
|
||||||
# Create ViajesTuristicos.vue
|
|
||||||
viajes_script = """<script setup lang="ts">
|
|
||||||
import { onMounted, ref, computed } from 'vue'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { useShuttleStore } from '@/stores/shuttle'
|
|
||||||
import { analyticsService } from '@/services/analyticsService'
|
|
||||||
import { getImageUrl } from '@/utils/imageUrl'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
|
||||||
const shuttleStore = useShuttleStore()
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const shuttleRouteFilter = ref('all')
|
|
||||||
const shuttleTypeFilter = ref('all')
|
|
||||||
const shuttleRefs = ref<Record<string, any>>({})
|
|
||||||
|
|
||||||
const setShuttleRef = (el: any, id: string) => {
|
|
||||||
if (el) shuttleRefs.value[id] = el
|
|
||||||
}
|
|
||||||
|
|
||||||
const shuttleRoutes = computed(() => {
|
|
||||||
const routes = shuttleStore.shuttles.map(s => `${s.origin} - ${s.destination}`)
|
|
||||||
return [...new Set(routes)].sort()
|
|
||||||
})
|
|
||||||
|
|
||||||
const filteredShuttles = computed(() => {
|
|
||||||
return shuttleStore.shuttles.filter(shuttle => {
|
|
||||||
const routeName = `${shuttle.origin} - ${shuttle.destination}`
|
|
||||||
const matchesRoute = shuttleRouteFilter.value === 'all' || routeName === shuttleRouteFilter.value
|
|
||||||
const matchesType = shuttleTypeFilter.value === 'all' || shuttle.trip_type === shuttleTypeFilter.value
|
|
||||||
return matchesRoute && matchesType
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const verDetalle = (shuttleId: number) => {
|
|
||||||
router.push({
|
|
||||||
name: 'ShuttleDetalle',
|
|
||||||
params: { id: shuttleId }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
analyticsService.logEvent({ event_name: 'screen_view', screen_name: 'ViajesTuristicos' })
|
|
||||||
if(shuttleStore.shuttles.length === 0) {
|
|
||||||
await shuttleStore.loadShuttles()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>"""
|
|
||||||
tab2_code = tab2_code.replace("router.push(`/shuttle/${shuttle.id}`);", "verDetalle(shuttle.id);")
|
|
||||||
with open('src/views/transporte/ViajesTuristicos.vue', 'w', encoding='utf-8') as f:
|
|
||||||
f.write(viajes_script + f"\n<template>\n <div class=\"viajes-turisticos\">\n{tab2_code}\n </div>\n</template>\n\n<style scoped>\n{style_content}\n</style>")
|
|
||||||
|
|
||||||
print("Success!")
|
|
||||||
else:
|
|
||||||
print("Could not find tabs")
|
|
||||||
else:
|
|
||||||
print("Could not find template")
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
import { createClient } from '@supabase/supabase-js'
|
|
||||||
|
|
||||||
const SUPABASE_URL = 'https://bjgixlugjzsccazdfmph.supabase.co'
|
|
||||||
const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJqZ2l4bHVnanpzY2NhemRmbXBoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIwNjQyMTAsImV4cCI6MjA4NzY0MDIxMH0.untLQoPi4yUr3cPnxo23wYSlg6xnNK0daKu9UHmFTp8'
|
|
||||||
const sb = createClient(SUPABASE_URL, SUPABASE_ANON_KEY)
|
|
||||||
|
|
||||||
async function test() {
|
|
||||||
await sb.auth.signInWithPassword({ email: 'admin@sibu.com', password: 'Admin123!' })
|
|
||||||
|
|
||||||
console.log("Testing REGULAR");
|
|
||||||
const { data: stopData, error: stopErr } = await sb.from('bus_stops').insert([{
|
|
||||||
name: 'test enum',
|
|
||||||
latitude: 0,
|
|
||||||
longitude: 0,
|
|
||||||
stop_type: 'REGULAR',
|
|
||||||
has_shelter: false,
|
|
||||||
has_seating: false,
|
|
||||||
is_accessible: true,
|
|
||||||
city: 'David'
|
|
||||||
}]).select()
|
|
||||||
|
|
||||||
console.log("REGULAR test:", stopErr ? stopErr.message : "Success")
|
|
||||||
|
|
||||||
if (!stopErr && stopData) {
|
|
||||||
await sb.from('bus_stops').delete().eq('id', stopData[0].id)
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("Testing regular");
|
|
||||||
const { error: err2 } = await sb.from('bus_stops').insert([{
|
|
||||||
name: 'test enum',
|
|
||||||
latitude: 0,
|
|
||||||
longitude: 0,
|
|
||||||
stop_type: 'regular',
|
|
||||||
has_shelter: false,
|
|
||||||
has_seating: false,
|
|
||||||
is_accessible: true,
|
|
||||||
city: 'David'
|
|
||||||
}]).select()
|
|
||||||
console.log("regular test:", err2 ? err2.message : "Success")
|
|
||||||
}
|
|
||||||
test()
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
import { createClient } from '@supabase/supabase-js'
|
|
||||||
|
|
||||||
const SUPABASE_URL = 'https://bjgixlugjzsccazdfmph.supabase.co'
|
|
||||||
const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJqZ2l4bHVnanpzY2NhemRmbXBoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIwNjQyMTAsImV4cCI6MjA4NzY0MDIxMH0.untLQoPi4yUr3cPnxo23wYSlg6xnNK0daKu9UHmFTp8'
|
|
||||||
const sb = createClient(SUPABASE_URL, SUPABASE_ANON_KEY)
|
|
||||||
|
|
||||||
async function test() {
|
|
||||||
console.log("Fetching a route and a bus stop to link...");
|
|
||||||
const { data: route } = await sb.from('routes').select('id').limit(1);
|
|
||||||
const { data: stop } = await sb.from('bus_stops').select('id').limit(1);
|
|
||||||
|
|
||||||
if (route?.[0] && stop?.[0]) {
|
|
||||||
console.log("Upserting route_stop link...");
|
|
||||||
const res = await sb.from('route_stops').upsert([{
|
|
||||||
route_id: route[0].id,
|
|
||||||
stop_id: stop[0].id,
|
|
||||||
stop_order: 1
|
|
||||||
}]).select()
|
|
||||||
console.log("Insert response:", JSON.stringify(res, null, 2))
|
|
||||||
|
|
||||||
console.log("Testing join...")
|
|
||||||
const { data, error } = await sb.from('route_stops').select('*, bus_stops(*)')
|
|
||||||
console.log('Join Data:', JSON.stringify(data?.[0], null, 2))
|
|
||||||
console.log('Join Error:', error)
|
|
||||||
} else {
|
|
||||||
console.log("No existing route or stop to link.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
test()
|
|
||||||
Reference in New Issue
Block a user