mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b746843086 | |||
| cbbd06fecd | |||
| 11e99b6af0 | |||
| 31f4a2e5b2 | |||
| 22514c3263 | |||
| 0df673467c | |||
| 6377e13809 | |||
| 13fa633db4 | |||
| dd9661551c | |||
| 495012a5ca | |||
| 3cfccb1bb4 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stacjownik",
|
"name": "stacjownik",
|
||||||
"version": "1.28.2",
|
"version": "1.28.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+10
-16
@@ -6,6 +6,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Tooltip />
|
<Tooltip />
|
||||||
|
|
||||||
<AppHeader :current-lang="currentLang" @change-lang="changeLang" />
|
<AppHeader :current-lang="currentLang" @change-lang="changeLang" />
|
||||||
|
|
||||||
<main class="app_main">
|
<main class="app_main">
|
||||||
@@ -16,21 +17,12 @@
|
|||||||
</router-view>
|
</router-view>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="app_footer">
|
<AppFooter
|
||||||
©
|
:version="VERSION"
|
||||||
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
|
:is-on-production-host="isOnProductionHost"
|
||||||
{{ new Date().getUTCFullYear() }} |
|
:is-update-card-open="isUpdateCardOpen"
|
||||||
<button class="btn--text" @click="() => (isUpdateCardOpen = true)">
|
@open-update-card="() => (isUpdateCardOpen = true)"
|
||||||
v{{ VERSION }}{{ isOnProductionHost ? '' : 'dev' }}
|
/>
|
||||||
</button>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<a href="https://discord.gg/x2mpNN3svk">
|
|
||||||
<img src="/images/icon-discord.png" alt="" /> <b>{{ $t('footer.discord') }}</b>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div style="display: none">∫ ukryta taktyczna całka do programowania w HTMLu</div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -38,7 +30,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import { version } from '.././package.json';
|
import { version } from '../package.json';
|
||||||
import { Status } from './typings/common';
|
import { Status } from './typings/common';
|
||||||
import { useMainStore } from './store/mainStore';
|
import { useMainStore } from './store/mainStore';
|
||||||
import { useApiStore } from './store/apiStore';
|
import { useApiStore } from './store/apiStore';
|
||||||
@@ -51,6 +43,7 @@ import Tooltip from './components/Tooltip/Tooltip.vue';
|
|||||||
import UpdateCard from './components/App/UpdateCard.vue';
|
import UpdateCard from './components/App/UpdateCard.vue';
|
||||||
|
|
||||||
import StorageManager from './managers/storageManager';
|
import StorageManager from './managers/storageManager';
|
||||||
|
import AppFooter from './components/App/AppFooter.vue';
|
||||||
|
|
||||||
const STORAGE_VERSION_KEY = 'app_version';
|
const STORAGE_VERSION_KEY = 'app_version';
|
||||||
|
|
||||||
@@ -59,6 +52,7 @@ export default defineComponent({
|
|||||||
Clock,
|
Clock,
|
||||||
StatusIndicator,
|
StatusIndicator,
|
||||||
AppHeader,
|
AppHeader,
|
||||||
|
AppFooter,
|
||||||
UpdateCard,
|
UpdateCard,
|
||||||
Tooltip
|
Tooltip
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<footer class="app_footer">
|
||||||
|
©
|
||||||
|
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
|
||||||
|
{{ new Date().getUTCFullYear() }} |
|
||||||
|
<button class="btn--text" @click="openUpdateCard">
|
||||||
|
v{{ version }}{{ isOnProductionHost ? '' : 'dev' }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<a href="https://discord.gg/x2mpNN3svk">
|
||||||
|
<img src="/images/icon-discord.png" alt="" /> <b>{{ $t('footer.discord') }}</b>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div style="display: none">∫ ukryta taktyczna całka do programowania w HTMLu</div>
|
||||||
|
</footer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
emits: ['openUpdateCard'],
|
||||||
|
props: {
|
||||||
|
isUpdateCardOpen: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
version: String,
|
||||||
|
isOnProductionHost: Boolean
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
openUpdateCard() {
|
||||||
|
this.$emit('openUpdateCard');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="stock-images">
|
<div class="stock-images">
|
||||||
<img
|
<img
|
||||||
v-for="(thumbnailImage, imageIndex) in images"
|
v-for="(thumbnailImage, imageIndex) in images"
|
||||||
:src="`https://static.spythere.eu/thumbnails/v2/${thumbnailImage}.png`"
|
:src="`https://stacjownik.spythere.eu/static/thumbnails/${thumbnailImage}.png`"
|
||||||
height="60"
|
height="60"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
data-tooltip-type="VehiclePreviewTooltip"
|
data-tooltip-type="VehiclePreviewTooltip"
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tooltip-content">
|
<div class="tooltip-content">
|
||||||
<div v-if="imageState == 'loading'" class="loading-info">
|
<div class="image-box">
|
||||||
{{ $t('vehicle-preview.loading') }}
|
<div v-if="imageState == 'loading'" class="loading-info">
|
||||||
|
{{ $t('vehicle-preview.loading') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="imageState == 'error'" class="loading-info">{{ $t('vehicle-preview.error') }}</div>
|
||||||
|
|
||||||
|
<img
|
||||||
|
v-if="tooltipStore.type"
|
||||||
|
@load="onImageLoad"
|
||||||
|
@error="onImageError"
|
||||||
|
width="300"
|
||||||
|
height="176"
|
||||||
|
:src="`https://stacjownik.spythere.eu/static/images/${vehicleName}--300px.jpg`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="imageState == 'error'">{{ $t('vehicle-preview.error') }}</div>
|
|
||||||
|
|
||||||
<img
|
|
||||||
v-if="tooltipStore.type"
|
|
||||||
@load="onImageLoad"
|
|
||||||
@error="onImageError"
|
|
||||||
width="300"
|
|
||||||
height="176"
|
|
||||||
class="rounded-md w-full h-auto"
|
|
||||||
:src="`https://static.spythere.eu/images/${vehicleName}--300px.jpg`"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div v-if="imageState == 'error'" class="error-placeholder"></div>
|
|
||||||
|
|
||||||
<div class="vehicle-name">
|
<div class="vehicle-name">
|
||||||
{{ vehicleName.replace(/_/g, ' ') }}
|
{{ vehicleName.replace(/_/g, ' ') }}
|
||||||
<span v-if="vehicleCargo">({{ vehicleCargo.id }})</span>
|
<span v-if="vehicleCargo">({{ vehicleCargo.id }})</span>
|
||||||
@@ -98,10 +97,17 @@ export default defineComponent({
|
|||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-box {
|
||||||
|
position: relative;
|
||||||
|
min-height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
.loading-info {
|
.loading-info {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
top: 50%;
|
||||||
|
font-size: 1.15em;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@
|
|||||||
"RP": "wojewódzki pospieszny",
|
"RP": "wojewódzki pospieszny",
|
||||||
"RO": "wojewódzki osobowy",
|
"RO": "wojewódzki osobowy",
|
||||||
"RM": "wojewódzki osobowy międzynarodowy",
|
"RM": "wojewódzki osobowy międzynarodowy",
|
||||||
"RA": "wojewódzki osobowy algomeracyjny",
|
"RA": "wojewódzki osobowy aglomeracyjny",
|
||||||
|
|
||||||
"PW": "pasażerski próżny - służbowy",
|
"PW": "pasażerski próżny - służbowy",
|
||||||
"PX": "pasażerski próżny próbny",
|
"PX": "pasażerski próżny próbny",
|
||||||
|
|||||||
@@ -59,11 +59,7 @@ export const useApiStore = defineStore('apiStore', {
|
|||||||
if (t >= this.nextDataCheckTime) {
|
if (t >= this.nextDataCheckTime) {
|
||||||
this.fetchDonatorsData();
|
this.fetchDonatorsData();
|
||||||
this.fetchVehiclesInfo();
|
this.fetchVehiclesInfo();
|
||||||
|
this.fetchStationsGeneralInfo();
|
||||||
// Revalidation after staling
|
|
||||||
this.fetchStationsGeneralInfo().then(() => {
|
|
||||||
this.fetchStationsGeneralInfo();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.nextDataCheckTime = t + 3600000;
|
this.nextDataCheckTime = t + 3600000;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,16 +216,20 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
return acc;
|
return acc;
|
||||||
}, [] as ActiveScenery[]);
|
}, [] as ActiveScenery[]);
|
||||||
|
|
||||||
|
|
||||||
|
const referenceTimestamp = Date.now();
|
||||||
|
|
||||||
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
||||||
if (scenery.isOnline !== 1 && Date.now() - scenery.lastSeen > 1000 * 60 * 2) return list;
|
if (scenery.isOnline !== 1 && Date.now() - scenery.lastSeen > 1000 * 60 * 2) return list;
|
||||||
if (scenery.dispatcherStatus == Status.ActiveDispatcher.UNKNOWN) return list;
|
if (scenery.dispatcherStatus == Status.ActiveDispatcher.UNKNOWN) return list;
|
||||||
|
|
||||||
const dispatcherTimestamp =
|
const dispatcherTimestamp =
|
||||||
scenery.dispatcherStatus == Status.ActiveDispatcher.NO_LIMIT
|
scenery.dispatcherStatus == Status.ActiveDispatcher.NO_LIMIT
|
||||||
? Date.now() + 25500000
|
? referenceTimestamp + 25500000
|
||||||
: scenery.dispatcherStatus > 5
|
: scenery.dispatcherStatus > 5
|
||||||
? scenery.dispatcherStatus
|
? scenery.dispatcherStatus
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
|
||||||
list.push({
|
list.push({
|
||||||
name: scenery.stationName,
|
name: scenery.stationName,
|
||||||
|
|||||||
Reference in New Issue
Block a user