Merge pull request #51 from Spythere/development

v1.9.3
This commit is contained in:
Spythere
2025-11-05 14:51:56 +01:00
committed by GitHub
12 changed files with 109 additions and 90 deletions
+50 -49
View File
@@ -1,55 +1,56 @@
<!doctype html> <!doctype html>
<html> <html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Pojazdownik</title> <head>
<meta name="description" content="Edytor składów online dla symulatora Train Driver 2" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="/favicon.ico" sizes="any" /> <title>Pojazdownik</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml" /> <meta name="description" content="Edytor składów online dla symulatora Train Driver 2" />
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="msapplication-TileColor" content="#da532c" /> <link rel="icon" href="/favicon.ico" sizes="any" />
<meta name="theme-color" content="#111" /> <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<link rel="manifest" href="/site.webmanifest" />
<!-- Static OpenGraph meta --> <meta name="msapplication-TileColor" content="#da532c" />
<meta name="description" content="Edytor składów online dla symulatora Train Driver 2" /> <meta name="theme-color" content="#111" />
<meta property="og:url" content="https://pojazdownik-td2.web.app/" />
<meta property="og:type" content="website" /> <!-- Static OpenGraph meta -->
<meta property="og:title" content="Pojazdownik" /> <meta name="description" content="Edytor składów online dla symulatora Train Driver 2" />
<meta <meta property="og:url" content="https://pojazdownik-td2.web.app/" />
property="og:description" <meta property="og:type" content="website" />
content="Edytor składów online dla symulatora Train Driver 2" <meta property="og:title" content="Pojazdownik" />
/> <meta property="og:description" content="Edytor składów online dla symulatora Train Driver 2" />
<meta <meta property="og:image"
property="og:image" content="https://raw.githubusercontent.com/Spythere/api/refs/heads/main/thumbnails/pojazdownik-banner.png" />
content="https://raw.githubusercontent.com/Spythere/api/refs/heads/main/thumbnails/pojazdownik-banner.png" <meta property="og:image:width" content="1200" />
/> <meta property="og:image:height" content="630" />
<meta property="og:image:width" content="1200" /> <meta property="og:site_name" content="Pojazdownik" />
<meta property="og:image:height" content="630" />
<meta property="og:site_name" content="Pojazdownik" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Pojazdownik" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:description" content="Edytor składów online dla symulatora Train Driver 2" />
<meta name="twitter:title" content="Pojazdownik" /> <meta name="twitter:image"
<meta content="https://raw.githubusercontent.com/Spythere/api/refs/heads/main/thumbnails/pojazdownik-banner.png" />
name="twitter:description"
content="Edytor składów online dla symulatora Train Driver 2" <!-- Preload -->
/> <link rel="preload" href="/fonts/Lato-Bold.woff2" as="font" type="font/woff2" crossorigin />
<meta <link rel="preload" href="/fonts/Lato-Regular.woff2" as="font" type="font/woff2" crossorigin />
name="twitter:image"
content="https://raw.githubusercontent.com/Spythere/api/refs/heads/main/thumbnails/pojazdownik-banner.png" <link rel="preload" as="image" href="/logo-pl.svg" />
/> <link rel="preload" as="image" href="/logo-en.svg" />
</head> </head>
<body>
<noscript> <body>
<strong> We're sorry but Pojazdownik doesn't work properly without JavaScript enabled. Please enable it to continue. </strong> <noscript>
</noscript> <strong> We're sorry but Pojazdownik doesn't work properly without JavaScript enabled. Please enable it to continue.
<div id="app"></div> </strong>
<script type="module" src="/src/main.ts"></script> </noscript>
</body> <div id="app"></div>
</html> <script type="module" src="/src/main.ts"></script>
</body>
</html>
+15 -15
View File
@@ -1,6 +1,6 @@
{ {
"name": "pojazdownik", "name": "pojazdownik",
"version": "1.9.2", "version": "1.9.3",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -13,27 +13,27 @@
}, },
"dependencies": { "dependencies": {
"axios": "^1.4.0", "axios": "^1.4.0",
"lucide-vue-next": "^0.487.0", "lucide-vue-next": "^0.552.0",
"pinia": "^2.0.17", "pinia": "^3.0.3",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-i18n": "9.11.0", "vue-i18n": "11.1.12",
"vue-router": "4" "vue-router": "4"
}, },
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.3.3", "@rushstack/eslint-patch": "^1.3.3",
"@types/node": "^22.13.9", "@types/node": "^24.10.0",
"@vite-pwa/assets-generator": "^0.2.3", "@vite-pwa/assets-generator": "^1.0.2",
"@vitejs/plugin-vue": "^5.0.3", "@vitejs/plugin-vue": "^6.0.1",
"@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^12.0.0", "@vue/eslint-config-typescript": "^14.6.0",
"@vue/tsconfig": "^0.5.1", "@vue/tsconfig": "^0.8.1",
"eslint": "^8.49.0", "eslint": "^9.39.1",
"eslint-plugin-vue": "^9.17.0", "eslint-plugin-vue": "^10.5.1",
"sass": "^1.59.3", "sass": "^1.59.3",
"typescript": "^5.0.2", "typescript": "^5.0.2",
"vite": "^5.0.12", "vite": "^7.1.12",
"vite-plugin-pwa": "^0.17.5", "vite-plugin-pwa": "^1.1.0",
"vue-tsc": "^2.2.8" "vue-tsc": "^3.1.3"
} }
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9 -4
View File
@@ -11,6 +11,14 @@ import { useStore } from './store';
import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue'; import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue';
import AppContainerView from './views/AppContainerView.vue'; import AppContainerView from './views/AppContainerView.vue';
import AppModals from './components/app/AppModals.vue'; import AppModals from './components/app/AppModals.vue';
import { registerSW } from 'virtual:pwa-register';
registerSW({
immediate: true,
onNeedRefresh() {
console.log('Needs refresh!');
},
});
export default defineComponent({ export default defineComponent({
components: { ImageFullscreenPreview, AppContainerView, AppModals }, components: { ImageFullscreenPreview, AppContainerView, AppModals },
@@ -49,10 +57,7 @@ export default defineComponent({
try { try {
this.store.storageStockData = JSON.parse(savedData); this.store.storageStockData = JSON.parse(savedData);
} catch (error) { } catch (error) {
console.error( console.error('Wystąpił błąd podczas przetwarzania danych o składach z localStorage!', error);
'Wystąpił błąd podczas przetwarzania danych o składach z localStorage!',
error
);
} }
}, },
}, },
@@ -1,23 +1,31 @@
<template> <template>
<div class="stock_warnings" v-if="hasAnyWarnings"> <div class="stock_warnings" v-if="hasAnyWarnings">
<div class="warning" v-if="locoNotSuitable">(!) {{ $t('stocklist.warning-not-suitable') }}</div> <div class="warning" v-if="locoNotSuitable"><TriangleAlertIcon :size="20" :stroke-width="2" /> {{ $t('stocklist.warning-not-suitable') }}</div>
<div class="warning" v-if="lengthExceeded && store.isTrainPassenger">(!) {{ $t('stocklist.warning-passenger-too-long') }}</div> <div class="warning" v-if="lengthExceeded && store.isTrainPassenger">
<TriangleAlertIcon :size="20" :stroke-width="2" /> {{ $t('stocklist.warning-passenger-too-long') }}
</div>
<div class="warning" v-if="lengthExceeded && !store.isTrainPassenger">(!) {{ $t('stocklist.warning-freight-too-long') }}</div> <div class="warning" v-if="lengthExceeded && !store.isTrainPassenger">
<TriangleAlertIcon :size="20" :stroke-width="2" /> {{ $t('stocklist.warning-freight-too-long') }}
</div>
<div class="warning" v-if="teamOnlyVehicles.length > 0"> <div class="warning" v-if="teamOnlyVehicles.length > 0">
(!) <TriangleAlertIcon :size="20" :stroke-width="2" />
{{ $t('stocklist.warning-team-only-vehicle', [teamOnlyVehicles.map((v) => v.vehicleRef.type).join(', ')]) }} {{ $t('stocklist.warning-team-only-vehicle', [teamOnlyVehicles.map((v) => v.vehicleRef.type).join(', ')]) }}
</div> </div>
<div class="warning" v-if="store.cargoWarnings.size > 0"> <div class="warning" v-if="store.cargoWarnings.size > 0">
(!) <b>{{ $t('cargo-warnings.title') }}</b> <TriangleAlertIcon :size="20" :stroke-width="2" /> <b>{{ $t('cargo-warnings.title') }}</b>
{{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }} {{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }}
</div> </div>
<div class="warning" v-if="!isRearPRSM4">
<TriangleAlertIcon :size="20" :stroke-width="2" /> {{ $t('stocklist.warning-prsm4-not-at-the-rear') }}
</div>
<div class="warning" v-if="weightExceeded"> <div class="warning" v-if="weightExceeded">
(!) <TriangleAlertIcon :size="20" :stroke-width="2" />
<i18n-t keypath="stocklist.warning-too-heavy"> <i18n-t keypath="stocklist.warning-too-heavy">
<template #href> <template #href>
<a target="_blank" href="https://docs.google.com/spreadsheets/d/1BvTU-U7huIaEheov22TrhTtROUM4MwVfdbq03GVAEM8"> <a target="_blank" href="https://docs.google.com/spreadsheets/d/1BvTU-U7huIaEheov22TrhTtROUM4MwVfdbq03GVAEM8">
@@ -26,10 +34,6 @@
</template> </template>
</i18n-t> </i18n-t>
</div> </div>
<!-- <div class="warning" v-if="locoCountExceeded">
{{ $t('stocklist.warning-too-many-locos') }}
</div> -->
</div> </div>
</template> </template>
@@ -37,8 +41,11 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { useStore } from '../../../store'; import { useStore } from '../../../store';
import { isTractionUnit } from '../../../utils/vehicleUtils'; import { isTractionUnit } from '../../../utils/vehicleUtils';
import { TriangleAlertIcon } from 'lucide-vue-next';
export default defineComponent({ export default defineComponent({
components: { TriangleAlertIcon },
data: () => ({ data: () => ({
store: useStore(), store: useStore(),
}), }),
@@ -68,6 +75,14 @@ export default defineComponent({
this.store.stockList.some((stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP')) this.store.stockList.some((stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP'))
); );
}, },
isRearPRSM4() {
if (this.store.stockList.length <= 1) return true;
const index = this.store.stockList.findIndex((stock) => stock.vehicleRef.type.startsWith('PRSM4'));
return index != -1 ? index == this.store.stockList.length - 1 : true;
},
}, },
}); });
</script> </script>
@@ -81,6 +96,10 @@ export default defineComponent({
font-weight: bold; font-weight: bold;
.lucide {
vertical-align: text-bottom;
}
a { a {
color: black; color: black;
text-decoration: underline; text-decoration: underline;
+1
View File
@@ -84,6 +84,7 @@
"warning-too-many-locos": "This train has too many traction units!", "warning-too-many-locos": "This train has too many traction units!",
"warning-too-heavy": "This train is too heavy! Check {href}", "warning-too-heavy": "This train is too heavy! Check {href}",
"warning-team-only-vehicle": "There's at least one vehicle available only for TD2 team members in your stock composition! ({0})", "warning-team-only-vehicle": "There's at least one vehicle available only for TD2 team members in your stock composition! ({0})",
"warning-prsm4-not-at-the-rear": "PRSM4 welding car must be at the end of a train!",
"acceptable-mass-docs": "acceptable rolling stock masses (PL)", "acceptable-mass-docs": "acceptable rolling stock masses (PL)",
"stock-loading-error": "An error occurred: cannot parse data from the file - make sure it's in a proper format!", "stock-loading-error": "An error occurred: cannot parse data from the file - make sure it's in a proper format!",
"stock-clipboard-error": "An error occurred: cannot read data from the clipboard - make sure the site has been granted right permissions for this action!" "stock-clipboard-error": "An error occurred: cannot read data from the clipboard - make sure the site has been granted right permissions for this action!"
+1
View File
@@ -84,6 +84,7 @@
"warning-too-many-locos": "Ten skład posiada za dużo pojazdów trakcyjnych!", "warning-too-many-locos": "Ten skład posiada za dużo pojazdów trakcyjnych!",
"warning-too-heavy": "Ten skład jest za ciężki! Sprawdź {href}", "warning-too-heavy": "Ten skład jest za ciężki! Sprawdź {href}",
"warning-team-only-vehicle": "W zestawieniu znajduje się co najmniej jeden pojazd dostępny tylko dla członków zespołu TD2! ({0})", "warning-team-only-vehicle": "W zestawieniu znajduje się co najmniej jeden pojazd dostępny tylko dla członków zespołu TD2! ({0})",
"warning-prsm4-not-at-the-rear": "Zgrzewarka PRSM4 może znajdować się jedynie na końcu składu w przypadku jazdy pociągowej!",
"acceptable-mass-docs": "dopuszczalne masy składów", "acceptable-mass-docs": "dopuszczalne masy składów",
"stock-loading-error": "Wystąpił błąd: nie można przetworzyć danych ze schowka! Upewnij się, że są one w poprawnym formacie!", "stock-loading-error": "Wystąpił błąd: nie można przetworzyć danych ze schowka! Upewnij się, że są one w poprawnym formacie!",
"stock-clipboard-error": "Wystąpił błąd: nie można odczytać danych ze schowka! Upewnij się, że nadałeś uprawnienia stronie do tej akcji!" "stock-clipboard-error": "Wystąpił błąd: nie można odczytać danych ze schowka! Upewnij się, że nadałeś uprawnienia stronie do tej akcji!"
+4 -12
View File
@@ -10,16 +10,6 @@ $accentColor: #e4c428;
$sponsorColor: gold; $sponsorColor: gold;
$teamColor: #ff4848; $teamColor: #ff4848;
@font-face {
font-family: 'Lato';
src:
url('/fonts/Lato-Light.woff2') format('woff2'),
url('/fonts/Lato-Light.woff') format('woff');
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face { @font-face {
font-family: 'Lato'; font-family: 'Lato';
src: src:
@@ -350,7 +340,7 @@ hr {
outline: none; outline: none;
} }
label > input:checked + span { label>input:checked+span {
color: $accentColor; color: $accentColor;
border-color: $accentColor; border-color: $accentColor;
} }
@@ -358,6 +348,7 @@ hr {
// Vue Transition anims // Vue Transition anims
.slide-top { .slide-top {
&-enter-from, &-enter-from,
&-leave-to { &-leave-to {
transform: translateY(-100%); transform: translateY(-100%);
@@ -370,6 +361,7 @@ hr {
} }
.card-appear { .card-appear {
&-enter-from, &-enter-from,
&-leave-to { &-leave-to {
opacity: 0; opacity: 0;
@@ -379,4 +371,4 @@ hr {
&-leave-active { &-leave-active {
transition: all 100ms ease-in-out; transition: all 100ms ease-in-out;
} }
} }