mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c453820663 | |||
| 3ff19ba722 | |||
| 8011f3b053 | |||
| 6bfcd0f8e0 |
+47
-31
@@ -1,16 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="migration-info">
|
<AppModals />
|
||||||
<img src="/favicon.svg" alt="logo" width="120" />
|
<ImageFullscreenPreview v-if="store.vehiclePreviewSrc" />
|
||||||
<h1><span class="text--accent">Aplikacja</span> została przeniesiona na nową domenę!</h1>
|
|
||||||
<h1><span class="text--accent">This app</span> has been moved to a new domain!</h1>
|
<transition name="slide-bottom-anim">
|
||||||
<a href="http://pojazdownik-td2.spythere.eu/">http://pojazdownik-td2.spythere.eu/</a>
|
<MigrationInfo v-if="store.isMigrationInfoOpen" />
|
||||||
</div>
|
</transition>
|
||||||
|
|
||||||
|
<router-view></router-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useStore } from './store';
|
import { useStore } from './store';
|
||||||
import { computed, watchEffect } from 'vue';
|
import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue';
|
||||||
|
import AppModals from './components/app/AppModals.vue';
|
||||||
|
import { computed, onMounted, watchEffect } from 'vue';
|
||||||
import { registerSW } from 'virtual:pwa-register';
|
import { registerSW } from 'virtual:pwa-register';
|
||||||
|
import MigrationInfo from './components/app/MigrationInfo.vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|
||||||
@@ -18,6 +23,12 @@ registerSW({
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadStockDataFromStorage();
|
||||||
|
handleMigrationInfo();
|
||||||
|
store.setupAPIData();
|
||||||
|
});
|
||||||
|
|
||||||
const currentStockString = computed(() => store.stockString);
|
const currentStockString = computed(() => store.stockString);
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
@@ -25,6 +36,35 @@ watchEffect(() => {
|
|||||||
store.chosenStorageStockName = '';
|
store.chosenStorageStockName = '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function handleMigrationInfo() {
|
||||||
|
// Show only on old domain
|
||||||
|
if (location.hostname !== 'pojazdownik-td2.web.app') return;
|
||||||
|
|
||||||
|
const showInfo = localStorage.getItem('showMigrationInfo');
|
||||||
|
|
||||||
|
// Do not show if already acknowledged
|
||||||
|
if (showInfo === 'false') return;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
store.isMigrationInfoOpen = true;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadStockDataFromStorage() {
|
||||||
|
const savedData = localStorage.getItem('savedStockData');
|
||||||
|
|
||||||
|
if (!savedData) {
|
||||||
|
localStorage.setItem('savedStockData', JSON.stringify({}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
store.storageStockData = JSON.parse(savedData);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Wystąpił błąd podczas przetwarzania danych o składach z localStorage!', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -43,28 +83,4 @@ watchEffect(() => {
|
|||||||
font-size: calc(0.7rem + 0.75vw);
|
font-size: calc(0.7rem + 0.75vw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.migration-info {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1em;
|
|
||||||
|
|
||||||
img {
|
|
||||||
margin-bottom: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-size: 1.85em;
|
|
||||||
margin-top: 1em;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"627Z:wt_20_empty"
|
"627Z:wt_20_empty"
|
||||||
],
|
],
|
||||||
"cold-storage": ["202Lc:all"],
|
"cold-storage": ["202Lc:all"],
|
||||||
"loose-cargo": ["426S:all", "208Kf:all", "401Ka_PKP_Gags:all", "401Ka_PKPC_Gags:all"],
|
"loose-cargo": ["426S:all", "208Kf:all", "401Ka_PKP_Gags:all", "401Ka_PKPC_Gags:all", "411V_PKPC_Facc:all", "411V_ALU_Faccpp:all", "411V_DOLWR_Facc:all", "411V_PKP_Facc:all", "411V_PNUIK_Facc:all"],
|
||||||
"coal": ["412W:coal_01", "413S:coal_413S", "429W:coal_01", "401Zb:coal_02"],
|
"coal": ["412W:coal_01", "413S:coal_413S", "429W:coal_01", "401Zb:coal_02"],
|
||||||
"ore": ["412W:ore_01", "401Zl:ore_35", "429W:ore_01"],
|
"ore": ["412W:ore_01", "401Zl:ore_35", "429W:ore_01"],
|
||||||
"sand": [
|
"sand": [
|
||||||
@@ -57,7 +57,8 @@
|
|||||||
"wheat": ["206Sh_PKP_Ugpps:wheat_3", "206Sh_PKPC_Ugpps:wheat_3"],
|
"wheat": ["206Sh_PKP_Ugpps:wheat_3", "206Sh_PKPC_Ugpps:wheat_3"],
|
||||||
"corn": ["206Sh_PKP_Ugpps:corn_3", "206Sh_PKPC_Ugpps:corn_3"],
|
"corn": ["206Sh_PKP_Ugpps:corn_3", "206Sh_PKPC_Ugpps:corn_3"],
|
||||||
"fodder": ["206Sh_PKP_Ugpps:forage_3", "206Sh_PKPC_Ugpps:forage_3"],
|
"fodder": ["206Sh_PKP_Ugpps:forage_3", "206Sh_PKPC_Ugpps:forage_3"],
|
||||||
"vehicles": ["426Z:tank_01", "426Z:truck_01", "426Z:vehicles_01"],
|
"military": ["426Z:tank_01", "426Z:truck_01", "426Z:vehicles_01"],
|
||||||
|
"vehicles_nysa": ["424Z:vehicles_nysa", "426Z:vehicles_02"],
|
||||||
"carbide": ["421S:carbide_01"],
|
"carbide": ["421S:carbide_01"],
|
||||||
"sensitive": ["425S:all", "421S:carbide_01"],
|
"sensitive": ["425S:all", "421S:carbide_01"],
|
||||||
"steel": ["401Ze:steel_01", "401Ze:steel_02"],
|
"steel": ["401Ze:steel_01", "401Ze:steel_02"],
|
||||||
|
|||||||
+2
-1
@@ -251,7 +251,8 @@
|
|||||||
"corn": "corn",
|
"corn": "corn",
|
||||||
"fodder": "fodder",
|
"fodder": "fodder",
|
||||||
"carbide": "carbide",
|
"carbide": "carbide",
|
||||||
"vehicles": "vehicles",
|
"vehicles_nysa": "vehicles (nysa)",
|
||||||
|
"military": "vehicles (military)",
|
||||||
"sensitive": "sensitive",
|
"sensitive": "sensitive",
|
||||||
"steel": "steel",
|
"steel": "steel",
|
||||||
"gas": "gas",
|
"gas": "gas",
|
||||||
|
|||||||
+4
-3
@@ -251,7 +251,8 @@
|
|||||||
"corn": "kukurydza",
|
"corn": "kukurydza",
|
||||||
"fodder": "pasza",
|
"fodder": "pasza",
|
||||||
"carbide": "karbid",
|
"carbide": "karbid",
|
||||||
"vehicles": "pojazdy",
|
"vehicles_nysa": "pojazdy (nysa)",
|
||||||
|
"military": "pojazdy (wojsko)",
|
||||||
"sensitive": "wrażliwe",
|
"sensitive": "wrażliwe",
|
||||||
"steel": "stal",
|
"steel": "stal",
|
||||||
"gas": "gaz",
|
"gas": "gaz",
|
||||||
@@ -334,7 +335,7 @@
|
|||||||
"Luban_XH_short": "krótki wagon mieszkalny",
|
"Luban_XH_short": "krótki wagon mieszkalny",
|
||||||
"Luban_XH_long": "długi wagon mieszkalny",
|
"Luban_XH_long": "długi wagon mieszkalny",
|
||||||
"Luban_XH_workshop": "wagon warsztatowy",
|
"Luban_XH_workshop": "wagon warsztatowy",
|
||||||
"EDK80": "dźwig kolejowy"
|
"EDK80": "żuraw kolejowy"
|
||||||
},
|
},
|
||||||
"cargo-warnings": {
|
"cargo-warnings": {
|
||||||
"title": "Skład z dodatkowymi uwagami przewozowymi:",
|
"title": "Skład z dodatkowymi uwagami przewozowymi:",
|
||||||
@@ -343,7 +344,7 @@
|
|||||||
"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"
|
"warning_edk80_pn": "PN: żuraw 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!",
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ export const useStore = defineStore('store', {
|
|||||||
...v,
|
...v,
|
||||||
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
|
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export function getCargoWarnings(stockList: IStock[]) {
|
|||||||
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.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');
|
else if (stockVehicle.cargo && /^(tank|vehicles_01|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn');
|
||||||
});
|
});
|
||||||
|
|
||||||
return warnings;
|
return warnings;
|
||||||
|
|||||||
Reference in New Issue
Block a user