mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 130732921b | |||
| 1b2cd34e86 | |||
| 17bda9e6e7 | |||
| c66ff8feed | |||
| 027cdee25a | |||
| 435cfb3b3f |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stacjownik",
|
"name": "stacjownik",
|
||||||
"version": "1.28.6",
|
"version": "1.28.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="text--grayed" v-if="timetable.currentSceneryName">
|
<span class="entry-location" v-if="timetable.currentSceneryName">
|
||||||
<b>
|
<b>
|
||||||
{{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }}
|
{{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }}
|
||||||
{{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }}
|
{{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }}
|
||||||
@@ -71,4 +71,9 @@ export default defineComponent({
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.entry-location {
|
||||||
|
text-align: center;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,7 +20,24 @@
|
|||||||
>
|
>
|
||||||
<router-link :to="train.driverRouteLocation" class="a-block">
|
<router-link :to="train.driverRouteLocation" class="a-block">
|
||||||
<span class="user_train"> {{ train.trainNo }}</span>
|
<span class="user_train"> {{ train.trainNo }}</span>
|
||||||
<span class="user_name">{{ train.driverName }}</span>
|
<span class="user_name">
|
||||||
|
{{ train.driverName }}
|
||||||
|
<i
|
||||||
|
v-if="train.timetableData != undefined && train.lastSeen <= Date.now() - 120000"
|
||||||
|
class="fa-solid fa-user-slash"
|
||||||
|
style="color: lightcoral"
|
||||||
|
data-tooltip-type="BaseTooltip"
|
||||||
|
:data-tooltip-content="$t('app.tooltip-driver-offline')"
|
||||||
|
></i>
|
||||||
|
|
||||||
|
<i
|
||||||
|
v-if="train.currentStationName.indexOf('.sc') != -1"
|
||||||
|
class="fa-solid fa-ban"
|
||||||
|
style="color: lightcoral"
|
||||||
|
data-tooltip-type="BaseTooltip"
|
||||||
|
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
||||||
|
></i>
|
||||||
|
</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
@@ -66,8 +83,13 @@ export default defineComponent({
|
|||||||
this.station?.generalInfo?.checkpoints.includes(stop.stopNameRAW)
|
this.station?.generalInfo?.checkpoints.includes(stop.stopNameRAW)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const sceneryName =
|
||||||
|
train.currentStationName.indexOf('.sc') != -1
|
||||||
|
? train.currentStationName.split(' ').slice(0, -1).join(' ')
|
||||||
|
: train.currentStationName;
|
||||||
|
|
||||||
const status = stop
|
const status = stop
|
||||||
? getTrainStopStatus(stop, train.currentStationName, this.onlineScenery!.name)
|
? getTrainStopStatus(stop, sceneryName, this.onlineScenery!.name)
|
||||||
: 'no-timetable';
|
: 'no-timetable';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -4,7 +4,16 @@
|
|||||||
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
||||||
>
|
>
|
||||||
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
|
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
|
||||||
<b class="stop-name">{{ stop.nameRaw }}</b>
|
<b class="stop-name"
|
||||||
|
><i
|
||||||
|
v-if="!stop.isSceneryOnline"
|
||||||
|
class="fa-solid fa-ban"
|
||||||
|
data-tooltip-type="BaseTooltip"
|
||||||
|
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
||||||
|
style="margin-right: 0.25rem; color: salmon"
|
||||||
|
></i>
|
||||||
|
{{ stop.nameRaw }}
|
||||||
|
</b>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<span v-else class="stop-name">{{ stop.nameRaw }}</span>
|
<span v-else class="stop-name">{{ stop.nameRaw }}</span>
|
||||||
@@ -118,10 +127,6 @@ s {
|
|||||||
&.misc {
|
&.misc {
|
||||||
background: gray;
|
background: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<div class="status-badges">
|
<div class="status-badges">
|
||||||
<div v-if="!train.currentStationHash" class="train-badge offline">
|
<div v-if="!train.currentStationHash" class="train-badge offline">
|
||||||
<i class="fa-solid fa-shop-slash"></i>
|
<i class="fa-solid fa-ban"></i>
|
||||||
{{ $t('trains.scenery-offline') }}
|
{{ $t('trains.scenery-offline') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ import StopLabel from './StopLabel.vue';
|
|||||||
import StockList from '../Global/StockList.vue';
|
import StockList from '../Global/StockList.vue';
|
||||||
import { useMainStore } from '../../store/mainStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
import { useApiStore } from '../../store/apiStore';
|
import { useApiStore } from '../../store/apiStore';
|
||||||
import { StationRoutesInfo, Train } from '../../typings/common';
|
import { Train } from '../../typings/common';
|
||||||
import { TrainScheduleStop } from './typings';
|
import { TrainScheduleStop } from './typings';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -173,6 +173,10 @@ export default defineComponent({
|
|||||||
const sceneryName = timetablePath[currentPathIndex].stationName;
|
const sceneryName = timetablePath[currentPathIndex].stationName;
|
||||||
const sceneryInfo = this.apiStore.sceneryData.find((st) => st.name == sceneryName);
|
const sceneryInfo = this.apiStore.sceneryData.find((st) => st.name == sceneryName);
|
||||||
|
|
||||||
|
const isSceneryOnline =
|
||||||
|
(this.apiStore.activeData?.activeSceneries?.find((sc) => sc.stationName == sceneryName)
|
||||||
|
?.isOnline ?? 0) == 1;
|
||||||
|
|
||||||
const arrivalLineInfo = sceneryInfo?.routesInfo.find(
|
const arrivalLineInfo = sceneryInfo?.routesInfo.find(
|
||||||
(r) => r.routeName == stop.arrivalLine
|
(r) => r.routeName == stop.arrivalLine
|
||||||
);
|
);
|
||||||
@@ -214,8 +218,10 @@ export default defineComponent({
|
|||||||
isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere,
|
isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere,
|
||||||
isSBL: /sbl/gi.test(stop.stopName),
|
isSBL: /sbl/gi.test(stop.stopName),
|
||||||
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
||||||
|
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed',
|
||||||
|
|
||||||
sceneryName,
|
sceneryName,
|
||||||
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed'
|
isSceneryOnline
|
||||||
};
|
};
|
||||||
}) ?? []
|
}) ?? []
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ export interface TrainScheduleStop {
|
|||||||
isSBL: boolean;
|
isSBL: boolean;
|
||||||
|
|
||||||
sceneryName: string | null;
|
sceneryName: string | null;
|
||||||
|
isSceneryOnline: boolean;
|
||||||
|
|
||||||
distance: number;
|
distance: number;
|
||||||
|
|
||||||
arrivalLine: string | null;
|
arrivalLine: string | null;
|
||||||
|
|||||||
+3
-1
@@ -48,7 +48,9 @@
|
|||||||
"no-result": "No results for current search!",
|
"no-result": "No results for current search!",
|
||||||
"migration-warning": "Stacjownik services will be unavailable 2/06/2022 between 1-3am (CEST time) due to the migration of API hostings!",
|
"migration-warning": "Stacjownik services will be unavailable 2/06/2022 between 1-3am (CEST time) due to the migration of API hostings!",
|
||||||
"migration-confirm": "Roger that!",
|
"migration-confirm": "Roger that!",
|
||||||
"offline": "App is in the offline mode!"
|
"offline": "App is in the offline mode!",
|
||||||
|
"tooltip-driver-offline": "Driver is offline",
|
||||||
|
"tooltip-scenery-offline": "Scenery is offline"
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"discord": "Stacjownik Discord server"
|
"discord": "Stacjownik Discord server"
|
||||||
|
|||||||
+4
-2
@@ -21,7 +21,7 @@
|
|||||||
"driver-message": "Maszynista wspierający projekt Stacjownika!"
|
"driver-message": "Maszynista wspierający projekt Stacjownika!"
|
||||||
},
|
},
|
||||||
"warnings": {
|
"warnings": {
|
||||||
"TWR": "Pociąg z towarami niebezpiecznie wysokiego ryzyka",
|
"TWR": "Pociąg z towarami niebezpiecznymi wysokiego ryzyka",
|
||||||
"SKR": "Pociąg z przekroczoną skrajnią",
|
"SKR": "Pociąg z przekroczoną skrajnią",
|
||||||
"PN": "Pociąg z przesyłkami nadzwyczajnymi",
|
"PN": "Pociąg z przesyłkami nadzwyczajnymi",
|
||||||
"TN": "Pociąg z towarami niebezpiecznymi",
|
"TN": "Pociąg z towarami niebezpiecznymi",
|
||||||
@@ -45,7 +45,9 @@
|
|||||||
"loading": "Pobieranie danych...",
|
"loading": "Pobieranie danych...",
|
||||||
"error": "Wystąpił problem z załadowaniem danych!",
|
"error": "Wystąpił problem z załadowaniem danych!",
|
||||||
"no-result": "Brak wyników o podanych kryteriach!",
|
"no-result": "Brak wyników o podanych kryteriach!",
|
||||||
"offline": "Aplikacja w trybie offline!"
|
"offline": "Aplikacja w trybie offline!",
|
||||||
|
"tooltip-driver-offline": "Maszynista offline",
|
||||||
|
"tooltip-scenery-offline": "Sceneria offline"
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"discord": "Serwer Discord Stacjownika"
|
"discord": "Serwer Discord Stacjownika"
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
sceneriesTrains.clear();
|
sceneriesTrains.clear();
|
||||||
|
|
||||||
return (apiStore.activeData?.trains ?? [])
|
return (apiStore.activeData?.trains ?? [])
|
||||||
.filter((train) => train.timetable || train.online)
|
.filter((train) => train.timetable || train.lastSeen >= Date.now() - 60000)
|
||||||
.map((train) => {
|
.map((train) => {
|
||||||
const stock = train.stockString.split(';');
|
const stock = train.stockString.split(';');
|
||||||
const locoType = stock ? stock[0] : train.stockString;
|
const locoType = stock ? stock[0] : train.stockString;
|
||||||
@@ -112,13 +112,15 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
: undefined
|
: undefined
|
||||||
} as Train;
|
} as Train;
|
||||||
|
|
||||||
|
const stationNameKey = train.currentStationName.indexOf('.sc') != -1 ? train.currentStationName.split(' ').slice(0, -1).join(' ') : train.currentStationName;
|
||||||
|
|
||||||
// Sceneries trains map
|
// Sceneries trains map
|
||||||
if (sceneriesTrains.has(train.currentStationName)) {
|
if (sceneriesTrains.has(stationNameKey)) {
|
||||||
sceneriesTrains.set(train.currentStationName, [
|
sceneriesTrains.set(stationNameKey, [
|
||||||
...sceneriesTrains.get(train.currentStationName)!,
|
...sceneriesTrains.get(stationNameKey)!,
|
||||||
trainObj
|
trainObj
|
||||||
]);
|
]);
|
||||||
} else sceneriesTrains.set(train.currentStationName, [trainObj]);
|
} else sceneriesTrains.set(stationNameKey, [trainObj]);
|
||||||
|
|
||||||
// Checkpoints trains map
|
// Checkpoints trains map
|
||||||
if (trainObj.timetableData) {
|
if (trainObj.timetableData) {
|
||||||
@@ -216,7 +218,6 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
return acc;
|
return acc;
|
||||||
}, [] as ActiveScenery[]);
|
}, [] as ActiveScenery[]);
|
||||||
|
|
||||||
|
|
||||||
const referenceTimestamp = Date.now();
|
const referenceTimestamp = Date.now();
|
||||||
|
|
||||||
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
||||||
@@ -230,7 +231,6 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
? scenery.dispatcherStatus
|
? scenery.dispatcherStatus
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
|
||||||
list.push({
|
list.push({
|
||||||
name: scenery.stationName,
|
name: scenery.stationName,
|
||||||
hash: scenery.stationHash,
|
hash: scenery.stationHash,
|
||||||
|
|||||||
Reference in New Issue
Block a user