Compare commits

...

40 Commits

Author SHA1 Message Date
Spythere 130732921b Merge pull request #119 from Spythere/development
v1.28.7
2025-01-28 14:51:24 +01:00
Spythere 1b2cd34e86 fix: responsive text center 2025-01-28 14:32:48 +01:00
Spythere 17bda9e6e7 chore: added scenery offline icon in active train schedule; icon improvements 2025-01-28 14:23:57 +01:00
Spythere c66ff8feed bump: v1.28.7 2025-01-15 16:26:02 +01:00
Spythere 027cdee25a fix: twr polish locale 2025-01-15 16:24:56 +01:00
Spythere 435cfb3b3f chore: added offline players indicators in the scenery view 2025-01-15 16:23:26 +01:00
Spythere 425241c8e7 Merge pull request #118 from Spythere/development
v1.28.6
2025-01-11 13:22:13 +01:00
Spythere f24f961d52 fix: warning notes display for TN & PN in journal 2025-01-11 13:09:45 +01:00
Spythere 4718eeeaaf bump: v1.28.6 2025-01-11 00:21:11 +01:00
Spythere 931fd7b21b feat: copying a railway stock of active drivers and timetable journal 2025-01-11 00:20:58 +01:00
Spythere bb79c5033a chore: added icon packs 2025-01-10 23:20:24 +01:00
Spythere ee290788dc Merge pull request #117 from Spythere/development
v1.28.5
2024-12-23 16:50:34 +01:00
Spythere a87d1060d3 chore: adjusted christmas dates 2024-12-23 16:45:46 +01:00
Spythere 1804d6d0f0 bump: v1.28.5 2024-12-23 16:44:59 +01:00
Spythere 77250e30c7 fix: preview tooltip fallback image 2024-12-23 16:44:42 +01:00
Spythere c5aefd03b8 Merge pull request #116 from Spythere/development
1.28.4 - minor fixes & updates
2024-12-20 16:27:08 +01:00
Spythere 2ec4694bd3 restruct: train info & timetable code 2024-12-20 15:51:16 +01:00
Spythere 729f66bcdb chore: added changing logo to christmas version 2024-12-20 15:46:34 +01:00
Spythere b746843086 Merge pull request #115 from Spythere/development
v1.28.4
2024-11-15 19:00:00 +01:00
Spythere cbbd06fecd bump: v1.28.4 2024-11-15 18:52:21 +01:00
Spythere 11e99b6af0 hotfix: stations sorting by 'no limit' 2024-11-15 18:51:34 +01:00
Spythere 31f4a2e5b2 Merge pull request #114 from Spythere/development
v1.28.3
2024-10-22 21:30:53 +02:00
Spythere 22514c3263 bump: v.1.28.3 2024-10-22 21:22:37 +02:00
Spythere 0df673467c fix: image loading styles 2024-10-22 21:22:22 +02:00
Spythere 6377e13809 refactor: footer component 2024-10-22 21:13:23 +02:00
Spythere 13fa633db4 chore: updated api image source 2024-10-22 20:58:20 +02:00
Spythere dd9661551c fix: typo 2024-10-22 20:58:08 +02:00
Spythere 495012a5ca Merge pull request #113 from Spythere/development
hotfix: data fetching
2024-10-02 14:59:34 +02:00
Spythere 3cfccb1bb4 hotfix: data fetching 2024-10-02 14:58:58 +02:00
Spythere d2a8cdb2b0 Merge pull request #112 from Spythere/development
v1.28.2
2024-10-02 14:31:39 +02:00
Spythere c33b5ef8c1 refactor: journal dispatcher filters 2024-10-01 16:40:11 +02:00
Spythere 52d1771c21 chore: added tn/pn filters for trains & timetables 2024-10-01 15:53:59 +02:00
Spythere cac4345683 chore: added journal timetable comments 2024-10-01 15:28:22 +02:00
Spythere 6fd9e21213 bump: v1.28.2 2024-09-30 22:33:45 +02:00
Spythere 421add1ec1 chore: added TN/PN freight types 2024-09-30 22:32:29 +02:00
Spythere 4ac92198b7 chore: api mock configuration files 2024-09-30 14:23:20 +02:00
Spythere 5105229eef chore: api mock endpoints 2024-09-30 11:50:08 +02:00
Spythere 2ec02080c3 chore: added internal api mocking for tests 2024-09-29 13:15:46 +02:00
Spythere 95b2a696e1 Merge pull request #111 from Spythere/development
fix: vehicle thumbnail names
2024-09-19 16:00:02 +02:00
Spythere 091e94e396 fix: vehicle thumbnail names 2024-09-19 15:48:55 +02:00
55 changed files with 9326 additions and 456 deletions
+4
View File
@@ -33,6 +33,10 @@ node_modules
# Env # Env
.env .env
.env.*
.fake .fake
.ionide .ionide
# api-mock
/api-mock/endpoints/
+33
View File
@@ -0,0 +1,33 @@
import { existsSync } from 'fs';
import { mkdir, writeFile } from 'fs/promises';
async function fetchJSONEndpointData(url, fileName) {
try {
const res = await fetch(url);
const data = await res.json();
await writeFile(`./endpoints/${fileName}`, JSON.stringify(data));
return true;
} catch (error) {
console.error(error);
}
return false;
}
async function main() {
if (!existsSync('endpoints')) await mkdir('endpoints');
Promise.all(
['getActiveData', 'getDonators', 'getSceneries', 'getVehicles'].map((endpointName) =>
fetchJSONEndpointData(
`https://stacjownik.spythere.eu/api/${endpointName}`,
`${endpointName}.json`
)
)
).then(() => {
console.log('Endpoints downloaded!');
});
}
main();
+28
View File
@@ -0,0 +1,28 @@
import express from 'express';
import path from 'path';
import { cwd } from 'process';
import cors from 'cors';
const app = express();
app.use(cors());
app.get('/api/getActiveData', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getActiveData.json'));
});
app.get('/api/getSceneries', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getSceneries.json'));
});
app.get('/api/getVehicles', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getVehicles.json'));
});
app.get('/api/getDonators', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getDonators.json'));
});
app.listen(3123, () => {
console.log('Mocking API server...');
});
+18
View File
@@ -0,0 +1,18 @@
{
"name": "api-mock",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"fetch": "node fetchEndpoints.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.3"
}
}
+481
View File
@@ -0,0 +1,481 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
accepts@~1.3.8:
version "1.3.8"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==
dependencies:
mime-types "~2.1.34"
negotiator "0.6.3"
array-flatten@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==
body-parser@1.20.3:
version "1.20.3"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6"
integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==
dependencies:
bytes "3.1.2"
content-type "~1.0.5"
debug "2.6.9"
depd "2.0.0"
destroy "1.2.0"
http-errors "2.0.0"
iconv-lite "0.4.24"
on-finished "2.4.1"
qs "6.13.0"
raw-body "2.5.2"
type-is "~1.6.18"
unpipe "1.0.0"
bytes@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
call-bind@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9"
integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==
dependencies:
es-define-property "^1.0.0"
es-errors "^1.3.0"
function-bind "^1.1.2"
get-intrinsic "^1.2.4"
set-function-length "^1.2.1"
content-disposition@0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
dependencies:
safe-buffer "5.2.1"
content-type@~1.0.4, content-type@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918"
integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==
cookie-signature@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==
cookie@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==
cors@^2.8.5:
version "2.8.5"
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
dependencies:
object-assign "^4"
vary "^1"
debug@2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
dependencies:
ms "2.0.0"
define-data-property@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e"
integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==
dependencies:
es-define-property "^1.0.0"
es-errors "^1.3.0"
gopd "^1.0.1"
depd@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
destroy@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015"
integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
encodeurl@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58"
integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==
es-define-property@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845"
integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==
dependencies:
get-intrinsic "^1.2.4"
es-errors@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f"
integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==
escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==
etag@~1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==
express@^4.18.3:
version "4.21.0"
resolved "https://registry.yarnpkg.com/express/-/express-4.21.0.tgz#d57cb706d49623d4ac27833f1cbc466b668eb915"
integrity sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
body-parser "1.20.3"
content-disposition "0.5.4"
content-type "~1.0.4"
cookie "0.6.0"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
encodeurl "~2.0.0"
escape-html "~1.0.3"
etag "~1.8.1"
finalhandler "1.3.1"
fresh "0.5.2"
http-errors "2.0.0"
merge-descriptors "1.0.3"
methods "~1.1.2"
on-finished "2.4.1"
parseurl "~1.3.3"
path-to-regexp "0.1.10"
proxy-addr "~2.0.7"
qs "6.13.0"
range-parser "~1.2.1"
safe-buffer "5.2.1"
send "0.19.0"
serve-static "1.16.2"
setprototypeof "1.2.0"
statuses "2.0.1"
type-is "~1.6.18"
utils-merge "1.0.1"
vary "~1.1.2"
finalhandler@1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019"
integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==
dependencies:
debug "2.6.9"
encodeurl "~2.0.0"
escape-html "~1.0.3"
on-finished "2.4.1"
parseurl "~1.3.3"
statuses "2.0.1"
unpipe "~1.0.0"
forwarded@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
fresh@0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==
function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==
get-intrinsic@^1.1.3, get-intrinsic@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==
dependencies:
es-errors "^1.3.0"
function-bind "^1.1.2"
has-proto "^1.0.1"
has-symbols "^1.0.3"
hasown "^2.0.0"
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==
dependencies:
get-intrinsic "^1.1.3"
has-property-descriptors@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854"
integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==
dependencies:
es-define-property "^1.0.0"
has-proto@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd"
integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==
has-symbols@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8"
integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==
hasown@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003"
integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==
dependencies:
function-bind "^1.1.2"
http-errors@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3"
integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==
dependencies:
depd "2.0.0"
inherits "2.0.4"
setprototypeof "1.2.0"
statuses "2.0.1"
toidentifier "1.0.1"
iconv-lite@0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
dependencies:
safer-buffer ">= 2.1.2 < 3"
inherits@2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
ipaddr.js@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
media-typer@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==
merge-descriptors@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5"
integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==
methods@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==
mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
mime-types@~2.1.24, mime-types@~2.1.34:
version "2.1.35"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
dependencies:
mime-db "1.52.0"
mime@1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==
ms@2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
negotiator@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd"
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==
object-assign@^4:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
object-inspect@^1.13.1:
version "1.13.2"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff"
integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==
on-finished@2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f"
integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==
dependencies:
ee-first "1.1.1"
parseurl@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
path-to-regexp@0.1.10:
version "0.1.10"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b"
integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==
proxy-addr@~2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"
qs@6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906"
integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==
dependencies:
side-channel "^1.0.6"
range-parser@~1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
raw-body@2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a"
integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
dependencies:
bytes "3.1.2"
http-errors "2.0.0"
iconv-lite "0.4.24"
unpipe "1.0.0"
safe-buffer@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
send@0.19.0:
version "0.19.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8"
integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==
dependencies:
debug "2.6.9"
depd "2.0.0"
destroy "1.2.0"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
fresh "0.5.2"
http-errors "2.0.0"
mime "1.6.0"
ms "2.1.3"
on-finished "2.4.1"
range-parser "~1.2.1"
statuses "2.0.1"
serve-static@1.16.2:
version "1.16.2"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296"
integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==
dependencies:
encodeurl "~2.0.0"
escape-html "~1.0.3"
parseurl "~1.3.3"
send "0.19.0"
set-function-length@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449"
integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==
dependencies:
define-data-property "^1.1.4"
es-errors "^1.3.0"
function-bind "^1.1.2"
get-intrinsic "^1.2.4"
gopd "^1.0.1"
has-property-descriptors "^1.0.2"
setprototypeof@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
side-channel@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2"
integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==
dependencies:
call-bind "^1.0.7"
es-errors "^1.3.0"
get-intrinsic "^1.2.4"
object-inspect "^1.13.1"
statuses@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
toidentifier@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
type-is@~1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==
dependencies:
media-typer "0.3.0"
mime-types "~2.1.24"
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==
utils-merge@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==
vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
+5
View File
@@ -22,6 +22,11 @@
<link rel="icon" href="favicon.ico" /> <link rel="icon" href="favicon.ico" />
<link rel="stylesheet" href="fa/css/fontawesome.css" />
<link rel="stylesheet" href="fa/css/brands.css" />
<link rel="stylesheet" href="fa/css/regular.css" />
<link rel="stylesheet" href="fa/css/solid.css" />
<!-- Static OpenGraph meta --> <!-- Static OpenGraph meta -->
<meta name="description" content="Pomocnik maszynisty i dyżurnego symulatora Train Driver 2" /> <meta name="description" content="Pomocnik maszynisty i dyżurnego symulatora Train Driver 2" />
<meta property="og:url" content="https://stacjownik-td2.web.app/" /> <meta property="og:url" content="https://stacjownik-td2.web.app/" />
+4 -2
View File
@@ -1,10 +1,12 @@
{ {
"name": "stacjownik", "name": "stacjownik",
"version": "1.28.1", "version": "1.28.7",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --mode staging",
"dev:mock": "vite --mode development & yarn --cwd ./api-mock start",
"dev:fetch": "yarn --cwd ./api-mock fetch",
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"deploy:prod": "yarn build && firebase deploy --only hosting", "deploy:prod": "yarn build && firebase deploy --only hosting",
"deploy:dev": "yarn build && firebase hosting:channel:deploy dev --expires 7d", "deploy:dev": "yarn build && firebase hosting:channel:deploy dev --expires 7d",
File diff suppressed because it is too large Load Diff
+6243
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
/*!
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/
:root, :host {
--fa-style-family-classic: 'Font Awesome 6 Free';
--fa-font-regular: normal 400 1em/1 'Font Awesome 6 Free'; }
@font-face {
font-family: 'Font Awesome 6 Free';
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }
.far,
.fa-regular {
font-weight: 400; }
+19
View File
@@ -0,0 +1,19 @@
/*!
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/
:root, :host {
--fa-style-family-classic: 'Font Awesome 6 Free';
--fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free'; }
@font-face {
font-family: 'Font Awesome 6 Free';
font-style: normal;
font-weight: 900;
font-display: block;
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
.fas,
.fa-solid {
font-weight: 900; }
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.

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

+10 -16
View File
@@ -6,6 +6,7 @@
/> />
<Tooltip /> <Tooltip />
<AppHeader :current-lang="currentLang" @change-lang="changeLang" /> <AppHeader :current-lang="currentLang" @change-lang="changeLang" />
<main class="app_main"> <main class="app_main">
@@ -16,21 +17,12 @@
</router-view> </router-view>
</main> </main>
<footer class="app_footer"> <AppFooter
&copy; :version="VERSION"
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a> :is-on-production-host="isOnProductionHost"
{{ new Date().getUTCFullYear() }} | :is-update-card-open="isUpdateCardOpen"
<button class="btn--text" @click="() => (isUpdateCardOpen = true)"> @open-update-card="() => (isUpdateCardOpen = true)"
v{{ VERSION }}{{ isOnProductionHost ? '' : 'dev' }} />
</button>
<br />
<a href="https://discord.gg/x2mpNN3svk">
<img src="/images/icon-discord.png" alt="" />&nbsp;<b>{{ $t('footer.discord') }}</b>
</a>
<div style="display: none">&int; ukryta taktyczna całka do programowania w HTMLu</div>
</footer>
</div> </div>
</template> </template>
@@ -38,7 +30,7 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import axios from 'axios'; import axios from 'axios';
import { version } from '.././package.json'; import { version } from '../package.json';
import { Status } from './typings/common'; import { Status } from './typings/common';
import { useMainStore } from './store/mainStore'; import { useMainStore } from './store/mainStore';
import { useApiStore } from './store/apiStore'; import { useApiStore } from './store/apiStore';
@@ -51,6 +43,7 @@ import Tooltip from './components/Tooltip/Tooltip.vue';
import UpdateCard from './components/App/UpdateCard.vue'; import UpdateCard from './components/App/UpdateCard.vue';
import StorageManager from './managers/storageManager'; import StorageManager from './managers/storageManager';
import AppFooter from './components/App/AppFooter.vue';
const STORAGE_VERSION_KEY = 'app_version'; const STORAGE_VERSION_KEY = 'app_version';
@@ -59,6 +52,7 @@ export default defineComponent({
Clock, Clock,
StatusIndicator, StatusIndicator,
AppHeader, AppHeader,
AppFooter,
UpdateCard, UpdateCard,
Tooltip Tooltip
}, },
+41
View File
@@ -0,0 +1,41 @@
<template>
<footer class="app_footer">
&copy;
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
{{ new Date().getUTCFullYear() }} |
<button class="btn--text" @click="openUpdateCard">
v{{ version }}{{ isOnProductionHost ? '' : 'dev' }}
</button>
<br />
<a href="https://discord.gg/x2mpNN3svk">
<img src="/images/icon-discord.png" alt="" />&nbsp;<b>{{ $t('footer.discord') }}</b>
</a>
<div style="display: none">&int; ukryta taktyczna całka do programowania w HTMLu</div>
</footer>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
emits: ['openUpdateCard'],
props: {
isUpdateCardOpen: {
type: Boolean,
required: true
},
version: String,
isOnProductionHost: Boolean
},
methods: {
openUpdateCard() {
this.$emit('openUpdateCard');
}
}
});
</script>
<style scoped></style>
+16 -3
View File
@@ -18,7 +18,12 @@
<span class="header_brand"> <span class="header_brand">
<router-link to="/"> <router-link to="/">
<img src="/images/stacjownik-header-logo.svg" alt="Stacjownik" /> <img
v-if="isChristmas"
src="/images/stacjownik-header-logo-christmas.svg"
alt="Stacjownik logo (christmas)"
/>
<img v-else src="/images/stacjownik-header-logo.svg" alt="Stacjownik logo" />
</router-link> </router-link>
</span> </span>
@@ -69,7 +74,10 @@ import Clock from './Clock.vue';
import RegionDropdown from '../Global/RegionDropdown.vue'; import RegionDropdown from '../Global/RegionDropdown.vue';
export default defineComponent({ export default defineComponent({
components: { StatusIndicator, Clock, RegionDropdown },
emits: ['changeLang'], emits: ['changeLang'],
props: { props: {
currentLang: { currentLang: {
type: String, type: String,
@@ -98,9 +106,14 @@ export default defineComponent({
return this.store.activeSceneryList.filter( return this.store.activeSceneryList.filter(
(scenery) => scenery.region == this.store.region.id && scenery.dispatcherId != -1 (scenery) => scenery.region == this.store.region.id && scenery.dispatcherId != -1
).length; ).length;
},
isChristmas() {
const date = new Date();
return date.getUTCMonth() == 11 && date.getUTCDate() >= 20 && date.getUTCDate() <= 31;
} }
}, }
components: { StatusIndicator, Clock, RegionDropdown }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
+12 -25
View File
@@ -1,15 +1,13 @@
<template> <template>
<div class="stock-list"> <div class="list-wrapper">
<ul> <ul class="stock-list">
<li v-for="({ images, imagesFallbacks, vehicleString }, i) in thumbnailNames" :key="i"> <li v-for="({ images, imagesFallbacks, vehicleString }, i) in thumbnailNames">
<span> <VehicleThumbnail
<VehicleThumbnail :key="i"
v-for="(thumbnailImage, imageIndex) in images" :vehicle-string="vehicleString"
:vehicle-string="vehicleString" :images="images"
:img-name="thumbnailImage" :image-fallbacks="imagesFallbacks"
:fallback-name="imagesFallbacks[imageIndex]" />
/>
</span>
</li> </li>
</ul> </ul>
</div> </div>
@@ -148,32 +146,21 @@ export default defineComponent({
return vehicleThumbnailData; return vehicleThumbnailData;
}); });
} }
},
methods: {
onImageError(event: Event, fallbackImage: string) {
(event.target as HTMLImageElement).src = `/images/${fallbackImage}.png`;
}
} }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.stock-list {
.list-wrapper {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.stock-list ul { .stock-list {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
overflow: auto; overflow: auto;
margin: 0 auto; margin: 0 auto;
} }
ul > li > span {
display: flex;
align-items: flex-end;
cursor: crosshair;
}
</style> </style>
+27 -15
View File
@@ -5,26 +5,28 @@
<small v-if="vehicleCargo">({{ vehicleCargo }})</small> <small v-if="vehicleCargo">({{ vehicleCargo }})</small>
</div> </div>
<img <div class="stock-images">
:src="`https://static.spythere.eu/thumbnails/v2/${imgName}.png`" <img
height="60" v-for="(thumbnailImage, imageIndex) in images"
loading="lazy" :src="`https://stacjownik.spythere.eu/static/thumbnails/${thumbnailImage}.png`"
data-tooltip-type="VehiclePreviewTooltip" height="60"
:data-tooltip-content="vehicleString" loading="lazy"
@error="onImageError" data-tooltip-type="VehiclePreviewTooltip"
@load="onImageLoad" :data-tooltip-content="vehicleString"
/> @error="onImageError($event, imageFallbacks[imageIndex])"
@load="onImageLoad"
/>
</div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, Ref, ref } from 'vue'; import { computed, PropType, Ref, ref } from 'vue';
const props = defineProps({ const props = defineProps({
vehicleString: { type: String, required: true }, vehicleString: { type: String, required: true },
imgName: { type: String, required: true }, images: { type: Object as PropType<string[]>, required: true },
fallbackName: { type: String, required: true }, imageFallbacks: { type: Object as PropType<string[]>, required: true }
placeholderName: String
}); });
const thumbRef = ref(null) as Ref<HTMLElement | null>; const thumbRef = ref(null) as Ref<HTMLElement | null>;
@@ -33,8 +35,8 @@ const imgStatus = ref('loading');
const vehicleName = computed(() => props.vehicleString.split(':')[0].replace(/_/g, ' ')); const vehicleName = computed(() => props.vehicleString.split(':')[0].replace(/_/g, ' '));
const vehicleCargo = computed(() => props.vehicleString.split(':')[1]); const vehicleCargo = computed(() => props.vehicleString.split(':')[1]);
function onImageError(event: Event) { function onImageError(event: Event, fallbackImage: string) {
(event.target as HTMLImageElement).src = `/images/${props.fallbackName}.png`; (event.target as HTMLImageElement).src = `/images/${fallbackImage}.png`;
imgStatus.value = 'error'; imgStatus.value = 'error';
} }
@@ -49,6 +51,7 @@ function onImageLoad() {
<style lang="scss" scoped> <style lang="scss" scoped>
.vehicle-thumbnail { .vehicle-thumbnail {
position: relative; position: relative;
opacity: 0; opacity: 0;
transition: opacity 100ms ease-in-out; transition: opacity 100ms ease-in-out;
@@ -66,4 +69,13 @@ function onImageLoad() {
margin-bottom: 0.25em; margin-bottom: 0.25em;
padding: 0.25em 0; padding: 0.25em 0;
} }
.stock-images {
display: flex;
justify-content: center;
align-items: flex-end;
cursor: crosshair;
padding: 0.5em 0;
}
</style> </style>
@@ -1,43 +1,45 @@
<template> <template>
<div class="journal_warning" v-if="store.isOffline"> <div>
{{ $t('app.offline') }} <div class="journal_warning" v-if="store.isOffline">
</div> {{ $t('app.offline') }}
</div>
<Loading v-else-if="dataStatus == Status.Data.Loading" /> <Loading v-else-if="dataStatus == Status.Data.Loading" />
<div v-else-if="dataStatus == Status.Data.Error" class="journal_warning error"> <div v-else-if="dataStatus == Status.Data.Error" class="journal_warning error">
{{ $t('app.error') }} {{ $t('app.error') }}
</div> </div>
<div class="journal_warning" v-else-if="dispatcherHistory.length == 0"> <div class="journal_warning" v-else-if="dispatcherHistory.length == 0">
{{ $t('app.no-result') }} {{ $t('app.no-result') }}
</div> </div>
<div v-else> <div v-else>
<transition-group name="list-anim" class="journal-list" tag="ul"> <transition-group name="list-anim" class="journal-list" tag="ul">
<JournalDispatcherEntry <JournalDispatcherEntry
v-for="entry in dispatcherHistory" v-for="entry in dispatcherHistory"
:key="entry.id" :key="entry.id"
:entry="entry" :entry="entry"
:onToggleShowExtraInfo="toggleExtraInfo" :onToggleShowExtraInfo="toggleExtraInfo"
:showExtraInfo="extraInfoIndexes.includes(entry.id)" :showExtraInfo="extraInfoIndexes.includes(entry.id)"
/>
</transition-group>
<AddDataButton
:list="dispatcherHistory"
:scrollDataLoaded="scrollDataLoaded"
:scrollNoMoreData="scrollNoMoreData"
@addHistoryData="addHistoryData"
/> />
</transition-group> </div>
<AddDataButton <div class="journal_warning" v-if="scrollNoMoreData">
:list="dispatcherHistory" {{ $t('journal.no-further-data') }}
:scrollDataLoaded="scrollDataLoaded" </div>
:scrollNoMoreData="scrollNoMoreData"
@addHistoryData="addHistoryData"
/>
</div>
<div class="journal_warning" v-if="scrollNoMoreData"> <div class="journal_warning" v-else-if="!scrollDataLoaded">
{{ $t('journal.no-further-data') }} {{ $t('journal.loading-further-data') }}
</div> </div>
<div class="journal_warning" v-else-if="!scrollDataLoaded">
{{ $t('journal.loading-further-data') }}
</div> </div>
</template> </template>
@@ -81,6 +83,15 @@ export default defineComponent({
}; };
}, },
watch: {
'$route.query': {
deep: true,
handler() {
this.extraInfoIndexes.length = 0;
}
}
},
methods: { methods: {
toggleExtraInfo(id: number) { toggleExtraInfo(id: number) {
const existingIdx = this.extraInfoIndexes.indexOf(id); const existingIdx = this.extraInfoIndexes.indexOf(id);
@@ -59,26 +59,35 @@
</span> </span>
</div> </div>
<div class="stock-dangers" v-if="timetable.twr || timetable.skr"> <div class="stock-dangers" v-if="timetable.warningNotes">
<div class="g-separator"></div> <div class="g-separator"></div>
<b>{{ $t('journal.stock-dangers') }}:</b> <b>{{ $t('journal.stock-dangers') }}:</b>
<ul> <ul>
<li v-if="timetable.twr"> <li v-if="timetable.twr">
<b class="text--primary">{{ $t('general.TWR') }} (TWR)</b> <b class="text--primary">{{ $t('warnings.TWR') }} (TWR)</b>
<span v-if="timetable.warningNotes">
| <i>{{ timetable.warningNotes }}</i>
</span>
</li> </li>
<li v-if="timetable.skr"> <li v-if="timetable.skr">
<b class="text--primary">{{ $t('general.SKR') }}</b> <b class="text--primary">{{ $t('warnings.SKR') }}</b>
<span v-if="timetable.warningNotes"> </li>
| Komentarze: <i>{{ timetable.warningNotes }}</i>
</span> <li v-if="timetable.hasDangerousCargo">
<b class="text--primary">{{ $t('warnings.TN') }}</b>
</li>
<li v-if="timetable.hasExtraDeliveries">
<b class="text--primary">{{ $t('warnings.PN') }}</b>
</li> </li>
</ul> </ul>
<div class="dangers-notes" v-if="timetable.warningNotes">
<h4>{{ $t('warnings.header-title') }}</h4>
<p>
<i>{{ timetable.warningNotes }}</i>
</p>
</div>
</div> </div>
<!-- Historia zmian w składzie --> <!-- Historia zmian w składzie -->
@@ -86,7 +95,11 @@
<div class="g-separator"></div> <div class="g-separator"></div>
<b>{{ $t('journal.stock-preview') }}:</b> <b>{{ $t('journal.stock-preview') }}:</b>
<div class="stock-history" v-if="stockHistory.length > 1"> <div class="stock-history">
<button class="btn btn--action" @click="copyStockToClipboard()">
<i class="fa-regular fa-copy"></i> {{ $t('journal.stock-copy') }}
</button>
<button <button
v-for="(sh, i) in stockHistory" v-for="(sh, i) in stockHistory"
:key="i" :key="i"
@@ -119,6 +132,7 @@ import StockList from '../../Global/StockList.vue';
import { API } from '../../../typings/api'; import { API } from '../../../typings/api';
import { RouteLocationRaw } from 'vue-router'; import { RouteLocationRaw } from 'vue-router';
import EntryStops from './EntryStops.vue'; import EntryStops from './EntryStops.vue';
import { useI18n } from 'vue-i18n';
export default defineComponent({ export default defineComponent({
components: { StockList, EntryStops }, components: { StockList, EntryStops },
@@ -137,7 +151,8 @@ export default defineComponent({
}, },
data() { data() {
return { return {
currentHistoryIndex: 0 currentHistoryIndex: 0,
i18n: useI18n()
}; };
}, },
computed: { computed: {
@@ -158,6 +173,7 @@ export default defineComponent({
}; };
}); });
}, },
driverRouteLocation(): RouteLocationRaw | null { driverRouteLocation(): RouteLocationRaw | null {
if (this.timetable.terminated) return null; if (this.timetable.terminated) return null;
return { return {
@@ -176,6 +192,25 @@ export default defineComponent({
toggleExtraInfo() { toggleExtraInfo() {
this.$emit('toggleExtraInfo', this.timetable.id); this.$emit('toggleExtraInfo', this.timetable.id);
},
copyStockToClipboard() {
const currentStockString =
this.stockHistory[this.currentHistoryIndex]?.stockString ?? this.timetable.stockString;
if (!currentStockString) {
alert(this.i18n.t('journal.stock-clipboard-failure'));
return;
}
navigator.clipboard
.writeText(currentStockString)
.then(() => {
prompt(this.i18n.t('journal.stock-clipboard-success'), currentStockString);
})
.catch(() => {
alert(this.i18n.t('journal.stock-clipboard-failure'));
});
} }
} }
}); });
@@ -234,6 +269,19 @@ hr {
list-style: disc; list-style: disc;
padding-left: 1em; padding-left: 1em;
padding-top: 0.5em; padding-top: 0.5em;
white-space: pre-wrap;
}
.dangers-notes {
margin-top: 0.5em;
white-space: pre-wrap;
p {
margin-top: 0.25em;
max-height: 200px;
max-width: 500px;
overflow: auto;
}
} }
@include smallScreen() { @include smallScreen() {
@@ -7,21 +7,38 @@
class="train-badge twr" class="train-badge twr"
v-if="timetable.twr" v-if="timetable.twr"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content=" :data-tooltip-content="$t('warnings.TWR')"
$t('general.TWR') + `${timetable.warningNotes ? ':\n' + timetable.warningNotes : ''}`
"
> >
TWR TWR
</span> </span>
<span <span
class="train-badge skr" class="train-badge skr"
v-if="timetable.skr" v-if="timetable.skr"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('general.SKR')" :data-tooltip-content="$t('warnings.SKR')"
> >
SKR SKR
</span> </span>
<span
class="train-badge tn"
v-if="timetable.hasDangerousCargo"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('warnings.TN')"
>
TN
</span>
<span
class="train-badge pn"
v-if="timetable.hasExtraDeliveries"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('warnings.PN')"
>
PN
</span>
<span> <span>
<strong <strong
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
@@ -21,7 +21,7 @@
> >
</span> </span>
<span class="text--grayed" v-if="timetable.currentSceneryName"> <span class="entry-location" v-if="timetable.currentSceneryName">
<b> <b>
{{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }} {{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }}
{{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }} {{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }}
@@ -71,4 +71,9 @@ export default defineComponent({
justify-content: center; justify-content: center;
} }
} }
.entry-location {
text-align: center;
color: #ccc;
}
</style> </style>
@@ -94,12 +94,13 @@ import { API } from '../../../typings/api';
interface ITimetableStopDetails { interface ITimetableStopDetails {
stopName: string; stopName: string;
stopComments: string | null;
stopTime: number;
stopType: string;
arrivalTimestamp: number; arrivalTimestamp: number;
scheduledArrivalTimestamp: number; scheduledArrivalTimestamp: number;
departureTimestamp: number; departureTimestamp: number;
scheduledDepartureTimestamp: number; scheduledDepartureTimestamp: number;
stopTime: number;
stopType: string;
isConfirmed: boolean; isConfirmed: boolean;
} }
@@ -164,15 +165,17 @@ export default defineComponent({
const stopTime = Number(timetable.checkpointStopTypes.at(i)?.split(',')[0]) || 0; const stopTime = Number(timetable.checkpointStopTypes.at(i)?.split(',')[0]) || 0;
const stopType = timetable.checkpointStopTypes.at(i)?.split(',').slice(1).join(',') || 'pt'; const stopType = timetable.checkpointStopTypes.at(i)?.split(',').slice(1).join(',') || 'pt';
const stopComments = timetable.checkpointComments.at(i) ?? null;
acc.push({ acc.push({
stopName, stopName,
stopTime,
stopType,
stopComments,
arrivalTimestamp: this.dateStringToTimestamp(arrivalDate), arrivalTimestamp: this.dateStringToTimestamp(arrivalDate),
scheduledArrivalTimestamp: this.dateStringToTimestamp(scheduledArrivalDate), scheduledArrivalTimestamp: this.dateStringToTimestamp(scheduledArrivalDate),
departureTimestamp: this.dateStringToTimestamp(departureDate), departureTimestamp: this.dateStringToTimestamp(departureDate),
scheduledDepartureTimestamp: this.dateStringToTimestamp(scheduledDepartureDate), scheduledDepartureTimestamp: this.dateStringToTimestamp(scheduledDepartureDate),
stopTime,
stopType,
isConfirmed: i < timetable.confirmedStopsCount isConfirmed: i < timetable.confirmedStopsCount
}); });
@@ -218,6 +221,10 @@ export default defineComponent({
.stop-name { .stop-name {
font-weight: bold; font-weight: bold;
color: #ccc; color: #ccc;
i {
display: none;
}
} }
.stop-date { .stop-date {
@@ -94,6 +94,7 @@ export default defineComponent({
} }
} }
}, },
methods: { methods: {
toggleExtraInfo(id: number) { toggleExtraInfo(id: number) {
const existingIdx = this.extraInfoIndexes.indexOf(id); const existingIdx = this.extraInfoIndexes.indexOf(id);
+3 -1
View File
@@ -19,7 +19,7 @@ export namespace Journal {
}; };
export type TimetableSorterKey = 'timetableId' | 'beginDate' | 'distance' | 'total-stops'; export type TimetableSorterKey = 'timetableId' | 'beginDate' | 'distance' | 'total-stops';
export type DispatcherSorterKey = 'timestampFrom' | 'duration'; export type DispatcherSorterKey = 'timestampFrom' | 'currentDuration';
export interface DispatcherSorter { export interface DispatcherSorter {
id: DispatcherSorterKey; id: DispatcherSorterKey;
@@ -39,6 +39,8 @@ export namespace Journal {
ALL_SPECIALS = 'all-specials', ALL_SPECIALS = 'all-specials',
TWR = 'twr', TWR = 'twr',
SKR = 'skr', SKR = 'skr',
PN = 'pn',
TN = 'tn',
TWR_SKR = 'twr-skr' TWR_SKR = 'twr-skr'
} }
@@ -19,8 +19,25 @@
:data-status="status" :data-status="status"
> >
<router-link :to="train.driverRouteLocation" class="a-block"> <router-link :to="train.driverRouteLocation" class="a-block">
<span class="user_train">{{ train.trainNo }}</span> <span class="user_train"> {{ train.trainNo }}</span>
<span class="user_name">{{ train.driverName }}</span> <span class="user_name">
{{ train.driverName }}
<i
v-if="train.timetableData != undefined && train.lastSeen <= Date.now() - 120000"
class="fa-solid fa-user-slash"
style="color: lightcoral"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('app.tooltip-driver-offline')"
></i>
<i
v-if="train.currentStationName.indexOf('.sc') != -1"
class="fa-solid fa-ban"
style="color: lightcoral"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
></i>
</span>
</router-link> </router-link>
</li> </li>
</transition-group> </transition-group>
@@ -66,8 +83,13 @@ export default defineComponent({
this.station?.generalInfo?.checkpoints.includes(stop.stopNameRAW) this.station?.generalInfo?.checkpoints.includes(stop.stopNameRAW)
); );
const sceneryName =
train.currentStationName.indexOf('.sc') != -1
? train.currentStationName.split(' ').slice(0, -1).join(' ')
: train.currentStationName;
const status = stop const status = stop
? getTrainStopStatus(stop, train.currentStationName, this.onlineScenery!.name) ? getTrainStopStatus(stop, sceneryName, this.onlineScenery!.name)
: 'no-timetable'; : 'no-timetable';
return { return {
@@ -1,23 +1,18 @@
<template> <template>
<div class="tooltip-content"> <div class="tooltip-content">
<div v-if="imageState == 'loading'" class="loading-info"> <div class="image-box">
{{ $t('vehicle-preview.loading') }} <Loading v-if="imageState == 'loading'" class="loading-info" />
<img
v-if="tooltipStore.type"
@load="onImageLoad"
@error="onImageError"
width="300"
height="176"
:src="`https://stacjownik.spythere.eu/static/images/${vehicleName}--300px.jpg`"
/>
</div> </div>
<div v-if="imageState == 'error'">{{ $t('vehicle-preview.error') }}</div>
<img
v-if="tooltipStore.type"
@load="onImageLoad"
@error="onImageError"
width="300"
height="176"
class="rounded-md w-full h-auto"
:src="`https://static.spythere.eu/images/${vehicleName}--300px.jpg`"
/>
<div v-if="imageState == 'error'" class="error-placeholder"></div>
<div class="vehicle-name"> <div class="vehicle-name">
{{ vehicleName.replace(/_/g, ' ') }} {{ vehicleName.replace(/_/g, ' ') }}
<span v-if="vehicleCargo">({{ vehicleCargo.id }})</span> <span v-if="vehicleCargo">({{ vehicleCargo.id }})</span>
@@ -35,8 +30,11 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { useTooltipStore } from '../../store/tooltipStore'; import { useTooltipStore } from '../../store/tooltipStore';
import { useApiStore } from '../../store/apiStore'; import { useApiStore } from '../../store/apiStore';
import Loading from '../Global/Loading.vue';
export default defineComponent({ export default defineComponent({
components: { Loading },
data() { data() {
return { return {
tooltipStore: useTooltipStore(), tooltipStore: useTooltipStore(),
@@ -61,9 +59,12 @@ export default defineComponent({
}, },
onImageError(e: Event) { onImageError(e: Event) {
if (!e.target || !(e.target instanceof HTMLImageElement) || this.imageState == 'error')
return;
this.imageState = 'error'; this.imageState = 'error';
(e.target as HTMLElement).style.display = 'none'; e.target.src = '/images/no-vehicle-image.png';
} }
}, },
@@ -98,10 +99,16 @@ export default defineComponent({
border-radius: 0.5em; border-radius: 0.5em;
} }
.image-box {
position: relative;
min-height: 170px;
}
.loading-info { .loading-info {
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); top: 35%;
transform: translate(-50%, -50%);
} }
img { img {
+15 -2
View File
@@ -4,10 +4,19 @@
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)" :data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
> >
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref"> <router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
<span class="stop-name" v-html="stop.nameHtml"></span> <b class="stop-name"
><i
v-if="!stop.isSceneryOnline"
class="fa-solid fa-ban"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
style="margin-right: 0.25rem; color: salmon"
></i>
{{ stop.nameRaw }}
</b>
</router-link> </router-link>
<span v-else class="stop-name" v-html="stop.nameHtml"></span> <span v-else class="stop-name">{{ stop.nameRaw }}</span>
<span <span
v-if="stop.position != 'begin'" v-if="stop.position != 'begin'"
@@ -139,6 +148,10 @@ s {
color: #aaa; color: #aaa;
padding: 0; padding: 0;
} }
i {
display: none;
}
} }
.stop { .stop {
+174 -181
View File
@@ -1,177 +1,183 @@
<template> <template>
<div class="train-info" :data-extended="extended"> <div class="train-info" :data-extended="extended">
<section class="train-general"> <div class="general-top-bar">
<div class="general-top-bar"> <div class="top-bar-header">
<div class="top-bar-header"> <b class="warning-timeout" v-if="train.isTimeout" :title="$t('trains.timeout')">?</b>
<b class="warning-timeout" v-if="train.isTimeout" :title="$t('trains.timeout')">?</b> <span class="timetable-id" v-if="train.timetableData">
<span class="timetable-id" v-if="train.timetableData"> #{{ train.timetableData.timetableId }}
#{{ train.timetableData.timetableId }} </span>
</span>
<span <span
class="train-badge twr" class="train-badge twr"
v-if="train.timetableData?.TWR" v-if="train.timetableData?.TWR"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('general.TWR') + `:\n${train.timetableData.warningNotes}`" :data-tooltip-content="$t('warnings.TWR')"
> >
TWR TWR
</span> </span>
<span <span
class="train-badge skr" class="train-badge tn"
v-if="train.timetableData?.SKR" v-if="train.timetableData?.hasDangerousCargo"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('general.SKR')" :data-tooltip-content="$t('warnings.TN')"
>
TN
</span>
<span
class="train-badge pn"
v-if="train.timetableData?.hasExtraDeliveries"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('warnings.PN')"
>
PN
</span>
<b
v-if="train.timetableData"
data-tooltip-type="BaseTooltip"
:data-tooltip-content="getCategoryExplanation(train.timetableData.category)"
class="text--primary tooltip-help"
>
{{ train.timetableData.category }}
</b>
<b class="train-number">{{ train.trainNo }}</b>
<span>&bull;</span>
<div class="train-driver">
<b
class="level-badge driver"
:style="calculateExpStyle(train.driverLevel, train.isSupporter)"
> >
SKR {{ train.driverLevel < 2 ? 'L' : `${train.driverLevel}` }}
</span> </b>
<b <b
v-if="train.timetableData" v-if="apiStore.donatorsData.includes(train.driverName)"
data-tooltip-type="BaseTooltip" data-tooltip-type="DonatorTooltip"
:data-tooltip-content="getCategoryExplanation(train.timetableData.category)" :data-tooltip-content="$t('donations.driver-message')"
class="text--primary tooltip-help"
> >
{{ train.timetableData.category }} {{ train.driverName }}
<img src="/images/icon-diamond.svg" alt="donator diamond icon" />
</b> </b>
<b class="train-number">{{ train.trainNo }}</b>
<span>&bull;</span>
<div class="train-driver"> <span v-else>{{ train.driverName }}</span>
<b
class="level-badge driver"
:style="calculateExpStyle(train.driverLevel, train.isSupporter)"
>
{{ train.driverLevel < 2 ? 'L' : `${train.driverLevel}` }}
</b>
<b
v-if="apiStore.donatorsData.includes(train.driverName)"
data-tooltip-type="DonatorTooltip"
:data-tooltip-content="$t('donations.driver-message')"
>
{{ train.driverName }}
<img src="/images/icon-diamond.svg" alt="donator diamond icon" />
</b>
<span v-else>{{ train.driverName }}</span>
</div>
</div> </div>
</div> </div>
</div>
<div class="general-timetable" v-if="train.timetableData"> <div class="general-timetable" v-if="train.timetableData">
<strong>{{ train.timetableData.route.replace('|', ' - ') }}</strong> <strong>{{ train.timetableData.route.replace('|', ' - ') }}</strong>
<span <span
v-if="getSceneriesWithComments(train.timetableData).length > 0" v-if="getSceneriesWithComments(train.timetableData).length > 0"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="`${$t('trains.timetable-comments')} (${getSceneriesWithComments( :data-tooltip-content="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(
train.timetableData train.timetableData
)})`" )})`"
>
<img class="image-warning" src="/images/icon-warning.svg" />
</span>
</div>
<hr style="margin: 0.25em 0" />
<div class="general-stops" v-if="train.timetableData">
<span v-if="train.timetableData.followingStops.length > 2">
{{ $t('trains.via-title') }}
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
</span>
</div>
<div class="general-status">
<div class="status-timetable-progress" v-if="train.timetableData">
<ProgressBar :progressPercent="confirmedPercentage(train.timetableData.followingStops)" />
<span class="progress-distance">
<span>{{ currentDistance(train.timetableData.followingStops) }} km</span>
<span>/</span>
<span class="text--primary">{{ train.timetableData.routeDistance }} km </span>
<span>|</span>
<span v-html="currentDelay(train.timetableData.followingStops)"></span>
</span>
</div>
<div class="status-badges">
<div v-if="!train.currentStationHash" class="train-badge offline">
<img src="/images/icon-offline.svg" alt="offline train icon" />
{{ $t('trains.scenery-offline') }}
</div>
<div v-if="!train.online" class="train-badge offline">
<img src="/images/icon-offline.svg" alt="offline train icon" />
Offline {{ lastSeenMessage(train.lastSeen) }}
</div>
</div>
</div>
<div class="general-stats" v-if="extended">
<div>
<img src="/images/icon-length.svg" alt="length icon" />
{{ train.length }}m
</div>
<div>
<img src="/images/icon-mass.svg" alt="mass icon" />
{{ (train.mass / 1000).toFixed(1) }}t
</div>
<div>
<img src="/images/icon-speed.svg" alt="speed icon" />
{{ train.speed }} km/h
<span v-if="stockSpeedLimit != Infinity">
&bull;
<em
class="text--grayed"
style="text-decoration: underline dotted"
tabindex="0"
:data-tooltip="$t('trains.vmax-tooltip')"
>
{{ stockSpeedLimit }} km/h
</em>
</span>
</div>
</div>
<div class="text--grayed" style="margin-top: 0.25em">
{{ displayTrainPosition(train) }}
</div>
<div
class="train-dangers"
v-if="extended && (train.timetableData?.TWR || train.timetableData?.SKR)"
> >
<div v-if="train.timetableData.TWR"> <img class="image-warning" src="/images/icon-warning.svg" />
<b style="color: var(--clr-twr)">TWR</b> - {{ $t('general.TWR') }} </span>
<i>({{ train.timetableData?.warningNotes }})</i> </div>
<hr style="margin: 0.25em 0" />
<div class="general-stops" v-if="train.timetableData">
<span v-if="train.timetableData.followingStops.length > 2">
{{ $t('trains.via-title') }}
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
</span>
</div>
<div class="general-status">
<div class="status-timetable-progress" v-if="train.timetableData">
<ProgressBar :progressPercent="confirmedPercentage(train.timetableData.followingStops)" />
<span class="progress-distance">
<span>{{ currentDistance(train.timetableData.followingStops) }} km</span>
<span>/</span>
<span class="text--primary">{{ train.timetableData.routeDistance }} km </span>
<span>|</span>
<span v-html="currentDelay(train.timetableData.followingStops)"></span>
</span>
</div>
<div class="status-badges">
<div v-if="!train.currentStationHash" class="train-badge offline">
<i class="fa-solid fa-ban"></i>
{{ $t('trains.scenery-offline') }}
</div> </div>
<div v-if="train.timetableData.SKR"> <div v-if="!train.online" class="train-badge offline">
<b style="color: var(--clr-skr)">SKR</b> - {{ $t('general.SKR') }} <i class="fa-solid fa-user-slash"></i>
Offline {{ lastSeenMessage(train.lastSeen) }}
</div> </div>
</div> </div>
</section> </div>
<section class="train-stats" v-if="!extended"> <div class="general-stats" v-if="extended">
<StockList :trainStockList="train.stockList" :tractionOnly="true" /> <div>
<img src="/images/icon-length.svg" alt="length icon" />
{{ train.length }}m
</div>
<div> <div>
<span>{{ train.speed }}km/h</span> <img src="/images/icon-mass.svg" alt="mass icon" />
{{ (train.mass / 1000).toFixed(1) }}t
</div>
<div> <div>
<span> {{ train.length }}m</span> <img src="/images/icon-speed.svg" alt="speed icon" />
{{ train.speed }} km/h
<span v-if="stockSpeedLimit != Infinity">
&bull; &bull;
<span> {{ (train.mass / 1000).toFixed(1) }}t</span> <em
<span v-if="train.stockList.length > 1"> class="text--grayed"
&bull; style="text-decoration: underline dotted"
{{ $t('trains.cars') }}: {{ train.stockList.length - 1 }} tabindex="0"
</span> :data-tooltip="$t('trains.vmax-tooltip')"
>
{{ stockSpeedLimit }} km/h
</em>
</span>
</div>
</div>
<div class="text--grayed" style="margin-top: 0.25em">
{{ displayTrainPosition(train) }}
</div>
<div
class="train-dangers"
v-if="extended && train.timetableData && train.timetableData.warningNotes"
>
<div class="dangers-badges">
<div v-if="train.timetableData?.TWR">
<div class="train-badge twr">TWR</div>
- {{ $t('warnings.TWR') }}
</div>
<div v-if="train.timetableData?.hasDangerousCargo">
<div class="train-badge tn">TN</div>
- {{ $t('warnings.TN') }}
</div>
<div v-if="train.timetableData?.hasExtraDeliveries">
<div class="train-badge pn">PN</div>
- {{ $t('warnings.PN') }}
</div> </div>
</div> </div>
</section>
<div class="dangers-notes">
<h4>{{ $t('warnings.header-title') }}</h4>
<p>
<i>{{ train.timetableData?.warningNotes }}</i>
</p>
</div>
</div>
</div> </div>
</template> </template>
@@ -230,7 +236,6 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../styles/responsive.scss';
@import '../../styles/badge.scss'; @import '../../styles/badge.scss';
.image-warning { .image-warning {
@@ -239,31 +244,32 @@ export default defineComponent({
vertical-align: middle; vertical-align: middle;
} }
.train-stats {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
text-align: center;
line-height: 1.5em;
}
.train-dangers { .train-dangers {
margin-top: 0.5em; margin-top: 0.5em;
} }
.train-info { .dangers-badges {
display: grid; display: flex;
grid-template-columns: 2fr 1fr; flex-direction: column;
grid-template-rows: 1fr; gap: 0.5em;
}
&[data-extended='true'] { .dangers-notes {
grid-template-columns: 1fr; margin-top: 0.5em;
white-space: pre-wrap;
p {
margin-top: 0.25em;
max-height: 200px;
max-width: 500px;
overflow: auto;
} }
}
padding: 1em; .train-info {
display: flex;
flex-direction: column;
gap: 0.25em;
background-color: #1a1a1a; background-color: #1a1a1a;
gap: 0.5em; gap: 0.5em;
@@ -293,12 +299,6 @@ export default defineComponent({
padding: 0 0.25em; padding: 0 0.25em;
} }
.train-general {
display: flex;
flex-direction: column;
gap: 0.25em;
}
.general-stops { .general-stops {
font-size: 0.8em; font-size: 0.8em;
} }
@@ -375,11 +375,4 @@ export default defineComponent({
display: flex; display: flex;
gap: 0.25em; gap: 0.25em;
} }
@include smallScreen() {
.train-info {
grid-template-columns: 1fr;
gap: 1em 0;
}
}
</style> </style>
+9 -15
View File
@@ -1,7 +1,5 @@
<template> <template>
<div class="train-schedule" @click="toggleShowState"> <div class="train-schedule">
<StockList :trainStockList="train.stockList" />
<div class="schedule-wrapper" v-if="train.timetableData"> <div class="schedule-wrapper" v-if="train.timetableData">
<div class="stops"> <div class="stops">
<div <div
@@ -136,7 +134,7 @@ import StopLabel from './StopLabel.vue';
import StockList from '../Global/StockList.vue'; import StockList from '../Global/StockList.vue';
import { useMainStore } from '../../store/mainStore'; import { useMainStore } from '../../store/mainStore';
import { useApiStore } from '../../store/apiStore'; import { useApiStore } from '../../store/apiStore';
import { StationRoutesInfo, Train } from '../../typings/common'; import { Train } from '../../typings/common';
import { TrainScheduleStop } from './typings'; import { TrainScheduleStop } from './typings';
export default defineComponent({ export default defineComponent({
@@ -175,6 +173,10 @@ export default defineComponent({
const sceneryName = timetablePath[currentPathIndex].stationName; const sceneryName = timetablePath[currentPathIndex].stationName;
const sceneryInfo = this.apiStore.sceneryData.find((st) => st.name == sceneryName); const sceneryInfo = this.apiStore.sceneryData.find((st) => st.name == sceneryName);
const isSceneryOnline =
(this.apiStore.activeData?.activeSceneries?.find((sc) => sc.stationName == sceneryName)
?.isOnline ?? 0) == 1;
const arrivalLineInfo = sceneryInfo?.routesInfo.find( const arrivalLineInfo = sceneryInfo?.routesInfo.find(
(r) => r.routeName == stop.arrivalLine (r) => r.routeName == stop.arrivalLine
); );
@@ -216,8 +218,10 @@ export default defineComponent({
isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere, isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere,
isSBL: /sbl/gi.test(stop.stopName), isSBL: /sbl/gi.test(stop.stopName),
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route', position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed',
sceneryName, sceneryName,
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed' isSceneryOnline
}; };
}) ?? [] }) ?? []
); );
@@ -252,12 +256,6 @@ export default defineComponent({
return activeMinorStopList; return activeMinorStopList;
} }
},
methods: {
toggleShowState() {
this.$emit('click');
}
} }
}); });
</script> </script>
@@ -281,10 +279,6 @@ $blinkAnim: 0.5s ease-in-out alternate infinite blink;
} }
} }
.train-schedule {
padding: 1em;
}
.schedule-wrapper { .schedule-wrapper {
overflow-y: auto; overflow-y: auto;
width: 100%; width: 100%;
-1
View File
@@ -249,7 +249,6 @@ h3 {
} }
@include smallScreen { @include smallScreen {
h1,
.no-data { .no-data {
text-align: center; text-align: center;
} }
+8 -18
View File
@@ -13,15 +13,7 @@
</div> </div>
<transition-group name="list-anim" tag="ul"> <transition-group name="list-anim" tag="ul">
<li <TrainTableItem v-for="train in trains" :key="train.id" :train="train" />
class="train-row"
v-for="train in trains"
:key="train.id"
>
<router-link class="a-block" :to="train.driverRouteLocation">
<TrainInfo :train="train" :extended="false" />
</router-link>
</li>
</transition-group> </transition-group>
</div> </div>
</transition> </transition>
@@ -30,13 +22,15 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, inject, PropType, Ref } from 'vue'; import { defineComponent, inject, PropType, Ref } from 'vue';
import { useMainStore } from '../../store/mainStore'; import { useMainStore } from '../../store/mainStore';
import Loading from '../Global/Loading.vue';
import TrainInfo from './TrainInfo.vue';
import { Status, Train } from '../../typings/common';
import { useApiStore } from '../../store/apiStore'; import { useApiStore } from '../../store/apiStore';
import { Status, Train } from '../../typings/common';
import Loading from '../Global/Loading.vue';
import TrainTableItem from './TrainTableItem.vue';
import TrainInfo from './TrainInfo.vue';
export default defineComponent({ export default defineComponent({
components: { Loading, TrainInfo }, components: { Loading, TrainInfo, TrainTableItem },
props: { props: {
trains: { trains: {
@@ -99,9 +93,5 @@ export default defineComponent({
background: #1a1a1a; background: #1a1a1a;
} }
li.train-row {
background-color: var(--clr-secondary);
margin-bottom: 1em;
width: 100%;
}
</style> </style>
@@ -0,0 +1,76 @@
<template>
<li class="train-item">
<router-link class="a-block" :to="train.driverRouteLocation">
<div class="item-wrapper">
<TrainInfo :train="train" />
<div class="train-stats">
<StockList :trainStockList="train.stockList" :tractionOnly="true" />
<div>
<span>{{ train.speed }}km/h</span>
<div>
<span> {{ train.length }}m</span>
&bull;
<span> {{ (train.mass / 1000).toFixed(1) }}t</span>
<span v-if="train.stockList.length > 1">
&bull;
{{ $t('trains.cars') }}: {{ train.stockList.length - 1 }}
</span>
</div>
</div>
</div>
</div>
</router-link>
</li>
</template>
<script setup lang="ts">
import { PropType } from 'vue';
import { Train } from '../../typings/common';
import TrainInfo from './TrainInfo.vue';
import StockList from '../Global/StockList.vue';
defineProps({
train: {
type: Object as PropType<Train>,
required: true
}
});
</script>
<style lang="scss" scoped>
@import '../../styles/responsive.scss';
.train-item {
background-color: #1a1a1a;
margin-bottom: 1em;
width: 100%;
padding: 1em;
}
.item-wrapper {
display: grid;
grid-template-columns: 2fr 1fr;
grid-template-rows: 1fr;
}
.train-stats {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
text-align: center;
line-height: 1.5em;
}
@include smallScreen() {
.item-wrapper {
grid-template-columns: 1fr;
gap: 1em 0;
}
}
</style>
+11 -2
View File
@@ -12,12 +12,14 @@ export const enum TrainFilterId {
withComments = 'withComments', withComments = 'withComments',
twr = 'twr', twr = 'twr',
skr = 'skr', tn = 'tn',
pn = 'pn',
common = 'common', common = 'common',
passenger = 'passenger', passenger = 'passenger',
freight = 'freight', freight = 'freight',
other = 'other', other = 'other',
noTimetable = 'noTimetable', noTimetable = 'noTimetable',
withTimetable = 'withTimetable' withTimetable = 'withTimetable'
} }
@@ -40,7 +42,12 @@ export const trainFilters: TrainFilter[] = [
isActive: true isActive: true
}, },
{ {
id: TrainFilterId.skr, id: TrainFilterId.tn,
section: TrainFilterSection.TRAIN_TYPE,
isActive: true
},
{
id: TrainFilterId.pn,
section: TrainFilterSection.TRAIN_TYPE, section: TrainFilterSection.TRAIN_TYPE,
isActive: true isActive: true
}, },
@@ -144,6 +151,8 @@ export interface TrainScheduleStop {
isSBL: boolean; isSBL: boolean;
sceneryName: string | null; sceneryName: string | null;
isSceneryOnline: boolean;
distance: number; distance: number;
arrivalLine: string | null; arrivalLine: string | null;
+25 -9
View File
@@ -20,11 +20,16 @@
"dispatcher-message": "Dispatcher supporting the Stacjownik project!", "dispatcher-message": "Dispatcher supporting the Stacjownik project!",
"driver-message": "Driver supporting the Stacjownik project!" "driver-message": "Driver supporting the Stacjownik project!"
}, },
"warnings": {
"TWR": "Train with high risk cargo",
"SKR": "Train with exceeded gauge",
"PN": "Train with extra deliveries",
"TN": "Train with dangerous cargo",
"header-title": "Freight notes:"
},
"general": { "general": {
"and": " and ", "and": " and ",
"refresh": "REFRESH", "refresh": "REFRESH"
"TWR": "High risk freight train",
"SKR": "Train with exceeded gauge"
}, },
"update": { "update": {
"title": "Stacjownik update!", "title": "Stacjownik update!",
@@ -43,7 +48,9 @@
"no-result": "No results for current search!", "no-result": "No results for current search!",
"migration-warning": "Stacjownik services will be unavailable 2/06/2022 between 1-3am (CEST time) due to the migration of API hostings!", "migration-warning": "Stacjownik services will be unavailable 2/06/2022 between 1-3am (CEST time) due to the migration of API hostings!",
"migration-confirm": "Roger that!", "migration-confirm": "Roger that!",
"offline": "App is in the offline mode!" "offline": "App is in the offline mode!",
"tooltip-driver-offline": "Driver is offline",
"tooltip-scenery-offline": "Scenery is offline"
}, },
"footer": { "footer": {
"discord": "Stacjownik Discord server" "discord": "Stacjownik Discord server"
@@ -188,15 +195,17 @@
"sort-beginDate": "date", "sort-beginDate": "date",
"sort-timetableId": "timetable ID", "sort-timetableId": "timetable ID",
"sort-timestampFrom": "date", "sort-timestampFrom": "date",
"sort-duration": "duration", "sort-currentDuration": "duration",
"filter-noComments": "NO COMMENTS", "filter-noComments": "NO COMMENTS",
"filter-withComments": "COMMENTS", "filter-withComments": "COMMENTS",
"filter-twr": "HIGH RISK CARGO", "filter-twr": "TWR",
"filter-skr": "EXCEEDED GAUGE", "filter-skr": "SKR",
"filter-tn": "TN",
"filter-pn": "PN",
"filter-twr-skr": "BOTH TYPES", "filter-twr-skr": "BOTH TYPES",
"filter-all-specials": "ALL", "filter-all-specials": "ALL",
"filter-common": "NO WARNINGS", "filter-common": "COMMON",
"filter-passenger": "PASSENGER", "filter-passenger": "PASSENGER",
"filter-freight": "FREIGHT", "filter-freight": "FREIGHT",
"filter-other": "OTHER", "filter-other": "OTHER",
@@ -416,7 +425,11 @@
"driver-not-found-desc-2": "You can browse timetable history in the", "driver-not-found-desc-2": "You can browse timetable history in the",
"driver-not-found-journal": "TIMETABLES JOURNAL", "driver-not-found-journal": "TIMETABLES JOURNAL",
"driver-not-found-others": "Player {driver} is online as:", "driver-not-found-others": "Player {driver} is online as:",
"driver-not-found-return": "GO BACK TO THE MAIN SITE" "driver-not-found-return": "GO BACK TO THE MAIN SITE",
"stock-copy": "COPY THE STOCK",
"stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard!",
"stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/"
}, },
"train-stats": { "train-stats": {
"stats-button": "STATISTICS", "stats-button": "STATISTICS",
@@ -471,6 +484,9 @@
"stock-dangers": "ADDITIONAL NOTES", "stock-dangers": "ADDITIONAL NOTES",
"stock-preview": "STOCK PREVIEW", "stock-preview": "STOCK PREVIEW",
"stock-copy": "COPY THE STOCK",
"stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard:",
"stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/",
"load-data": "Load further data...", "load-data": "Load further data...",
+25 -9
View File
@@ -20,11 +20,16 @@
"dispatcher-message": "Dyżurny wspierający projekt Stacjownika!", "dispatcher-message": "Dyżurny wspierający projekt Stacjownika!",
"driver-message": "Maszynista wspierający projekt Stacjownika!" "driver-message": "Maszynista wspierający projekt Stacjownika!"
}, },
"warnings": {
"TWR": "Pociąg z towarami niebezpiecznymi wysokiego ryzyka",
"SKR": "Pociąg z przekroczoną skrajnią",
"PN": "Pociąg z przesyłkami nadzwyczajnymi",
"TN": "Pociąg z towarami niebezpiecznymi",
"header-title": "Uwagi przewozowe:"
},
"general": { "general": {
"and": " oraz ", "and": " oraz ",
"refresh": "ODŚWIEŻ", "refresh": "ODŚWIEŻ"
"TWR": "Towar niebezpieczny wysokiego ryzyka",
"SKR": "Przekroczona skrajnia"
}, },
"update": { "update": {
"title": "Aktualizacja Stacjownika!", "title": "Aktualizacja Stacjownika!",
@@ -40,7 +45,9 @@
"loading": "Pobieranie danych...", "loading": "Pobieranie danych...",
"error": "Wystąpił problem z załadowaniem danych!", "error": "Wystąpił problem z załadowaniem danych!",
"no-result": "Brak wyników o podanych kryteriach!", "no-result": "Brak wyników o podanych kryteriach!",
"offline": "Aplikacja w trybie offline!" "offline": "Aplikacja w trybie offline!",
"tooltip-driver-offline": "Maszynista offline",
"tooltip-scenery-offline": "Sceneria offline"
}, },
"footer": { "footer": {
"discord": "Serwer Discord Stacjownika" "discord": "Serwer Discord Stacjownika"
@@ -58,7 +65,7 @@
"RP": "wojewódzki pospieszny", "RP": "wojewódzki pospieszny",
"RO": "wojewódzki osobowy", "RO": "wojewódzki osobowy",
"RM": "wojewódzki osobowy międzynarodowy", "RM": "wojewódzki osobowy międzynarodowy",
"RA": "wojewódzki osobowy algomeracyjny", "RA": "wojewódzki osobowy aglomeracyjny",
"PW": "pasażerski próżny - służbowy", "PW": "pasażerski próżny - służbowy",
"PX": "pasażerski próżny próbny", "PX": "pasażerski próżny próbny",
@@ -177,7 +184,7 @@
"sort-beginDate": "data", "sort-beginDate": "data",
"sort-timetableId": "ID rozkładu", "sort-timetableId": "ID rozkładu",
"sort-timestampFrom": "data", "sort-timestampFrom": "data",
"sort-duration": "czas dyżuru", "sort-currentDuration": "czas dyżuru",
"sort-id": "id rozkładu", "sort-id": "id rozkładu",
"sort-mass": "masa", "sort-mass": "masa",
@@ -190,8 +197,10 @@
"filter-withComments": "UWAGI EKSPLOATACYJNE", "filter-withComments": "UWAGI EKSPLOATACYJNE",
"filter-noComments": "BEZ UWAG", "filter-noComments": "BEZ UWAG",
"filter-twr": "WYS. RYZYKA", "filter-twr": "TWR",
"filter-skr": "SKRAJNIA", "filter-skr": "SKR",
"filter-tn": "TN",
"filter-pn": "PN",
"filter-twr-skr": "TWR/SKR", "filter-twr-skr": "TWR/SKR",
"filter-all-statuses": "WSZYSTKIE", "filter-all-statuses": "WSZYSTKIE",
"filter-common": "ZWYKŁE", "filter-common": "ZWYKŁE",
@@ -402,7 +411,11 @@
"driver-not-found-desc-2": "Historię rozkładów jazdy możesz przejrzeć w", "driver-not-found-desc-2": "Historię rozkładów jazdy możesz przejrzeć w",
"driver-not-found-journal": "DZIENNIKU RJ", "driver-not-found-journal": "DZIENNIKU RJ",
"driver-not-found-others": "Gracz {driver} jest online jako:", "driver-not-found-others": "Gracz {driver} jest online jako:",
"driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ" "driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ",
"stock-copy": "SKOPIUJ SKŁAD",
"stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka!",
"stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/"
}, },
"train-stats": { "train-stats": {
"stats-button": "STATYSTYKI", "stats-button": "STATYSTYKI",
@@ -455,6 +468,9 @@
"stock-dangers": "DODATKOWE UWAGI", "stock-dangers": "DODATKOWE UWAGI",
"stock-preview": "PODGLĄD SKŁADU", "stock-preview": "PODGLĄD SKŁADU",
"stock-copy": "SKOPIUJ SKŁAD",
"stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka:",
"stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/",
"load-data": "Pobierz dalszą historię...", "load-data": "Pobierz dalszą historię...",
+5 -2
View File
@@ -45,8 +45,11 @@ function filterTrainList(
case TrainFilterId.twr: case TrainFilterId.twr:
return !train.timetableData?.TWR; return !train.timetableData?.TWR;
case TrainFilterId.skr: case TrainFilterId.pn:
return !train.timetableData?.SKR; return !train.timetableData?.hasExtraDeliveries;
case TrainFilterId.tn:
return !train.timetableData?.hasDangerousCargo;
case TrainFilterId.common: case TrainFilterId.common:
return train.timetableData?.SKR || train.timetableData?.TWR; return train.timetableData?.SKR || train.timetableData?.TWR;
+1 -5
View File
@@ -59,11 +59,7 @@ export const useApiStore = defineStore('apiStore', {
if (t >= this.nextDataCheckTime) { if (t >= this.nextDataCheckTime) {
this.fetchDonatorsData(); this.fetchDonatorsData();
this.fetchVehiclesInfo(); this.fetchVehiclesInfo();
this.fetchStationsGeneralInfo();
// Revalidation after staling
this.fetchStationsGeneralInfo().then(() => {
this.fetchStationsGeneralInfo();
});
this.nextDataCheckTime = t + 3600000; this.nextDataCheckTime = t + 3600000;
} }
+14 -8
View File
@@ -43,7 +43,7 @@ export const useMainStore = defineStore('mainStore', {
sceneriesTrains.clear(); sceneriesTrains.clear();
return (apiStore.activeData?.trains ?? []) return (apiStore.activeData?.trains ?? [])
.filter((train) => train.timetable || train.online) .filter((train) => train.timetable || train.lastSeen >= Date.now() - 60000)
.map((train) => { .map((train) => {
const stock = train.stockString.split(';'); const stock = train.stockString.split(';');
const locoType = stock ? stock[0] : train.stockString; const locoType = stock ? stock[0] : train.stockString;
@@ -87,14 +87,16 @@ export const useMainStore = defineStore('mainStore', {
timetableData: timetable timetableData: timetable
? { ? {
timetableId: timetable.timetableId, timetableId: timetable.timetableId,
SKR: timetable.SKR,
TWR: timetable.TWR,
route: timetable.route, route: timetable.route,
category: timetable.category, category: timetable.category,
followingStops: timetable.stopList, followingStops: timetable.stopList,
routeDistance: timetable.stopList[timetable.stopList.length - 1].stopDistance, routeDistance: timetable.stopList[timetable.stopList.length - 1].stopDistance,
sceneries: timetable.sceneries, sceneries: timetable.sceneries,
TWR: timetable.TWR,
SKR: timetable.SKR,
warningNotes: timetable.warningNotes, warningNotes: timetable.warningNotes,
hasDangerousCargo: timetable.hasDangerousCargo,
hasExtraDeliveries: timetable.hasExtraDeliveries,
timetablePath: timetable.path.split(';').map((pathElementString) => { timetablePath: timetable.path.split(';').map((pathElementString) => {
const [arrival, station, departure] = pathElementString.split(','); const [arrival, station, departure] = pathElementString.split(',');
@@ -110,13 +112,15 @@ export const useMainStore = defineStore('mainStore', {
: undefined : undefined
} as Train; } as Train;
const stationNameKey = train.currentStationName.indexOf('.sc') != -1 ? train.currentStationName.split(' ').slice(0, -1).join(' ') : train.currentStationName;
// Sceneries trains map // Sceneries trains map
if (sceneriesTrains.has(train.currentStationName)) { if (sceneriesTrains.has(stationNameKey)) {
sceneriesTrains.set(train.currentStationName, [ sceneriesTrains.set(stationNameKey, [
...sceneriesTrains.get(train.currentStationName)!, ...sceneriesTrains.get(stationNameKey)!,
trainObj trainObj
]); ]);
} else sceneriesTrains.set(train.currentStationName, [trainObj]); } else sceneriesTrains.set(stationNameKey, [trainObj]);
// Checkpoints trains map // Checkpoints trains map
if (trainObj.timetableData) { if (trainObj.timetableData) {
@@ -214,13 +218,15 @@ export const useMainStore = defineStore('mainStore', {
return acc; return acc;
}, [] as ActiveScenery[]); }, [] as ActiveScenery[]);
const referenceTimestamp = Date.now();
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => { const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
if (scenery.isOnline !== 1 && Date.now() - scenery.lastSeen > 1000 * 60 * 2) return list; if (scenery.isOnline !== 1 && Date.now() - scenery.lastSeen > 1000 * 60 * 2) return list;
if (scenery.dispatcherStatus == Status.ActiveDispatcher.UNKNOWN) return list; if (scenery.dispatcherStatus == Status.ActiveDispatcher.UNKNOWN) return list;
const dispatcherTimestamp = const dispatcherTimestamp =
scenery.dispatcherStatus == Status.ActiveDispatcher.NO_LIMIT scenery.dispatcherStatus == Status.ActiveDispatcher.NO_LIMIT
? Date.now() + 25500000 ? referenceTimestamp + 25500000
: scenery.dispatcherStatus > 5 : scenery.dispatcherStatus > 5
? scenery.dispatcherStatus ? scenery.dispatcherStatus
: null; : null;
+13 -3
View File
@@ -79,18 +79,17 @@
} }
.train-badge { .train-badge {
display: flex; display: inline-block;
align-items: center;
gap: 0.3em; gap: 0.3em;
padding: 0.1em 0.3em; padding: 0.1em 0.3em;
border-radius: 0.2em; border-radius: 0.2em;
font-weight: bold; font-weight: bold;
user-select: none;
&.twr { &.twr {
background-color: var(--clr-twr); background-color: var(--clr-twr);
box-shadow: 0 0 5px 1px var(--clr-twr); box-shadow: 0 0 5px 1px var(--clr-twr);
color: black;
} }
&.skr { &.skr {
@@ -98,6 +97,17 @@
box-shadow: 0 0 5px 1px var(--clr-skr); box-shadow: 0 0 5px 1px var(--clr-skr);
} }
&.tn {
background-color: var(--clr-tn);
box-shadow: 0 0 5px 1px var(--clr-tn);
}
&.pn {
background-color: var(--clr-pn);
box-shadow: 0 0 5px 1px var(--clr-pn);
color: black;
}
&.offline { &.offline {
background-color: #be3728; background-color: #be3728;
} }
+4 -2
View File
@@ -13,7 +13,9 @@
--clr-accent2: #ff3d5d; --clr-accent2: #ff3d5d;
--clr-skr: #ff5100; --clr-skr: #ff5100;
--clr-twr: #ffbb00; --clr-twr: #ee503e;
--clr-tn: #cb4dcf;
--clr-pn: #ffd000;
--clr-error: #fa3636; --clr-error: #fa3636;
--clr-warning: #c59429; --clr-warning: #c59429;
@@ -225,7 +227,7 @@ a.a-button {
font-weight: bold; font-weight: bold;
&:hover { &:hover {
background-color: #424242; background-color: #505050;
} }
&:disabled { &:disabled {
-3
View File
@@ -9,6 +9,3 @@ $warningCol: #ffe15b;
$accentCol: #ffc014; $accentCol: #ffc014;
$accent2Col: #ff3d5d; $accent2Col: #ff3d5d;
$skr: #ff5100;
$twr: #ffbb00;
+7 -3
View File
@@ -201,10 +201,11 @@ export namespace API {
TWR: boolean; TWR: boolean;
SKR: boolean; SKR: boolean;
sceneries: string[]; hasDangerousCargo: boolean;
hasExtraDeliveries: boolean;
path: string;
warningNotes: string | null; warningNotes: string | null;
sceneries: string[];
path: string;
} }
} }
@@ -262,10 +263,13 @@ export namespace API {
checkpointArrivalsScheduled: string[]; checkpointArrivalsScheduled: string[];
checkpointDeparturesScheduled: string[]; checkpointDeparturesScheduled: string[];
checkpointStopTypes: string[]; checkpointStopTypes: string[];
checkpointComments: string[];
visitedSceneries: string[]; visitedSceneries: string[];
sceneryNames: string[]; sceneryNames: string[];
path: string; path: string;
warningNotes: string | null; warningNotes: string | null;
hasDangerousCargo: boolean;
hasExtraDeliveries: boolean;
} }
export type Response = Data[]; export type Response = Data[];
+3 -1
View File
@@ -84,10 +84,12 @@ export interface TrainTimetableData {
followingStops: TrainStop[]; followingStops: TrainStop[];
TWR: boolean; TWR: boolean;
SKR: boolean; SKR: boolean;
hasDangerousCargo: boolean;
hasExtraDeliveries: boolean;
warningNotes: string | null;
routeDistance: number; routeDistance: number;
sceneries: string[]; sceneries: string[];
timetablePath: TimetablePathElement[]; timetablePath: TimetablePathElement[];
warningNotes: string | null;
} }
export interface Station { export interface Station {
+31 -1
View File
@@ -17,12 +17,19 @@
<span class="hidable"> <span class="hidable">
{{ $t('trains.driver-journal-link') }} {{ $t('trains.driver-journal-link') }}
</span> </span>
<img src="/images/icon-train.svg" alt="train icon" /> <img src="/images/icon-train.svg" alt="train icon" />
</router-link> </router-link>
</div> </div>
<div class="train-card"> <div class="train-card">
<TrainInfo :train="chosenTrain" :extended="true" ref="trainInfo" /> <TrainInfo :train="chosenTrain" :extended="true" />
<button class="btn btn--action" style="margin: 1em 0" @click="copyStockToClipboard()">
<i class="fa-regular fa-copy"></i> {{ $t('trains.stock-copy') }}
</button>
<StockList :trainStockList="chosenTrain.stockList" />
<TrainSchedule :train="chosenTrain" /> <TrainSchedule :train="chosenTrain" />
</div> </div>
</div> </div>
@@ -69,11 +76,13 @@
import { computed } from 'vue'; import { computed } from 'vue';
import TrainInfo from '../components/TrainsView/TrainInfo.vue'; import TrainInfo from '../components/TrainsView/TrainInfo.vue';
import TrainSchedule from '../components/TrainsView/TrainSchedule.vue'; import TrainSchedule from '../components/TrainsView/TrainSchedule.vue';
import StockList from '../components/Global/StockList.vue';
import Loading from '../components/Global/Loading.vue'; import Loading from '../components/Global/Loading.vue';
import { useMainStore } from '../store/mainStore'; import { useMainStore } from '../store/mainStore';
import { useApiStore } from '../store/apiStore'; import { useApiStore } from '../store/apiStore';
import { Status } from '../typings/common'; import { Status } from '../typings/common';
import { regions as regionsJSON } from '../data/options.json'; import { regions as regionsJSON } from '../data/options.json';
import { useI18n } from 'vue-i18n';
const props = defineProps({ const props = defineProps({
trainId: { trainId: {
@@ -88,6 +97,8 @@ const props = defineProps({
const mainStore = useMainStore(); const mainStore = useMainStore();
const apiStore = useApiStore(); const apiStore = useApiStore();
const i18n = useI18n();
const chosenTrain = computed(() => const chosenTrain = computed(() =>
mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId) mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId)
); );
@@ -99,6 +110,24 @@ const otherDriverTrains = computed(() => {
(train.timetableData || train.online || train.lastSeen >= Date.now() - 60000) (train.timetableData || train.online || train.lastSeen >= Date.now() - 60000)
); );
}); });
function copyStockToClipboard() {
const stockString = chosenTrain.value?.stockList.join(';');
if (!stockString) {
alert(i18n.t('trains.stock-clipboard-failure'));
return;
}
navigator.clipboard
.writeText(stockString)
.then(() => {
prompt(i18n.t('trains.stock-clipboard-success'), stockString);
})
.catch(() => {
alert(i18n.t('trains.stock-clipboard-failure'));
});
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -131,6 +160,7 @@ $viewBgCol: #1a1a1a;
} }
.train-card { .train-card {
padding: 1em;
background-color: $viewBgCol; background-color: $viewBgCol;
border-radius: 0 0 0.5em 0.5em; border-radius: 0 0 0.5em 0.5em;
} }
+52 -44
View File
@@ -7,8 +7,8 @@
<JournalOptions <JournalOptions
@on-search-confirm="fetchHistoryData" @on-search-confirm="fetchHistoryData"
@on-options-reset="resetOptions" @on-options-reset="resetOptions"
@on-refresh-data="fetchHistoryData(true)" @on-refresh-data="fetchHistoryData"
:sorter-option-ids="['timestampFrom', 'duration']" :sorter-option-ids="['timestampFrom', 'currentDuration']"
:data-status="dataStatus" :data-status="dataStatus"
:current-options-active="currentOptionsActive" :current-options-active="currentOptionsActive"
optionsType="dispatchers" optionsType="dispatchers"
@@ -59,6 +59,28 @@ const statsButtons: Journal.StatsButton[] = [
} }
]; ];
interface DispatchersQueryParams {
dispatcherName?: string;
stationName?: string;
stationHash?: string;
timestampFrom?: number;
timestampTo?: number;
countFrom?: number;
countLimit?: number;
sortBy?: Journal.DispatcherSorter['id'];
}
const defaultQueryParams: DispatchersQueryParams = {
countLimit: 30,
sortBy: 'timestampFrom',
countFrom: undefined,
dispatcherName: undefined,
stationHash: undefined,
stationName: undefined,
timestampFrom: undefined,
timestampTo: undefined
};
export default defineComponent({ export default defineComponent({
components: { components: {
JournalOptions, JournalOptions,
@@ -83,9 +105,8 @@ export default defineComponent({
data: () => ({ data: () => ({
statsButtons, statsButtons,
currentQuery: '',
currentQueryArray: [] as string[],
dataRefreshedAt: null as Date | null, dataRefreshedAt: null as Date | null,
currentQueryParams: {} as DispatchersQueryParams,
scrollDataLoaded: true, scrollDataLoaded: true,
scrollNoMoreData: false, scrollNoMoreData: false,
@@ -109,9 +130,6 @@ export default defineComponent({
'search-date': '' 'search-date': ''
} as Journal.DispatcherSearchType); } as Journal.DispatcherSearchType);
const countFromIndex = ref(0);
const countLimit = 15;
provide('sorterActive', sorterActive); provide('sorterActive', sorterActive);
provide('journalFilterActive', journalFilterActive); provide('journalFilterActive', journalFilterActive);
provide('searchersValues', searchersValues); provide('searchersValues', searchersValues);
@@ -126,19 +144,17 @@ export default defineComponent({
sorterActive, sorterActive,
searchersValues, searchersValues,
countFromIndex, scrollElement
countLimit,
scrollElement,
maxCount: ref(15)
}; };
}, },
watch: { watch: {
currentQueryArray(q: string[]) { currentQueryParams(queryParams: DispatchersQueryParams) {
this.currentOptionsActive = this.currentOptionsActive = Object.keys(queryParams).some(
q.length > 2 || (k) =>
q.some((qv) => qv.startsWith('sortBy=') && qv.split('=')[1] != 'timestampFrom'); queryParams[k as keyof DispatchersQueryParams] !=
defaultQueryParams[k as keyof DispatchersQueryParams]
);
}, },
'mainStore.dispatcherStatsData'(stats) { 'mainStore.dispatcherStatsData'(stats) {
@@ -234,13 +250,10 @@ export default defineComponent({
async addHistoryData() { async addHistoryData() {
this.scrollDataLoaded = false; this.scrollDataLoaded = false;
this.currentQueryParams['countFrom'] = this.historyList.length;
this.countFromIndex = this.historyList.length;
const responseData: API.DispatcherHistory.Response = await ( const responseData: API.DispatcherHistory.Response = await (
await this.apiStore.client!.get( await this.apiStore.client!.get(`api/getDispatchers`, { params: this.currentQueryParams })
`api/getDispatchers?${this.currentQuery}&countFrom=${this.countFromIndex}`
)
).data; ).data;
if (!responseData) return; if (!responseData) return;
@@ -254,43 +267,38 @@ export default defineComponent({
this.scrollDataLoaded = true; this.scrollDataLoaded = true;
}, },
async fetchHistoryData(reset = false) { async fetchHistoryData() {
const queries: string[] = []; const queryParams: DispatchersQueryParams = {};
const dispatcher = this.searchersValues['search-dispatcher'].trim(); const dispatcherName = this.searchersValues['search-dispatcher'].trim() || undefined;
const station = this.searchersValues['search-station'].trim(); const stationName = this.searchersValues['search-station'].trim() || undefined;
const dateString = this.searchersValues['search-date'].trim(); const dateString = this.searchersValues['search-date'].trim() || undefined;
const timestampFrom = dateString const timestampFrom = dateString
? Date.parse(new Date(dateString).toISOString()) - 120 * 60 * 1000 ? Date.parse(new Date(dateString).toISOString()) - 120 * 60 * 1000
: undefined; : undefined;
const timestampTo = timestampFrom ? timestampFrom + 86400000 : undefined; const timestampTo = timestampFrom ? timestampFrom + 86400000 : undefined;
if (dispatcher) queries.push(`dispatcherName=${dispatcher}`); queryParams['dispatcherName'] = dispatcherName;
queryParams['timestampFrom'] = timestampFrom;
queryParams['timestampTo'] = timestampTo;
queryParams['countLimit'] = 30;
if (station.startsWith("#")) queries.push(`stationHash=${station.slice(1)}`); if (stationName && stationName.startsWith('#'))
else if (station.length > 0) queries.push(`stationName=${station}`); queryParams['stationHash'] = stationName.slice(1);
else queryParams['stationName'] = stationName;
if (timestampFrom && timestampTo) queryParams['sortBy'] = this.sorterActive.id;
queries.push(`timestampFrom=${timestampFrom}`, `timestampTo=${timestampTo}`);
// API: const SORT_TYPES = ['allStopsCount', 'endDate', 'beginDate', 'routeDistance']; if (JSON.stringify(this.currentQueryParams) != JSON.stringify(queryParams))
if (this.sorterActive.id == 'timestampFrom') queries.push('sortBy=timestampFrom'); this.dataStatus = Status.Data.Loading;
else if (this.sorterActive.id == 'duration') queries.push('sortBy=currentDuration');
else queries.push('sortBy=timestampFrom');
queries.push('countLimit=30'); this.currentQueryParams = queryParams;
if (this.currentQuery != queries.join('&')) this.dataStatus = Status.Data.Loading;
this.currentQuery = queries.join('&');
this.currentQueryArray = queries;
try { try {
if (reset) this.dataStatus = Status.Data.Loading;
const responseData: API.DispatcherHistory.Response = await ( const responseData: API.DispatcherHistory.Response = await (
await this.apiStore.client!.get(`api/getDispatchers?${this.currentQuery}`) await this.apiStore.client!.get(`api/getDispatchers`, { params: this.currentQueryParams })
).data; ).data;
if (!responseData) { if (!responseData) {
+18 -9
View File
@@ -105,7 +105,13 @@ export const journalTimetableFilters: Journal.TimetableFilter[] = [
default: false default: false
}, },
{ {
id: Journal.TimetableFilterId.TWR_SKR, id: Journal.TimetableFilterId.TN,
filterSection: Journal.FilterSection.SPECIAL,
isActive: false,
default: false
},
{
id: Journal.TimetableFilterId.PN,
filterSection: Journal.FilterSection.SPECIAL, filterSection: Journal.FilterSection.SPECIAL,
isActive: false, isActive: false,
default: false default: false
@@ -118,8 +124,6 @@ interface TimetablesQueryParams {
timetableId?: string; timetableId?: string;
authorName?: string; authorName?: string;
// timestampFrom?: number;
// timestampTo?: number;
dateFrom?: string; dateFrom?: string;
dateTo?: string; dateTo?: string;
@@ -136,6 +140,8 @@ interface TimetablesQueryParams {
twr?: number; twr?: number;
skr?: number; skr?: number;
pn?: number;
tn?: number;
sortBy?: Journal.TimetableSorter['id']; sortBy?: Journal.TimetableSorter['id'];
} }
@@ -327,7 +333,7 @@ export default defineComponent({
const responseData: API.TimetableHistory.Response = await ( const responseData: API.TimetableHistory.Response = await (
await this.apiStore.client!.get('api/getTimetables', { await this.apiStore.client!.get('api/getTimetables', {
params: { ...this.currentQueryParams } params: this.currentQueryParams
}) })
).data; ).data;
@@ -391,21 +397,24 @@ export default defineComponent({
case Journal.TimetableFilterId.ALL_SPECIALS: case Journal.TimetableFilterId.ALL_SPECIALS:
queryParams['twr'] = undefined; queryParams['twr'] = undefined;
queryParams['skr'] = undefined; queryParams['skr'] = undefined;
queryParams['pn'] = undefined;
queryParams['tn'] = undefined;
break; break;
case Journal.TimetableFilterId.TWR: case Journal.TimetableFilterId.TWR:
queryParams['twr'] = 1; queryParams['twr'] = 1;
queryParams['skr'] = 0;
break; break;
case Journal.TimetableFilterId.SKR: case Journal.TimetableFilterId.SKR:
queryParams['twr'] = 0;
queryParams['skr'] = 1; queryParams['skr'] = 1;
break; break;
case Journal.TimetableFilterId.TWR_SKR: case Journal.TimetableFilterId.TN:
queryParams['twr'] = 1; queryParams['tn'] = 1;
queryParams['skr'] = 1; break;
case Journal.TimetableFilterId.PN:
queryParams['pn'] = 1;
break; break;
default: default:
+6
View File
@@ -133,4 +133,10 @@ export default defineComponent({
position: relative; position: relative;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
@include smallScreen {
.trains_topbar {
justify-content: space-between;
}
}
</style> </style>
File diff suppressed because one or more lines are too long