Compare commits

...

77 Commits
v3.2.0 ... main

Author SHA1 Message Date
996f16a313
Merge pull request 'update license year.' (#119) from license-year into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #119
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-04-11 16:52:41 +02:00
0f8b1a4729
update license year. 2025-04-11 16:48:47 +02:00
badefb0f7f
Merge pull request 'build(): drone CI build' (#118) from drone-ci into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #118
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-03-27 16:57:27 +01:00
2ba037fab5
build(): drone CI build 2025-03-27 16:56:14 +01:00
637134081a
Merge pull request 'build(): drone CI' (#117) from drone-ci into main
All checks were successful
Build simrail.pro / build (push) Successful in 16s
continuous-integration/drone/push Build is passing
Reviewed-on: #117
2025-03-27 16:54:39 +01:00
96c17ffe85
build(): drone CI
All checks were successful
Build simrail.pro / build (push) Successful in 14s
2025-03-27 16:54:21 +01:00
8db158afe9
Merge pull request 'build(): drone CI' (#116) from drone-ci into main
Some checks failed
continuous-integration/drone/push Build is failing
Build simrail.pro / build (push) Successful in 14s
Reviewed-on: #116
2025-03-27 16:51:58 +01:00
6015349c6f
build(): drone CI
Some checks failed
Build simrail.pro / build (push) Has been cancelled
2025-03-27 16:51:18 +01:00
cd191a6f61
Merge pull request 'build(): drone CI' (#115) from drone-ci into main
Some checks failed
continuous-integration/drone/push Build is failing
Build simrail.pro / build (push) Successful in 14s
Reviewed-on: #115
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-03-27 16:50:37 +01:00
08bfe767bb
build(): drone CI
All checks were successful
Build simrail.pro / build (push) Successful in 41s
2025-03-27 16:49:36 +01:00
6a4ebf56c4
Merge pull request 'fix(): refactor frontend build process to optimize site performance' (#114) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 29s
Reviewed-on: #114
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-03-05 14:40:36 +01:00
1e4cafc07f
fix(): refactor frontend build process to optimize site performance
All checks were successful
Build simrail.pro / build (push) Successful in 1m6s
2025-03-05 14:37:07 +01:00
623bdd8d42
Merge pull request 'fix(): rollbacl' (#113) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #113
2025-03-04 16:02:11 +01:00
51b3ff2e22
fix(): rollbacl
All checks were successful
Build simrail.pro / build (push) Successful in 42s
2025-03-04 16:01:56 +01:00
816ee5c454
Merge pull request 'fix(): rollbacl' (#112) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Has been cancelled
Reviewed-on: #112
2025-03-04 16:01:23 +01:00
9a3f004c72
fix(): rollbacl
Some checks failed
Build simrail.pro / build (push) Failing after 32s
2025-03-04 16:01:07 +01:00
f528da171b
Merge pull request 'fix(): rollbacl' (#111) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 25s
Reviewed-on: #111
2025-03-04 16:00:00 +01:00
b23921a28c
fix(): rollbacl
All checks were successful
Build simrail.pro / build (push) Successful in 54s
2025-03-04 15:59:42 +01:00
e045ded046
Merge pull request 'fix(): rollbacl' (#110) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 23s
Reviewed-on: #110
2025-03-04 15:59:19 +01:00
859b7ab3cc
fix(): rollbacl
Some checks failed
Build simrail.pro / build (push) Failing after 26s
2025-03-04 15:58:58 +01:00
34432e9622
Merge pull request 'fix(): rollbacl' (#109) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #109
2025-03-04 15:54:47 +01:00
3af371703b
fix(): rollbacl
All checks were successful
Build simrail.pro / build (push) Successful in 43s
2025-03-04 15:54:28 +01:00
fcef4e428e
Merge pull request 'fix(): rollbacl' (#108) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 22s
Reviewed-on: #108
2025-03-04 15:49:46 +01:00
ca8e270c5e
fix(): rollbacl
All checks were successful
Build simrail.pro / build (push) Successful in 43s
2025-03-04 15:49:30 +01:00
a9d35c604e
Merge pull request 'fix(): rollbacl' (#107) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 23s
Reviewed-on: #107
2025-03-04 15:48:40 +01:00
8c24a29de2
fix(): rollbacl
Some checks failed
Build simrail.pro / build (push) Failing after 43s
2025-03-04 15:48:17 +01:00
e079a1177e
Merge pull request 'fix(): fix nginx' (#106) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 23s
Reviewed-on: #106
2025-03-04 15:46:47 +01:00
7bf053e452
fix(): fix nginx
Some checks failed
Build simrail.pro / build (push) Failing after 23s
2025-03-04 15:46:09 +01:00
328f665c5c
Merge pull request 'fix(): fix nginx' (#105) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 23s
Reviewed-on: #105
2025-03-04 15:45:21 +01:00
05fe82eff1
fix(): fix nginx
Some checks failed
Build simrail.pro / build (push) Failing after 33s
2025-03-04 15:45:05 +01:00
3143ce1058
Merge pull request 'fix(): fix nginx' (#104) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 23s
Reviewed-on: #104
2025-03-04 15:44:06 +01:00
85d18190a7
fix(): fix nginx
Some checks failed
Build simrail.pro / build (push) Failing after 44s
2025-03-04 15:43:51 +01:00
45434f5a2d
Merge pull request 'fix(): fix nginx' (#103) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #103
2025-03-04 15:41:16 +01:00
922b7ea633
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 39s
2025-03-04 15:40:57 +01:00
f0f01ccda1
Merge pull request 'fix(): fix nginx' (#102) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #102
2025-03-04 15:38:43 +01:00
947bd5dedc
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 56s
2025-03-04 15:38:21 +01:00
a2a9fd25b5
Merge pull request 'fix(): fix nginx' (#101) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #101
2025-03-04 15:36:10 +01:00
afdc700a64
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 39s
2025-03-04 15:35:54 +01:00
f5ba173b24
Merge pull request 'fix(): fix nginx' (#100) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 22s
Reviewed-on: #100
2025-03-04 15:34:53 +01:00
7459649829
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 39s
2025-03-04 15:34:37 +01:00
31c1f3fc40
Merge pull request 'fix(): fix nginx' (#99) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 22s
Reviewed-on: #99
2025-03-04 15:31:35 +01:00
df1d9df212
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 44s
2025-03-04 15:31:03 +01:00
680a18d15a
Merge pull request 'fix(): fix nginx' (#98) from feat-1 into main
Some checks failed
Build simrail.pro / build (push) Failing after 22s
Reviewed-on: #98
2025-03-04 15:30:06 +01:00
40f31ba723
fix(): fix nginx
Some checks failed
Build simrail.pro / build (push) Failing after 31s
2025-03-04 15:29:41 +01:00
f9974a3430
Merge pull request 'fix(): rollbacl' (#97) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #97
2025-03-04 15:20:36 +01:00
c5249da57e
fix(): rollbacl
All checks were successful
Build simrail.pro / build (push) Successful in 34s
2025-03-04 15:20:19 +01:00
85e00e8d52
Merge pull request 'fix(): fix nginx' (#96) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 23s
Reviewed-on: #96
2025-03-04 15:16:27 +01:00
5841c77913
fix(): fix nginx
All checks were successful
Build simrail.pro / build (push) Successful in 35s
2025-03-04 15:16:03 +01:00
84d2972869
Merge pull request 'fix(): nginx config for spa' (#95) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 22s
Reviewed-on: #95
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-03-04 15:09:30 +01:00
94407bc7c4
Merge branch 'main' of https://git.alekswilc.dev/simrail/simrail.pro
All checks were successful
Build simrail.pro / build (push) Successful in 37s
2025-03-04 15:06:46 +01:00
47695d7e4f
fix(): nginx config for SPA 2025-03-04 15:06:23 +01:00
529d8b8020
Merge pull request 'feat(): docker, fix darkmode' (#93) from feat-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 25s
Reviewed-on: #93
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-02-20 01:39:15 +01:00
3db6ced4d2
feat(): docker, fix darkmode
All checks were successful
Build simrail.pro / build (push) Successful in 1m29s
2025-02-20 01:36:13 +01:00
e5614da846
Merge pull request 'Update packages/backend/src/util/imgproxy.ts' (#92) from alekswilc-patch-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 20s
Reviewed-on: #92
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-02-11 03:15:58 +01:00
71a5b77235
Update packages/backend/src/util/imgproxy.ts
All checks were successful
Build simrail.pro / build (push) Successful in 1m2s
2025-02-11 03:14:44 +01:00
7617738ab2
Merge pull request 'fix(): active trains search' (#90) from v3.0.1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 18s
Reviewed-on: #90
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2025-01-13 02:19:08 +01:00
9c3d3e0767
fix(): fix workflows
All checks were successful
Build simrail.pro / build (push) Successful in 18s
2025-01-13 02:18:21 +01:00
294068ee97
fix(): fix workflows
All checks were successful
Build simrail.pro / build (push) Successful in 1m6s
Build simrail.pro / build (pull_request) Successful in 19s
2025-01-13 02:16:42 +01:00
29a7ab3a6b
fix(): fix runner 2025-01-13 02:12:38 +01:00
b4cee2447d
fix(): active trains search 2025-01-13 02:08:56 +01:00
a4091c92e4
Merge pull request 'Update .gitea/workflows/build.yaml' (#89) from alekswilc-patch-1 into main
All checks were successful
Build simrail.pro / build (push) Successful in 19s
Reviewed-on: #89
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2024-12-31 02:29:47 +01:00
77a9540be4
Update .gitea/workflows/build.yaml
All checks were successful
Build simrail.pro / build (push) Successful in 18s
2024-12-31 02:29:04 +01:00
f8f5a38add
Update .gitea/workflows/build.yaml
All checks were successful
Build simrail.pro / build (push) Successful in 18s
2024-12-31 02:26:37 +01:00
4c7482b919
Update .gitea/workflows/build.yaml
All checks were successful
Build project / build (push) Successful in 18s
2024-12-31 02:25:37 +01:00
f10c623aa8
Update .gitea/workflows/build.yaml
All checks were successful
Build project / build (push) Successful in 18s
Build project / build (pull_request) Successful in 18s
2024-12-31 02:23:29 +01:00
4e090ed281
Update .gitea/workflows/build.yaml
Some checks failed
Build project / build (22.x) (push) Failing after 9s
Build project / build (22.x) (pull_request) Failing after 3s
2024-12-31 02:12:33 +01:00
1b9c616e16
Update .gitea/workflows/build.yaml
All checks were successful
Build project / build (push) Successful in 19s
2024-12-31 02:07:55 +01:00
7fe575a651
Update .gitea/workflows/build.yaml
Some checks failed
Build project / build (push) Failing after 17s
2024-12-31 02:07:05 +01:00
f33c54ba26
Update .gitea/workflows/build.yaml
Some checks failed
Build project / build (push) Failing after 36s
2024-12-31 02:05:54 +01:00
a9094fd1ed
Add .gitea/workflows/build.yaml 2024-12-31 02:04:04 +01:00
47d98aba82
Merge pull request 'fix(): steam ratelimits' (#88) from v3.0.1 into main
Reviewed-on: #88
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2024-12-30 23:07:43 +01:00
c8efbb92f5
fix(): steam ratelimits 2024-12-30 23:06:25 +01:00
e460fdefe8
Merge pull request 'feat(): Czech language. Thanks to Maty556677' (#87) from v3.0.1 into main
Reviewed-on: #87
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2024-12-30 21:44:07 +01:00
7ed9df1e9d
feat(): Czech language. Thanks to Maty556677 2024-12-30 21:41:56 +01:00
094e00842a
Merge pull request 'v3.2.1' (#86) from v3.0.1 into main
Reviewed-on: #86
Reviewed-by: Aleksander Wilczyński <aleks@alekswilc.dev>
2024-12-27 01:50:07 +01:00
608894ee1e
fix(): fix images in profile & log. small backend change related to profile, logs imgproxy and gitutil. 2024-12-27 01:48:11 +01:00
895725dc66
fix(frontend): fixed default state in leaderboard 2024-12-27 01:19:23 +01:00
102 changed files with 754 additions and 444 deletions

31
.drone.yml Normal file
View File

@ -0,0 +1,31 @@
---
kind: pipeline
type: docker
name: build
steps:
- name: build-backend
image: plugins/docker
settings:
insecure: true
repo: 10.5.0.103:1222/simrail-backend
registry: 10.5.0.103:1222
context: './packages/backend'
dockerfile: './packages/backend/Dockerfile'
tags:
- latest
- name: build-frontend
image: plugins/docker
settings:
insecure: true
repo: 10.5.0.103:1222/simrail-frontend
registry: 10.5.0.103:1222
context: './packages/frontend'
dockerfile: './packages/frontend/Dockerfile'
tags:
- latest
trigger:
branch:
- main

7
.idea/copyright/profiles_settings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<component name="CopyrightManager">
<settings default="gnu agpl alekswilc">
<module2copyright>
<element module="Project Files" copyright="gnu agpl alekswilc" />
</module2copyright>
</settings>
</component>

View File

@ -0,0 +1,10 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="457" name="TypeScript" />
</Languages>
</inspection_tool>
</profile>
</component>

6
.idea/jsLibraryMappings.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$/packages/frontend" libraries="{script}" />
</component>
</project>

View File

@ -4,7 +4,6 @@
"main": "dist/index.js",
"scripts": {
"build": "yarn workspace backend build && yarn workspace frontend build",
"postbuild": "copyfiles --error ./LICENSE.txt ./dist && copyfiles --error ./LICENSE.txt ./dist/frontend/",
"start": "concurrently --kill-others-on-fail \"yarn workspace backend start\" \"yarn workspace frontend dev\""
},
"workspaces": [

View File

@ -0,0 +1,20 @@
FROM node:21-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN yarn add -D typescript
RUN yarn rawbuild
RUN ls
# Install Doppler CLI
RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/cli@doppler-8004D9FF50437357.rsa.pub && \
echo 'https://packages.doppler.com/public/cli/alpine/any-version/main' | tee -a /etc/apk/repositories && \
apk add doppler
ENTRYPOINT ["doppler", "run", "--"]
CMD ["node", "/app/dist"]

View File

@ -4,7 +4,8 @@
"main": "../../dist/backend/index.js",
"version": "3.0.0",
"scripts": {
"build": "tsc",
"build": "docker build --progress=plain -t simrailpro:backend .",
"rawbuild": "yarn tsc",
"start": "yarn build && doppler run node ../../dist/backend/index.js"
},
"author": "Aleksander <alekswilc> Wilczyński",
@ -15,6 +16,7 @@
"@types/node": "^22.10.1",
"@types/uuid": "^10.0.0",
"copyfiles": "^2.4.1",
"tsc": "^2.0.4",
"typescript": "^5.5.4"
},
"type": "module",

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -66,10 +66,9 @@ export class ActivePlayersRoute
app.get("/train", async (req, res) =>
{
const s = req.query.q?.toString().split(",").map(x => new RegExp(escapeRegexString(x), "i"));
const s = req.query.query?.toString().split(",").map(x => new RegExp(escapeRegexString(x), "i"));
const sserver = req.query.server?.toString();
let a: ActiveTrain[] = [];
for (const data of sserver ? [ client.trains[ sserver as Server["ServerCode"] ] ] : Object.values(client.trains))

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -64,10 +64,10 @@ export class LogRoute
if (process.env.IMGPROXY_KEY)
{
log.player.avatar = generateUrl(log.player.avatar);
log.player.avatar = generateUrl(log.player.avatar, "rs:auto:256:256:1/f:png");
}
res.status(200).json(new SuccessResponseBuilder().setCode(200).setData(log.toJSON()));
res.status(200).json(new SuccessResponseBuilder().setCode(200).setData(log.toJSON()).toJSON());
});
return app;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -114,7 +114,7 @@ export class ProfilesRoute
if (process.env.IMGPROXY_KEY)
{
player.avatar = generateUrl(player.avatar);
player.avatar = generateUrl(player.avatar, "rs:auto:256:256:1/f:png");
}
res.json(

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -24,6 +24,7 @@ import { TrainsModule } from "./modules/trains.js";
import { Server, Station, Train } from "@simrail/types";
import dayjs from "dayjs";
import { TMProfile } from "./mongo/profile.js";
import { GitUtil } from "./util/git.js";
;(async () =>
{
@ -47,6 +48,7 @@ import { TMProfile } from "./mongo/profile.js";
}
ApiModule.load(); // TODO: use fastify
GitUtil.getData();
if (process.env.NODE_ENV === "development")
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -18,7 +18,7 @@ import { IPlayerPayload, IPlayerStatsPayload } from "../types/player.js";
import { MProfile } from "../mongo/profile.js";
import { assert } from "node:console";
const STEAM_API_KEY = process.env.STEAM_APIKEY;
const steamKeys: string[] = JSON.parse(process.env.STEAM_APIKEY!);
const steamFetch = (url: string) =>
{
@ -28,12 +28,13 @@ const steamFetch = (url: string) =>
{
const req = () =>
{
const steamKey = steamKeys[ Math.floor(Math.random() * steamKeys.length) ];
fetch(url, { signal: AbortSignal.timeout(10000) }).then(x => x.json())
fetch(url.replace("[STEAMKEY]", steamKey), { signal: AbortSignal.timeout(10000) }).then(x => x.json())
.then(x => res(x))
.catch(() =>
{
console.log("STEAM request failed! ", url.replace(STEAM_API_KEY!, "[XXX]"), retries);
console.log("STEAM request failed! ", url.replace("[STEAMKEY]", steamKey), retries);
retries++;
setTimeout(() => req(), retries * 1000);
@ -54,7 +55,7 @@ export class PlayerUtil
if (!player)
{
const data = await steamFetch(`https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${ STEAM_API_KEY }&format=json&steamids=${ steamId }`) as IPlayerPayload;
const data = await steamFetch(`https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=[STEAMKEY]&format=json&steamids=${ steamId }`) as IPlayerPayload;
assert(data.response.players, "Expected data.response.players to be truthy");
@ -149,7 +150,7 @@ export class PlayerUtil
public static async getPlayerSteamData(steamId: string)
{
const data = await steamFetch(`https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${ STEAM_API_KEY }&format=json&steamids=${ steamId }`) as IPlayerPayload;
const data = await steamFetch(`https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=[STEAMKEY]&format=json&steamids=${ steamId }`) as IPlayerPayload;
if (!data?.response?.players?.length)
{
@ -161,7 +162,7 @@ export class PlayerUtil
public static async getPlayerStats(steamId: string)
{
const data = await steamFetch(`https://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=1422130&key=${ STEAM_API_KEY }&steamid=${ steamId }`) as IPlayerStatsPayload;
const data = await steamFetch(`https://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=1422130&key=[STEAMKEY]&steamid=${ steamId }`) as IPlayerStatsPayload;
if (!data.playerstats?.stats)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,3 +1,20 @@
/*
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* See LICENSE for more.
*/
import wcmatch from "wildcard-match";
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -18,30 +18,32 @@ import { execSync } from "child_process";
export class GitUtil
{
private static cache: { lastUpdated: number, version?: string, commit?: string } = undefined!;
private static cache: { version?: string, commit?: string } = undefined!;
public static getLatestVersion()
private static getLatestVersion()
{
try
{
const data = execSync("git describe --tags --exact-match").toString();
return data.replace("\n", "");
} catch
{
return undefined;
}
return process.env.CURRENT_VERSION;
// try
// {
// const data = execSync("git describe --tags --exact-match").toString();
// return data.replace("\n", "");
// } catch
// {
// return undefined;
// }
}
public static getLatestCommit()
private static getLatestCommit()
{
try
{
const data = execSync("git rev-parse --short HEAD").toString();
return data.replace("\n", "");
} catch
{
return undefined;
}
return process.env.CURRENT_COMMIT;
// try
// {
// const data = execSync("git rev-parse --short HEAD").toString();
// return data.replace("\n", "");
// } catch
// {
// return undefined;
// }
}
@ -55,7 +57,6 @@ export class GitUtil
const data = {
version: this.getLatestVersion(),
commit: this.getLatestCommit(),
lastUpdated: Date.now(),
};
this.cache = data;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -26,9 +26,9 @@ export const imgProxySign = (target: string) =>
return hmac.digest("base64url");
};
export const generateUrl = (url: string, options: string = "preset:simrailpro") =>
export const generateUrl = (url: string, options: string = "rs:auto:128:128:1/f:png") =>
{
if (url.includes('https://imgproxy.alekswilc.dev/')) return url;
if (url.includes('https://proxy.cdn.alekswilc.dev/')) return url;
if (process.env.NODE_ENV === "development")
{
@ -38,5 +38,5 @@ export const generateUrl = (url: string, options: string = "preset:simrailpro")
}
const signature = imgProxySign(`/${ options }/plain/${ url }`);
return `https://imgproxy.alekswilc.dev/${ signature }/${ options }/plain/${ url }`;
return `https://proxy.cdn.alekswilc.dev/${ signature }/${ options }/plain/${ url }`;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -55,7 +55,7 @@
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "../../dist/backend", /* Specify an output folder for all emitted files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */

View File

@ -0,0 +1,17 @@
FROM node:18-alpine
WORKDIR /app
COPY package.json .
RUN npm install
RUN npm i -g serve vite
COPY . .
RUN npm run rawbuild
EXPOSE 3000
CMD [ "serve", "-s", "dist" ]

View File

@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
~ Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published

View File

@ -5,8 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"rawbuild": "vite build",
"preview": "vite preview",
"build": "docker build --progress=plain -t simrailpro:frontend ."
},
"dependencies": {
"dayjs": "^1.11.13",
@ -35,7 +36,7 @@
"prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.4.1",
"tailwindcss": "^3.4.1",
"vite": "^4.4.7",
"vite": "^6.2.0",
"webpack": "^5.88.2"
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -76,10 +76,13 @@ export const Header = (props: {
<div className="flex items-center gap-3 2xsm:gap-7">
<ul className="flex items-center gap-2 2xsm:gap-4">
<a className="cursor-pointer" onClick={ () => i18n.changeLanguage("pl") }>
<ReactCountryFlag countryCode={ "PL" } svg alt={'PL'} />
<ReactCountryFlag countryCode={ "PL" } svg alt={ "PL" }/>
</a>
<a className="cursor-pointer" onClick={ () => i18n.changeLanguage("en") }>
<ReactCountryFlag countryCode={ "US" } svg alt={'EN'}/>
<ReactCountryFlag countryCode={ "US" } svg alt={ "EN" }/>
</a>
<a className="cursor-pointer" onClick={ () => i18n.changeLanguage("cs") }>
<ReactCountryFlag countryCode={ "CZ" } svg alt={ "CZ" }/>
</a>
</ul>
<ul className="flex items-center gap-2 2xsm:gap-4">

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,3 +1,20 @@
/*
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* See LICENSE for more.
*/
import { Dispatch, SetStateAction } from "react";
export const ConfirmModal = ({ showModal, setShowModal, onConfirm, title, description }: {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -44,8 +44,8 @@ export const StationLog = ({ data }: { data: TLogStationData }) =>
className="overflow-hidden rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark">
<div className="px-4 pt-6 text-center lg:pb-8 xl:pb-11.5">
<div
className="mx-auto w-full max-w-30 rounded-full bg-white/20 p-1 backdrop-blur sm:h-44 sm:max-w-44 sm:p-3">
<div className="relative drop-shadow-2">
className="mx-auto max-w-44 rounded-full">
<div className="relative">
<img className="rounded-full"
src={ data.player.avatar }
alt="Player"/>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -44,8 +44,8 @@ export const TrainLog = ({ data }: { data: TLogTrainData }) =>
className="overflow-hidden rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark">
<div className="px-4 pt-6 text-center lg:pb-8 xl:pb-11.5">
<div
className="mx-auto w-full max-w-30 rounded-full bg-white/20 p-1 backdrop-blur sm:h-44 sm:max-w-44 sm:p-3">
<div className="relative drop-shadow-2">
className="mx-auto max-w-44 rounded-full">
<div className="relative">
<img className="rounded-full"
src={ data.player.avatar }
alt="Player"/>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -87,7 +87,7 @@ export const ProfileCard = ({ data }: { data: TProfileData }) =>
className="overflow-hidden rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark">
<div className="px-4 pt-6 text-center lg:pb-8 xl:pb-11.5">
<div
className="mx-auto max-w-30 rounded-full p-1">
className="mx-auto max-w-44 rounded-full">
<div className="relative rounded-full">
<img className="rounded-full" src={ data.player.avatar } alt="profile"/>
{ data.active &&

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,3 +1,20 @@
/*
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* See LICENSE for more.
*/
import { useContext, createContext, ReactNode } from "react";
import useSWR from "swr";
import { get } from "../util/fetcher.ts";

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -35,7 +35,7 @@ function useLocalStorage<T>(
return item ? JSON.parse(item) : initialValue;
} catch
{
return item ? item : initialValue;
return (item && item !== "undefined") ? item : initialValue;
}
}
} catch (error)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -19,7 +19,7 @@ import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import translationsInEng from "./languages/en.json";
import translationsInPl from "./languages/pl.json";
// import translationsInCz from "./languages/cs.json";
import translationsInCs from "./languages/cs.json";
const resources = {
en: {
@ -28,9 +28,9 @@ const resources = {
pl: {
translation: translationsInPl,
},
// cs: {
// translation: translationsInCz,
// }
cs: {
translation: translationsInCs,
}
};
void i18n

View File

@ -0,0 +1,173 @@
{
"search": {
"placeholder": "například alekswilc",
"placeholder_with_station": "například alekswilc,Katowice",
"none": "Žádné"
},
"home": {
"stats": {
"trains": "vlaků",
"dispatchers": "výpravčích",
"profiles": "profilů"
},
"title": "Simrail Stats",
"description": "Nejlepší stránka se záznamy a statistikami hráčů SimRail!",
"buttons": {
"project": "Stránka projektu",
"forum": "Stránka na fóru SimRail",
"discord": "Discord server"
},
"footer": {
"license": "Licence:",
"powered": "Založeno na:",
"thanks": "Speciální poděkování: <bahu>BAHU.PRO hosting</bahu>, <simrailelite>Simrail ELITE discord</simrailelite>, komunita SimRail a moje přítelkyně",
"author": "Pro komunitu SimRail vytvořeno s ❤️ uživatelem <anchor>{{author}}</anchor> "
}
},
"notfound": {
"title": "Stránka nenalezena",
"description": "Vypadá to, že ses ztratil...",
"button": "Vrátit se na hlavní stránku"
},
"leaderboard": {
"train": {
"distance": "Ujetá vzdálenost: {{distance}} km",
"points": "Získané body: {{points}}"
},
"station": {
"time": "Čas strávený v režimu výpravčího: {{time}}"
},
"buttons": {
"trainDistance": "Největší ujetá vzdálenost",
"trainPoints": "Nejvyšší počet body",
"dispatcherTime": "Nejvíce hodin nahráno v režimu výpravčího"
}
},
"content_loader": {
"error": {
"header": "Chyba načtení stránky",
"description": "Zkontrolujte vaše internetové připojení a načtěte stránku znovu",
"report": "Nahlásit chybu",
"refresh": "Načíst znovu"
},
"notfound": {
"header": "Nebyla nalezena žádná data",
"description": "Vaše vyhledávání nevrátilo žádné výsledky."
}
},
"profile": {
"stats": {
"distance": "Strojvedoucí",
"time": "Výpravčí"
},
"trains": {
"header": "Statistiky vlaků",
"train": "Vlak",
"distance": "Vzdálenost",
"points": "Body",
"time": "Čas"
},
"stations": {
"header": "Statistiky stanic",
"station": "Stanice",
"time": "Čas"
},
"errors": {
"notfound": {
"title": "Profil nebyl nalezen",
"description": "Profil tohoto hráče nemohl být nalezen, nebo si hráč nastavil soukromý Steam účet."
},
"blacklist": {
"title": "Profil není možné zobrazit",
"description": "Profil hráče nemohl být zobrazen kvůli aktivním činnostem moderátorů."
}
},
"info": "Tyto statistiky jsou shromažďovány od {{date}}.",
"active": {
"train": "Řídí vlak {{train}} na serveru {{server}}",
"station": "Výpravčí ve stanici {{station}} na serveru {{server}}"
}
},
"log": {
"errors": {
"notfound": {
"title": "Podrobnosti nebyly nalezeny",
"description": "Podrobnosti tohoto uživatele nebyly nalezeny."
},
"blacklist": {
"title": "Tyto podrobnosti není možné zobrazit",
"description": "Podrobnosti hráče nemohly být zobrazeny kvůli aktivním činnostem moderátorů."
}
},
"station": {
"header": "Opouští stanici",
"server": "Server: {{server}}",
"station": "Stanice: {{name}} - {{short}}",
"joined": "Čas připojení do stanice: {{date}}",
"left": "Čas odpojení ze stanice: {{date}}",
"spent": "Čas strávený ve stanici: {{date}}"
},
"train": {
"header": "Opouští vlak",
"server": "Server: {{server}}",
"train": "Vlak: {{name}} {{number}}",
"joined": "Čas připojení do vlaku: {{date}}",
"left": "Čas odpojení z vlaku: {{date}}",
"spent": "Čas strávený ve vlaku: {{date}}",
"distance": "Vzdálenost: {{distance}} km",
"points": "Body: {{points}}"
},
"toasts": {
"copied": "Odkaz byl zkopírován!",
"report": "Údaje byly zkopírovány do schránky. Můžete je použít v kanálu #multiplayer-help-requests na oficiálním Discord serveru SimRailu. Nezapomeňte připsat důvod nahlášení!"
},
"buttons": {
"report": "Nahlásit",
"copy": "Zkopírovat odkaz",
"profile": "Profil",
"record": "Zobrazit"
}
},
"sidebar": {
"home": "Hlavní stránka",
"logs": "Záznamy",
"stations": "Stanice",
"trains": "Vlaky",
"leaderboard": "Žebříčky hráčů",
"active_players": "Aktivní hráči",
"info": "INFO",
"admin": "ADMIN",
"logged": "Přihlášen jako {{username}}",
"logout": "Odhlásit se",
"profiles": "Profily"
},
"icons": {
"admin": "Administrátor",
"leaderboard_hidden": "Žebříček je skrytý",
"hidden": "Profil je skrytý"
},
"admin": {
"header": "Akce moderátora",
"hideLeaderboard": {
"modal": {
"title": "Jste si jisti?",
"description": "Tato akce skryje profil uživatele z žebříčků."
},
"button": "Skrýt profil v žebříčku",
"button2": "Zobrazit profil v žebříčku",
"alert": "Profil hráče je skrytý."
},
"hide": {
"modal": {
"title": "Jste si jisti?",
"description": "Tato akce skryje profil uživatele ze zobrazování v žebříčku."
},
"button": "Skrýt profil",
"alert": "Profil hráče je skrytý."
},
"update": {
"button": "Vynutit aktualizaci",
"alert": "Profil je aktualizován!"
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -36,7 +36,7 @@ export const Leaderboard = () =>
const { data, error, isLoading } = useSWR(`/leaderboard/${ queryType }/?${ params.toString() }`, get, { refreshInterval: 10_000, errorRetryCount: 5 });
const [ searchItem, setSearchItem ] = useState(searchParams.get("query") ?? "");
const [ sortBy, setSortBy ] = useState(searchParams.get("sort_by") ?? "");
const [ sortBy, setSortBy ] = useState(searchParams.get("sort_by") ?? "distance");
const [ searchValue ] = useDebounce(searchItem, 500);
const [ page, setPage ] = useState(parseInt(searchParams.get("page") as string) || 1);
@ -44,7 +44,7 @@ export const Leaderboard = () =>
useEffect(() =>
{
setSearchItem(searchParams.get("query") ?? "");
setSortBy(searchParams.get("sort_by") ?? "");
setSortBy(searchParams.get("sort_by") ?? "distance");
setPage(parseInt(searchParams.get("page") as string) || 1);
}, []);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@ -21,6 +21,6 @@ import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [ react() ],
build: {
outDir: "../../dist/frontend",
outDir: "./dist/",
}
});

Some files were not shown because too many files have changed in this diff Show More