Merge pull request #62 from Spythere/development

v1.10.0
This commit is contained in:
Spythere
2026-04-06 00:53:15 +02:00
committed by GitHub
27 changed files with 695 additions and 860 deletions
+1 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "pojazdownik", "name": "pojazdownik",
"version": "1.9.3", "version": "1.10.0",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -12,7 +12,6 @@
"format": "prettier --write src/" "format": "prettier --write src/"
}, },
"dependencies": { "dependencies": {
"axios": "^1.4.0",
"lucide-vue-next": "^0.576.0", "lucide-vue-next": "^0.576.0",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"prettier": "^3.0.3", "prettier": "^3.0.3",
+19 -14
View File
@@ -1,12 +1,11 @@
<template> <template>
<footer> <footer>
<i18n-t keypath="footer.disclaimer" tag="div" class="text--grayed"> <div>
<template #tos> &copy;
<a style="color: #ccc" :href="$t('footer.tos-href')" target="_blank"> <a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
{{ $t('footer.tos') }} {{ new Date().getUTCFullYear() }} |
</a> <a class="release-link" :href="githubReleaseHref" target="_blank">v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }}</a>
</template> </div>
</i18n-t>
<div class="text--grayed" v-if="store.vehiclesData"> <div class="text--grayed" v-if="store.vehiclesData">
{{ {{
@@ -17,12 +16,6 @@
}) })
}} }}
</div> </div>
<div>
&copy;
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
{{ new Date().getUTCFullYear() }} | v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }}
</div>
</footer> </footer>
</template> </template>
@@ -41,6 +34,10 @@ export default defineComponent({
}, },
computed: { computed: {
githubReleaseHref() {
return `https://github.com/Spythere/pojazdownik/releases/tag/${this.VERSION}`;
},
vehiclesCounters() { vehiclesCounters() {
let counters = { let counters = {
all: 0, all: 0,
@@ -66,6 +63,14 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
footer { footer {
text-align: center; text-align: center;
padding: 1em 1em 0 1em; padding: 0 0.5em 0.5em 0.5em;
}
.release-link {
color: var(--accentColor);
&:hover {
color: white;
}
} }
</style> </style>
+6 -8
View File
@@ -26,17 +26,14 @@ main {
display: grid; display: grid;
gap: 1em; gap: 1em;
width: 100%; width: 100vw;
max-width: 1350px; max-width: 1600px;
grid-template-columns: 1fr 2fr; grid-template-columns: minmax(380px, 1fr) 3fr;
grid-template-rows: auto 360px minmax(300px, 1fr); grid-template-rows: auto 350px minmax(300px, 1fr);
background-color: var(--bgColorDarker);
border-radius: 1em; border-radius: 1em;
overflow: hidden;
min-height: 950px;
padding: 1em; padding: 1em;
} }
@@ -45,6 +42,7 @@ main {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1em; gap: 1em;
height: auto;
} }
} }
</style> </style>
+23 -19
View File
@@ -1,17 +1,9 @@
<template> <template>
<section class="tabs-section"> <section class="tabs-section">
<div class="tabs-modes"> <div class="tabs-modes">
<router-link <router-link v-for="(route, i) in routes" :key="route.name" class="link-btn" :to="route.href" :style="{ 'grid-area': route.name }">
v-for="(route, i) in routes"
:key="route.name"
class="link-btn"
:to="route.href"
:style="{ 'grid-area': route.name }"
>
<span class="text--accent">{{ i + 1 }}.</span> {{ $t(`topbar.${route.name}`) }} <span class="text--accent">{{ i + 1 }}.</span> {{ $t(`topbar.${route.name}`) }}
<span class="text--grayed" v-if="route.name == 'stock'" <span class="text--grayed" v-if="route.name == 'stock'">({{ store.stockList.length }})</span>
>({{ store.stockList.length }})</span
>
</router-link> </router-link>
</div> </div>
@@ -68,7 +60,7 @@ onMounted(() => {
}); });
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
@use '@/styles/responsive'; @use '@/styles/responsive';
// Tab change animation // Tab change animation
@@ -86,6 +78,10 @@ onMounted(() => {
// Section styles // Section styles
.tabs-section { .tabs-section {
display: grid;
grid-template-rows: auto 1fr;
gap: 1em;
grid-row: 1 / 4; grid-row: 1 / 4;
grid-column: 2; grid-column: 2;
@@ -95,16 +91,18 @@ onMounted(() => {
.tabs-modes { .tabs-modes {
display: grid; display: grid;
grid-template-areas:
'stock stock wiki wiki storage storage'
'numgen numgen numgen stockgen stockgen stockgen';
grid-template-columns: repeat(6, 1fr);
// grid-template-rows: 1fr 1fr;
padding: 1px;
gap: 0.5em; gap: 0.5em;
grid-template-areas: 'stock wiki storage numgen stockgen';
margin-bottom: 1em; padding: 1px;
}
@media only screen and (max-width: 1200px) {
.tabs-modes {
grid-template-areas:
'stock stock wiki wiki storage storage'
'numgen numgen numgen stockgen stockgen stockgen';
}
} }
@include responsive.smallScreen { @include responsive.smallScreen {
@@ -116,4 +114,10 @@ onMounted(() => {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
} }
@include responsive.midScreen {
.tabs-section {
min-height: 100vh;
}
}
</style> </style>
+8 -27
View File
@@ -5,10 +5,7 @@
<img <img
:src="getThumbnailURL(store.chosenVehicle.type, 'small')" :src="getThumbnailURL(store.chosenVehicle.type, 'small')"
:data-preview-available="isDataPreviewAvailable" :data-preview-available="isDataPreviewAvailable"
:data-sponsor-only=" :data-sponsor-only="store.chosenVehicle.sponsorOnlyTimestamp && store.chosenVehicle.sponsorOnlyTimestamp > Date.now()"
store.chosenVehicle.sponsorOnlyTimestamp &&
store.chosenVehicle.sponsorOnlyTimestamp > Date.now()
"
:data-team-only="store.chosenVehicle.teamOnly" :data-team-only="store.chosenVehicle.teamOnly"
@click="onImageClick" @click="onImageClick"
@keydown.enter="onImageClick" @keydown.enter="onImageClick"
@@ -21,23 +18,15 @@
<div class="image-info"> <div class="image-info">
<b class="text--accent">{{ store.chosenVehicle.type }}</b> &bull; <b class="text--accent">{{ store.chosenVehicle.type }}</b> &bull;
<b style="color: #ccc"> <b style="color: #ccc">
{{ {{ $t(`preview.${isTractionUnit(store.chosenVehicle) ? store.chosenVehicle.group : store.chosenVehicle.group}`) }}
$t(
`preview.${isTractionUnit(store.chosenVehicle) ? store.chosenVehicle.group : store.chosenVehicle.group}`
)
}}
</b> </b>
<div style="color: #ccc"> <div style="color: #ccc">
<div> <div>
{{ store.chosenVehicle.length }}m | {{ store.chosenVehicle.length }}m | {{ (store.chosenVehicle.weight / 1000).toFixed(1) }}t | {{ store.chosenVehicle.maxSpeed }} km/h
{{ (store.chosenVehicle.weight / 1000).toFixed(1) }}t |
{{ store.chosenVehicle.maxSpeed }} km/h
</div> </div>
<div v-if="isTractionUnit(store.chosenVehicle)"> <div v-if="isTractionUnit(store.chosenVehicle)">{{ $t('preview.cabin') }} {{ store.chosenVehicle.cabinType }}</div>
{{ $t('preview.cabin') }} {{ store.chosenVehicle.cabinType }}
</div>
<div v-else> <div v-else>
{{ {{
@@ -47,18 +36,10 @@
}} }}
</div> </div>
<b <b v-if="store.chosenVehicle.sponsorOnlyTimestamp && store.chosenVehicle.sponsorOnlyTimestamp > Date.now()" class="sponsor-only">
v-if="
store.chosenVehicle.sponsorOnlyTimestamp &&
store.chosenVehicle.sponsorOnlyTimestamp > Date.now()
"
class="sponsor-only"
>
{{ {{
$t('preview.sponsor-only', [ $t('preview.sponsor-only', [
new Date(store.chosenVehicle.sponsorOnlyTimestamp).toLocaleDateString( new Date(store.chosenVehicle.sponsorOnlyTimestamp).toLocaleDateString($i18n.locale == 'pl' ? 'pl-PL' : 'en-GB'),
$i18n.locale == 'pl' ? 'pl-PL' : 'en-GB'
),
]) ])
}} }}
</b> </b>
@@ -164,8 +145,8 @@ export default defineComponent({
& > div { & > div {
position: relative; position: relative;
max-width: 100%; width: 100%;
width: 380px; max-width: 380px;
} }
} }
+9 -2
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="number-generator tab"> <div class="number-generator-tab">
<div class="tab_header"> <div class="tab_header">
<h2>{{ $t('numgen.title') }}</h2> <h2>{{ $t('numgen.title') }}</h2>
<h3>{{ $t('numgen.subtitle') }}</h3> <h3>{{ $t('numgen.subtitle') }}</h3>
@@ -227,6 +227,13 @@ const randomizeTrainNumber = (randomizeRegions = false) => {
@use '@/styles/tab'; @use '@/styles/tab';
@use '@/styles/responsive'; @use '@/styles/responsive';
.number-generator-tab {
display: flex;
flex-direction: column;
gap: 1em;
overflow: auto;
}
.category-select { .category-select {
select { select {
width: auto; width: auto;
@@ -283,7 +290,7 @@ const randomizeTrainNumber = (randomizeRegions = false) => {
} }
@include responsive.midScreen { @include responsive.midScreen {
.number-generator { .number-generator-tab {
min-height: 100vh; min-height: 100vh;
} }
} }
+86 -80
View File
@@ -1,98 +1,96 @@
<template> <template>
<div class="stock-generator tab"> <div class="stock-generator-tab">
<div class="tab_content"> <div>
<div> <h2>{{ $t('stockgen.properties-title') }}</h2>
<h2>{{ $t('stockgen.properties-title') }}</h2>
<b class="text--accent"> <b class="text--accent">
{{ $t('stockgen.properties-desc') }} {{ $t('stockgen.properties-desc') }}
</b> </b>
<div class="inputs"> <div class="inputs">
<label> <label>
<span>{{ $t('stockgen.input-mass') }}</span> <span>{{ $t('stockgen.input-mass') }}</span>
<input type="number" v-model="maxTons" step="100" max="4000" min="0" /> <input type="number" v-model="maxTons" step="100" max="4000" min="0" />
</label> </label>
<label> <label>
<span>{{ $t('stockgen.input-length') }}</span> <span>{{ $t('stockgen.input-length') }}</span>
<input type="number" v-model="maxLength" step="25" max="650" min="0" /> <input type="number" v-model="maxLength" step="25" max="650" min="0" />
</label> </label>
<label> <label>
<span>{{ $t('stockgen.input-carcount') }}</span> <span>{{ $t('stockgen.input-carcount') }}</span>
<input type="number" v-model="maxCarCount" step="1" max="60" min="1" /> <input type="number" v-model="maxCarCount" step="1" max="60" min="1" />
</label> </label>
</div> </div>
<!-- <hr style="margin: 1em 0" /> --> <!-- <hr style="margin: 1em 0" /> -->
<!-- <div class="generator_options"> <!-- <div class="generator_options">
<Checkbox v-model="isCarGroupingEnabled">Grupuj wylosowane wagony (ustawia podobne wagony obok siebie w składzie)</Checkbox> <Checkbox v-model="isCarGroupingEnabled">Grupuj wylosowane wagony (ustawia podobne wagony obok siebie w składzie)</Checkbox>
</div> --> </div> -->
</div>
<div>
<h2>{{ $t('stockgen.cargo-title') }}</h2>
<b>{{ $t('stockgen.cargo-desc') }}</b>
</div>
<div class="generator_cargo">
<button
v-for="cargo in computedCargoData"
:key="cargo.name"
class="btn"
:data-chosen="chosenCargoTypes.includes(cargo.name)"
@click="toggleCargoChosen(cargo.name, cargo.cargoList)"
>
{{ $t(`cargo.${cargo.name}`) }}
</button>
</div>
<div>
<h2>{{ $t('stockgen.chosen-title') }}</h2>
<div class="generator_warning">
<span v-if="computedChosenCarTypes.size == 0">
{{ $t('stockgen.chosen-empty-warning') }}
</span>
<span v-else>
{{ $t('stockgen.chosen-warning') }}
</span>
</div> </div>
</div>
<div> <div class="generator_vehicles" v-if="computedChosenCarTypes.size != 0">
<h2>{{ $t('stockgen.cargo-title') }}</h2> <button
<b>{{ $t('stockgen.cargo-desc') }}</b> :data-chosen="true"
</div> :data-excluded="excludedCarTypes.includes(carType)"
class="btn"
v-for="carType in computedChosenCarTypes"
:key="carType"
@mouseover="onMouseHover(carType)"
@mouseleave="onMouseLeave"
@click="toggleCarExclusion(carType)"
>
{{ carType }}
</button>
</div>
<div class="generator_cargo"> <hr />
<button
v-for="cargo in computedCargoData"
:key="cargo.name"
class="btn"
:data-chosen="chosenCargoTypes.includes(cargo.name)"
@click="toggleCargoChosen(cargo.name, cargo.cargoList)"
>
{{ $t(`cargo.${cargo.name}`) }}
</button>
</div>
<div> <div class="tab_actions">
<h2>{{ $t('stockgen.chosen-title') }}</h2> <button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="generateStock()">
{{ $t('stockgen.action-generate') }}
</button>
<div class="generator_warning"> <button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="generateStock(true)">
<span v-if="computedChosenCarTypes.size == 0"> {{ $t('stockgen.action-generate-empty') }}
{{ $t('stockgen.chosen-empty-warning') }} </button>
</span>
<span v-else> <button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="resetChosenCargo">
{{ $t('stockgen.chosen-warning') }} {{ $t('stockgen.action-reset') }}
</span> </button>
</div>
</div>
<div class="generator_vehicles" v-if="computedChosenCarTypes.size != 0">
<button
:data-chosen="true"
:data-excluded="excludedCarTypes.includes(carType)"
class="btn"
v-for="carType in computedChosenCarTypes"
:key="carType"
@mouseover="onMouseHover(carType)"
@mouseleave="onMouseLeave"
@click="toggleCarExclusion(carType)"
>
{{ carType }}
</button>
</div>
<hr />
<div class="tab_actions">
<button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="generateStock()">
{{ $t('stockgen.action-generate') }}
</button>
<button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="generateStock(true)">
{{ $t('stockgen.action-generate-empty') }}
</button>
<button class="btn" :data-disabled="computedChosenCarTypes.size == 0" @click="resetChosenCargo">
{{ $t('stockgen.action-reset') }}
</button>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -290,6 +288,14 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/tab'; @use '@/styles/tab';
.stock-generator-tab {
display: flex;
flex-direction: column;
gap: 1em;
overflow: auto;
padding: 0.5em;
}
h2 { h2 {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5em; margin-bottom: 0.5em;
+18 -13
View File
@@ -1,21 +1,19 @@
<template> <template>
<section class="stock-list-tab"> <section class="stock-list-tab">
<div class="tab_content"> <!-- Stock Actions -->
<!-- Stock Actions --> <StockActions />
<StockActions />
<!-- Stock Specs --> <!-- Stock Specs -->
<StockSpecs /> <StockSpecs />
<!-- Stock Spawn Settings --> <!-- Stock Spawn Settings -->
<StockSpawnSettings /> <StockSpawnSettings />
<!-- Stock Warnings --> <!-- Stock Warnings -->
<StockWarnings /> <StockWarnings />
<!-- Stock List --> <!-- Stock List -->
<StockList /> <StockList />
</div>
</section> </section>
</template> </template>
@@ -42,7 +40,14 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/tab'; @use '../../styles/tab';
.stock-list-tab {
display: grid;
grid-template-rows: auto auto auto auto 1fr;
gap: 0.5em;
overflow: hidden;
}
.tab_content { .tab_content {
display: flex; display: flex;
+49 -45
View File
@@ -1,57 +1,54 @@
<template> <template>
<section class="tab storage-tab"> <section class="storage-tab">
<div class="tab_header"> <div class="tab_header">
<h2>{{ $t('storage.title') }}</h2> <h2>{{ $t('storage.title') }}</h2>
<h3>{{ $t('storage.subtitle') }}</h3> <h3>{{ $t('storage.subtitle') }}</h3>
</div> </div>
<div class="tab_content"> <div class="tab_content">
<div class="storage-list-wrapper"> <transition-group name="storage-list-anim" tag="ul" class="storage-list">
<transition-group name="storage-list-anim" tag="ul" class="storage-list"> <li v-for="storageEntry in storageStockDataList" :key="storageEntry.id">
<li v-for="storageEntry in storageStockDataList" :key="storageEntry.id"> <div class="storage-item-top">
<div class="storage-item-top"> <h3>
<h3> {{ storageEntry.id }}
{{ storageEntry.id }} </h3>
</h3>
<div class="storage-item-top-actions"> <div class="storage-item-top-actions">
<button class="btn btn--icon" @click="chooseStorageStock(storageEntry.id)"> <button class="btn btn--icon" @click="chooseStorageStock(storageEntry.id)">
<LogIn /> <LogIn />
</button> </button>
<button class="btn btn--icon" @click="toggleStorageEntryExpand(storageEntry.id)"> <button class="btn btn--icon" @click="toggleStorageEntryExpand(storageEntry.id)">
<ChevronDown v-if="!expandedEntries.includes(storageEntry.id)" /> <ChevronDown v-if="!expandedEntries.includes(storageEntry.id)" />
<ChevronUp v-else /> <ChevronUp v-else />
</button> </button>
<button class="btn btn--icon" @click="removeStockIndexFromStorage(storageEntry.id)"> <button class="btn btn--icon" @click="removeStockIndexFromStorage(storageEntry.id)">
<Trash2 /> <Trash2 />
</button> </button>
</div>
</div> </div>
</div>
<div class="storage-item-expandable" v-if="expandedEntries.includes(storageEntry.id)"> <div class="storage-item-expandable" v-if="expandedEntries.includes(storageEntry.id)">
<i> <i>
{{ $t('storage.created-at') }} {{ $t('storage.created-at') }}
{{ new Date(storageEntry.createdAt).toLocaleString($i18n.locale) }}</i {{ new Date(storageEntry.createdAt).toLocaleString($i18n.locale) }}</i
> >
<i v-if="storageEntry.updatedAt"> <i v-if="storageEntry.updatedAt">
&bull; {{ $t('storage.updated-at') }} &bull; {{ $t('storage.updated-at') }} {{ new Date(storageEntry.updatedAt).toLocaleString($i18n.locale) }}</i
{{ new Date(storageEntry.updatedAt).toLocaleString($i18n.locale) }}</i >
>
<div style="margin-top: 0.5em"> <div style="margin-top: 0.5em">
<i>{{ $t('storage.stock-title') }} </i> <i>{{ $t('storage.stock-title') }} </i>
{{ shortenStockString(storageEntry.stockString) }} {{ shortenStockString(storageEntry.stockString) }}
</div>
</div> </div>
</li> </div>
</li>
<li v-if="Object.keys(storageStockDataList).length == 0" class="storage-no-entries"> <li v-if="Object.keys(storageStockDataList).length == 0" class="storage-no-entries">
{{ $t('storage.no-entires') }} {{ $t('storage.no-entires') }}
</li> </li>
</transition-group> </transition-group>
</div>
</div> </div>
</section> </section>
</template> </template>
@@ -146,21 +143,26 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/tab'; @use '@/styles/tab';
.storage-tab {
display: grid;
grid-template-rows: auto 1fr;
overflow: hidden;
}
.tab_actions { .tab_actions {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
.storage-list-wrapper { .tab_content {
position: relative;
height: 730px;
overflow: auto; overflow: auto;
margin-top: 1em;
position: relative;
} }
ul.storage-list { ul.storage-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5em; gap: 0.5em;
margin-top: 0.5em;
} }
ul.storage-list > li { ul.storage-list > li {
@@ -174,12 +176,14 @@ ul.storage-list > li {
.storage-item-top { .storage-item-top {
display: flex; display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: center; align-items: center;
gap: 0.5em; gap: 0.5em;
} }
.storage-item-top > h3 { .storage-item-top > h3 {
width: 100%; min-width: 350px;
text-align: left; text-align: left;
margin: 0; margin: 0;
} }
@@ -208,7 +212,7 @@ ul.storage-list > li {
&-move, &-move,
&-enter-active, &-enter-active,
&-leave-active { &-leave-active {
transition: all 120ms ease-in-out; transition: all 100ms ease-in-out;
} }
&-enter-from { &-enter-from {
+91 -97
View File
@@ -1,97 +1,86 @@
<template> <template>
<section class="wiki-list tab"> <section class="wiki-list-tab">
<div class="tab_content"> <div class="actions">
<div class="actions"> <div class="action action-input">
<div class="action action-input"> <label for="search-vehicle">
<label for="search-vehicle"> {{ $t('wiki.labels.search-vehicle') }}
{{ $t('wiki.labels.search-vehicle') }} <button class="reset-btn" @click="resetSearchInput">
<button class="reset-btn" @click="resetSearchInput"> <img src="/images/icon-exit.svg" alt="reset vehicle input icon" />
<img src="/images/icon-exit.svg" alt="reset vehicle input icon" /> </button>
</button> </label>
</label> <input
<input type="text"
type="text" id="search-vehicle"
id="search-vehicle" name="search-vehicle"
name="search-vehicle" :placeholder="$t('wiki.labels.search-vehicle-placeholder')"
:placeholder="$t('wiki.labels.search-vehicle-placeholder')" v-model="searchedVehicleTypeName"
v-model="searchedVehicleTypeName" />
/>
</div>
<div class="action action-select">
<label for="filter-type">{{ $t('wiki.labels.vehicles') }}</label>
<select name="filter-type" id="filter-type" v-model="filterType">
<option v-for="filter in filters" :key="filter" :value="filter">
{{ $t(`wiki.filters.${filter}`) }}
</option>
</select>
</div>
<div class="action action-select">
<label for="sorter-type">{{ $t('wiki.labels.sort-by') }}</label>
<select name="sorter-type" id="sorter-type" v-model="sorterType">
<option v-for="sorter in sorters" :key="sorter" :value="sorter">
{{ $t(`wiki.sort-by.${sorter}`) }}
</option>
</select>
</div>
<div class="action action-select">
<label for="sorter-direction">{{ $t('wiki.labels.sort-direction') }}</label>
<select name="sorter-direction" id="sorter-direction" v-model="sorterDirection">
<option value="asc">{{ $t('wiki.sort-direction.asc') }}</option>
<option value="desc">{{ $t('wiki.sort-direction.desc') }}</option>
</select>
</div>
</div> </div>
<ul class="vehicles" ref="vehicles"> <div class="action action-select">
<li <label for="filter-type">{{ $t('wiki.labels.vehicles') }}</label>
v-for="vehicle in computedVehicles" <select name="filter-type" id="filter-type" v-model="filterType">
:key="vehicle.type" <option v-for="filter in filters" :key="filter" :value="filter">
:data-preview="vehicle.type === store.chosenVehicle?.type" {{ $t(`wiki.filters.${filter}`) }}
@click="previewVehicle(vehicle)" </option>
@dblclick="addVehicle(vehicle)" </select>
@keydown.enter="onVehicleSelect(vehicle)" </div>
tabindex="0"
>
<img
loading="lazy"
width="120"
:src="getThumbnailURL(vehicle.type, 'small')"
@error="onThumbnailImageError"
/>
<span> <div class="action action-select">
<span <label for="sorter-type">{{ $t('wiki.labels.sort-by') }}</label>
class="vehicle-name" <select name="sorter-type" id="sorter-type" v-model="sorterType">
:class="{ <option v-for="sorter in sorters" :key="sorter" :value="sorter">
'sponsor-only': {{ $t(`wiki.sort-by.${sorter}`) }}
vehicle.sponsorOnlyTimestamp && vehicle.sponsorOnlyTimestamp > Date.now(), </option>
'team-only': vehicle.teamOnly, </select>
}" </div>
>
<b>{{ vehicle.type.replace(/_/g, ' ') }}</b>
</span>
<div class="vehicle-group"> <div class="action action-select">
{{ $t(`wiki.${vehicle.group}`) }} | <label for="sorter-direction">{{ $t('wiki.labels.sort-direction') }}</label>
{{ isTractionUnit(vehicle) ? vehicle.cabinType : vehicle.constructionType }}
</div>
<div class="vehicle-props"> <select name="sorter-direction" id="sorter-direction" v-model="sorterDirection">
{{ vehicle.length }}m | {{ (vehicle.weight / 1000).toFixed(1) }}t | <option value="asc">{{ $t('wiki.sort-direction.asc') }}</option>
{{ vehicle.maxSpeed }}km/h <option value="desc">{{ $t('wiki.sort-direction.desc') }}</option>
</div> </select>
</span>
</li>
</ul>
<div class="no-vehicles-warning" v-if="computedVehicles.length == 0">
{{ $t('wiki.no-vehicles') }}
</div> </div>
</div> </div>
<div class="no-vehicles-warning" v-if="computedVehicles.length == 0">
{{ $t('wiki.no-vehicles') }}
</div>
<ul class="vehicles" ref="vehicles">
<li
v-for="vehicle in computedVehicles"
:key="vehicle.type"
:data-preview="vehicle.type === store.chosenVehicle?.type"
@click="previewVehicle(vehicle)"
@dblclick="addVehicle(vehicle)"
@keydown.enter="onVehicleSelect(vehicle)"
tabindex="0"
>
<img loading="lazy" width="120" :src="getThumbnailURL(vehicle.type, 'small')" @error="onThumbnailImageError" />
<span>
<span
class="vehicle-name"
:class="{
'sponsor-only': vehicle.sponsorOnlyTimestamp && vehicle.sponsorOnlyTimestamp > Date.now(),
'team-only': vehicle.teamOnly,
}"
>
<b>{{ vehicle.type.replace(/_/g, ' ') }}</b>
</span>
<div class="vehicle-group">
{{ $t(`wiki.${vehicle.group}`) }} |
{{ isTractionUnit(vehicle) ? vehicle.cabinType : vehicle.constructionType }}
</div>
<div class="vehicle-props">{{ vehicle.length }}m | {{ (vehicle.weight / 1000).toFixed(1) }}t | {{ vehicle.maxSpeed }}km/h</div>
</span>
</li>
</ul>
</section> </section>
</template> </template>
@@ -181,11 +170,7 @@ export default defineComponent({
}, },
filterVehicles(v: IVehicle) { filterVehicles(v: IVehicle) {
if ( if (this.searchedVehicleTypeName != '' && !v.type.toLocaleLowerCase().includes(this.searchedVehicleTypeName.toLocaleLowerCase())) return false;
this.searchedVehicleTypeName != '' &&
!v.type.toLocaleLowerCase().includes(this.searchedVehicleTypeName.toLocaleLowerCase())
)
return false;
switch (this.filterType) { switch (this.filterType) {
case VehicleFilter.AllTractions: case VehicleFilter.AllTractions:
@@ -247,6 +232,13 @@ export default defineComponent({
@use '@/styles/tab'; @use '@/styles/tab';
@use '@/styles/responsive'; @use '@/styles/responsive';
.wiki-list-tab {
display: grid;
grid-template-rows: auto auto 1fr;
gap: 0.5em;
overflow: hidden;
}
.actions { .actions {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); grid-template-columns: repeat(auto-fit, minmax(10em, 1fr));
@@ -284,10 +276,7 @@ export default defineComponent({
gap: 0.5em; gap: 0.5em;
overflow: auto; overflow: auto;
max-height: 730px; margin-top: 1em;
margin-top: 0.75em;
padding: 0.25em;
} }
.vehicles > li { .vehicles > li {
@@ -297,7 +286,6 @@ export default defineComponent({
background-color: #161c2e; background-color: #161c2e;
padding: 0.5em; padding: 0.5em;
min-height: 75px;
cursor: pointer; cursor: pointer;
&[data-preview='true'] { &[data-preview='true'] {
@@ -340,11 +328,17 @@ export default defineComponent({
.no-vehicles-warning { .no-vehicles-warning {
text-align: center; text-align: center;
width: 100%;
padding: 1em; padding: 1em;
background-color: #161c2e; background-color: #161c2e;
} }
@include responsive.smallScreen { @include responsive.midScreen {
.vehicles {
height: 100vh;
min-height: 400px;
}
.actions-panel { .actions-panel {
align-items: stretch; align-items: stretch;
flex-direction: column; flex-direction: column;
+11 -20
View File
@@ -1,20 +1,12 @@
<template> <template>
<div class="stock_actions"> <div class="stock_actions">
<div class="actions-top"> <div class="actions-top">
<button <button class="btn btn--image" @click="clickFileInput" :data-button-tooltip="$t('stocklist.action-upload-file')">
class="btn btn--image"
@click="clickFileInput"
:data-button-tooltip="$t('stocklist.action-upload-file')"
>
<input type="file" @change="uploadStockFromFile" ref="conFile" accept=".con,.txt" /> <input type="file" @change="uploadStockFromFile" ref="conFile" accept=".con,.txt" />
<FolderUp :stroke-width="2.5" /> <FolderUp :stroke-width="2.5" />
</button> </button>
<button <button class="btn btn--image" @click="uploadStockFromClipboard" :data-button-tooltip="$t('stocklist.action-upload-clipboard')">
class="btn btn--image"
@click="uploadStockFromClipboard"
:data-button-tooltip="$t('stocklist.action-upload-clipboard')"
>
<ClipboardPaste :stroke-width="2.5" /> <ClipboardPaste :stroke-width="2.5" />
</button> </button>
@@ -115,10 +107,11 @@ import { defineComponent } from 'vue';
import { useStore } from '../../../store'; import { useStore } from '../../../store';
import { isTractionUnit } from '../../../utils/vehicleUtils'; import { isTractionUnit } from '../../../utils/vehicleUtils';
import { useFileUtils } from '../../../utils/fileUtils';
import stockMixin from '../../../mixins/stockMixin'; import stockMixin from '../../../mixins/stockMixin';
import { useStockListUtils } from '../../../utils/stockListUtils'; import { useStockListUtils } from '../../../utils/stockListUtils';
import { getCurrentStockFileName } from '../../../composables/file';
import { import {
Bookmark, Bookmark,
ChevronDown, ChevronDown,
@@ -157,12 +150,11 @@ export default defineComponent({
}), }),
setup() { setup() {
const fileUtils = useFileUtils();
const stockListUtils = useStockListUtils(); const stockListUtils = useStockListUtils();
return { return {
fileUtils,
stockListUtils, stockListUtils,
getCurrentStockFileName,
}; };
}, },
@@ -202,8 +194,7 @@ export default defineComponent({
availableIndexes.splice(i, -1); availableIndexes.splice(i, -1);
const randAvailableIndex = const randAvailableIndex = availableIndexes[Math.floor(Math.random() * availableIndexes.length)];
availableIndexes[Math.floor(Math.random() * availableIndexes.length)];
const tempSwap = this.store.stockList[randAvailableIndex]; const tempSwap = this.store.stockList[randAvailableIndex];
this.store.stockList[randAvailableIndex] = this.store.stockList[i]; this.store.stockList[randAvailableIndex] = this.store.stockList[i];
@@ -216,9 +207,7 @@ export default defineComponent({
const isFirstTractionUnit = isTractionUnit(this.store.stockList[0].vehicleRef); const isFirstTractionUnit = isTractionUnit(this.store.stockList[0].vehicleRef);
const sliceToSwap = isFirstTractionUnit const sliceToSwap = isFirstTractionUnit ? this.store.stockList.slice(1) : this.store.stockList.slice();
? this.store.stockList.slice(1)
: this.store.stockList.slice();
sliceToSwap.reverse(); sliceToSwap.reverse();
@@ -230,7 +219,7 @@ export default defineComponent({
downloadStock() { downloadStock() {
if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty')); if (this.store.stockList.length == 0) return alert(this.$t('stocklist.alert-empty'));
const defaultName = this.fileUtils.getCurrentStockFileName(); const defaultName = this.getCurrentStockFileName();
const fileName = prompt(this.$t('stocklist.prompt-file'), defaultName); const fileName = prompt(this.$t('stocklist.prompt-file'), defaultName);
if (!fileName) return; if (!fileName) return;
@@ -273,7 +262,7 @@ export default defineComponent({
saveStockDataToStorage() { saveStockDataToStorage() {
if (this.store.stockList.length == 0) return; if (this.store.stockList.length == 0) return;
const defaultName = this.fileUtils.getCurrentStockFileName(); const defaultName = this.getCurrentStockFileName();
const entryName = prompt(this.$t('stocklist.prompt-bookmark'), defaultName); const entryName = prompt(this.$t('stocklist.prompt-bookmark'), defaultName);
if (!entryName) return; if (!entryName) return;
@@ -307,6 +296,8 @@ export default defineComponent({
const content = await navigator.clipboard.readText(); const content = await navigator.clipboard.readText();
this.loadStockFromString(content); this.loadStockFromString(content);
} catch (error) { } catch (error) {
console.error(error);
switch (error) { switch (error) {
case 'stock-loading-error': case 'stock-loading-error':
alert(this.$t('stocklist.stock-loading-error')); alert(this.$t('stocklist.stock-loading-error'));
+14 -9
View File
@@ -2,15 +2,16 @@
<div class="list-wrapper"> <div class="list-wrapper">
<StockThumbnails :onListItemClick="onListItemClick" /> <StockThumbnails :onListItemClick="onListItemClick" />
<div v-if="stockIsEmpty" class="list-empty"> <ul>
<div class="stock-info">{{ $t('stocklist.list-empty') }}</div>
</div>
<ul v-else>
<transition-group name="stock-list-anim"> <transition-group name="stock-list-anim">
<li v-if="stockIsEmpty" class="list-empty">
{{ $t('stocklist.list-empty') }}
</li>
<li <li
v-for="(stock, i) in store.stockList" v-for="(stock, i) in store.stockList"
:key="stock.id" :key="stock.id"
class="stock-item"
:class="{ loco: isTractionUnit(stock.vehicleRef) }" :class="{ loco: isTractionUnit(stock.vehicleRef) }"
tabindex="0" tabindex="0"
@click="onListItemClick(i)" @click="onListItemClick(i)"
@@ -139,7 +140,10 @@ export default defineComponent({
@use '@/styles/responsive'; @use '@/styles/responsive';
.list-wrapper { .list-wrapper {
display: grid;
grid-template-rows: auto 1fr;
position: relative; position: relative;
overflow: hidden;
} }
.list-empty { .list-empty {
@@ -147,18 +151,18 @@ export default defineComponent({
border-radius: 0.5em; border-radius: 0.5em;
padding: 0.75em; padding: 0.75em;
font-weight: bold; font-weight: bold;
width: 100%;
} }
ul { ul {
overflow-y: scroll; overflow-y: auto;
height: 500px;
} }
ul > li { ul > li {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
min-width: 500px; white-space: nowrap;
margin: 0.25em 0; margin: 0.25em 0;
@@ -239,7 +243,8 @@ li > .stock-info {
@include responsive.midScreen { @include responsive.midScreen {
ul { ul {
min-height: auto; height: 100vh;
min-height: 400px;
} }
} }
</style> </style>
+51
View File
@@ -0,0 +1,51 @@
import { useStore } from '../store';
import { additionalCargoTypes } from '../utils/vehicleUtils';
export function getCurrentStockFileName() {
const store = useStore();
let fileName = '';
if (store.chosenStorageStockName.trim() != '') {
return store.chosenStorageStockName;
}
const currentStockString = store.stockList.map((s) => s.vehicleRef.type).join(';');
const currentRealComp = store.realCompositionList.find((rc) => rc.stockString == currentStockString);
// Append real composition to the name if chosen
if (currentRealComp != undefined) {
fileName += `${currentRealComp.stockId} `;
}
// Append default props
fileName += `${store.stockList[0].vehicleRef.type} ${(store.totalWeight / 1000).toFixed(1)}t; ${store.totalLength}m; vmax ${store.maxStockSpeed}`;
return fileName;
}
// UNUSED - PARSES ADDITIONAL CARGO FOR INTERMODALS
export function getStockStringOutput() {
const store = useStore();
const stockEntries = store.stockString.split(';');
const parsedEntries = store.stockList.map((stockVehicle, i) => {
if (stockVehicle.cargo && /412Z|627Z/.test(stockVehicle.vehicleRef.constructionType)) {
const additionalCargo = additionalCargoTypes.find(
(c) => c.groupType == stockVehicle.vehicleRef.constructionType && c.id == stockVehicle.cargo!.id
);
if (additionalCargo) {
let cargoString = additionalCargo.cargoStringVariations[Math.floor(Math.random() * additionalCargo.cargoStringVariations.length)];
return stockEntries[i].replace(stockVehicle.cargo.id, cargoString);
}
}
return stockEntries[i];
});
return parsedEntries.join(';');
}
+46 -293
View File
@@ -1,198 +1,32 @@
{ {
"cargo": { "cargo": {
"kontenery": [ "containers": ["412Z:sc_20", "412Z:sc_40", "627Z:sc_20", "627Z:sc_40"],
"412Z:sc_20_red", "food": ["412Z:tc_20_loaded", "627Z:tc_20_loaded"],
"412Z:sc_20_blue", "food-empty": ["412Z:tc_20_empty", "627Z:tc_20_empty"],
"412Z:sc_20_green", "intermodal": [
"412Z:sc_20_APL",
"412Z:sc_20_CMA",
"412Z:sc_20_Cosco",
"412Z:sc_20_Evr1",
"412Z:sc_20_Evr2",
"412Z:sc_20_Finnlines",
"412Z:sc_20_Hamburg",
"412Z:sc_20_Hanjin",
"412Z:sc_20_HapagLloyd",
"412Z:sc_20_HMM",
"412Z:sc_20_KLine",
"412Z:sc_20_Maersk",
"412Z:sc_20_ONE",
"412Z:sc_20_OOCL",
"412Z:sc_20_Schavemaker",
"412Z:sc_20_TD2",
"412Z:sc_20_Titan",
"412Z:sc_20_Toll",
"412Z:sc_40_red",
"412Z:sc_40_blue",
"412Z:sc_40_green",
"412Z:sc_40_APL",
"412Z:sc_40_CMA",
"412Z:sc_40_Cosco",
"412Z:sc_40_Evr1",
"412Z:sc_40_Evr2",
"412Z:sc_40_Finnlines",
"412Z:sc_40_Hamburg",
"412Z:sc_40_Hanjin",
"412Z:sc_40_HapagLloyd",
"412Z:sc_40_HMM",
"412Z:sc_40_KLine",
"412Z:sc_40_Maersk",
"412Z:sc_40_ONE",
"412Z:sc_40_OOCL",
"412Z:sc_40_Schavemaker",
"412Z:sc_40_TD2",
"412Z:sc_40_Titan",
"412Z:sc_40_Toll",
"627Z:sc_20", "627Z:sc_20",
"627Z:sc_20_red",
"627Z:sc_20_blue",
"627Z:sc_20_green",
"627Z:sc_20_APL",
"627Z:sc_20_CMA",
"627Z:sc_20_Cosco",
"627Z:sc_20_Evr1",
"627Z:sc_20_Evr2",
"627Z:sc_20_Finnlines",
"627Z:sc_20_Hamburg",
"627Z:sc_20_Hanjin",
"627Z:sc_20_HapagLloyd",
"627Z:sc_20_HMM",
"627Z:sc_20_KLine",
"627Z:sc_20_Maersk",
"627Z:sc_20_ONE",
"627Z:sc_20_OOCL",
"627Z:sc_20_Schavemaker",
"627Z:sc_20_TD2",
"627Z:sc_20_Titan",
"627Z:sc_20_Toll",
"627Z:sc_40_red",
"627Z:sc_40", "627Z:sc_40",
"627Z:sc_40_blue", "627Z:tc_20_empty",
"627Z:sc_40_green", "627Z:tc_20_loaded",
"627Z:sc_40_APL",
"627Z:sc_40_CMA",
"627Z:sc_40_Cosco",
"627Z:sc_40_Evr1",
"627Z:sc_40_Evr2",
"627Z:sc_40_Finnlines",
"627Z:sc_40_Hamburg",
"627Z:sc_40_Hanjin",
"627Z:sc_40_HapagLloyd",
"627Z:sc_40_HMM",
"627Z:sc_40_KLine",
"627Z:sc_40_Maersk",
"627Z:sc_40_ONE",
"627Z:sc_40_OOCL",
"627Z:sc_40_Schavemaker",
"627Z:sc_40_TD2",
"627Z:sc_40_Titan",
"627Z:sc_40_Toll"
],
"biomasa": [
"412Z:wt_20_biomass",
"412Z:wt_20_mix_black_green_biomass",
"412Z:wt_20_mix_blue_biomass",
"412Z:wt_20_mix_blue_CDC_white_biomass",
"412Z:wt_20_mix_blue_white_biomass",
"412Z:wt_20_mix_EPC_biomass",
"412Z:wt_20_mix_green_biomass",
"412Z:wt_20_black_biomass",
"412Z:wt_20_blue_biomass",
"412Z:wt_20_blue_gr_biomass",
"412Z:wt_20_blue_gr_r_biomass",
"412Z:wt_20_CDC_biomass",
"412Z:wt_20_EPC_black_biomass",
"412Z:wt_20_EPC_red_biomass",
"412Z:wt_20_green_new_biomass",
"412Z:wt_20_green_old_biomass",
"412Z:wt_20_white_new_biomass",
"412Z:wt_20_white_old_biomass",
"412Z:wt_20_white_old_gr_biomass",
"412Z:wt_20_white_old_gr_r_biomass",
"627Z:wt_20_biomass",
"627Z:wt_20_mix_black_green_biomass",
"627Z:wt_20_mix_blue_biomass",
"627Z:wt_20_mix_blue_CDC_white_biomass",
"627Z:wt_20_mix_blue_white_biomass",
"627Z:wt_20_mix_EPC_biomass",
"627Z:wt_20_mix_green_biomass",
"627Z:wt_20_black_biomass",
"627Z:wt_20_blue_biomass",
"627Z:wt_20_blue_gr_biomass",
"627Z:wt_20_blue_gr_r_biomass",
"627Z:wt_20_CDC_biomass",
"627Z:wt_20_EPC_black_biomass",
"627Z:wt_20_EPC_red_biomass",
"627Z:wt_20_green_new_biomass",
"627Z:wt_20_green_old_biomass",
"627Z:wt_20_white_new_biomass",
"627Z:wt_20_white_old_biomass",
"627Z:wt_20_white_old_gr_biomass",
"627Z:wt_20_white_old_gr_r_biomass"
],
"biomasa-puste": [
"412Z:wt_20_empty",
"412Z:wt_20_mix_black_green_empty",
"412Z:wt_20_mix_blue_empty",
"412Z:wt_20_mix_blue_CDC_white_empty",
"412Z:wt_20_mix_blue_white_empty",
"412Z:wt_20_mix_EPC_empty",
"412Z:wt_20_mix_green_empty",
"412Z:wt_20_black_empty",
"412Z:wt_20_blue_empty",
"412Z:wt_20_blue_gr_empty",
"412Z:wt_20_blue_gr_r_empty",
"412Z:wt_20_CDC_empty",
"412Z:wt_20_EPC_black_empty",
"412Z:wt_20_EPC_red_empty",
"412Z:wt_20_green_new_empty",
"412Z:wt_20_green_old_empty",
"412Z:wt_20_white_new_empty",
"412Z:wt_20_white_old_empty",
"412Z:wt_20_white_old_gr_empty",
"412Z:wt_20_white_old_gr_r_empty",
"627Z:wt_20_empty", "627Z:wt_20_empty",
"627Z:wt_20_mix_black_green_empty", "627Z:wt_20_biomass",
"627Z:wt_20_mix_blue_empty", "412Z:sc_20",
"627Z:wt_20_mix_blue_CDC_white_empty", "412Z:sc_40",
"627Z:wt_20_mix_blue_white_empty", "412Z:tc_20_empty",
"627Z:wt_20_mix_EPC_empty", "412Z:tc_20_loaded",
"627Z:wt_20_mix_green_empty", "412Z:wt_20_empty",
"627Z:wt_20_black_empty", "412Z:wt_20_biomass"
"627Z:wt_20_blue_empty",
"627Z:wt_20_blue_gr_empty",
"627Z:wt_20_blue_gr_r_empty",
"627Z:wt_20_CDC_empty",
"627Z:wt_20_EPC_black_empty",
"627Z:wt_20_EPC_red_empty",
"627Z:wt_20_green_new_empty",
"627Z:wt_20_green_old_empty",
"627Z:wt_20_white_new_empty",
"627Z:wt_20_white_old_empty",
"627Z:wt_20_white_old_gr_empty",
"627Z:wt_20_white_old_gr_r_empty"
], ],
"chłodnia": [ "biomass": ["412Z:wt_20_biomass", "627Z:wt_20_biomass"],
"202Lc:all" "biomass-empty": [
"412Z:wt_20_empty",
"627Z:wt_20_empty"
], ],
"drobnica": [ "cold-storage": ["202Lc:all"],
"426S:all", "loose-cargo": ["426S:all", "208Kf:all", "401Ka_PKP_Gags:all", "401Ka_PKPC_Gags:all"],
"208Kf:all", "coal": ["412W:coal_01", "413S:coal_413S", "429W:coal_01", "401Zb:coal_02"],
"401Ka_PKP_Gags:all", "ore": ["412W:ore_01", "401Zl:ore_35", "429W:ore_01"],
"401Ka_PKPC_Gags:all" "sand": [
],
"węgiel": [
"412W:coal_01",
"413S:coal_413S",
"429W:coal_01",
"401Zb:coal_02"
],
"ruda": [
"412W:ore_01",
"401Zl:ore_35",
"429W:ore_01"
],
"piasek": [
"412W:sand_01", "412W:sand_01",
"412W:sand_02", "412W:sand_02",
"413S:sand_413S", "413S:sand_413S",
@@ -204,110 +38,29 @@
"418Va:sand_418V", "418Va:sand_418V",
"418Vb:sand_418V" "418Vb:sand_418V"
], ],
"kreda": [ "chalk": ["413S:chalk_413S"],
"413S:chalk_413S" "stone": ["412W:stone_01", "412W:stone_50", "401Zl:stone_25", "429W:stone_01", "401Zb:stone_02", "418Va:stone_418V", "418Vb:stone_418V"],
], "scrap": ["412W:scrap_01", "412W:scrap_02", "429W:scrap_01", "429W:scrap_02"],
"kamień": [ "fuel": ["29R_CTLL:all", "29R_PKP:all", "445Rb:all"],
"412W:stone_01", "molasses": ["29R_PLPOL:all"],
"412W:stone_50", "gravel": ["441V"],
"401Zl:stone_25", "wheels": ["424Z:wheels_01"],
"429W:stone_01", "wood": ["424Z:woods_01", "424Z:woods_02"],
"401Zb:stone_02", "rails": ["424Z:rails_01"],
"418Va:stone_418V", "cables": ["424Z:cables_01", "24Z:cables_Ks", "401Ze:cables_02"],
"418Vb:stone_418V" "aggregate": ["59WS:all"],
], "technical": ["209c", "304Ca", "102a_PKPE", "401Ka_PKP_XGa:all"],
"złom": [ "mail": ["211K:all"],
"412W:scrap_01", "concrete": ["408S:cement_4", "206S_CEMET:cement_3", "206S_SPEED:cement_3", "220S_CEMET:cement_3"],
"412W:scrap_02", "lime": ["408S:lime_4", "206S_CEMET:lime_3", "206S_SPEED:lime_3", "220S_CEMET:lime_3"],
"429W:scrap_01", "soda": ["408S:soda_4", "206S_CEMET:soda_3", "206S_SPEED:soda_3", "220S_CEMET:soda_3"],
"429W:scrap_02" "wheat": ["206Sh_PKP_Ugpps:wheat_3", "206Sh_PKPC_Ugpps:wheat_3"],
], "corn": ["206Sh_PKP_Ugpps:corn_3", "206Sh_PKPC_Ugpps:corn_3"],
"paliwo": [ "fodder": ["206Sh_PKP_Ugpps:forage_3", "206Sh_PKPC_Ugpps:forage_3"],
"29R_CTLL:all", "vehicles": ["426Z:tank_01", "426Z:truck_01", "426Z:vehicles_01"],
"29R_PKP:all", "carbide": ["421S:carbide_01"],
"445Rb:all" "sensitive": ["425S:all", "421S:carbide_01"],
], "steel": ["401Ze:steel_01", "401Ze:steel_02"],
"melasa": [ "gas": ["WB117:all"]
"29R_PLPOL:all"
],
"żwir": [
"441V"
],
"koła": [
"424Z:wheels_01"
],
"drewno": [
"424Z:woods_01",
"424Z:woods_02"
],
"szyny": [
"424Z:rails_01"
],
"kable": [
"424Z:cables_01",
"24Z:cables_Ks",
"401Ze:cables_02"
],
"kruszywo": [
"59WS:all"
],
"techniczne": [
"209c",
"304Ca",
"102a_PKPE",
"401Ka_PKP_XGa:all"
],
"poczta": [
"211K:all"
],
"cement": [
"408S:cement_4",
"206S_CEMET:cement_3",
"206S_SPEED:cement_3",
"220S_CEMET:cement_3"
],
"wapno": [
"408S:lime_4",
"206S_CEMET:lime_3",
"206S_SPEED:lime_3",
"220S_CEMET:lime_3"
],
"soda": [
"408S:soda_4",
"206S_CEMET:soda_3",
"206S_SPEED:soda_3",
"220S_CEMET:soda_3"
],
"pszenica": [
"206Sh_PKP_Ugpps:wheat_3",
"206Sh_PKPC_Ugpps:wheat_3"
],
"kukurydza": [
"206Sh_PKP_Ugpps:corn_3",
"206Sh_PKPC_Ugpps:corn_3"
],
"pasza": [
"206Sh_PKP_Ugpps:forage_3",
"206Sh_PKPC_Ugpps:forage_3"
],
"pojazdy": [
"426Z:tank_01",
"426Z:truck_01",
"426Z:vehicles_01"
],
"karbid": [
"421S:carbide_01"
],
"wrażliwe": [
"425S:all",
"421S:carbide_01"
],
"stal": [
"401Ze:steel_01",
"401Ze:steel_02"
],
"gaz": [
"WB117:all"
]
} }
} }
+21 -8
View File
@@ -1,10 +1,23 @@
import axios from 'axios'; export class HttpClient {
constructor(private readonly baseURL: string) {}
const http = axios.create({ async get<T>(url: string, params?: Record<string, any>): Promise<T> {
baseURL: const absoluteURL = new URL(this.baseURL + '/' + url);
import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV
? 'http://localhost:3001'
: 'https://stacjownik.spythere.eu',
});
export default http; if (params) {
Object.keys(params).forEach((key) => {
if (params[key] === undefined) return;
absoluteURL.searchParams.append(key, params[key]);
});
}
const data = await fetch(absoluteURL);
if (!data.ok) {
throw new Error(`Cannot fetch: ${absoluteURL}`);
}
return data.json();
}
}
+37 -33
View File
@@ -221,38 +221,41 @@
"stock-title": "Rolling stock:" "stock-title": "Rolling stock:"
}, },
"cargo": { "cargo": {
"kontenery": "containers", "containers": "containers",
"biomasa": "biomass", "food": "food tanks",
"biomasa-puste": "biomass (empty)", "food-empty": "food tanks (empty)",
"chłodnia": "refrigerator", "biomass": "biomass",
"drobnica": "loose cargo", "biomass-empty": "biomass (empty)",
"węgiel": "coal", "cold-storage": "cold storage",
"ruda": "ore", "loose-cargo": "loose cargo",
"piasek": "sand", "coal": "coal",
"kreda": "chalk", "ore": "ore",
"kamień": "stone", "sand": "sand",
"złom": "scrap", "chalk": "chalk",
"paliwo": "fuel", "stone": "stone",
"melasa": "molasses", "scrap": "scrap",
"żwir": "gravel", "fuel": "fuel",
"koła": "wheels", "molasses": "molasses",
"drewno": "wood", "gravel": "gravel",
"szyny": "rails", "wheels": "wheels",
"kable": "cables", "wood": "wood",
"kruszywo": "aggregate", "rails": "rails",
"techniczne": "technical", "cables": "cables",
"poczta": "mail", "aggregate": "aggregate",
"cement": "concrete", "technical": "technical",
"wapno": "lime", "mail": "mail",
"concrete": "concrete",
"lime": "lime",
"soda": "soda", "soda": "soda",
"pszenica": "wheat", "wheat": "wheat",
"kukurydza": "corn", "corn": "corn",
"pasza": "fodder", "fodder": "fodder",
"karbid": "carbide", "carbide": "carbide",
"pojazdy": "vehicles", "vehicles": "vehicles",
"wrażliwe": "sensitive", "sensitive": "sensitive",
"stal": "steel", "steel": "steel",
"gaz": "gas" "gas": "gas",
"intermodal": "intermodalne"
}, },
"usage": { "usage": {
"Gor89": "passenger carriage", "Gor89": "passenger carriage",
@@ -332,7 +335,7 @@
"Luban_XH_short": "short residential car", "Luban_XH_short": "short residential car",
"Luban_XH_long": "long residential car", "Luban_XH_long": "long residential car",
"Luban_XH_workshop": "workshop car", "Luban_XH_workshop": "workshop car",
"EDK80": "crane car" "EDK80": "railway crane car"
}, },
"cargo-warnings": { "cargo-warnings": {
"title": "Rolling stock containing extra cargo warnings:", "title": "Rolling stock containing extra cargo warnings:",
@@ -340,7 +343,8 @@
"warning_un1965_twr": "TWR: LPG (UN 1965)", "warning_un1965_twr": "TWR: LPG (UN 1965)",
"warning_un1965_tn": "TN: LPG - empty tank (UN 1965)", "warning_un1965_tn": "TN: LPG - empty tank (UN 1965)",
"warning_un1202_tn": "TN: diesel fuel (UN 1202)", "warning_un1202_tn": "TN: diesel fuel (UN 1202)",
"warning_military_pn": "PN: military transport" "warning_military_pn": "PN: military transport",
"warning_edk80_pn": "PN: railway crane EDK80"
}, },
"migrate-info": { "migrate-info": {
"line-1": "Pojazdownik is being moved to a new domain - {0}! You can still use the current website, but it will no longer be updated and will be shut down in the nearest future!", "line-1": "Pojazdownik is being moved to a new domain - {0}! You can still use the current website, but it will no longer be updated and will be shut down in the nearest future!",
+36 -32
View File
@@ -221,38 +221,41 @@
"stock-title": "Skład:" "stock-title": "Skład:"
}, },
"cargo": { "cargo": {
"kontenery": "kontenery", "containers": "kontenery",
"biomasa": "biomasa", "food": "żywność",
"biomasa-puste": "biomasa (puste)", "food-empty": "żywność (puste)",
"chłodnia": "chłodnia", "biomass": "biomasa",
"drobnica": "drobnica", "biomass-empty": "biomasa (puste)",
"węgiel": "węgiel", "cold-storage": "chłodnia",
"ruda": "ruda", "loose-cargo": "drobnica",
"piasek": "piasek", "coal": "węgiel",
"kreda": "kreda", "ore": "ruda",
"kamień": "kamień", "sand": "piasek",
"złom": "złom", "chalk": "kreda",
"paliwo": "paliwo", "stone": "kamień",
"melasa": "melasa", "scrap": "złom",
"żwir": "żwir", "fuel": "paliwo",
"koła": "koła", "molasses": "melasa",
"drewno": "drewno", "gravel": "żwir",
"szyny": "szyny", "wheels": "koła",
"kable": "kable", "wood": "drewno",
"kruszywo": "kruszywo", "rails": "szyny",
"techniczne": "techniczne", "cables": "kable",
"poczta": "poczta", "aggregate": "kruszywo",
"cement": "cement", "technical": "techniczne",
"wapno": "wapno", "mail": "poczta",
"concrete": "cement",
"lime": "wapno",
"soda": "soda", "soda": "soda",
"pszenica": "pszenica", "wheat": "pszenica",
"kukurydza": "kukurydza", "corn": "kukurydza",
"pasza": "pasza", "fodder": "pasza",
"karbid": "karbid", "carbide": "karbid",
"pojazdy": "pojazdy", "vehicles": "pojazdy",
"wrażliwe": "wrażliwe", "sensitive": "wrażliwe",
"stal": "stal", "steel": "stal",
"gaz": "gaz" "gas": "gaz",
"intermodal": "intermodalne"
}, },
"usage": { "usage": {
"Gor89": "wagon pasażerski", "Gor89": "wagon pasażerski",
@@ -339,7 +342,8 @@
"warning_un1965_twr": "TWR: gazy węglowodorowe skroplone (UN 1965)", "warning_un1965_twr": "TWR: gazy węglowodorowe skroplone (UN 1965)",
"warning_un1965_tn": "TN: gazy węglowodorowe skroplone - puste cysterny (UN 1965)", "warning_un1965_tn": "TN: gazy węglowodorowe skroplone - puste cysterny (UN 1965)",
"warning_un1202_tn": "TN: olej napędowy (UN 1202)", "warning_un1202_tn": "TN: olej napędowy (UN 1202)",
"warning_military_pn": "PN: transport wojskowy" "warning_military_pn": "PN: transport wojskowy",
"warning_edk80_pn": "PN: dźwig kolejowy EDK80"
}, },
"migrate-info": { "migrate-info": {
"line-1": "Pojazdownik zostaje przeniesiony na nową domenę - {0}! Możesz korzystać z obecnej strony, jednak nie będzie ona otrzymywać już aktualizacji i w przyszłości zostanie wyłączona!", "line-1": "Pojazdownik zostaje przeniesiony na nową domenę - {0}! Możesz korzystać z obecnej strony, jednak nie będzie ona otrzymywać już aktualizacji i w przyszłości zostanie wyłączona!",
-16
View File
@@ -1,16 +0,0 @@
import http from '../http';
import { API } from '../types/api.types';
export class ApiManager {
static async fetchActiveData() {
try {
const responseData = (await http.get<API.ActiveData>('/api/getActiveData')).data;
return responseData;
} catch (error) {
console.error('Nie udało się pobrać zdalnej zawartości', error);
}
return null;
}
}
+16 -8
View File
@@ -28,11 +28,7 @@ export default defineComponent({
const stock = this.getStockObject(vehicle, cargo); const stock = this.getStockObject(vehicle, cargo);
if ( if (isTractionUnit(stock.vehicleRef) && this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef))
isTractionUnit(stock.vehicleRef) &&
this.store.stockList.length > 0 &&
!isTractionUnit(this.store.stockList[0].vehicleRef)
)
this.store.stockList.unshift(stock); this.store.stockList.unshift(stock);
else this.store.stockList.push(stock); else this.store.stockList.push(stock);
}, },
@@ -40,8 +36,7 @@ export default defineComponent({
addLocomotive(loco: ILocomotive) { addLocomotive(loco: ILocomotive) {
const stockObj = this.getStockObject(loco); const stockObj = this.getStockObject(loco);
if (this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef)) if (this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef)) this.store.stockList.unshift(stockObj);
this.store.stockList.unshift(stockObj);
else this.store.stockList.push(stockObj); else this.store.stockList.push(stockObj);
}, },
@@ -83,7 +78,20 @@ export default defineComponent({
const [carType, cargo] = type.split(':'); const [carType, cargo] = type.split(':');
vehicle = this.store.carDataList.find((car) => car.type == carType) || null; vehicle = this.store.carDataList.find((car) => car.type == carType) || null;
if (cargo) vehicleCargo = vehicle?.cargoTypes.find((c) => c.id == cargo) || null; if (cargo) {
vehicleCargo = vehicle?.cargoTypes.find((c) => c.id == cargo) || null;
// UNUSED - ADDITIONAL INTERMODAL CARGO TEST
// if (/412Z|627Z/.test(vehicle.constructionType)) {
// const additionalCargo = additionalCargoTypes.find(
// (c) => c.groupType == vehicle!.constructionType && c.cargoStringVariations.includes(cargo.join(':'))
// );
// if (additionalCargo) {
// cargo[0] = additionalCargo.id;
// }
// }
}
} }
if (!vehicle && type) { if (!vehicle && type) {
+13 -4
View File
@@ -26,9 +26,11 @@ import {
totalWeight, totalWeight,
} from './utils/vehicleUtils'; } from './utils/vehicleUtils';
import http from './http';
import realCompositionsJSON from './data/realCompositions.json'; import realCompositionsJSON from './data/realCompositions.json';
import { HttpClient } from './http';
import { API } from './types/api.types';
const baseURL = import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV ? 'http://localhost:3001' : 'https://stacjownik.spythere.eu';
export const useStore = defineStore('store', { export const useStore = defineStore('store', {
state: () => ({ state: () => ({
@@ -65,6 +67,8 @@ export const useStore = defineStore('store', {
chosenStorageStockString: '', chosenStorageStockString: '',
compatibleSimulatorVersion: '2025.1.1', compatibleSimulatorVersion: '2025.1.1',
httpClient: new HttpClient(baseURL),
}), }),
getters: { getters: {
@@ -125,8 +129,13 @@ export const useStore = defineStore('store', {
actions: { actions: {
async fetchVehiclesAPI() { async fetchVehiclesAPI() {
try { try {
const vehiclesData = (await http.get<IVehiclesAPIResponse>('/api/getVehicles')).data; const response = await this.httpClient.get<API.VehiclesData.Response>('api/getVehiclesData');
this.vehiclesData = vehiclesData; this.vehiclesData = response.vehicles.map((v) => ({
...v,
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
}));
console.log(response);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
+1 -1
View File
@@ -38,7 +38,7 @@ html {
font-family: Lato, sans-serif; font-family: Lato, sans-serif;
background-color: var(--bgColor); background-color: var(--bgColorDarker);
overflow-x: hidden; overflow-x: hidden;
} }
-2
View File
@@ -1,6 +1,5 @@
.tab { .tab {
height: 100%; height: 100%;
margin-top: 1px;
&_header { &_header {
padding: 0.5em 1em; padding: 0.5em 1em;
@@ -26,7 +25,6 @@
} }
&_content { &_content {
margin-top: 1em;
height: 100%; height: 100%;
} }
+48 -83
View File
@@ -1,87 +1,52 @@
import { IVehicleRestrictions } from './common.types';
// API namespace // API namespace
export namespace API { export namespace API {
export interface ActiveData { export namespace VehiclesData {
trains: Train[]; export interface VehicleObject {
activeSceneries: ActiveScenery[]; id: number;
name: string;
type: string;
cabinName: string | null;
restrictions: IVehicleRestrictions | null;
vehicleGroupsId: number;
}
export interface VehicleGroupObject {
id: number;
name: string;
speed: number;
speedLoaded?: number;
speedLoco?: number;
length: number;
weight: number;
cargoTypes: VehicleCargo[] | null;
locoProps: {
coldStart: boolean;
doubleManned: boolean;
} | null;
massSpeeds: VehicleGroupMassSpeeds | null;
}
export interface VehicleGroupMassSpeeds {
passenger: Record<string, number> | null;
cargo: Record<string, number> | null;
none: number | null;
}
export interface VehicleCargo {
id: string;
weight: number;
}
export interface Data {
vehicles: VehicleObject[];
vehicleGroups: VehicleGroupObject[];
}
export type Response = Data;
} }
} }
export interface ActiveScenery {
dispatcherId: number;
dispatcherName: string;
dispatcherIsSupporter: boolean;
stationName: string;
stationHash: string;
region: string;
maxUsers: number;
currentUsers: number;
spawn: number;
lastSeen: number;
dispatcherExp: number;
nameFromHeader: string;
spawnString?: string;
networkConnectionString: string;
isOnline: number;
dispatcherRate: number;
dispatcherStatus: number;
}
export interface Train {
id: string;
trainNo: number;
mass: number;
speed: number;
length: number;
distance: number;
stockString: string;
driverName: string;
driverId: number;
driverIsSupporter: boolean;
driverLevel: number;
currentStationHash: string;
currentStationName: string;
signal: string;
connectedTrack: string;
online: number;
lastSeen: number;
region: string;
isTimeout: boolean;
timetable?: Timetable;
}
export interface Timetable {
SKR: boolean;
TWR: boolean;
hasDangerousCargo: boolean;
hasExtraDeliveries: boolean;
warningNotes: string;
category: string;
stopList: TimetableStop[];
route: string;
timetableId: number;
sceneries: string[];
path: string;
}
export interface TimetableStop {
stopName: string;
stopNameRAW: string;
stopType: string;
stopDistance: number;
pointId: string;
comments?: (null | string)[];
mainStop: boolean;
arrivalLine?: string;
arrivalTimestamp: number;
arrivalRealTimestamp: number;
arrivalDelay: number;
departureLine?: string;
departureTimestamp: number;
departureRealTimestamp: number;
departureDelay: number;
beginsHere: boolean;
terminatesHere: boolean;
confirmed: number;
stopped: number;
stopTime?: number;
}
-1
View File
@@ -74,7 +74,6 @@ export interface IVehicleData {
cabinName: string | null; cabinName: string | null;
restrictions: IVehicleRestrictions | null; restrictions: IVehicleRestrictions | null;
vehicleGroupsId: number; vehicleGroupsId: number;
simulatorVersion: string;
group: IVehicleGroup; group: IVehicleGroup;
} }
-27
View File
@@ -1,27 +0,0 @@
import { useStore } from '../store';
export const useFileUtils = () => {
const store = useStore();
function getCurrentStockFileName() {
let fileName = '';
const currentStockString = store.stockList.map((s) => s.vehicleRef.type).join(';');
const currentRealComp = store.realCompositionList.find(
(rc) => rc.stockString == currentStockString
);
// Append real composition to the name if chosen
if (currentRealComp != undefined) {
fileName += `${currentRealComp.stockId} `;
}
// Append default props
fileName += `${store.stockList[0].vehicleRef.type} ${(store.totalWeight / 1000).toFixed(1)}t; ${store.totalLength}m; vmax ${store.maxStockSpeed}`;
return fileName;
}
return { getCurrentStockFileName };
};
+73 -7
View File
@@ -1,6 +1,57 @@
import { ICarWagon, ILocomotive, IStock, IVehicleData, LocoGroupType, WagonGroupType } from '../types/common.types'; import { ICarWagon, ILocomotive, IStock, IVehicleData, LocoGroupType, WagonGroupType } from '../types/common.types';
import { MassLimitLocoType, calculateMassLimit, calculateSpeedLimit } from './vehicleLimitsUtils'; import { MassLimitLocoType, calculateMassLimit, calculateSpeedLimit } from './vehicleLimitsUtils';
// UNUSED - ADDITIONAL CARGO TYPES FOR INTERMODALS
export const additionalCargoTypes = [
{
groupType: '627Z',
id: '627Z_mix1_sctc_loaded',
weight: 96500,
cargoStringVariations: [
'sc_20:tc_20_loaded:tc_20_loaded:tc_20_loaded',
'tc_20_loaded:sc_20:tc_20_loaded:tc_20_loaded',
'tc_20_loaded:tc_20_loaded:sc_20:tc_20_loaded',
'tc_20_loaded:tc_20_loaded:tc_20_loaded:sc_20',
],
},
{
groupType: '627Z',
id: '627Z_mix2_sctc_loaded',
weight: 87000,
cargoStringVariations: [
'sc_20:tc_20_loaded:tc_20_loaded:sc_20',
'sc_20:tc_20_loaded:sc_20:tc_20_loaded',
'sc_20:sc_20:tc_20_loaded:tc_20_loaded',
'tc_20_loaded:tc_20_loaded:sc_20:sc_20',
'tc_20_loaded:sc_20:tc_20_loaded:sc_20',
'tc_20_loaded:sc_20:sc_20:tc_20_loaded',
],
},
{
groupType: '627Z',
id: '627Z_mix3_sctc_loaded',
weight: 77500,
cargoStringVariations: [
'sc_20:sc_20:sc_20:tc_20_loaded',
'sc_20:sc_20:tc_20_loaded:sc_20',
'sc_20:tc_20_loaded:sc_20:sc_20',
'tc_20_loaded:sc_20:sc_20:sc_20',
],
},
{
groupType: '412Z',
id: '412Z_mix1_sctc_loaded',
weight: 43500,
cargoStringVariations: ['sc_20:tc_20_loaded:tc_20_loaded'],
},
{
groupType: '412Z',
id: '412Z_mix1_sctc_empty',
weight: 37735,
cargoStringVariations: ['sc_20:tc_20_empty:sc_20'],
},
];
export function isTractionUnit(vehicle: ILocomotive | ICarWagon): vehicle is ILocomotive { export function isTractionUnit(vehicle: ILocomotive | ICarWagon): vehicle is ILocomotive {
return (vehicle as ILocomotive).cabinType !== undefined; return (vehicle as ILocomotive).cabinType !== undefined;
} }
@@ -42,12 +93,26 @@ export function carDataList(vehiclesData: IVehicleData[] | undefined) {
return vehiclesData.reduce<ICarWagon[]>((acc, data) => { return vehiclesData.reduce<ICarWagon[]>((acc, data) => {
if (data.cabinName !== null) return acc; if (data.cabinName !== null) return acc;
const cargoTypes = data.group.cargoTypes || [];
// UNUSED - ADDITIONAL CARGO TYPES FOR INTERMODALS
// if (/412Z|627Z/.test(data.group.name)) {
// cargoTypes.push(
// ...additionalCargoTypes
// .filter((c) => c.groupType == data.group.name)
// .map((c) => ({
// id: c.id,
// weight: c.weight,
// }))
// );
// }
acc.push({ acc.push({
group: data.type as WagonGroupType, group: data.type as WagonGroupType,
type: data.name, type: data.name,
constructionType: data.group.name, constructionType: data.group.name,
loadable: data.group.cargoTypes !== null && data.group.cargoTypes.length > 0, loadable: data.group.cargoTypes !== null && data.group.cargoTypes.length > 0,
cargoTypes: data.group?.cargoTypes ?? [], cargoTypes,
sponsorOnlyTimestamp: data.restrictions?.sponsorOnly ?? 0, sponsorOnlyTimestamp: data.restrictions?.sponsorOnly ?? 0,
teamOnly: data.restrictions?.teamOnly ?? false, teamOnly: data.restrictions?.teamOnly ?? false,
@@ -106,12 +171,13 @@ export function getCargoWarnings(stockList: IStock[]) {
let warnings: Set<string> = new Set(); let warnings: Set<string> = new Set();
stockList.forEach((stockVehicle) => { stockList.forEach((stockVehicle) => {
if (stockVehicle.vehicleRef.group == 'wagon-freight') { if (stockVehicle.vehicleRef.group != 'wagon-freight') return;
if (stockVehicle.cargo && stockVehicle.cargo.id.startsWith('wt_20')) warnings.add('warning_wt_20_pn');
else if (stockVehicle.cargo && /^(tank|vehicles|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn'); if (stockVehicle.cargo && stockVehicle.cargo.id.startsWith('wt_20')) warnings.add('warning_wt_20_pn');
else if (stockVehicle.vehicleRef.type.startsWith('WB117')) warnings.add(stockVehicle.cargo ? 'warning_un1965_twr' : 'warning_un1965_tn'); else if (stockVehicle.vehicleRef.type.startsWith('WB117')) warnings.add(stockVehicle.cargo ? 'warning_un1965_twr' : 'warning_un1965_tn');
else if (stockVehicle.vehicleRef.type.startsWith('445Rb')) warnings.add('warning_un1202_tn'); else if (stockVehicle.vehicleRef.type.startsWith('445Rb')) warnings.add('warning_un1202_tn');
} else if (stockVehicle.vehicleRef.type.startsWith('EDK80')) warnings.add('warning_edk80_pn');
else if (stockVehicle.cargo && /^(tank|vehicles|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn');
}); });
return warnings; return warnings;
+16 -7
View File
@@ -25,13 +25,22 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-container { @use '../styles/responsive';
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 100vh; .app-container {
padding: 0.5em; display: grid;
justify-content: center;
grid-template-rows: minmax(900px, 1fr) auto;
gap: 0.5em;
height: 100vh;
}
@include responsive.midScreen {
.app-container {
height: auto;
min-height: 100vh;
}
} }
</style> </style>