mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +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 { useStore } from '@/store';
|
||||||
import { GETTERS } from '@/constants/storeConstants';
|
import { GETTERS } from '@/constants/storeConstants';
|
||||||
import Station from '@/scripts/interfaces/Station';
|
import Station from '@/scripts/interfaces/Station';
|
||||||
|
import Train from '@/scripts/interfaces/Train';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ const i18n = createI18n({
|
|||||||
|
|
||||||
const clickOutsideDirective: Directive = {
|
const clickOutsideDirective: Directive = {
|
||||||
beforeMount(el, binding) {
|
beforeMount(el, binding) {
|
||||||
|
|
||||||
el.clickOutsideEvent = (event: Event) => {
|
el.clickOutsideEvent = (event: Event) => {
|
||||||
if (!(el == event.target || el.contains(event.target))) {
|
if (!(el == event.target || el.contains(event.target))) {
|
||||||
binding.value();
|
binding.value();
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ export const URLs = {
|
|||||||
stations: "https://api.td2.info.pl:9640/?method=getStationsOnline",
|
stations: "https://api.td2.info.pl:9640/?method=getStationsOnline",
|
||||||
trains: "https://api.td2.info.pl:9640/?method=getTrainsOnline",
|
trains: "https://api.td2.info.pl:9640/?method=getTrainsOnline",
|
||||||
dispatchers: "https://api.td2.info.pl:9640/?method=readFromSWDR&value=getDispatcherStatusList%3B1",
|
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 }) {
|
async fetchTimetableData({ commit }) {
|
||||||
const reducedList = this.state.trainList.reduce(async (acc: Promise<Timetable[]>, train: Train) => {
|
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;
|
const trainInfo = timetable.trainInfo;
|
||||||
|
|
||||||
if (!timetable || !trainInfo) return acc;
|
if (!timetable || !trainInfo) return acc;
|
||||||
|
|||||||
Reference in New Issue
Block a user