backup: before bulk replacement

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2026-05-19 19:49:01 +01:00
parent d7bec1ae78
commit 27806f438f
11 changed files with 1044 additions and 955 deletions

View File

@ -37,7 +37,7 @@ export async function GET() {
const rows = await query(sql);
const drivers = rows.map((row: any) => ({
const drivers = rows.map((row: unknown) => ({
driver_guid: row.driver_guid,
driver_name: row.driver_name,
driver_team: row.driver_team,

View File

@ -8,7 +8,7 @@ export const dynamic = 'force-dynamic';
export const runtime = 'nodejs';
// Cache for driver ranks (refreshed periodically)
let rankCache: Map<string, { rank: number, rating: number }> = new Map();
const rankCache: Map<string, { rank: number, rating: number }> = new Map();
let lastRankUpdate = 0;
const RANK_CACHE_TTL = 60000; // 1 minute

View File

@ -4,6 +4,7 @@
import { query } from '@/lib/db';
import { Event } from '@/types/racing';
import Link from 'next/link';
import Image from "next/image";
import { TrophyIcon, UsersIcon, MapPinIcon, ClockIcon, CalendarIcon } from '@/components/ui/icons';
export const dynamic = "force-dynamic";
@ -75,7 +76,7 @@ export default async function EventsPage() {
return (
<div key={event.event_id} className="border border-white/10 sharp-border bg-black">
<img
<Image
src={`https://files.openwheels.racing/img/EnduranceEvents1-${event.event_id}.png?fckcache=999`}
alt={event.event_name}
className="w-full h-48 object-cover object-[50%_0%] border-b border-white/10 grayscale hover:grayscale-0 transition duration-300"

View File

@ -1,5 +1,6 @@
'use client';
import Image from "next/image";
import { useState, useRef, useEffect, MouseEvent } from 'react';
// Configuration
@ -112,7 +113,7 @@ export default function MusicPage() {
};
useEffect(() => {
fetchTracks();
void fetchTracks();
}, []);
// Group tracks by theme

View File

@ -3,6 +3,7 @@
import Link from 'next/link';
import { query } from '@/lib/db';
import Image from "next/image";
import { TrophyIcon, ChartIcon, CircleIcon, UsersIcon, ServerIcon, ActivityIcon } from '@/components/ui/icons';
export const dynamic = "force-dynamic";
@ -44,7 +45,7 @@ export default async function HomePage() {
<div className="text-center space-y-8">
{/* Logo */}
<div className="flex justify-center mb-8">
<img
<Image
src="https://files.openwheels.racing/img/Openwheels_landscape.svg"
alt="OpenWheels"
className="h-24 brightness-0 invert"

View File

@ -111,7 +111,7 @@ export default function LiveTrackMap({ track, trackConfig, cars }: LiveTrackMapP
>
{/* Track Map Background */}
{!imageError ? (
<img
<Image
src={trackMapUrl}
alt={`${track} track map`}
className="absolute inset-0 w-full h-full object-contain opacity-60"

View File

@ -20,7 +20,7 @@ export default function Navbar() {
<div className="flex items-center justify-between h-16">
{/* Logo - links to home */}
<Link href="/" className="flex items-center space-x-3 hover:opacity-80 transition-opacity">
<img
<Image
src="https://files.openwheels.racing/img/Openwheels_landscape.svg"
alt="OpenWheels"
className="h-6 hidden sm:block brightness-0 invert"

View File

@ -44,7 +44,7 @@ export async function getTrackMapConfig(
try {
// Try to fetch from openwheels.racing first
let configUrl = cleanConfig && cleanConfig !== 'default'
const configUrl = cleanConfig && cleanConfig !== 'default'
? `https://files.openwheels.racing/img/tracks/${cleanTrack}/${cleanConfig}/map.ini`
: `https://files.openwheels.racing/img/tracks/${cleanTrack}/map.ini`;
@ -143,7 +143,7 @@ export function worldToMapCoords(
worldZ: number,
config: TrackMapConfig
): { x: number; y: number } {
var aspectRatio = config.width / config.height;
const aspectRatio = config.width / config.height;
// Add offsets to player position
console.log("config" , config);
@ -154,8 +154,8 @@ export function worldToMapCoords(
worldZ = worldZ / aspectRatio;
}
var x = (worldX) + config.xOffset;
var y = (worldZ) + config.zOffset;
let x = (worldX) + config.xOffset;
let y = (worldZ) + config.zOffset;
y /= config.scaleFactor;
x /= config.scaleFactor;

1954
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,11 +11,11 @@
"dependencies": {
"axios": "^1.12.2",
"date-fns": "^4.1.0",
"next": "^16.0.10",
"next": "^15",
"pg": "^8.16.3",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"socket.io-client": "^4.8.1"
"socket.io-client": "^4.2.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",

View File

@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@ -11,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true,
"plugins": [
{
@ -19,7 +23,9 @@
}
],
"paths": {
"@/*": ["./*"]
"@/*": [
"./*"
]
}
},
"include": [
@ -30,5 +36,7 @@
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
"exclude": [
"node_modules"
]
}