push
This commit is contained in:
parent
62192783b6
commit
563f3fb8ed
2
.env
2
.env
@ -20,7 +20,7 @@ PTERO_SERVER_SFTP_USER=army.37a11489
|
||||
PTERO_SERVER_SFTP_PASSWORD=IJHoYHTXQvJkCxkycTYM
|
||||
PTERO_SERVER_ID=37a11489
|
||||
|
||||
NEXT_PUBLIC_SSE_URL=http://127.0.0.1:8090
|
||||
NEXT_PUBLIC_SSE_URL=https://new.ironieopen.de/events
|
||||
|
||||
# META (vom CS2-Server-Plugin)
|
||||
NEXT_PUBLIC_CS2_TELEMETRY_WS_HOST=new.ironieopen.de
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
output = "../src/generated/prisma"
|
||||
binaryTargets = ["debian-openssl-3.0.x"]
|
||||
|
||||
}
|
||||
|
||||
datasource db {
|
||||
|
||||
@ -35,7 +35,7 @@ export default function TeamAdminClient({ teamId }: Props) {
|
||||
const steamId = session?.user?.steamId
|
||||
if (!steamId) return
|
||||
|
||||
const base = process.env.NEXT_PUBLIC_SSE_URL ?? 'http://localhost:3001'
|
||||
const base = process.env.NEXT_PUBLIC_SSE_URL
|
||||
const url = `${base}/events?steamId=${encodeURIComponent(steamId)}`
|
||||
let es: EventSource | null = new EventSource(url, { withCredentials: false })
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ async function buildPlayerSummaryAndFaceit(steamId: string): Promise<{
|
||||
faceit: PrefetchedFaceit | null
|
||||
}> {
|
||||
try {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? ''
|
||||
const base = process.env.NEXTAUTH_URL ?? ''
|
||||
const res = await fetch(`${base}/api/stats/${steamId}`, { cache: 'no-store', credentials: 'include' })
|
||||
if (!res.ok) return { summary: null, faceit: null }
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ const kdTone = (v: number) =>
|
||||
'text-rose-300 bg-rose-500/10 ring-rose-400/20'
|
||||
|
||||
async function getStats(steamId: string): Promise<ApiStats | null> {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? 'http://localhost:3000'
|
||||
const base = process.env.NEXTAUTH_URL
|
||||
const res = await fetch(`${base}/api/stats/${steamId}`, { cache: 'no-store' })
|
||||
if (!res.ok) return null
|
||||
return res.json()
|
||||
@ -269,7 +269,7 @@ function getBanBadgeFromRow(m: MatchRow) {
|
||||
|
||||
/* nur die letzten N holen */
|
||||
async function getRecentMatches(steamId: string, n = 3) {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? 'http://localhost:3000'
|
||||
const base = process.env.NEXTAUTH_URL
|
||||
const res = await fetch(`${base}/api/user/${steamId}/matches?types=premier,competitive&limit=${n}`, { cache: 'no-store' })
|
||||
if (!res.ok) return [] as MatchRow[]
|
||||
const json = await res.json()
|
||||
|
||||
@ -158,7 +158,7 @@ function Pill({ label, value }: { label: string; value: string }) {
|
||||
|
||||
/* data */
|
||||
async function getData(steamId: string) {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? 'http://localhost:3000'
|
||||
const base = process.env.NEXTAUTH_URL
|
||||
const res = await fetch(`${base}/api/user/${steamId}/matches?types=premier,competitive`, { cache: 'no-store' })
|
||||
if (!res.ok) return { matches: [] as MatchRow[] }
|
||||
const json = await res.json()
|
||||
|
||||
@ -29,7 +29,7 @@ const fetcher = (url: string) => fetch(url, { cache: 'no-store' }).then(r => r.j
|
||||
|
||||
async function fetchFaceitFor(steamId: string): Promise<FaceitState | null> {
|
||||
try {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? ''
|
||||
const base = process.env.NEXTAUTH_URL ?? ''
|
||||
const res = await fetch(`${base}/api/stats/${steamId}`, {
|
||||
cache: 'no-store',
|
||||
credentials: 'include',
|
||||
|
||||
@ -4,7 +4,7 @@ import { MatchStats } from '@/types/match'
|
||||
import type { AsyncParams } from '@/types/next'
|
||||
|
||||
async function getStats(steamId: string) {
|
||||
const base = process.env.NEXT_PUBLIC_BASE_URL ?? 'http://localhost:3000'
|
||||
const base = process.env.NEXTAUTH_URL
|
||||
const res = await fetch(`${base}/api/stats/${steamId}`, { cache: 'no-store' })
|
||||
if (!res.ok) return null
|
||||
return res.json()
|
||||
|
||||
@ -84,7 +84,7 @@ export const useSSEStore = create<SSEState>((set, get) => {
|
||||
set({ source: null, isConnected: false });
|
||||
}
|
||||
|
||||
const base = process.env.NEXT_PUBLIC_SSE_URL ?? 'http://localhost:3001';
|
||||
const base = process.env.NEXT_PUBLIC_SSE_URL
|
||||
const url = `${base}/events?steamId=${encodeURIComponent(steamId)}`;
|
||||
const source = new EventSource(url);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user