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",
|
||||
"version": "1.28.6",
|
||||
"version": "1.28.7",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
>
|
||||
</span>
|
||||
|
||||
<span class="text--grayed" v-if="timetable.currentSceneryName">
|
||||
<span class="entry-location" v-if="timetable.currentSceneryName">
|
||||
<b>
|
||||
{{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }}
|
||||
{{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }}
|
||||
@@ -71,4 +71,9 @@ export default defineComponent({
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.entry-location {
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -19,8 +19,25 @@
|
||||
:data-status="status"
|
||||
>
|
||||
<router-link :to="train.driverRouteLocation" class="a-block">
|
||||
<span class="user_train">{{ train.trainNo }}</span>
|
||||
<span class="user_name">{{ train.driverName }}</span>
|
||||
<span class="user_train"> {{ train.trainNo }}</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>
|
||||
</li>
|
||||
</transition-group>
|
||||
@@ -66,8 +83,13 @@ export default defineComponent({
|
||||
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
|
||||
? getTrainStopStatus(stop, train.currentStationName, this.onlineScenery!.name)
|
||||
? getTrainStopStatus(stop, sceneryName, this.onlineScenery!.name)
|
||||
: 'no-timetable';
|
||||
|
||||
return {
|
||||
|
||||
@@ -4,7 +4,16 @@
|
||||
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
||||
>
|
||||
<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>
|
||||
|
||||
<span v-else class="stop-name">{{ stop.nameRaw }}</span>
|
||||
@@ -118,10 +127,6 @@ s {
|
||||
&.misc {
|
||||
background: gray;
|
||||
}
|
||||
|
||||
i {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
<div class="status-badges">
|
||||
<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') }}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ import StopLabel from './StopLabel.vue';
|
||||
import StockList from '../Global/StockList.vue';
|
||||
import { useMainStore } from '../../store/mainStore';
|
||||
import { useApiStore } from '../../store/apiStore';
|
||||
import { StationRoutesInfo, Train } from '../../typings/common';
|
||||
import { Train } from '../../typings/common';
|
||||
import { TrainScheduleStop } from './typings';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -173,6 +173,10 @@ export default defineComponent({
|
||||
const sceneryName = timetablePath[currentPathIndex].stationName;
|
||||
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(
|
||||
(r) => r.routeName == stop.arrivalLine
|
||||
);
|
||||
@@ -214,8 +218,10 @@ export default defineComponent({
|
||||
isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere,
|
||||
isSBL: /sbl/gi.test(stop.stopName),
|
||||
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
||||
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed',
|
||||
|
||||
sceneryName,
|
||||
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed'
|
||||
isSceneryOnline
|
||||
};
|
||||
}) ?? []
|
||||
);
|
||||
|
||||
@@ -151,6 +151,8 @@ export interface TrainScheduleStop {
|
||||
isSBL: boolean;
|
||||
|
||||
sceneryName: string | null;
|
||||
isSceneryOnline: boolean;
|
||||
|
||||
distance: number;
|
||||
|
||||
arrivalLine: string | null;
|
||||
|
||||
+3
-1
@@ -48,7 +48,9 @@
|
||||
"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-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": {
|
||||
"discord": "Stacjownik Discord server"
|
||||
|
||||
+4
-2
@@ -21,7 +21,7 @@
|
||||
"driver-message": "Maszynista wspierający projekt Stacjownika!"
|
||||
},
|
||||
"warnings": {
|
||||
"TWR": "Pociąg z towarami niebezpiecznie wysokiego ryzyka",
|
||||
"TWR": "Pociąg z towarami niebezpiecznymi wysokiego ryzyka",
|
||||
"SKR": "Pociąg z przekroczoną skrajnią",
|
||||
"PN": "Pociąg z przesyłkami nadzwyczajnymi",
|
||||
"TN": "Pociąg z towarami niebezpiecznymi",
|
||||
@@ -45,7 +45,9 @@
|
||||
"loading": "Pobieranie danych...",
|
||||
"error": "Wystąpił problem z załadowaniem danych!",
|
||||
"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": {
|
||||
"discord": "Serwer Discord Stacjownika"
|
||||
|
||||
@@ -43,7 +43,7 @@ export const useMainStore = defineStore('mainStore', {
|
||||
sceneriesTrains.clear();
|
||||
|
||||
return (apiStore.activeData?.trains ?? [])
|
||||
.filter((train) => train.timetable || train.online)
|
||||
.filter((train) => train.timetable || train.lastSeen >= Date.now() - 60000)
|
||||
.map((train) => {
|
||||
const stock = train.stockString.split(';');
|
||||
const locoType = stock ? stock[0] : train.stockString;
|
||||
@@ -112,13 +112,15 @@ export const useMainStore = defineStore('mainStore', {
|
||||
: undefined
|
||||
} as Train;
|
||||
|
||||
const stationNameKey = train.currentStationName.indexOf('.sc') != -1 ? train.currentStationName.split(' ').slice(0, -1).join(' ') : train.currentStationName;
|
||||
|
||||
// Sceneries trains map
|
||||
if (sceneriesTrains.has(train.currentStationName)) {
|
||||
sceneriesTrains.set(train.currentStationName, [
|
||||
...sceneriesTrains.get(train.currentStationName)!,
|
||||
if (sceneriesTrains.has(stationNameKey)) {
|
||||
sceneriesTrains.set(stationNameKey, [
|
||||
...sceneriesTrains.get(stationNameKey)!,
|
||||
trainObj
|
||||
]);
|
||||
} else sceneriesTrains.set(train.currentStationName, [trainObj]);
|
||||
} else sceneriesTrains.set(stationNameKey, [trainObj]);
|
||||
|
||||
// Checkpoints trains map
|
||||
if (trainObj.timetableData) {
|
||||
@@ -216,7 +218,6 @@ export const useMainStore = defineStore('mainStore', {
|
||||
return acc;
|
||||
}, [] as ActiveScenery[]);
|
||||
|
||||
|
||||
const referenceTimestamp = Date.now();
|
||||
|
||||
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
||||
@@ -229,7 +230,6 @@ export const useMainStore = defineStore('mainStore', {
|
||||
: scenery.dispatcherStatus > 5
|
||||
? scenery.dispatcherStatus
|
||||
: null;
|
||||
|
||||
|
||||
list.push({
|
||||
name: scenery.stationName,
|
||||
|
||||
Reference in New Issue
Block a user