mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Naprawiono błąd z brakiem RJ dla innych serwerów niż PL1
This commit is contained in:
@@ -206,6 +206,7 @@ import { computed, ComputedRef, defineComponent } from '@vue/runtime-core';
|
||||
import { useStore } from '@/store';
|
||||
import { GETTERS } from '@/constants/storeConstants';
|
||||
import Station from '@/scripts/interfaces/Station';
|
||||
import Train from '@/scripts/interfaces/Train';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ const i18n = createI18n({
|
||||
|
||||
const clickOutsideDirective: Directive = {
|
||||
beforeMount(el, binding) {
|
||||
|
||||
|
||||
el.clickOutsideEvent = (event: Event) => {
|
||||
if (!(el == event.target || el.contains(event.target))) {
|
||||
binding.value();
|
||||
|
||||
@@ -3,5 +3,5 @@ export const URLs = {
|
||||
stations: "https://api.td2.info.pl:9640/?method=getStationsOnline",
|
||||
trains: "https://api.td2.info.pl:9640/?method=getTrainsOnline",
|
||||
dispatchers: "https://api.td2.info.pl:9640/?method=readFromSWDR&value=getDispatcherStatusList%3B1",
|
||||
getTimetableURL: (trainNo: string | number) => `https://api.td2.info.pl:9640/?method=readFromSWDR&value=getTimetable%3B${trainNo}%3Beu`
|
||||
getTimetableURL: (trainNo: string | number, region = "eu") => `https://api.td2.info.pl:9640/?method=readFromSWDR&value=getTimetable%3B${trainNo}%3B${region}`
|
||||
};
|
||||
+1
-1
@@ -179,7 +179,7 @@ export const store = createStore<State>({
|
||||
|
||||
async fetchTimetableData({ commit }) {
|
||||
const reducedList = this.state.trainList.reduce(async (acc: Promise<Timetable[]>, train: Train) => {
|
||||
const timetable: TimetableAPIData = await (await axios.get(URLs.getTimetableURL(train.trainNo))).data.message;
|
||||
const timetable: TimetableAPIData = await (await axios.get(URLs.getTimetableURL(train.trainNo, this.state.region.id))).data.message;
|
||||
const trainInfo = timetable.trainInfo;
|
||||
|
||||
if (!timetable || !trainInfo) return acc;
|
||||
|
||||
Reference in New Issue
Block a user