diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue new file mode 100644 index 0000000..ff41ea0 --- /dev/null +++ b/src/components/JournalView/JournalOptions.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/src/components/StationsView/FilterOption.vue b/src/components/StationsView/FilterOption.vue index f1f633a..fe21e30 100644 --- a/src/components/StationsView/FilterOption.vue +++ b/src/components/StationsView/FilterOption.vue @@ -1,8 +1,7 @@ \ No newline at end of file + diff --git a/src/locales/en.json b/src/locales/en.json index 1fbfe7f..fae189f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -143,7 +143,13 @@ "journal": { "title": "DISPATCHER HISTORY", "loading": "Loading dispatcher history data...", - "no-history": "No dispatcher history found!" + "no-history": "No dispatcher history found!", + + "search-train": "Train no.", + "search-driver": "Driver name", + + "option-distance": "distance", + "option-total-stops": "total stops" }, "scenery": { "users": "PLAYERS ONLINE", diff --git a/src/locales/pl.json b/src/locales/pl.json index aa4a525..2171aef 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -143,7 +143,13 @@ "journal": { "title": "HISTORIA DYŻURÓW", "loading": "Ładowanie historii dyżurów...", - "no-history": "Brak historii dyżurów dla tej scenerii!" + "no-history": "Brak historii dyżurów dla tej scenerii!", + + "search-train": "Numer pociągu", + "search-driver": "Nick maszynisty", + + "option-distance": "kilometraż", + "option-total-stops": "stacje" }, "scenery": { "users": "GRACZE ONLINE", diff --git a/src/router/index.ts b/src/router/index.ts index be38a0f..753668c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,8 +22,8 @@ const routes: Array = [ }, { path: "/journal", - name: "TimetableHistoryView", - component: () => import("@/views/TimetableHistoryView.vue"), + name: "JournalView", + component: () => import("@/views/JournalView.vue"), }, { path: '/:catchAll(.*)', diff --git a/src/scripts/interfaces/FilterOption.ts b/src/scripts/interfaces/FilterOption.ts new file mode 100644 index 0000000..02e8c78 --- /dev/null +++ b/src/scripts/interfaces/FilterOption.ts @@ -0,0 +1,6 @@ +export default interface FilterOption { + id: string; + name: string; + value: boolean; + defaultValue: boolean; +} \ No newline at end of file diff --git a/src/store/index.ts b/src/store/index.ts index 08cc9dc..332f5eb 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -182,7 +182,13 @@ export const store = createStore({ async fetchTimetableData({ commit }) { const reducedList = this.state.trainList.reduce(async (acc: Promise, train: Train) => { - const timetable: TimetableAPIData = await (await axios.get(URLs.getTimetableURL(train.trainNo, this.state.region.id))).data.message; + const data: { success: boolean; message: TimetableAPIData } = await (await axios.get(URLs.getTimetableURL(train.trainNo, this.state.region.id))).data; + + if (!data.success) { + return acc; + } + + const timetable = data.message; const trainInfo = timetable.trainInfo; if (!timetable || !trainInfo) return acc; diff --git a/src/styles/option.scss b/src/styles/option.scss new file mode 100644 index 0000000..0b1edcc --- /dev/null +++ b/src/styles/option.scss @@ -0,0 +1,36 @@ + +.option { + font-size: 1em; + + input { + display: none; + } + + span { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + + width: 100%; + text-align: center; + + cursor: pointer; + + padding: 0.5em 0.55em; + + display: inline-block; + position: relative; + + transition: all 0.2s; + + border-radius: 0.5em; + + &:not(.checked) { + background-color: #585858; + + &::before { + box-shadow: none; + } + } + } +} diff --git a/src/views/TimetableHistoryView.vue b/src/views/JournalView.vue similarity index 75% rename from src/views/TimetableHistoryView.vue rename to src/views/JournalView.vue index 56fe5f5..65af776 100644 --- a/src/views/TimetableHistoryView.vue +++ b/src/views/JournalView.vue @@ -1,25 +1,7 @@