From 4ef90e655d0daa2a258c3182ec1dd2edf00f7f15 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 10 Sep 2020 21:25:10 +0200 Subject: [PATCH] =?UTF-8?q?Restrukturyzacja=20pobierania=20danych,=20zmian?= =?UTF-8?q?y=20w=20wygl=C4=85dzie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 39 +- src/components/App/Clock.vue | 2 +- src/components/StationsView/FilterCard.vue | 4 +- src/components/StationsView/StationCard.vue | 42 ++- src/components/StationsView/StationTable.vue | 2 - src/components/TrainsView/TrainStats.vue | 44 ++- src/components/TrainsView/TrainTable.vue | 17 +- src/data/stations.json | 5 +- src/scripts/interfaces/Station.ts | 12 +- src/scripts/interfaces/Timetable.ts | 16 + src/scripts/interfaces/Train.ts | 50 ++- src/store/index.ts | 11 +- src/store/modules/stationsModule.ts | 54 +-- src/store/modules/trainsModule.ts | 35 +- src/store/store.ts | 361 +++++++++++++++++++ src/views/StationsView.vue | 70 +--- src/views/TrainsView.vue | 14 +- 17 files changed, 553 insertions(+), 225 deletions(-) create mode 100644 src/scripts/interfaces/Timetable.ts create mode 100644 src/store/store.ts diff --git a/src/App.vue b/src/App.vue index 8b72651..f3022e7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,9 +13,9 @@
icon dispatcher - {{onlineInfo.stationCount}} + {{data.stationCount}} - {{onlineInfo.trainCount}} + {{data.trainCount}} icon train
@@ -40,10 +40,10 @@ - -
Pobieranie danych...
+ +
Pobieranie danych...
-
+
Error Brak odpowiedzi ze strony serwera!
@@ -67,20 +67,25 @@ import Clock from "@/components/App/Clock.vue"; export default class App extends Vue { ErrorIcon = require("@/assets/icon-error.svg"); - @Getter("getOnlineInfo") onlineInfo; - @Getter("getConnectionState") connState; + @Action("synchronizeData") synchronizeData; - @Action("initStations") initStations; + @Getter("getAllData") data; - @Action("fetchOnlineStations") fetchStations; - @Action("fetchTrainsData") fetchTrainsData; + // @Getter("getOnlineInfo") onlineInfo; + // @Getter("getConnectionState") connState; - async mounted() { - this.initStations(); - this.fetchTrainsData(); + // @Action("initStations") initStations; - setInterval(this.fetchStations, 15000); - setInterval(this.fetchTrainsData, 10000); + // @Action("fetchOnlineStations") fetchStations; + // @Action("fetchTrainsData") fetchTrainsData; + + mounted() { + this.synchronizeData(); + // this.initStations(); + // this.fetchTrainsData(); + + // setInterval(this.fetchStations, 15000); + // setInterval(this.fetchTrainsData, 45000); } } @@ -161,10 +166,10 @@ export default class App extends Vue { background: $bgCol; color: white; - font-size: calc(1rem + 2.1vw); + font-size: calc(1.1rem + 2.1vw); @include smallScreen() { - font-size: 2rem; + font-size: 2.5rem; } } diff --git a/src/components/App/Clock.vue b/src/components/App/Clock.vue index 474d4f5..3bf4f57 100644 --- a/src/components/App/Clock.vue +++ b/src/components/App/Clock.vue @@ -34,7 +34,7 @@ export default Vue.extend({ align-items: center; @include smallScreen() { - font-size: 0.65rem; + font-size: 0.95rem; } } \ No newline at end of file diff --git a/src/components/StationsView/FilterCard.vue b/src/components/StationsView/FilterCard.vue index 8420c10..5dfdad1 100644 --- a/src/components/StationsView/FilterCard.vue +++ b/src/components/StationsView/FilterCard.vue @@ -165,8 +165,8 @@ export default class FilterCard extends Vue { box-shadow: 0 0 15px 5px #474747; @include smallScreen() { - width: 85vw; - font-size: calc(0.3em + 1vw); + width: 100%; + font-size: calc(0.7em + 1.1vw); } @include bigScreen { diff --git a/src/components/StationsView/StationCard.vue b/src/components/StationsView/StationCard.vue index 44638c8..60885a0 100644 --- a/src/components/StationsView/StationCard.vue +++ b/src/components/StationsView/StationCard.vue @@ -124,11 +124,12 @@ @@ -174,16 +175,19 @@ + Odprawiony Na stacji + + Postój W drodze + Skończył bieg - Odprawiony @@ -220,6 +224,8 @@