mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-02 21:08:12 +00:00
+1
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pojazdownik",
|
||||
"version": "1.9.3",
|
||||
"version": "1.10.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -12,7 +12,6 @@
|
||||
"format": "prettier --write src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.4.0",
|
||||
"lucide-vue-next": "^0.576.0",
|
||||
"pinia": "^3.0.3",
|
||||
"prettier": "^3.0.3",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<footer>
|
||||
<i18n-t keypath="footer.disclaimer" tag="div" class="text--grayed">
|
||||
<template #tos>
|
||||
<a style="color: #ccc" :href="$t('footer.tos-href')" target="_blank">
|
||||
{{ $t('footer.tos') }}
|
||||
</a>
|
||||
</template>
|
||||
</i18n-t>
|
||||
<div>
|
||||
©
|
||||
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
|
||||
{{ new Date().getUTCFullYear() }} |
|
||||
<a class="release-link" :href="githubReleaseHref" target="_blank">v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }}</a>
|
||||
</div>
|
||||
|
||||
<div class="text--grayed" v-if="store.vehiclesData">
|
||||
{{
|
||||
@@ -17,12 +16,6 @@
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
©
|
||||
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
|
||||
{{ new Date().getUTCFullYear() }} | v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }}
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
@@ -41,6 +34,10 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
computed: {
|
||||
githubReleaseHref() {
|
||||
return `https://github.com/Spythere/pojazdownik/releases/tag/${this.VERSION}`;
|
||||
},
|
||||
|
||||
vehiclesCounters() {
|
||||
let counters = {
|
||||
all: 0,
|
||||
@@ -66,6 +63,14 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
footer {
|
||||
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>
|
||||
|
||||
@@ -26,17 +26,14 @@ main {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
|
||||
width: 100%;
|
||||
max-width: 1350px;
|
||||
width: 100vw;
|
||||
max-width: 1600px;
|
||||
|
||||
grid-template-columns: 1fr 2fr;
|
||||
grid-template-rows: auto 360px minmax(300px, 1fr);
|
||||
grid-template-columns: minmax(380px, 1fr) 3fr;
|
||||
grid-template-rows: auto 350px minmax(300px, 1fr);
|
||||
|
||||
background-color: var(--bgColorDarker);
|
||||
border-radius: 1em;
|
||||
|
||||
min-height: 950px;
|
||||
|
||||
overflow: hidden;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
@@ -45,6 +42,7 @@ main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
<template>
|
||||
<section class="tabs-section">
|
||||
<div class="tabs-modes">
|
||||
<router-link
|
||||
v-for="(route, i) in routes"
|
||||
:key="route.name"
|
||||
class="link-btn"
|
||||
:to="route.href"
|
||||
:style="{ 'grid-area': route.name }"
|
||||
>
|
||||
<router-link 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--grayed" v-if="route.name == 'stock'"
|
||||
>({{ store.stockList.length }})</span
|
||||
>
|
||||
<span class="text--grayed" v-if="route.name == 'stock'">({{ store.stockList.length }})</span>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
@@ -68,7 +60,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@use '@/styles/responsive';
|
||||
|
||||
// Tab change animation
|
||||
@@ -86,6 +78,10 @@ onMounted(() => {
|
||||
|
||||
// Section styles
|
||||
.tabs-section {
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr;
|
||||
gap: 1em;
|
||||
|
||||
grid-row: 1 / 4;
|
||||
grid-column: 2;
|
||||
|
||||
@@ -95,16 +91,18 @@ onMounted(() => {
|
||||
|
||||
.tabs-modes {
|
||||
display: grid;
|
||||
gap: 0.5em;
|
||||
grid-template-areas: 'stock wiki storage numgen stockgen';
|
||||
|
||||
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';
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
// grid-template-rows: 1fr 1fr;
|
||||
padding: 1px;
|
||||
|
||||
gap: 0.5em;
|
||||
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
@include responsive.smallScreen {
|
||||
@@ -116,4 +114,10 @@ onMounted(() => {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@include responsive.midScreen {
|
||||
.tabs-section {
|
||||
min-height: 100vh;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
<img
|
||||
:src="getThumbnailURL(store.chosenVehicle.type, 'small')"
|
||||
:data-preview-available="isDataPreviewAvailable"
|
||||
:data-sponsor-only="
|
||||
store.chosenVehicle.sponsorOnlyTimestamp &&
|
||||
store.chosenVehicle.sponsorOnlyTimestamp > Date.now()
|
||||
"
|
||||
:data-sponsor-only="store.chosenVehicle.sponsorOnlyTimestamp && store.chosenVehicle.sponsorOnlyTimestamp > Date.now()"
|
||||
:data-team-only="store.chosenVehicle.teamOnly"
|
||||
@click="onImageClick"
|
||||
@keydown.enter="onImageClick"
|
||||
@@ -21,23 +18,15 @@
|
||||
<div class="image-info">
|
||||
<b class="text--accent">{{ store.chosenVehicle.type }}</b> •
|
||||
<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>
|
||||
|
||||
<div style="color: #ccc">
|
||||
<div>
|
||||
{{ store.chosenVehicle.length }}m |
|
||||
{{ (store.chosenVehicle.weight / 1000).toFixed(1) }}t |
|
||||
{{ store.chosenVehicle.maxSpeed }} km/h
|
||||
{{ store.chosenVehicle.length }}m | {{ (store.chosenVehicle.weight / 1000).toFixed(1) }}t | {{ store.chosenVehicle.maxSpeed }} km/h
|
||||
</div>
|
||||
|
||||
<div v-if="isTractionUnit(store.chosenVehicle)">
|
||||
{{ $t('preview.cabin') }} {{ store.chosenVehicle.cabinType }}
|
||||
</div>
|
||||
<div v-if="isTractionUnit(store.chosenVehicle)">{{ $t('preview.cabin') }} {{ store.chosenVehicle.cabinType }}</div>
|
||||
|
||||
<div v-else>
|
||||
{{
|
||||
@@ -47,18 +36,10 @@
|
||||
}}
|
||||
</div>
|
||||
|
||||
<b
|
||||
v-if="
|
||||
store.chosenVehicle.sponsorOnlyTimestamp &&
|
||||
store.chosenVehicle.sponsorOnlyTimestamp > Date.now()
|
||||
"
|
||||
class="sponsor-only"
|
||||
>
|
||||
<b v-if="store.chosenVehicle.sponsorOnlyTimestamp && store.chosenVehicle.sponsorOnlyTimestamp > Date.now()" class="sponsor-only">
|
||||
{{
|
||||
$t('preview.sponsor-only', [
|
||||
new Date(store.chosenVehicle.sponsorOnlyTimestamp).toLocaleDateString(
|
||||
$i18n.locale == 'pl' ? 'pl-PL' : 'en-GB'
|
||||
),
|
||||
new Date(store.chosenVehicle.sponsorOnlyTimestamp).toLocaleDateString($i18n.locale == 'pl' ? 'pl-PL' : 'en-GB'),
|
||||
])
|
||||
}}
|
||||
</b>
|
||||
@@ -164,8 +145,8 @@ export default defineComponent({
|
||||
|
||||
& > div {
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
width: 380px;
|
||||
width: 100%;
|
||||
max-width: 380px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="number-generator tab">
|
||||
<div class="number-generator-tab">
|
||||
<div class="tab_header">
|
||||
<h2>{{ $t('numgen.title') }}</h2>
|
||||
<h3>{{ $t('numgen.subtitle') }}</h3>
|
||||
@@ -227,6 +227,13 @@ const randomizeTrainNumber = (randomizeRegions = false) => {
|
||||
@use '@/styles/tab';
|
||||
@use '@/styles/responsive';
|
||||
|
||||
.number-generator-tab {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.category-select {
|
||||
select {
|
||||
width: auto;
|
||||
@@ -283,7 +290,7 @@ const randomizeTrainNumber = (randomizeRegions = false) => {
|
||||
}
|
||||
|
||||
@include responsive.midScreen {
|
||||
.number-generator {
|
||||
.number-generator-tab {
|
||||
min-height: 100vh;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="stock-generator tab">
|
||||
<div class="tab_content">
|
||||
<div class="stock-generator-tab">
|
||||
<div>
|
||||
<h2>{{ $t('stockgen.properties-title') }}</h2>
|
||||
|
||||
@@ -94,7 +93,6 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -290,6 +288,14 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
@use '@/styles/tab';
|
||||
|
||||
.stock-generator-tab {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
overflow: auto;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5em;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<section class="stock-list-tab">
|
||||
<div class="tab_content">
|
||||
<!-- Stock Actions -->
|
||||
<StockActions />
|
||||
|
||||
@@ -15,7 +14,6 @@
|
||||
|
||||
<!-- Stock List -->
|
||||
<StockList />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -42,7 +40,14 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<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 {
|
||||
display: flex;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<section class="tab storage-tab">
|
||||
<section class="storage-tab">
|
||||
<div class="tab_header">
|
||||
<h2>{{ $t('storage.title') }}</h2>
|
||||
<h3>{{ $t('storage.subtitle') }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="tab_content">
|
||||
<div class="storage-list-wrapper">
|
||||
<transition-group name="storage-list-anim" tag="ul" class="storage-list">
|
||||
<li v-for="storageEntry in storageStockDataList" :key="storageEntry.id">
|
||||
<div class="storage-item-top">
|
||||
@@ -36,8 +35,7 @@
|
||||
{{ new Date(storageEntry.createdAt).toLocaleString($i18n.locale) }}</i
|
||||
>
|
||||
<i v-if="storageEntry.updatedAt">
|
||||
• {{ $t('storage.updated-at') }}
|
||||
{{ new Date(storageEntry.updatedAt).toLocaleString($i18n.locale) }}</i
|
||||
• {{ $t('storage.updated-at') }} {{ new Date(storageEntry.updatedAt).toLocaleString($i18n.locale) }}</i
|
||||
>
|
||||
|
||||
<div style="margin-top: 0.5em">
|
||||
@@ -52,7 +50,6 @@
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -146,21 +143,26 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
@use '@/styles/tab';
|
||||
|
||||
.storage-tab {
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab_actions {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.storage-list-wrapper {
|
||||
position: relative;
|
||||
height: 730px;
|
||||
.tab_content {
|
||||
overflow: auto;
|
||||
margin-top: 1em;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
ul.storage-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
ul.storage-list > li {
|
||||
@@ -174,12 +176,14 @@ ul.storage-list > li {
|
||||
|
||||
.storage-item-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
.storage-item-top > h3 {
|
||||
width: 100%;
|
||||
min-width: 350px;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -208,7 +212,7 @@ ul.storage-list > li {
|
||||
&-move,
|
||||
&-enter-active,
|
||||
&-leave-active {
|
||||
transition: all 120ms ease-in-out;
|
||||
transition: all 100ms ease-in-out;
|
||||
}
|
||||
|
||||
&-enter-from {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<section class="wiki-list tab">
|
||||
<div class="tab_content">
|
||||
<section class="wiki-list-tab">
|
||||
<div class="actions">
|
||||
<div class="action action-input">
|
||||
<label for="search-vehicle">
|
||||
@@ -46,6 +45,10 @@
|
||||
</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"
|
||||
@@ -56,19 +59,13 @@
|
||||
@keydown.enter="onVehicleSelect(vehicle)"
|
||||
tabindex="0"
|
||||
>
|
||||
<img
|
||||
loading="lazy"
|
||||
width="120"
|
||||
:src="getThumbnailURL(vehicle.type, 'small')"
|
||||
@error="onThumbnailImageError"
|
||||
/>
|
||||
<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(),
|
||||
'sponsor-only': vehicle.sponsorOnlyTimestamp && vehicle.sponsorOnlyTimestamp > Date.now(),
|
||||
'team-only': vehicle.teamOnly,
|
||||
}"
|
||||
>
|
||||
@@ -80,18 +77,10 @@
|
||||
{{ 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>
|
||||
<div class="vehicle-props">{{ vehicle.length }}m | {{ (vehicle.weight / 1000).toFixed(1) }}t | {{ vehicle.maxSpeed }}km/h</div>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="no-vehicles-warning" v-if="computedVehicles.length == 0">
|
||||
{{ $t('wiki.no-vehicles') }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -181,11 +170,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
filterVehicles(v: IVehicle) {
|
||||
if (
|
||||
this.searchedVehicleTypeName != '' &&
|
||||
!v.type.toLocaleLowerCase().includes(this.searchedVehicleTypeName.toLocaleLowerCase())
|
||||
)
|
||||
return false;
|
||||
if (this.searchedVehicleTypeName != '' && !v.type.toLocaleLowerCase().includes(this.searchedVehicleTypeName.toLocaleLowerCase())) return false;
|
||||
|
||||
switch (this.filterType) {
|
||||
case VehicleFilter.AllTractions:
|
||||
@@ -247,6 +232,13 @@ export default defineComponent({
|
||||
@use '@/styles/tab';
|
||||
@use '@/styles/responsive';
|
||||
|
||||
.wiki-list-tab {
|
||||
display: grid;
|
||||
grid-template-rows: auto auto 1fr;
|
||||
gap: 0.5em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(10em, 1fr));
|
||||
@@ -284,10 +276,7 @@ export default defineComponent({
|
||||
gap: 0.5em;
|
||||
overflow: auto;
|
||||
|
||||
max-height: 730px;
|
||||
|
||||
margin-top: 0.75em;
|
||||
padding: 0.25em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.vehicles > li {
|
||||
@@ -297,7 +286,6 @@ export default defineComponent({
|
||||
background-color: #161c2e;
|
||||
padding: 0.5em;
|
||||
|
||||
min-height: 75px;
|
||||
cursor: pointer;
|
||||
|
||||
&[data-preview='true'] {
|
||||
@@ -340,11 +328,17 @@ export default defineComponent({
|
||||
|
||||
.no-vehicles-warning {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 1em;
|
||||
background-color: #161c2e;
|
||||
}
|
||||
|
||||
@include responsive.smallScreen {
|
||||
@include responsive.midScreen {
|
||||
.vehicles {
|
||||
height: 100vh;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.actions-panel {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
<template>
|
||||
<div class="stock_actions">
|
||||
<div class="actions-top">
|
||||
<button
|
||||
class="btn btn--image"
|
||||
@click="clickFileInput"
|
||||
:data-button-tooltip="$t('stocklist.action-upload-file')"
|
||||
>
|
||||
<button class="btn btn--image" @click="clickFileInput" :data-button-tooltip="$t('stocklist.action-upload-file')">
|
||||
<input type="file" @change="uploadStockFromFile" ref="conFile" accept=".con,.txt" />
|
||||
<FolderUp :stroke-width="2.5" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="btn btn--image"
|
||||
@click="uploadStockFromClipboard"
|
||||
:data-button-tooltip="$t('stocklist.action-upload-clipboard')"
|
||||
>
|
||||
<button class="btn btn--image" @click="uploadStockFromClipboard" :data-button-tooltip="$t('stocklist.action-upload-clipboard')">
|
||||
<ClipboardPaste :stroke-width="2.5" />
|
||||
</button>
|
||||
|
||||
@@ -115,10 +107,11 @@ import { defineComponent } from 'vue';
|
||||
import { useStore } from '../../../store';
|
||||
|
||||
import { isTractionUnit } from '../../../utils/vehicleUtils';
|
||||
import { useFileUtils } from '../../../utils/fileUtils';
|
||||
import stockMixin from '../../../mixins/stockMixin';
|
||||
import { useStockListUtils } from '../../../utils/stockListUtils';
|
||||
|
||||
import { getCurrentStockFileName } from '../../../composables/file';
|
||||
|
||||
import {
|
||||
Bookmark,
|
||||
ChevronDown,
|
||||
@@ -157,12 +150,11 @@ export default defineComponent({
|
||||
}),
|
||||
|
||||
setup() {
|
||||
const fileUtils = useFileUtils();
|
||||
const stockListUtils = useStockListUtils();
|
||||
|
||||
return {
|
||||
fileUtils,
|
||||
stockListUtils,
|
||||
getCurrentStockFileName,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -202,8 +194,7 @@ export default defineComponent({
|
||||
|
||||
availableIndexes.splice(i, -1);
|
||||
|
||||
const randAvailableIndex =
|
||||
availableIndexes[Math.floor(Math.random() * availableIndexes.length)];
|
||||
const randAvailableIndex = availableIndexes[Math.floor(Math.random() * availableIndexes.length)];
|
||||
const tempSwap = this.store.stockList[randAvailableIndex];
|
||||
|
||||
this.store.stockList[randAvailableIndex] = this.store.stockList[i];
|
||||
@@ -216,9 +207,7 @@ export default defineComponent({
|
||||
|
||||
const isFirstTractionUnit = isTractionUnit(this.store.stockList[0].vehicleRef);
|
||||
|
||||
const sliceToSwap = isFirstTractionUnit
|
||||
? this.store.stockList.slice(1)
|
||||
: this.store.stockList.slice();
|
||||
const sliceToSwap = isFirstTractionUnit ? this.store.stockList.slice(1) : this.store.stockList.slice();
|
||||
|
||||
sliceToSwap.reverse();
|
||||
|
||||
@@ -230,7 +219,7 @@ export default defineComponent({
|
||||
downloadStock() {
|
||||
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);
|
||||
|
||||
if (!fileName) return;
|
||||
@@ -273,7 +262,7 @@ export default defineComponent({
|
||||
saveStockDataToStorage() {
|
||||
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);
|
||||
|
||||
if (!entryName) return;
|
||||
@@ -307,6 +296,8 @@ export default defineComponent({
|
||||
const content = await navigator.clipboard.readText();
|
||||
this.loadStockFromString(content);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
switch (error) {
|
||||
case 'stock-loading-error':
|
||||
alert(this.$t('stocklist.stock-loading-error'));
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
<div class="list-wrapper">
|
||||
<StockThumbnails :onListItemClick="onListItemClick" />
|
||||
|
||||
<div v-if="stockIsEmpty" class="list-empty">
|
||||
<div class="stock-info">{{ $t('stocklist.list-empty') }}</div>
|
||||
</div>
|
||||
|
||||
<ul v-else>
|
||||
<ul>
|
||||
<transition-group name="stock-list-anim">
|
||||
<li v-if="stockIsEmpty" class="list-empty">
|
||||
{{ $t('stocklist.list-empty') }}
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-for="(stock, i) in store.stockList"
|
||||
:key="stock.id"
|
||||
class="stock-item"
|
||||
:class="{ loco: isTractionUnit(stock.vehicleRef) }"
|
||||
tabindex="0"
|
||||
@click="onListItemClick(i)"
|
||||
@@ -139,7 +140,10 @@ export default defineComponent({
|
||||
@use '@/styles/responsive';
|
||||
|
||||
.list-wrapper {
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.list-empty {
|
||||
@@ -147,18 +151,18 @@ export default defineComponent({
|
||||
border-radius: 0.5em;
|
||||
padding: 0.75em;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
ul {
|
||||
overflow-y: scroll;
|
||||
height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
ul > li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-width: 500px;
|
||||
white-space: nowrap;
|
||||
|
||||
margin: 0.25em 0;
|
||||
|
||||
@@ -239,7 +243,8 @@ li > .stock-info {
|
||||
|
||||
@include responsive.midScreen {
|
||||
ul {
|
||||
min-height: auto;
|
||||
height: 100vh;
|
||||
min-height: 400px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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
@@ -1,198 +1,32 @@
|
||||
{
|
||||
"cargo": {
|
||||
"kontenery": [
|
||||
"412Z:sc_20_red",
|
||||
"412Z:sc_20_blue",
|
||||
"412Z:sc_20_green",
|
||||
"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",
|
||||
"containers": ["412Z:sc_20", "412Z:sc_40", "627Z:sc_20", "627Z:sc_40"],
|
||||
"food": ["412Z:tc_20_loaded", "627Z:tc_20_loaded"],
|
||||
"food-empty": ["412Z:tc_20_empty", "627Z:tc_20_empty"],
|
||||
"intermodal": [
|
||||
"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_blue",
|
||||
"627Z:sc_40_green",
|
||||
"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:tc_20_empty",
|
||||
"627Z:tc_20_loaded",
|
||||
"627Z:wt_20_empty",
|
||||
"627Z:wt_20_mix_black_green_empty",
|
||||
"627Z:wt_20_mix_blue_empty",
|
||||
"627Z:wt_20_mix_blue_CDC_white_empty",
|
||||
"627Z:wt_20_mix_blue_white_empty",
|
||||
"627Z:wt_20_mix_EPC_empty",
|
||||
"627Z:wt_20_mix_green_empty",
|
||||
"627Z:wt_20_black_empty",
|
||||
"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"
|
||||
"627Z:wt_20_biomass",
|
||||
"412Z:sc_20",
|
||||
"412Z:sc_40",
|
||||
"412Z:tc_20_empty",
|
||||
"412Z:tc_20_loaded",
|
||||
"412Z:wt_20_empty",
|
||||
"412Z:wt_20_biomass"
|
||||
],
|
||||
"chłodnia": [
|
||||
"202Lc:all"
|
||||
"biomass": ["412Z:wt_20_biomass", "627Z:wt_20_biomass"],
|
||||
"biomass-empty": [
|
||||
"412Z:wt_20_empty",
|
||||
"627Z:wt_20_empty"
|
||||
],
|
||||
"drobnica": [
|
||||
"426S:all",
|
||||
"208Kf:all",
|
||||
"401Ka_PKP_Gags:all",
|
||||
"401Ka_PKPC_Gags:all"
|
||||
],
|
||||
"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": [
|
||||
"cold-storage": ["202Lc:all"],
|
||||
"loose-cargo": ["426S:all", "208Kf:all", "401Ka_PKP_Gags:all", "401Ka_PKPC_Gags:all"],
|
||||
"coal": ["412W:coal_01", "413S:coal_413S", "429W:coal_01", "401Zb:coal_02"],
|
||||
"ore": ["412W:ore_01", "401Zl:ore_35", "429W:ore_01"],
|
||||
"sand": [
|
||||
"412W:sand_01",
|
||||
"412W:sand_02",
|
||||
"413S:sand_413S",
|
||||
@@ -204,110 +38,29 @@
|
||||
"418Va:sand_418V",
|
||||
"418Vb:sand_418V"
|
||||
],
|
||||
"kreda": [
|
||||
"413S:chalk_413S"
|
||||
],
|
||||
"kamień": [
|
||||
"412W:stone_01",
|
||||
"412W:stone_50",
|
||||
"401Zl:stone_25",
|
||||
"429W:stone_01",
|
||||
"401Zb:stone_02",
|
||||
"418Va:stone_418V",
|
||||
"418Vb:stone_418V"
|
||||
],
|
||||
"złom": [
|
||||
"412W:scrap_01",
|
||||
"412W:scrap_02",
|
||||
"429W:scrap_01",
|
||||
"429W:scrap_02"
|
||||
],
|
||||
"paliwo": [
|
||||
"29R_CTLL:all",
|
||||
"29R_PKP:all",
|
||||
"445Rb:all"
|
||||
],
|
||||
"melasa": [
|
||||
"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"
|
||||
]
|
||||
"chalk": ["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"],
|
||||
"fuel": ["29R_CTLL:all", "29R_PKP:all", "445Rb:all"],
|
||||
"molasses": ["29R_PLPOL:all"],
|
||||
"gravel": ["441V"],
|
||||
"wheels": ["424Z:wheels_01"],
|
||||
"wood": ["424Z:woods_01", "424Z:woods_02"],
|
||||
"rails": ["424Z:rails_01"],
|
||||
"cables": ["424Z:cables_01", "24Z:cables_Ks", "401Ze:cables_02"],
|
||||
"aggregate": ["59WS:all"],
|
||||
"technical": ["209c", "304Ca", "102a_PKPE", "401Ka_PKP_XGa:all"],
|
||||
"mail": ["211K:all"],
|
||||
"concrete": ["408S:cement_4", "206S_CEMET:cement_3", "206S_SPEED:cement_3", "220S_CEMET:cement_3"],
|
||||
"lime": ["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"],
|
||||
"wheat": ["206Sh_PKP_Ugpps:wheat_3", "206Sh_PKPC_Ugpps:wheat_3"],
|
||||
"corn": ["206Sh_PKP_Ugpps:corn_3", "206Sh_PKPC_Ugpps:corn_3"],
|
||||
"fodder": ["206Sh_PKP_Ugpps:forage_3", "206Sh_PKPC_Ugpps:forage_3"],
|
||||
"vehicles": ["426Z:tank_01", "426Z:truck_01", "426Z:vehicles_01"],
|
||||
"carbide": ["421S:carbide_01"],
|
||||
"sensitive": ["425S:all", "421S:carbide_01"],
|
||||
"steel": ["401Ze:steel_01", "401Ze:steel_02"],
|
||||
"gas": ["WB117:all"]
|
||||
}
|
||||
}
|
||||
+20
-7
@@ -1,10 +1,23 @@
|
||||
import axios from 'axios';
|
||||
export class HttpClient {
|
||||
constructor(private readonly baseURL: string) {}
|
||||
|
||||
const http = axios.create({
|
||||
baseURL:
|
||||
import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV
|
||||
? 'http://localhost:3001'
|
||||
: 'https://stacjownik.spythere.eu',
|
||||
async get<T>(url: string, params?: Record<string, any>): Promise<T> {
|
||||
const absoluteURL = new URL(this.baseURL + '/' + url);
|
||||
|
||||
if (params) {
|
||||
Object.keys(params).forEach((key) => {
|
||||
if (params[key] === undefined) return;
|
||||
|
||||
absoluteURL.searchParams.append(key, params[key]);
|
||||
});
|
||||
}
|
||||
|
||||
export default http;
|
||||
const data = await fetch(absoluteURL);
|
||||
|
||||
if (!data.ok) {
|
||||
throw new Error(`Cannot fetch: ${absoluteURL}`);
|
||||
}
|
||||
|
||||
return data.json();
|
||||
}
|
||||
}
|
||||
|
||||
+37
-33
@@ -221,38 +221,41 @@
|
||||
"stock-title": "Rolling stock:"
|
||||
},
|
||||
"cargo": {
|
||||
"kontenery": "containers",
|
||||
"biomasa": "biomass",
|
||||
"biomasa-puste": "biomass (empty)",
|
||||
"chłodnia": "refrigerator",
|
||||
"drobnica": "loose cargo",
|
||||
"węgiel": "coal",
|
||||
"ruda": "ore",
|
||||
"piasek": "sand",
|
||||
"kreda": "chalk",
|
||||
"kamień": "stone",
|
||||
"złom": "scrap",
|
||||
"paliwo": "fuel",
|
||||
"melasa": "molasses",
|
||||
"żwir": "gravel",
|
||||
"koła": "wheels",
|
||||
"drewno": "wood",
|
||||
"szyny": "rails",
|
||||
"kable": "cables",
|
||||
"kruszywo": "aggregate",
|
||||
"techniczne": "technical",
|
||||
"poczta": "mail",
|
||||
"cement": "concrete",
|
||||
"wapno": "lime",
|
||||
"containers": "containers",
|
||||
"food": "food tanks",
|
||||
"food-empty": "food tanks (empty)",
|
||||
"biomass": "biomass",
|
||||
"biomass-empty": "biomass (empty)",
|
||||
"cold-storage": "cold storage",
|
||||
"loose-cargo": "loose cargo",
|
||||
"coal": "coal",
|
||||
"ore": "ore",
|
||||
"sand": "sand",
|
||||
"chalk": "chalk",
|
||||
"stone": "stone",
|
||||
"scrap": "scrap",
|
||||
"fuel": "fuel",
|
||||
"molasses": "molasses",
|
||||
"gravel": "gravel",
|
||||
"wheels": "wheels",
|
||||
"wood": "wood",
|
||||
"rails": "rails",
|
||||
"cables": "cables",
|
||||
"aggregate": "aggregate",
|
||||
"technical": "technical",
|
||||
"mail": "mail",
|
||||
"concrete": "concrete",
|
||||
"lime": "lime",
|
||||
"soda": "soda",
|
||||
"pszenica": "wheat",
|
||||
"kukurydza": "corn",
|
||||
"pasza": "fodder",
|
||||
"karbid": "carbide",
|
||||
"pojazdy": "vehicles",
|
||||
"wrażliwe": "sensitive",
|
||||
"stal": "steel",
|
||||
"gaz": "gas"
|
||||
"wheat": "wheat",
|
||||
"corn": "corn",
|
||||
"fodder": "fodder",
|
||||
"carbide": "carbide",
|
||||
"vehicles": "vehicles",
|
||||
"sensitive": "sensitive",
|
||||
"steel": "steel",
|
||||
"gas": "gas",
|
||||
"intermodal": "intermodalne"
|
||||
},
|
||||
"usage": {
|
||||
"Gor89": "passenger carriage",
|
||||
@@ -332,7 +335,7 @@
|
||||
"Luban_XH_short": "short residential car",
|
||||
"Luban_XH_long": "long residential car",
|
||||
"Luban_XH_workshop": "workshop car",
|
||||
"EDK80": "crane car"
|
||||
"EDK80": "railway crane car"
|
||||
},
|
||||
"cargo-warnings": {
|
||||
"title": "Rolling stock containing extra cargo warnings:",
|
||||
@@ -340,7 +343,8 @@
|
||||
"warning_un1965_twr": "TWR: LPG (UN 1965)",
|
||||
"warning_un1965_tn": "TN: LPG - empty tank (UN 1965)",
|
||||
"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": {
|
||||
"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
@@ -221,38 +221,41 @@
|
||||
"stock-title": "Skład:"
|
||||
},
|
||||
"cargo": {
|
||||
"kontenery": "kontenery",
|
||||
"biomasa": "biomasa",
|
||||
"biomasa-puste": "biomasa (puste)",
|
||||
"chłodnia": "chłodnia",
|
||||
"drobnica": "drobnica",
|
||||
"węgiel": "węgiel",
|
||||
"ruda": "ruda",
|
||||
"piasek": "piasek",
|
||||
"kreda": "kreda",
|
||||
"kamień": "kamień",
|
||||
"złom": "złom",
|
||||
"paliwo": "paliwo",
|
||||
"melasa": "melasa",
|
||||
"żwir": "żwir",
|
||||
"koła": "koła",
|
||||
"drewno": "drewno",
|
||||
"szyny": "szyny",
|
||||
"kable": "kable",
|
||||
"kruszywo": "kruszywo",
|
||||
"techniczne": "techniczne",
|
||||
"poczta": "poczta",
|
||||
"cement": "cement",
|
||||
"wapno": "wapno",
|
||||
"containers": "kontenery",
|
||||
"food": "żywność",
|
||||
"food-empty": "żywność (puste)",
|
||||
"biomass": "biomasa",
|
||||
"biomass-empty": "biomasa (puste)",
|
||||
"cold-storage": "chłodnia",
|
||||
"loose-cargo": "drobnica",
|
||||
"coal": "węgiel",
|
||||
"ore": "ruda",
|
||||
"sand": "piasek",
|
||||
"chalk": "kreda",
|
||||
"stone": "kamień",
|
||||
"scrap": "złom",
|
||||
"fuel": "paliwo",
|
||||
"molasses": "melasa",
|
||||
"gravel": "żwir",
|
||||
"wheels": "koła",
|
||||
"wood": "drewno",
|
||||
"rails": "szyny",
|
||||
"cables": "kable",
|
||||
"aggregate": "kruszywo",
|
||||
"technical": "techniczne",
|
||||
"mail": "poczta",
|
||||
"concrete": "cement",
|
||||
"lime": "wapno",
|
||||
"soda": "soda",
|
||||
"pszenica": "pszenica",
|
||||
"kukurydza": "kukurydza",
|
||||
"pasza": "pasza",
|
||||
"karbid": "karbid",
|
||||
"pojazdy": "pojazdy",
|
||||
"wrażliwe": "wrażliwe",
|
||||
"stal": "stal",
|
||||
"gaz": "gaz"
|
||||
"wheat": "pszenica",
|
||||
"corn": "kukurydza",
|
||||
"fodder": "pasza",
|
||||
"carbide": "karbid",
|
||||
"vehicles": "pojazdy",
|
||||
"sensitive": "wrażliwe",
|
||||
"steel": "stal",
|
||||
"gas": "gaz",
|
||||
"intermodal": "intermodalne"
|
||||
},
|
||||
"usage": {
|
||||
"Gor89": "wagon pasażerski",
|
||||
@@ -339,7 +342,8 @@
|
||||
"warning_un1965_twr": "TWR: gazy węglowodorowe skroplone (UN 1965)",
|
||||
"warning_un1965_tn": "TN: gazy węglowodorowe skroplone - puste cysterny (UN 1965)",
|
||||
"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": {
|
||||
"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!",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,7 @@ export default defineComponent({
|
||||
|
||||
const stock = this.getStockObject(vehicle, cargo);
|
||||
|
||||
if (
|
||||
isTractionUnit(stock.vehicleRef) &&
|
||||
this.store.stockList.length > 0 &&
|
||||
!isTractionUnit(this.store.stockList[0].vehicleRef)
|
||||
)
|
||||
if (isTractionUnit(stock.vehicleRef) && this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef))
|
||||
this.store.stockList.unshift(stock);
|
||||
else this.store.stockList.push(stock);
|
||||
},
|
||||
@@ -40,8 +36,7 @@ export default defineComponent({
|
||||
addLocomotive(loco: ILocomotive) {
|
||||
const stockObj = this.getStockObject(loco);
|
||||
|
||||
if (this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef))
|
||||
this.store.stockList.unshift(stockObj);
|
||||
if (this.store.stockList.length > 0 && !isTractionUnit(this.store.stockList[0].vehicleRef)) this.store.stockList.unshift(stockObj);
|
||||
else this.store.stockList.push(stockObj);
|
||||
},
|
||||
|
||||
@@ -83,7 +78,20 @@ export default defineComponent({
|
||||
const [carType, cargo] = type.split(':');
|
||||
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) {
|
||||
|
||||
+13
-4
@@ -26,9 +26,11 @@ import {
|
||||
totalWeight,
|
||||
} from './utils/vehicleUtils';
|
||||
|
||||
import http from './http';
|
||||
|
||||
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', {
|
||||
state: () => ({
|
||||
@@ -65,6 +67,8 @@ export const useStore = defineStore('store', {
|
||||
chosenStorageStockString: '',
|
||||
|
||||
compatibleSimulatorVersion: '2025.1.1',
|
||||
|
||||
httpClient: new HttpClient(baseURL),
|
||||
}),
|
||||
|
||||
getters: {
|
||||
@@ -125,8 +129,13 @@ export const useStore = defineStore('store', {
|
||||
actions: {
|
||||
async fetchVehiclesAPI() {
|
||||
try {
|
||||
const vehiclesData = (await http.get<IVehiclesAPIResponse>('/api/getVehicles')).data;
|
||||
this.vehiclesData = vehiclesData;
|
||||
const response = await this.httpClient.get<API.VehiclesData.Response>('api/getVehiclesData');
|
||||
this.vehiclesData = response.vehicles.map((v) => ({
|
||||
...v,
|
||||
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
|
||||
}));
|
||||
|
||||
console.log(response);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ html {
|
||||
|
||||
font-family: Lato, sans-serif;
|
||||
|
||||
background-color: var(--bgColor);
|
||||
background-color: var(--bgColorDarker);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
.tab {
|
||||
height: 100%;
|
||||
margin-top: 1px;
|
||||
|
||||
&_header {
|
||||
padding: 0.5em 1em;
|
||||
@@ -26,7 +25,6 @@
|
||||
}
|
||||
|
||||
&_content {
|
||||
margin-top: 1em;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
+41
-76
@@ -1,87 +1,52 @@
|
||||
import { IVehicleRestrictions } from './common.types';
|
||||
|
||||
// API namespace
|
||||
export namespace API {
|
||||
export interface ActiveData {
|
||||
trains: Train[];
|
||||
activeSceneries: ActiveScenery[];
|
||||
}
|
||||
export namespace VehiclesData {
|
||||
export interface VehicleObject {
|
||||
id: number;
|
||||
name: string;
|
||||
type: string;
|
||||
cabinName: string | null;
|
||||
restrictions: IVehicleRestrictions | null;
|
||||
|
||||
vehicleGroupsId: number;
|
||||
}
|
||||
|
||||
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;
|
||||
export interface VehicleGroupObject {
|
||||
id: number;
|
||||
name: string;
|
||||
speed: number;
|
||||
speedLoaded?: number;
|
||||
speedLoco?: 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;
|
||||
weight: number;
|
||||
cargoTypes: VehicleCargo[] | null;
|
||||
|
||||
locoProps: {
|
||||
coldStart: boolean;
|
||||
doubleManned: boolean;
|
||||
} | null;
|
||||
|
||||
massSpeeds: VehicleGroupMassSpeeds | null;
|
||||
}
|
||||
|
||||
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 VehicleGroupMassSpeeds {
|
||||
passenger: Record<string, number> | null;
|
||||
cargo: Record<string, number> | null;
|
||||
none: number | null;
|
||||
}
|
||||
|
||||
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;
|
||||
export interface VehicleCargo {
|
||||
id: string;
|
||||
weight: number;
|
||||
}
|
||||
|
||||
export interface Data {
|
||||
vehicles: VehicleObject[];
|
||||
vehicleGroups: VehicleGroupObject[];
|
||||
}
|
||||
|
||||
export type Response = Data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ export interface IVehicleData {
|
||||
cabinName: string | null;
|
||||
restrictions: IVehicleRestrictions | null;
|
||||
vehicleGroupsId: number;
|
||||
simulatorVersion: string;
|
||||
group: IVehicleGroup;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 };
|
||||
};
|
||||
@@ -1,6 +1,57 @@
|
||||
import { ICarWagon, ILocomotive, IStock, IVehicleData, LocoGroupType, WagonGroupType } from '../types/common.types';
|
||||
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 {
|
||||
return (vehicle as ILocomotive).cabinType !== undefined;
|
||||
}
|
||||
@@ -42,12 +93,26 @@ export function carDataList(vehiclesData: IVehicleData[] | undefined) {
|
||||
return vehiclesData.reduce<ICarWagon[]>((acc, data) => {
|
||||
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({
|
||||
group: data.type as WagonGroupType,
|
||||
type: data.name,
|
||||
constructionType: data.group.name,
|
||||
loadable: data.group.cargoTypes !== null && data.group.cargoTypes.length > 0,
|
||||
cargoTypes: data.group?.cargoTypes ?? [],
|
||||
cargoTypes,
|
||||
|
||||
sponsorOnlyTimestamp: data.restrictions?.sponsorOnly ?? 0,
|
||||
teamOnly: data.restrictions?.teamOnly ?? false,
|
||||
@@ -106,12 +171,13 @@ export function getCargoWarnings(stockList: IStock[]) {
|
||||
let warnings: Set<string> = new Set();
|
||||
|
||||
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');
|
||||
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('EDK80')) warnings.add('warning_edk80_pn');
|
||||
else if (stockVehicle.cargo && /^(tank|vehicles|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn');
|
||||
});
|
||||
|
||||
return warnings;
|
||||
|
||||
@@ -25,13 +25,22 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
@use '../styles/responsive';
|
||||
|
||||
.app-container {
|
||||
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;
|
||||
padding: 0.5em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user