mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 05:48:11 +00:00
Dodano dynamiczne odświeżanie tabeli
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"hosting": {
|
"hosting": {
|
||||||
"public": "public",
|
"public": "dist",
|
||||||
|
"site": "stacjownik-td2",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"firebase.json",
|
"firebase.json",
|
||||||
"**/.*",
|
"**/.*",
|
||||||
|
|||||||
+12
-7
@@ -41,7 +41,15 @@ export default Vue.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(["fetchStations"])
|
...mapActions(["fetchStations"]),
|
||||||
|
getStationList() {
|
||||||
|
this.fetchStations()
|
||||||
|
.then(() => (this.connectionState = 2))
|
||||||
|
.catch(err => {
|
||||||
|
this.connectionState = 1;
|
||||||
|
this.errorMessage = err.message;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
errorMessage: "",
|
errorMessage: "",
|
||||||
@@ -49,12 +57,9 @@ export default Vue.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchStations()
|
this.getStationList();
|
||||||
.then(() => (this.connectionState = 2))
|
|
||||||
.catch(err => {
|
setInterval(this.getStationList, 5000);
|
||||||
this.connectionState = 1;
|
|
||||||
this.errorMessage = err.message;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -122,8 +122,6 @@ export default Vue.extend({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
focusedStationInfo() {
|
focusedStationInfo() {
|
||||||
console.log(this.focusedStationName);
|
|
||||||
|
|
||||||
return this.stations.find(
|
return this.stations.find(
|
||||||
(station: any) => station.stationName === this.focusedStationName
|
(station: any) => station.stationName === this.focusedStationName
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user