Poprawki do synchronizowania pociągów

This commit is contained in:
2020-09-11 00:56:09 +02:00
parent ead7c1fc54
commit 730c56eaee
3 changed files with 19 additions and 11 deletions
+12 -7
View File
@@ -175,22 +175,27 @@
</span>
<span class="general-confirmed">
<span style="color: lime" v-if="timetable.confirmed">Odprawiony</span>
<span
style="color: red"
v-if="timetable.terminatesHere && timetable.confimed"
>Skończył bieg</span>
<span
style="color: lime"
v-else-if="timetable.confirmed && !timetable.terminatesHere"
>Odprawiony</span>
<span
style="color: gold"
v-else-if="timetable.currentStationName == stationInfo.stationName"
v-else-if="timetable.currentStationName == stationInfo.stationName && !timetable.stopped"
>Na stacji</span>
<span style="color: #FF4646" v-else-if="timetable.stopped">Postój</span>
<span
style="color: #aaa"
v-else-if="!timetable.confirmed && timetable.currentStationName != stationInfo.stationName"
>W drodze</span>
<span
style="color: red"
v-else-if="(timetable.terminatesHere && timetable.confimed)"
>Skończył bieg</span>
<span style="color: #FF4646" v-else-if="timetable.stopped">Postój</span>
</span>
</span>
+5 -3
View File
@@ -97,7 +97,7 @@ export default class Store extends VuexModule {
this.context.commit('setJSONData');
this.context.dispatch('fetchOnlineData');
setInterval(() => this.context.dispatch('fetchOnlineData'), 5000);
setInterval(() => this.context.dispatch('fetchOnlineData'), 20000);
}
@Action({ commit: 'updateTimetableData' })
@@ -286,11 +286,13 @@ export default class Store extends VuexModule {
return acc;
}, [] as Station[]);
console.log(this.stationList);
// Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy
updatedStationList.forEach(updatedStation => {
const alreadyInList: any = this.stationList.find(station => station.stationName === updatedStation.stationName);
const alreadyInList: any = this.stationList.findIndex(station => station.stationName === updatedStation.stationName);
if (!alreadyInList) {
if (alreadyInList < 0) {
this.stationList.push({
...updatedStation,
online: true,
+2 -1
View File
@@ -177,7 +177,7 @@ export default class StationsView extends Vue {
if (this.filters["SPK"] && (station.controlType === "SPK" || station.controlType.includes("+SPK")))
return false;
if (this.filters["SCS"] && station.controlType === "SCS" || station.controlType.includes("+SCS"))
if (this.filters["SCS"] && (station.controlType === "SCS" || station.controlType.includes("+SCS")))
return false;
if (this.filters["SCS"] && this.filters["SPK"] && (station.controlType.includes("SPK") || station.controlType.includes("SCS")))
@@ -188,6 +188,7 @@ export default class StationsView extends Vue {
station.controlType.includes("mechaniczne")
)
return false;
if (this.filters["ręczne"] && station.controlType.includes("ręczne"))
return false;