diff --git a/src/components/SceneryView/SceneryInfo.vue b/src/components/SceneryView/SceneryInfo.vue index a0138c5..052964b 100644 --- a/src/components/SceneryView/SceneryInfo.vue +++ b/src/components/SceneryView/SceneryInfo.vue @@ -2,125 +2,128 @@
-
- {{ stationInfo.stationProject }} +
+ {{ station.generalInfo.project }}
- {{ - stationInfo.stationName + {{ + station.name }} - {{ stationInfo.stationName }} + {{ station.name }}
-
#{{ stationInfo.stationHash }}
+
#{{ station.onlineInfo.hash }}
-
+
icon-user - {{ stationInfo.currentUsers }} + {{ station.onlineInfo?.currentUsers || '0' }} / - {{ stationInfo.maxUsers }} + {{ station.onlineInfo?.maxUsers || '0' }} icon-spawn - {{ stationInfo.spawns.length }} + {{ station.onlineInfo?.spawns.length || '0' }} icon-timetable - {{ stationInfo.scheduledTrains.length }} + {{ station.onlineInfo?.scheduledTrains?.length || '0' }} / - {{ - stationInfo.scheduledTrains.filter((train) => train.stopInfo.confirmed).length - }} + {{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }} +
two way route blockade - default scenery + default scenery non public scenery icon unavailable real scenery - icon-unknown + icon-unknown
-
+
- {{ stationInfo.dispatcherExp > 1 ? stationInfo.dispatcherExp : 'L' }} + {{ station.onlineInfo.dispatcherExp > 1 ? station.onlineInfo.dispatcherExp : 'L' }} - {{ stationInfo.dispatcherName }} + {{ station.onlineInfo.dispatcherName }}
- - {{ $t(`status.${stationInfo.statusID}`) }} - {{ stationInfo.statusID == 'online' ? stationInfo.statusTimeString : '' }} + + {{ $t(`status.${station.onlineInfo.statusID}`) }} + {{ station.onlineInfo.statusID == 'online' ? station.onlineInfo.statusTimeString : '' }} + + + + {{ $t('status.free') }}
@@ -153,16 +156,18 @@ icon-spawn - - {{ spawn.spawnName }} - {{ spawn.spawnLength }}m + + + {{ spawn.spawnName }} + {{ spawn.spawnLength }}m + - {{ $t('scenery.no-spawns') }}
@@ -178,7 +183,7 @@ import { computed, defineComponent } from '@vue/runtime-core'; export default defineComponent({ props: { - stationInfo: { + station: { type: Object as () => Station, default: {}, }, @@ -206,10 +211,14 @@ export default defineComponent({ setup(props) { const computedStationTrains = computed(() => { - if (!props.stationInfo) return []; + if (!props.station) return []; + if (!props.station.onlineInfo) return []; + if (!props.station.onlineInfo.stationTrains) return []; - return props.stationInfo.stationTrains.map((train) => { - const scheduledTrainStatus = props.stationInfo?.scheduledTrains.find((st) => st.trainNo === train.trainNo); + return props.station.onlineInfo.stationTrains.map((train) => { + const scheduledTrainStatus = props.station.onlineInfo?.scheduledTrains?.find( + (st) => st.trainNo === train.trainNo + ); return { ...train, diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index c1a74aa..fac94de 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -19,16 +19,15 @@
- + @@ -60,7 +60,7 @@ export default defineComponent({ const stationInfo = computed(() => data.value.stationList.find( (station) => - station.stationName === + station.name === route.query.station?.toString().replace(/_/g, " ") ) ); diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index 6295a83..be76659 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -103,7 +103,7 @@ export default defineComponent({ }); const focusedStationInfo = computed(() => - computedStations.value.find((station) => station.stationName === focusedStationName) + computedStations.value.find((station) => station.name === focusedStationName) ); return {