+
diff --git a/src/components/TimetableViews/JournalStorageView.vue b/src/components/TimetableViews/JournalStorageView.vue
index 4a98da9..3d638ee 100644
--- a/src/components/TimetableViews/JournalStorageView.vue
+++ b/src/components/TimetableViews/JournalStorageView.vue
@@ -66,11 +66,29 @@
diff --git a/src/locales/pl.json b/src/locales/pl.json
index 7d9a6ae..e7e38b3 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -36,7 +36,9 @@
"journal-preview-title": "DZIENNIK ROZKŁADÓW JAZDY",
"journal-empty-info": "Wpisz dane rozkładu korzystając z pola tekstowego powyżej - mogą nimi być:
id (#numer); nickname (nick:Spythere); data (date:11.01.2025); punkt startowy (from:Krnów)
W przypadku wielu rozkładów jazdy wyświetli się maks. 15 najnowszych.",
- "journal-search-placeholder": "nick:Spythere date:02.04.2025 from:Krnów to:Biała_Sudecka",
+ "journal-driver-search-placeholder": "Maszynista / #ID",
+ "journal-date-search-placeholder": "Data",
+ "journal-route-search-placeholder": "Relacja",
"journal-preview-info": "Rozkład historyczny {id} maszynisty {driverName} z dnia {date}",
"journal-no-data": "Brak wyników dla obecnego wyszukiwania! Sprawdź czy wpisałeś poprawnie dane.",
diff --git a/src/stores/api.store.ts b/src/stores/api.store.ts
index a9e79f4..e749e29 100644
--- a/src/stores/api.store.ts
+++ b/src/stores/api.store.ts
@@ -4,16 +4,9 @@ import { defineStore } from 'pinia';
import {
DataStatus,
type ActiveDataResponse,
- type SceneriesDataResponse,
- type JournalTimetablesShortResponse
+ type SceneriesDataResponse
} from '../types/api.types';
-import type {
- ActiveData,
- JournalTimetableDetailed,
- JournalTimetableShort,
- SceneryData
-} from '../types/common.types';
-import { useGlobalStore } from './global.store';
+import type { ActiveData, JournalTimetableShort, SceneryData } from '../types/common.types';
let activeDataInterval = -1;
@@ -58,7 +51,7 @@ export const useApiStore = defineStore('api', {
}
clearInterval(activeDataInterval);
-
+
activeDataInterval = setInterval(() => {
this.fetchActiveData();
}, 25000);
@@ -93,74 +86,6 @@ export const useApiStore = defineStore('api', {
} catch (error) {
console.error(error);
}
- },
-
- async fetchJournalTimetables(searchValue: string) {
- // if (searchValue.trim().length == 0) {
- // this.journalDataStatus = DataStatus.SUCCESS;
- // this.journalTimetablesData = null;
-
- // return;
- // }
-
- let searchObj: Record
= {};
- const searchParams = searchValue.split(' ');
-
- searchParams.forEach((param) => {
- const [key, value] = param.split(':');
-
- if (key == 'nick') searchObj['driverName'] = value;
- else if (key == 'date') {
- let dateFromStr = new Date(value).toISOString();
-
- let dateTo = new Date(dateFromStr);
- dateTo.setDate(dateTo.getDate() + 1);
-
- searchObj['dateFrom'] = dateFromStr;
- searchObj['dateTo'] = dateTo.toISOString();
- } else if (key == 'from') searchObj['issuedFrom'] = value.replace(/_/g, ' ');
- else if (key == 'to') searchObj['terminatingAt'] = value.replace(/_/g, ' ');
- });
-
- searchObj['hasStopsDetails'] = 1;
- searchObj['returnType'] = 'short';
-
- try {
- this.journalDataStatus = DataStatus.LOADING;
-
- const response = (
- await this.client!.get('/api/getTimetables', {
- params: searchObj
- })
- ).data;
-
- this.journalDataStatus = DataStatus.SUCCESS;
- this.journalTimetablesData = response;
- } catch (error) {
- this.journalDataStatus = DataStatus.ERROR;
- this.journalTimetablesData = null;
- console.error(error);
- }
- },
-
- async fetchJournalTimetableDetails(id: number) {
- const globalStore = useGlobalStore();
-
- try {
- const response = (
- await this.client!.get('/api/getTimetables', {
- params: {
- timetableId: id,
- hasStopsDetails: 1
- }
- })
- ).data;
-
- if (response.length > 0) globalStore.selectedJournalTimetable = response[0];
- } catch (error) {
- globalStore.selectedJournalTimetable = null;
- console.error(error);
- }
}
}
});
diff --git a/src/stores/global.store.ts b/src/stores/global.store.ts
index 1a5e6a2..0faa329 100644
--- a/src/stores/global.store.ts
+++ b/src/stores/global.store.ts
@@ -26,7 +26,12 @@ export const useGlobalStore = defineStore('global', {
generatedMs: 0,
localTimetableSearch: '',
- journalTimetableSearch: '',
+
+ journalTimetableSearch: {
+ driverName: '',
+ date: '',
+ route: ''
+ },
showSettings: false
}),
diff --git a/src/types/common.types.ts b/src/types/common.types.ts
index 975a636..fd2cb5c 100644
--- a/src/types/common.types.ts
+++ b/src/types/common.types.ts
@@ -1,10 +1,5 @@
export type ViewMode = 'active' | 'storage' | 'journal';
-export enum StorageMode {
- LOCAL = 'local',
- API = 'api'
-}
-
export interface ActiveData {
trains: ActiveTrain[];
activeSceneries: ActiveScenery[];
@@ -228,7 +223,6 @@ export interface JournalTimetableDetailed extends JournalTimetableShort {
createdAt: string;
updatedAt: string;
stockHistory: string[];
- hidden: boolean;
routeSceneries: string;
checkpointArrivals: any[];
checkpointDepartures: any[];