backup: before bulk replacement
This commit is contained in:
parent
d7bec1ae78
commit
27806f438f
@ -37,7 +37,7 @@ export async function GET() {
|
|||||||
|
|
||||||
const rows = await query(sql);
|
const rows = await query(sql);
|
||||||
|
|
||||||
const drivers = rows.map((row: any) => ({
|
const drivers = rows.map((row: unknown) => ({
|
||||||
driver_guid: row.driver_guid,
|
driver_guid: row.driver_guid,
|
||||||
driver_name: row.driver_name,
|
driver_name: row.driver_name,
|
||||||
driver_team: row.driver_team,
|
driver_team: row.driver_team,
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export const dynamic = 'force-dynamic';
|
|||||||
export const runtime = 'nodejs';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
// Cache for driver ranks (refreshed periodically)
|
// 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;
|
let lastRankUpdate = 0;
|
||||||
const RANK_CACHE_TTL = 60000; // 1 minute
|
const RANK_CACHE_TTL = 60000; // 1 minute
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
import { query } from '@/lib/db';
|
import { query } from '@/lib/db';
|
||||||
import { Event } from '@/types/racing';
|
import { Event } from '@/types/racing';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import Image from "next/image";
|
||||||
import { TrophyIcon, UsersIcon, MapPinIcon, ClockIcon, CalendarIcon } from '@/components/ui/icons';
|
import { TrophyIcon, UsersIcon, MapPinIcon, ClockIcon, CalendarIcon } from '@/components/ui/icons';
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ export default async function EventsPage() {
|
|||||||
return (
|
return (
|
||||||
<div key={event.event_id} className="border border-white/10 sharp-border bg-black">
|
<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`}
|
src={`https://files.openwheels.racing/img/EnduranceEvents1-${event.event_id}.png?fckcache=999`}
|
||||||
alt={event.event_name}
|
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"
|
className="w-full h-48 object-cover object-[50%_0%] border-b border-white/10 grayscale hover:grayscale-0 transition duration-300"
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import Image from "next/image";
|
||||||
import { useState, useRef, useEffect, MouseEvent } from 'react';
|
import { useState, useRef, useEffect, MouseEvent } from 'react';
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
@ -112,7 +113,7 @@ export default function MusicPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchTracks();
|
void fetchTracks();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Group tracks by theme
|
// Group tracks by theme
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { query } from '@/lib/db';
|
import { query } from '@/lib/db';
|
||||||
|
import Image from "next/image";
|
||||||
import { TrophyIcon, ChartIcon, CircleIcon, UsersIcon, ServerIcon, ActivityIcon } from '@/components/ui/icons';
|
import { TrophyIcon, ChartIcon, CircleIcon, UsersIcon, ServerIcon, ActivityIcon } from '@/components/ui/icons';
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ export default async function HomePage() {
|
|||||||
<div className="text-center space-y-8">
|
<div className="text-center space-y-8">
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<div className="flex justify-center mb-8">
|
<div className="flex justify-center mb-8">
|
||||||
<img
|
<Image
|
||||||
src="https://files.openwheels.racing/img/Openwheels_landscape.svg"
|
src="https://files.openwheels.racing/img/Openwheels_landscape.svg"
|
||||||
alt="OpenWheels"
|
alt="OpenWheels"
|
||||||
className="h-24 brightness-0 invert"
|
className="h-24 brightness-0 invert"
|
||||||
|
|||||||
@ -111,7 +111,7 @@ export default function LiveTrackMap({ track, trackConfig, cars }: LiveTrackMapP
|
|||||||
>
|
>
|
||||||
{/* Track Map Background */}
|
{/* Track Map Background */}
|
||||||
{!imageError ? (
|
{!imageError ? (
|
||||||
<img
|
<Image
|
||||||
src={trackMapUrl}
|
src={trackMapUrl}
|
||||||
alt={`${track} track map`}
|
alt={`${track} track map`}
|
||||||
className="absolute inset-0 w-full h-full object-contain opacity-60"
|
className="absolute inset-0 w-full h-full object-contain opacity-60"
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export default function Navbar() {
|
|||||||
<div className="flex items-center justify-between h-16">
|
<div className="flex items-center justify-between h-16">
|
||||||
{/* Logo - links to home */}
|
{/* Logo - links to home */}
|
||||||
<Link href="/" className="flex items-center space-x-3 hover:opacity-80 transition-opacity">
|
<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"
|
src="https://files.openwheels.racing/img/Openwheels_landscape.svg"
|
||||||
alt="OpenWheels"
|
alt="OpenWheels"
|
||||||
className="h-6 hidden sm:block brightness-0 invert"
|
className="h-6 hidden sm:block brightness-0 invert"
|
||||||
|
|||||||
@ -44,7 +44,7 @@ export async function getTrackMapConfig(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Try to fetch from openwheels.racing first
|
// 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}/${cleanConfig}/map.ini`
|
||||||
: `https://files.openwheels.racing/img/tracks/${cleanTrack}/map.ini`;
|
: `https://files.openwheels.racing/img/tracks/${cleanTrack}/map.ini`;
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ export function worldToMapCoords(
|
|||||||
worldZ: number,
|
worldZ: number,
|
||||||
config: TrackMapConfig
|
config: TrackMapConfig
|
||||||
): { x: number; y: number } {
|
): { x: number; y: number } {
|
||||||
var aspectRatio = config.width / config.height;
|
const aspectRatio = config.width / config.height;
|
||||||
|
|
||||||
// Add offsets to player position
|
// Add offsets to player position
|
||||||
console.log("config" , config);
|
console.log("config" , config);
|
||||||
@ -154,8 +154,8 @@ export function worldToMapCoords(
|
|||||||
worldZ = worldZ / aspectRatio;
|
worldZ = worldZ / aspectRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = (worldX) + config.xOffset;
|
let x = (worldX) + config.xOffset;
|
||||||
var y = (worldZ) + config.zOffset;
|
let y = (worldZ) + config.zOffset;
|
||||||
|
|
||||||
y /= config.scaleFactor;
|
y /= config.scaleFactor;
|
||||||
x /= config.scaleFactor;
|
x /= config.scaleFactor;
|
||||||
|
|||||||
1954
package-lock.json
generated
1954
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,11 +11,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.12.2",
|
"axios": "^1.12.2",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"next": "^16.0.10",
|
"next": "^15",
|
||||||
"pg": "^8.16.3",
|
"pg": "^8.16.3",
|
||||||
"react": "^19.2.3",
|
"react": "^19.2.3",
|
||||||
"react-dom": "^19.2.3",
|
"react-dom": "^19.2.3",
|
||||||
"socket.io-client": "^4.8.1"
|
"socket.io-client": "^4.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@ -11,7 +15,7 @@
|
|||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "preserve",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
@ -19,7 +23,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"]
|
"@/*": [
|
||||||
|
"./*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
@ -30,5 +36,7 @@
|
|||||||
".next/dev/types/**/*.ts",
|
".next/dev/types/**/*.ts",
|
||||||
"**/*.mts"
|
"**/*.mts"
|
||||||
],
|
],
|
||||||
"exclude": ["node_modules"]
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user