mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Poprawki do zmiany serwerów TD2, ogólne
This commit is contained in:
+1
-23
@@ -89,14 +89,7 @@
|
|||||||
import Clock from "@/components/App/Clock.vue";
|
import Clock from "@/components/App/Clock.vue";
|
||||||
|
|
||||||
import StorageManager from "@/scripts/managers/storageManager";
|
import StorageManager from "@/scripts/managers/storageManager";
|
||||||
import {
|
import { computed, ComputedRef, defineComponent, provide, ref } from "vue";
|
||||||
computed,
|
|
||||||
ComputedRef,
|
|
||||||
defineComponent,
|
|
||||||
inject,
|
|
||||||
provide,
|
|
||||||
ref,
|
|
||||||
} from "vue";
|
|
||||||
import { GETTERS } from "./constants/storeConstants";
|
import { GETTERS } from "./constants/storeConstants";
|
||||||
import { StoreData } from "./scripts/interfaces/StoreData";
|
import { StoreData } from "./scripts/interfaces/StoreData";
|
||||||
import { useStore } from "./store";
|
import { useStore } from "./store";
|
||||||
@@ -191,21 +184,6 @@ export default defineComponent({
|
|||||||
this.changeLang("en");
|
this.changeLang("en");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (naviLanguage.includes("pl")) {
|
|
||||||
// this.changeLang("pl");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// switch (window.navigator.language) {
|
|
||||||
// case "pl-PL":
|
|
||||||
// this.changeLang("pl");
|
|
||||||
// break;
|
|
||||||
// case "en-EN":
|
|
||||||
// default:
|
|
||||||
// this.changeLang("en");
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,26 +14,28 @@
|
|||||||
<div class="card_title flex">{{ $t("filters.title") }}</div>
|
<div class="card_title flex">{{ $t("filters.title") }}</div>
|
||||||
|
|
||||||
<section class="card_regions">
|
<section class="card_regions">
|
||||||
<span
|
<div class="regions_content">
|
||||||
v-for="region in inputs.regions"
|
<span
|
||||||
:key="region.id"
|
v-for="region in inputs.regions"
|
||||||
:class="`region-${region.id}`"
|
:key="region.id"
|
||||||
>
|
:class="`region-${region.id}`"
|
||||||
<label>
|
>
|
||||||
<input
|
<label>
|
||||||
type="radio"
|
<input
|
||||||
name="region"
|
type="radio"
|
||||||
:id="region.id"
|
name="region"
|
||||||
:value="region"
|
:id="region.id"
|
||||||
v-model="currentRegion"
|
:value="region"
|
||||||
@change="handleChangeRegion"
|
v-model="currentRegion"
|
||||||
/>
|
@change="handleChangeRegion"
|
||||||
|
/>
|
||||||
|
|
||||||
<span :class="{ checked: currentRegion.id === region.id }">
|
<span :class="{ checked: currentRegion.id === region.id }">
|
||||||
{{ region.value }}
|
{{ region.value }}
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="card_options">
|
<section class="card_options">
|
||||||
@@ -97,7 +99,7 @@ import { ACTIONS, GETTERS, MUTATIONS } from "@/constants/storeConstants";
|
|||||||
import inputData from "@/data/options.json";
|
import inputData from "@/data/options.json";
|
||||||
|
|
||||||
import StorageManager from "@/scripts/managers/storageManager";
|
import StorageManager from "@/scripts/managers/storageManager";
|
||||||
import { defineComponent, inject, provide, ref } from "@vue/runtime-core";
|
import { defineComponent, inject } from "@vue/runtime-core";
|
||||||
import ActionButton from "../Global/ActionButton.vue";
|
import ActionButton from "../Global/ActionButton.vue";
|
||||||
import FilterOption from "./FilterOption.vue";
|
import FilterOption from "./FilterOption.vue";
|
||||||
|
|
||||||
@@ -155,6 +157,8 @@ export default defineComponent({
|
|||||||
handleChangeRegion() {
|
handleChangeRegion() {
|
||||||
this.$store.commit(MUTATIONS.SET_REGION, this.currentRegion);
|
this.$store.commit(MUTATIONS.SET_REGION, this.currentRegion);
|
||||||
this.$store.dispatch(ACTIONS.fetchOnlineData);
|
this.$store.dispatch(ACTIONS.fetchOnlineData);
|
||||||
|
|
||||||
|
this.closeCard();
|
||||||
},
|
},
|
||||||
|
|
||||||
invertFilters() {
|
invertFilters() {
|
||||||
|
|||||||
@@ -80,8 +80,8 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="station_status">
|
<td class="station_status">
|
||||||
<span class="status-badge" :class="station.statusID"
|
<span class="status-badge" :class="station.statusID">
|
||||||
>{{ $t(`status.${station.statusID}`) }}
|
{{ $t(`status.${station.statusID}`) }}
|
||||||
{{
|
{{
|
||||||
station.statusID == "online" ? station.statusTimeString : ""
|
station.statusID == "online" ? station.statusTimeString : ""
|
||||||
}}
|
}}
|
||||||
@@ -96,10 +96,9 @@
|
|||||||
<span
|
<span
|
||||||
v-if="station.online"
|
v-if="station.online"
|
||||||
:style="calculateExpStyle(station.dispatcherExp)"
|
:style="calculateExpStyle(station.dispatcherExp)"
|
||||||
>{{
|
|
||||||
2 > station.dispatcherExp ? "L" : station.dispatcherExp
|
|
||||||
}}</span
|
|
||||||
>
|
>
|
||||||
|
{{ 2 > station.dispatcherExp ? "L" : station.dispatcherExp }}
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="station_tracks twoway">
|
<td class="station_tracks twoway">
|
||||||
@@ -198,15 +197,19 @@
|
|||||||
class="station_schedules"
|
class="station_schedules"
|
||||||
:class="{ inactive: !station.online }"
|
:class="{ inactive: !station.online }"
|
||||||
>
|
>
|
||||||
<span class="highlight">
|
<span>
|
||||||
{{ station.scheduledTrains.length }}
|
<span class="highlight">
|
||||||
|
{{ station.scheduledTrains.length }}
|
||||||
|
</span>
|
||||||
|
/
|
||||||
|
<span style="color: #bbb">
|
||||||
|
{{
|
||||||
|
station.scheduledTrains.filter(
|
||||||
|
(train) => train.stopInfo.confirmed
|
||||||
|
).length
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
/
|
|
||||||
<span style="color: #bbb">{{
|
|
||||||
station.scheduledTrains.filter(
|
|
||||||
(train) => train.stopInfo.confirmed
|
|
||||||
).length
|
|
||||||
}}</span>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -217,7 +220,7 @@
|
|||||||
{{ $t("sceneries.no-stations") }}
|
{{ $t("sceneries.no-stations") }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="no-stations" v-if="!isDataLoaded">
|
<div class="no-stations" v-if="!isDataLoaded && stations.length == 0">
|
||||||
{{ $t("app.loading") }}
|
{{ $t("app.loading") }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export const ACTIONS = {
|
|||||||
export const MUTATIONS = {
|
export const MUTATIONS = {
|
||||||
SET_SCENERY_DATA: "SET_SCENERY_DATA",
|
SET_SCENERY_DATA: "SET_SCENERY_DATA",
|
||||||
SET_SCENERY_DATA_STATUS: "SET_SCENERY_DATA_STATUS",
|
SET_SCENERY_DATA_STATUS: "SET_SCENERY_DATA_STATUS",
|
||||||
|
SET_TIMETABLE_DATA_STATUS: "SET_TIMETABLE_DATA_STATUS",
|
||||||
SET_DATA_CONNECTION_STATUS: "SET_DATA_CONNECTION_STATUS",
|
SET_DATA_CONNECTION_STATUS: "SET_DATA_CONNECTION_STATUS",
|
||||||
SET_REGION: "SET_REGION",
|
SET_REGION: "SET_REGION",
|
||||||
UPDATE_STATIONS: "UPDATE_STATIONS",
|
UPDATE_STATIONS: "UPDATE_STATIONS",
|
||||||
|
|||||||
+6
-2
@@ -90,7 +90,7 @@ export const store = createStore<State>({
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fetchOnlineData({ commit, dispatch }) {
|
async fetchOnlineData({ commit, dispatch }) {
|
||||||
// commit(MUTATIONS.SET_DATA_CONNECTION_STATUS, DataStatus.Loading);
|
commit(MUTATIONS.SET_DATA_CONNECTION_STATUS, DataStatus.Loading);
|
||||||
|
|
||||||
Promise.all([axios.get(URLs.stations), axios.get(URLs.trains), axios.get(URLs.dispatchers)])
|
Promise.all([axios.get(URLs.stations), axios.get(URLs.trains), axios.get(URLs.dispatchers)])
|
||||||
.then(async response => {
|
.then(async response => {
|
||||||
@@ -297,6 +297,10 @@ export const store = createStore<State>({
|
|||||||
state.dataConnectionStatus = status;
|
state.dataConnectionStatus = status;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
SET_TIMETABLE_DATA_STATUS(state, status: DataStatus) {
|
||||||
|
state.timetableDataStatus = status;
|
||||||
|
},
|
||||||
|
|
||||||
SET_REGION(state, region: { id: string; value: string }) {
|
SET_REGION(state, region: { id: string; value: string }) {
|
||||||
state.region = region;
|
state.region = region;
|
||||||
},
|
},
|
||||||
@@ -457,7 +461,7 @@ export const store = createStore<State>({
|
|||||||
return acc;
|
return acc;
|
||||||
}, [] as Train[]);
|
}, [] as Train[]);
|
||||||
|
|
||||||
state.timetableDataStatus = DataStatus.Loaded;
|
state.timetableDataStatus = DataStatus.Loaded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user