mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Poprawki do synchronizowania pociągów
This commit is contained in:
@@ -175,22 +175,27 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="general-confirmed">
|
<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
|
<span
|
||||||
style="color: gold"
|
style="color: gold"
|
||||||
v-else-if="timetable.currentStationName == stationInfo.stationName"
|
v-else-if="timetable.currentStationName == stationInfo.stationName && !timetable.stopped"
|
||||||
>Na stacji</span>
|
>Na stacji</span>
|
||||||
|
|
||||||
<span style="color: #FF4646" v-else-if="timetable.stopped">Postój</span>
|
|
||||||
<span
|
<span
|
||||||
style="color: #aaa"
|
style="color: #aaa"
|
||||||
v-else-if="!timetable.confirmed && timetable.currentStationName != stationInfo.stationName"
|
v-else-if="!timetable.confirmed && timetable.currentStationName != stationInfo.stationName"
|
||||||
>W drodze</span>
|
>W drodze</span>
|
||||||
|
|
||||||
<span
|
<span style="color: #FF4646" v-else-if="timetable.stopped">Postój</span>
|
||||||
style="color: red"
|
|
||||||
v-else-if="(timetable.terminatesHere && timetable.confimed)"
|
|
||||||
>Skończył bieg</span>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -97,7 +97,7 @@ export default class Store extends VuexModule {
|
|||||||
this.context.commit('setJSONData');
|
this.context.commit('setJSONData');
|
||||||
|
|
||||||
this.context.dispatch('fetchOnlineData');
|
this.context.dispatch('fetchOnlineData');
|
||||||
setInterval(() => this.context.dispatch('fetchOnlineData'), 5000);
|
setInterval(() => this.context.dispatch('fetchOnlineData'), 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Action({ commit: 'updateTimetableData' })
|
@Action({ commit: 'updateTimetableData' })
|
||||||
@@ -286,11 +286,13 @@ export default class Store extends VuexModule {
|
|||||||
return acc;
|
return acc;
|
||||||
}, [] as Station[]);
|
}, [] as Station[]);
|
||||||
|
|
||||||
|
console.log(this.stationList);
|
||||||
|
|
||||||
// Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy
|
// Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy
|
||||||
updatedStationList.forEach(updatedStation => {
|
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({
|
this.stationList.push({
|
||||||
...updatedStation,
|
...updatedStation,
|
||||||
online: true,
|
online: true,
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export default class StationsView extends Vue {
|
|||||||
|
|
||||||
if (this.filters["SPK"] && (station.controlType === "SPK" || station.controlType.includes("+SPK")))
|
if (this.filters["SPK"] && (station.controlType === "SPK" || station.controlType.includes("+SPK")))
|
||||||
return false;
|
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;
|
return false;
|
||||||
|
|
||||||
if (this.filters["SCS"] && this.filters["SPK"] && (station.controlType.includes("SPK") || station.controlType.includes("SCS")))
|
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")
|
station.controlType.includes("mechaniczne")
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (this.filters["ręczne"] && station.controlType.includes("ręczne"))
|
if (this.filters["ręczne"] && station.controlType.includes("ręczne"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user