mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcb8357489 | |||
| ceffd8e675 | |||
| 5aa53521f7 | |||
| d8b559694b | |||
| c82ac04a91 | |||
| 284bdcbf2a | |||
| 7f4df98349 |
Generated
-3796
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stacjownik",
|
"name": "stacjownik",
|
||||||
"version": "1.10.6",
|
"version": "1.10.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.12.1",
|
"core-js": "^3.12.1",
|
||||||
"dotenv": "^8.6.0",
|
"dotenv": "^16.0.3",
|
||||||
"firebase": "^9.8.1",
|
"firebase": "^9.8.1",
|
||||||
"howler": "^2.2.1",
|
"howler": "^2.2.1",
|
||||||
"pinia": "^2.0.14",
|
"pinia": "^2.0.14",
|
||||||
@@ -21,12 +21,12 @@
|
|||||||
"vue-router": "^4.0.0-0"
|
"vue-router": "^4.0.0-0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^17.0.35",
|
"@types/node": "^18.8.3",
|
||||||
"@vitejs/plugin-vue": "^3.0.0",
|
"@vitejs/plugin-vue": "^3.0.0",
|
||||||
"axios": "^0.21.1",
|
"axios": "^1.1.2",
|
||||||
"typescript": "^4.6.4",
|
"typescript": "^4.6.4",
|
||||||
"vite": "^3.0.0",
|
"vite": "^3.0.0",
|
||||||
"vue-tsc": "^0.38.4"
|
"vue-tsc": "^1.0.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"> 1%",
|
"> 1%",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="journal-stats" v-if="store.driverStatsData?._sum.routeDistance != null">
|
<div class="journal-stats" v-if="store.driverStatsData?._sum.routeDistance != null">
|
||||||
<h1>
|
<h1>
|
||||||
STATYSTYKI MASZYNISTY <span class="text--primary">{{ store.driverStatsName.toUpperCase() }}</span>
|
{{ $t('journal.stats-title') }} <span class="text--primary">{{ store.driverStatsName.toUpperCase() }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="info-stats">
|
<div class="info-stats">
|
||||||
|
|||||||
@@ -10,12 +10,6 @@
|
|||||||
<span class="text--grayed">
|
<span class="text--grayed">
|
||||||
{{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }}
|
{{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }}
|
||||||
</span>
|
</span>
|
||||||
<!--
|
|
||||||
<button class="btn--image" v-if="!timetableOnly">
|
|
||||||
<a :href="`${$route.path}?station=${$route.query.station}&timetableOnly=1`">
|
|
||||||
<img :src="getIcon('view')" alt="View image" />
|
|
||||||
</a>
|
|
||||||
</button> -->
|
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="timetable-checkpoints" v-if="station && station.generalInfo?.checkpoints">
|
<div class="timetable-checkpoints" v-if="station && station.generalInfo?.checkpoints">
|
||||||
@@ -35,8 +29,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="timetable-list">
|
<div class="timetable-list">
|
||||||
<!-- <transition name="scenery-timetable-list-anim" mode="out-in"> -->
|
|
||||||
<!-- <div :key="store.dataStatuses.trains + selectedCheckpoint" class="scenery-timetable-list"> -->
|
|
||||||
<div style="padding-bottom: 5em" v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0">
|
<div style="padding-bottom: 5em" v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0">
|
||||||
<Loading />
|
<Loading />
|
||||||
</div>
|
</div>
|
||||||
@@ -49,10 +41,11 @@
|
|||||||
{{ $t('scenery.no-timetables') }}
|
{{ $t('scenery.no-timetables') }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<transition-group name="timetables-anim">
|
||||||
<div
|
<div
|
||||||
class="timetable-item"
|
class="timetable-item"
|
||||||
v-for="(scheduledTrain, i) in computedScheduledTrains"
|
v-for="(scheduledTrain, i) in computedScheduledTrains"
|
||||||
:key="i + 1"
|
:key="scheduledTrain.trainId"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@click.prevent.stop="selectModalTrain(scheduledTrain.trainId)"
|
@click.prevent.stop="selectModalTrain(scheduledTrain.trainId)"
|
||||||
@keydown.enter.prevent="selectModalTrain(scheduledTrain.trainId)"
|
@keydown.enter.prevent="selectModalTrain(scheduledTrain.trainId)"
|
||||||
@@ -69,23 +62,15 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
|
||||||
<span style="color: white">
|
<span>
|
||||||
{{ scheduledTrain.driverName }}
|
{{ scheduledTrain.driverName }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
<span class="general-status">
|
|
||||||
<span :class="scheduledTrain.stopStatus">
|
|
||||||
{{ $t(`timetables.${scheduledTrain.stopStatus}`) }}
|
|
||||||
<span v-if="scheduledTrain.stopStatus == 'arriving'"> {{ scheduledTrain.prevStationName }}</span>
|
|
||||||
<span v-if="scheduledTrain.stopStatus.startsWith('departed')">{{
|
|
||||||
scheduledTrain.nextStationName
|
|
||||||
}}</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="info-route">
|
<div class="info-route">
|
||||||
<strong>{{ scheduledTrain.beginsAt }} - {{ scheduledTrain.terminatesAt }}</strong>
|
<strong>{{ scheduledTrain.beginsAt }} - {{ scheduledTrain.terminatesAt }}</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ScheduledTrainStatus :scheduledTrain="scheduledTrain" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -108,7 +93,8 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
{{ timestampToString(scheduledTrain.stopInfo.arrivalRealTimestamp) }}
|
{{ timestampToString(scheduledTrain.stopInfo.arrivalRealTimestamp) }}
|
||||||
({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : '' }}{{ scheduledTrain.stopInfo.arrivalDelay }})
|
({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : ''
|
||||||
|
}}{{ scheduledTrain.stopInfo.arrivalDelay }})
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
@@ -127,11 +113,15 @@
|
|||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
|
|
||||||
<span class="stop-line">
|
<span class="stop-line">
|
||||||
|
<span>
|
||||||
{{ scheduledTrain.arrivingLine }}
|
{{ scheduledTrain.arrivingLine }}
|
||||||
{{ scheduledTrain.arrivingLine && scheduledTrain.departureLine && '>' }}
|
</span>
|
||||||
|
<span></span>
|
||||||
|
<span>
|
||||||
{{ scheduledTrain.departureLine }}
|
{{ scheduledTrain.departureLine }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<span class="schedule-departure">
|
<span class="schedule-departure">
|
||||||
<span class="departure-time terminates" v-if="scheduledTrain.stopInfo.terminatesHere">
|
<span class="departure-time terminates" v-if="scheduledTrain.stopInfo.terminatesHere">
|
||||||
@@ -159,9 +149,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</transition-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- </transition> -->
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -178,11 +167,13 @@ import Station from '../../scripts/interfaces/Station';
|
|||||||
import { useStore } from '../../store/store';
|
import { useStore } from '../../store/store';
|
||||||
import imageMixin from '../../mixins/imageMixin';
|
import imageMixin from '../../mixins/imageMixin';
|
||||||
import modalTrainMixin from '../../mixins/modalTrainMixin';
|
import modalTrainMixin from '../../mixins/modalTrainMixin';
|
||||||
|
import ScheduledTrainStatus from './ScheduledTrainStatus.vue';
|
||||||
|
import ScheduledTrain from '../../scripts/interfaces/ScheduledTrain';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'SceneryTimetable',
|
name: 'SceneryTimetable',
|
||||||
|
|
||||||
components: { SelectBox, Loading, TrainModal },
|
components: { SelectBox, Loading, TrainModal, ScheduledTrainStatus },
|
||||||
|
|
||||||
mixins: [dateMixin, routerMixin, imageMixin, modalTrainMixin],
|
mixins: [dateMixin, routerMixin, imageMixin, modalTrainMixin],
|
||||||
|
|
||||||
@@ -282,11 +273,21 @@ export default defineComponent({
|
|||||||
@import '../../styles/responsive.scss';
|
@import '../../styles/responsive.scss';
|
||||||
@import '../../styles/variables.scss';
|
@import '../../styles/variables.scss';
|
||||||
|
|
||||||
// .scenery-timetable {
|
.timetables-anim-move,
|
||||||
// height: 85vh;
|
.timetables-anim-enter-active,
|
||||||
// max-height: 900px;
|
.timetables-anim-leave-active {
|
||||||
// min-height: 450px;
|
transition: all 250ms ease;
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
.timetables-anim-enter-from,
|
||||||
|
.timetables-anim-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timetables-anim-leave-active {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
.scenery-timetable {
|
.scenery-timetable {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -320,12 +321,14 @@ export default defineComponent({
|
|||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
margin: 0.5em auto;
|
margin: 0.5em auto;
|
||||||
padding: 0 0.5em;
|
padding: 0.5em;
|
||||||
max-width: 1100px;
|
max-width: 1100px;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
||||||
gap: 0 0.5em;
|
gap: 2em 0.5em;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
background: #353535;
|
background: #353535;
|
||||||
|
|
||||||
@@ -340,9 +343,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-general {
|
&-general {
|
||||||
padding: 0.5rem 0;
|
|
||||||
border-radius: 10px;
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -353,6 +353,10 @@ export default defineComponent({
|
|||||||
&-schedule {
|
&-schedule {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,7 +419,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.info-route {
|
.info-route {
|
||||||
margin-top: 0.5em;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,38 +434,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.general-status {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
span.arriving {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.departed {
|
|
||||||
color: lime;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
&-away {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #5ecc5e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span.stopped {
|
|
||||||
color: #ffa600;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.online {
|
|
||||||
color: gold;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.terminated {
|
|
||||||
color: salmon;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule {
|
.schedule {
|
||||||
&-arrival,
|
&-arrival,
|
||||||
&-stop,
|
&-stop,
|
||||||
@@ -472,23 +443,40 @@ export default defineComponent({
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
margin: 0 0.3rem;
|
margin: 0 0.3rem;
|
||||||
font-size: 1.1em;
|
font-size: 1.15em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-stop {
|
&-stop {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 0.85em;
|
font-size: 0.9em;
|
||||||
|
|
||||||
padding: 0.3em 0;
|
padding: 0.3em 0;
|
||||||
|
|
||||||
.stop-line {
|
.stop-line {
|
||||||
margin-top: 0.25em;
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
span {
|
||||||
|
width: 65px;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
span:first-child {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
span:last-child {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stop-time {
|
.stop-time {
|
||||||
transform: translateY(-0.25em);
|
position: absolute;
|
||||||
|
transform: translateY(-15px);
|
||||||
|
|
||||||
|
color: $accentCol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -513,21 +501,9 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include smallScreen() {
|
@include smallScreen {
|
||||||
.timetable {
|
.timetable-item {
|
||||||
&-item {
|
grid-template-columns: 1fr;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-general {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-schedule {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<div class="general-status">
|
||||||
|
<span :class="scheduledTrain.stopStatus">
|
||||||
|
<span v-if="scheduledTrain.stopStatus == 'arriving'">
|
||||||
|
<span v-if="scheduledTrain.prevDepartureLine">({{ scheduledTrain.prevDepartureLine }})</span>
|
||||||
|
{{ scheduledTrain.prevStationName }}
|
||||||
|
><span v-if="scheduledTrain.nextArrivalLine"> ({{ scheduledTrain.nextArrivalLine }}) </span>
|
||||||
|
{{ scheduledTrain.nextStationName || '---' }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else-if="scheduledTrain.stopStatus == 'departed'">
|
||||||
|
>> <span v-if="scheduledTrain.nextArrivalLine"> ({{ scheduledTrain.nextArrivalLine }}) </span>
|
||||||
|
{{ scheduledTrain.nextStationName }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else-if="scheduledTrain.stopStatus == 'departed-away'">
|
||||||
|
>>>
|
||||||
|
<span v-if="scheduledTrain.nextArrivalLine"> ({{ scheduledTrain.nextArrivalLine }}) </span>
|
||||||
|
{{ scheduledTrain.nextStationName }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else-if="scheduledTrain.stopStatus == 'online'">
|
||||||
|
>
|
||||||
|
<span v-if="scheduledTrain.nextArrivalLine">
|
||||||
|
({{ scheduledTrain.nextArrivalLine }}) {{ scheduledTrain.nextStationName }}
|
||||||
|
</span>
|
||||||
|
<span v-else-if="!scheduledTrain.nextStationName">{{ $t('timetables.end') }}</span>
|
||||||
|
<span v-else>{{ scheduledTrain.nextStationName }}</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else-if="scheduledTrain.stopStatus == 'stopped'">
|
||||||
|
>
|
||||||
|
<span v-if="scheduledTrain.nextArrivalLine"> ({{ scheduledTrain.nextArrivalLine }}) </span>
|
||||||
|
{{ scheduledTrain.nextStationName }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else-if="scheduledTrain.stopStatus == 'terminated'">X {{ $t('timetables.terminated') }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, PropType } from 'vue';
|
||||||
|
import ScheduledTrain from '../../scripts/interfaces/ScheduledTrain';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
scheduledTrain: {
|
||||||
|
type: Object as PropType<ScheduledTrain>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.general-status {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
|
||||||
|
span.arriving {
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.departed {
|
||||||
|
color: lime;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&-away {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #5ecc5e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
span.stopped {
|
||||||
|
color: #ffa600;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.online {
|
||||||
|
color: gold;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.terminated {
|
||||||
|
color: salmon;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+4
-6
@@ -253,6 +253,8 @@
|
|||||||
|
|
||||||
"load-data": "Load further data...",
|
"load-data": "Load further data...",
|
||||||
|
|
||||||
|
"stats-title": "DRIVING STATISTICS OF",
|
||||||
|
|
||||||
"stats-timetables": "TIMETABLES",
|
"stats-timetables": "TIMETABLES",
|
||||||
"stats-longest-timetable": "LONGEST TIMETABLE",
|
"stats-longest-timetable": "LONGEST TIMETABLE",
|
||||||
"stats-avg-timetable": "AVERAGE TIMETABLE LENGTH",
|
"stats-avg-timetable": "AVERAGE TIMETABLE LENGTH",
|
||||||
@@ -299,12 +301,8 @@
|
|||||||
},
|
},
|
||||||
"timetables": {
|
"timetables": {
|
||||||
"timetable-only": "Switch to timetable-only view",
|
"timetable-only": "Switch to timetable-only view",
|
||||||
"online": "At station",
|
"end": "Timetable terminates here",
|
||||||
"departed": "Dispatched to:",
|
"terminated": "Timetable terminated",
|
||||||
"departed-away": "Departed to:",
|
|
||||||
"arriving": "Arriving from:",
|
|
||||||
"stopped": "Stopped",
|
|
||||||
"terminated": "Terminated",
|
|
||||||
"begins": "BEGINS HERE",
|
"begins": "BEGINS HERE",
|
||||||
"terminates": "TERMINATES\nHERE"
|
"terminates": "TERMINATES\nHERE"
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-6
@@ -257,6 +257,8 @@
|
|||||||
|
|
||||||
"load-data": "Pobierz dalszą historię...",
|
"load-data": "Pobierz dalszą historię...",
|
||||||
|
|
||||||
|
"stats-title": "STATYSTYKI MASZYNISTY",
|
||||||
|
|
||||||
"stats-timetables": "ROZKŁADY JAZDY",
|
"stats-timetables": "ROZKŁADY JAZDY",
|
||||||
"stats-longest-timetable": "NAJDŁUŻSZY RJ",
|
"stats-longest-timetable": "NAJDŁUŻSZY RJ",
|
||||||
"stats-avg-timetable": "ŚREDNIA DŁUGOŚĆ RJ",
|
"stats-avg-timetable": "ŚREDNIA DŁUGOŚĆ RJ",
|
||||||
@@ -303,12 +305,8 @@
|
|||||||
},
|
},
|
||||||
"timetables": {
|
"timetables": {
|
||||||
"timetable-only": "Wyodrębnij rozkłady jazdy",
|
"timetable-only": "Wyodrębnij rozkłady jazdy",
|
||||||
"online": "Na stacji",
|
"end": "Koniec rozkładu jazdy",
|
||||||
"departed": "Odprawiony do:",
|
"terminated": "Rozkład jazdy zakończony",
|
||||||
"departed-away": "Odjechał do:",
|
|
||||||
"arriving": "W drodze z:",
|
|
||||||
"stopped": "Postój",
|
|
||||||
"terminated": "Skończył bieg",
|
|
||||||
"begins": "ROZPOCZYNA\nBIEG",
|
"begins": "ROZPOCZYNA\nBIEG",
|
||||||
"terminates": "KOŃCZY BIEG"
|
"terminates": "KOŃCZY BIEG"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ export default interface ScheduledTrain {
|
|||||||
arrivingLine: string | null;
|
arrivingLine: string | null;
|
||||||
departureLine: string | null;
|
departureLine: string | null;
|
||||||
|
|
||||||
|
prevDepartureLine: string | null;
|
||||||
|
nextArrivalLine: string | null;
|
||||||
|
|
||||||
|
signal: string;
|
||||||
|
connectedTrack: string;
|
||||||
|
|
||||||
stopLabel: string;
|
stopLabel: string;
|
||||||
stopStatus: string;
|
stopStatus: string;
|
||||||
stopStatusID: number;
|
stopStatusID: number;
|
||||||
|
|||||||
@@ -117,31 +117,37 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
|
|||||||
let prevStationName = '',
|
let prevStationName = '',
|
||||||
nextStationName = '';
|
nextStationName = '';
|
||||||
|
|
||||||
|
let prevDepartureLine: string | null = null,
|
||||||
|
nextArrivalLine: string | null = null;
|
||||||
|
|
||||||
for (let i = trainStopIndex - 1; i >= 0; i--) {
|
for (let i = trainStopIndex - 1; i >= 0; i--) {
|
||||||
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
||||||
prevStationName = followingStops[i].stopNameRAW;
|
prevStationName = followingStops[i].stopNameRAW.replace(/,.*/g,"");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = trainStopIndex + 1; i < followingStops.length; i++) {
|
for (let i = trainStopIndex + 1; i < followingStops.length; i++) {
|
||||||
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
||||||
nextStationName = followingStops[i].stopNameRAW;
|
nextStationName = followingStops[i].stopNameRAW.replace(/,.*/g,"");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let departureLine: string | null = trainStop.departureLine;
|
let departureLine: string | null = null;
|
||||||
let arrivingLine: string | null = trainStop.arrivalLine;
|
let arrivingLine: string | null = null;
|
||||||
|
|
||||||
for (let i = trainStopIndex; i < followingStops.length; i++) {
|
for (let i = trainStopIndex; i < followingStops.length; i++) {
|
||||||
const currentStop = followingStops[i];
|
const currentStop = followingStops[i];
|
||||||
|
|
||||||
if (currentStop.departureLine == null) break;
|
if (currentStop.departureLine == null) continue;
|
||||||
|
|
||||||
if (!/-|_|it|sbl/gi.test(currentStop.departureLine)) {
|
if (!/-|_|it|sbl/gi.test(currentStop.departureLine)) {
|
||||||
departureLine = currentStop.departureLine;
|
departureLine = currentStop.departureLine;
|
||||||
|
nextArrivalLine = followingStops[i + 1]?.arrivalLine || null;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,10 +155,12 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
|
|||||||
for (let i = trainStopIndex; i >= 0; i--) {
|
for (let i = trainStopIndex; i >= 0; i--) {
|
||||||
const currentStop = followingStops[i];
|
const currentStop = followingStops[i];
|
||||||
|
|
||||||
if (currentStop.arrivalLine == null) break;
|
if (currentStop.arrivalLine == null) continue;
|
||||||
|
|
||||||
if (!/-|_|it|sbl/gi.test(currentStop.arrivalLine)) {
|
if (!/-|_|it|sbl/gi.test(currentStop.arrivalLine)) {
|
||||||
arrivingLine = currentStop.arrivalLine;
|
arrivingLine = currentStop.arrivalLine;
|
||||||
|
prevDepartureLine = followingStops[i - 1]?.departureLine || null;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,6 +169,10 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
|
|||||||
trainNo: train.trainNo,
|
trainNo: train.trainNo,
|
||||||
trainId: train.trainId,
|
trainId: train.trainId,
|
||||||
|
|
||||||
|
signal: train.signal,
|
||||||
|
connectedTrack: train.connectedTrack,
|
||||||
|
|
||||||
|
|
||||||
driverName: train.driverName,
|
driverName: train.driverName,
|
||||||
driverId: train.driverId,
|
driverId: train.driverId,
|
||||||
currentStationName: train.currentStationName,
|
currentStationName: train.currentStationName,
|
||||||
@@ -179,5 +191,8 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
|
|||||||
|
|
||||||
arrivingLine,
|
arrivingLine,
|
||||||
departureLine,
|
departureLine,
|
||||||
|
|
||||||
|
nextArrivalLine,
|
||||||
|
prevDepartureLine,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user