Dodano ostrzeżenie dla dystansów RJ większych niż 200km

This commit is contained in:
2021-06-12 20:59:48 +02:00
parent 3a104556f7
commit fed467cb72
3 changed files with 23 additions and 3 deletions
+19 -1
View File
@@ -1,5 +1,9 @@
<template> <template>
<div class="train-table"> <div class="train-table">
<div class="traffic-warning" v-if="distanceLimitExceeded">
{{ $t("trains.distance-exceeded") }}
</div>
<div class="no-trains" v-if="computedTrains.length == 0 && timetableLoaded"> <div class="no-trains" v-if="computedTrains.length == 0 && timetableLoaded">
{{ $t("trains.no-trains") }} {{ $t("trains.no-trains") }}
</div> </div>
@@ -303,6 +307,15 @@ export default class TrainTable extends Vue {
return this.timetableDataStatus == DataStatus.Error; return this.timetableDataStatus == DataStatus.Error;
} }
get distanceLimitExceeded() {
return (
this.computedTrains.findIndex(
(train) =>
train.timetableData && train.timetableData.routeDistance > 200
) != -1
);
}
changeScheduleShowState(elementId: number) { changeScheduleShowState(elementId: number) {
if (elementId < 0) return; if (elementId < 0) return;
@@ -383,6 +396,12 @@ img.train-image {
width: 12em; width: 12em;
} }
.traffic-warning {
padding: 1em 0.5em;
margin-bottom: 0.5em;
background: firebrick;
}
.train { .train {
&-list { &-list {
@include smallScreen() { @include smallScreen() {
@@ -395,7 +414,6 @@ img.train-image {
margin-bottom: 1em; margin-bottom: 1em;
background-color: var(--clr-secondary); background-color: var(--clr-secondary);
cursor: pointer; cursor: pointer;
} }
+2 -1
View File
@@ -105,7 +105,8 @@
"search-driver": "Search for driver...", "search-driver": "Search for driver...",
"detailed-timetable": "Detailed timetable for train no. ", "detailed-timetable": "Detailed timetable for train no. ",
"via-title": "Via: ", "via-title": "Via: ",
"no-timetable": "no current timetable" "no-timetable": "no current timetable",
"distance-exceeded": "Attention! Due to an internal error, timetables with route distance greater than 200km might be incorrect!"
}, },
"journal": { "journal": {
"title": "SCENERY ACTIVITY JOURNAL", "title": "SCENERY ACTIVITY JOURNAL",
+2 -1
View File
@@ -105,7 +105,8 @@
"search-driver": "Szukaj maszynisty...", "search-driver": "Szukaj maszynisty...",
"detailed-timetable": "Szczegółowy rozkład jazdy pociągu ", "detailed-timetable": "Szczegółowy rozkład jazdy pociągu ",
"via-title": "Przez: ", "via-title": "Przez: ",
"no-timetable": "brak rozkładu jazdy" "no-timetable": "brak rozkładu jazdy",
"distance-exceeded": "Uwaga! Z powodu wewnętrznego błędu serwera TD2, rozkłady jazdy o kilometrażu powyżej 200km mogą być niepoprawne!"
}, },
"journal": { "journal": {
"title": "DZIENNIK AKTYWNOŚCI SCENERII", "title": "DZIENNIK AKTYWNOŚCI SCENERII",