Dodano listę wszystkich scenerii

This commit is contained in:
2020-07-10 01:13:16 +02:00
parent 5386887076
commit e5235b6907
7 changed files with 510 additions and 432 deletions
+2 -1
View File
@@ -4,7 +4,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build" "build": "vue-cli-service build",
"deploy": "npm run build && firebase deploy --only hosting"
}, },
"dependencies": { "dependencies": {
"core-js": "^3.6.5", "core-js": "^3.6.5",
+30 -40
View File
@@ -1,7 +1,7 @@
<template> <template>
<div class="app"> <div class="app">
<div class="app-container"> <div class="app-container">
<header class="app-header"> <header class="app-header flex flex-column">
<div class="brand-name"> <div class="brand-name">
<span>Stacj</span> <span>Stacj</span>
<img src="@/assets/trainlogo.png" alt="trainlogo" /> <img src="@/assets/trainlogo.png" alt="trainlogo" />
@@ -10,15 +10,13 @@
<span class="online">Scenerie online: {{stationCount}} | Maszyniści online: {{ trainCount }}</span> <span class="online">Scenerie online: {{stationCount}} | Maszyniści online: {{ trainCount }}</span>
</header> </header>
<div class="app-bar" ref="appBar"> <div class="app-bar flex flex-spaced">
<div class="bar-content"> <div class="bar-content">
<div class="bar-left"> <div class="bar-left">
<Options /> <Options />
</div> </div>
<div class="bar-right"> <div class="bar-right"></div>
<!-- <div class="last-update">Ostatnie zmiany</div> -->
</div>
</div> </div>
</div> </div>
@@ -26,10 +24,9 @@
<Loading v-if="connectionState == 0" /> <Loading v-if="connectionState == 0" />
<Error v-else-if="connectionState == 1" :error="errorMessage" /> <Error v-else-if="connectionState == 1" :error="errorMessage" />
<router-view v-else /> <router-view v-else />
<!-- <router-view /> -->
</main> </main>
<footer class="app-footer">&copy; Spythere 2020</footer> <footer class="app-footer flex">&copy; Spythere 2020</footer>
</div> </div>
</div> </div>
</template> </template>
@@ -53,9 +50,9 @@ export default Vue.extend({
}), }),
methods: { methods: {
...mapActions(["fetchStations"]), ...mapActions(["initStations"]),
getStationList() { getStationList() {
this.fetchStations() this.initStations()
.then(() => (this.connectionState = 2)) .then(() => (this.connectionState = 2))
.catch(err => { .catch(err => {
this.connectionState = 1; this.connectionState = 1;
@@ -70,16 +67,6 @@ export default Vue.extend({
mounted() { mounted() {
this.getStationList(); this.getStationList();
setInterval(this.getStationList, 5000);
document.addEventListener("scroll", e => {
const appBarEl = this.$refs.appBar as Element;
if (appBarEl.getBoundingClientRect().top < 0)
appBarEl.classList.add("sticky");
else appBarEl.classList.remove("sticky");
});
} }
}); });
</script> </script>
@@ -125,7 +112,7 @@ input {
box-sizing: border-box; box-sizing: border-box;
} }
button { .button {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -136,11 +123,17 @@ button {
font-size: 0.9em; font-size: 0.9em;
outline: none; outline: none;
padding: 0.5em; padding: 0.35em;
cursor: pointer; cursor: pointer;
transition: all 0.3s; transition: all 0.3s;
&.open {
color: $accentCol;
border: none;
font-weight: bold;
}
&:hover { &:hover {
background: rgba(#e0e0e0, 0.4); background: rgba(#e0e0e0, 0.4);
} }
@@ -169,11 +162,24 @@ ul {
list-style: none; list-style: none;
} }
.flex {
display: flex;
align-items: center;
justify-content: center;
&-spaced {
justify-content: space-between;
}
&-column {
flex-direction: column;
}
}
.app { .app {
background: $bgCol; background: $bgCol;
color: white; color: white;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
&-container { &-container {
@@ -186,11 +192,6 @@ ul {
} }
&-header { &-header {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: #333; background: #333;
padding: 0.4rem; padding: 0.4rem;
@@ -208,29 +209,18 @@ ul {
} }
&-bar { &-bar {
display: flex;
align-items: center;
justify-content: space-between;
font-size: calc(0.8rem + 0.2vw);
position: sticky; position: sticky;
font-size: calc(0.8rem + 0.2vw);
top: 0; top: 0;
background: #222; background: #222;
} }
} }
footer { footer {
background: #111; background: #111;
padding: 0.3rem; padding: 0.3rem;
color: white; color: white;
display: flex;
justify-content: center;
align-items: center;
max-width: 100%; max-width: 100%;
font-size: calc(0.5rem + 0.5vw); font-size: calc(0.5rem + 0.5vw);
} }
</style> </style>
+45 -27
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="list"> <div class="list flex">
<Card :stationInfo="focusedStationInfo" :closeCard="closeCard" /> <Card :stationInfo="focusedStationInfo" :closeCard="closeCard" />
<!-- <div class="info">Ups! Brak stacji do wyświetlenia!</div> --> <!-- <div class="info">Ups! Brak stacji do wyświetlenia!</div> -->
@@ -9,10 +9,10 @@
<thead> <thead>
<tr> <tr>
<th>Stacja</th> <th>Stacja</th>
<th>Status</th>
<th>Dyżurny</th> <th>Dyżurny</th>
<th>Poziom</th> <th>Poziom</th>
<th>Maszyniści</th> <th>Maszyniści</th>
<th>Zajęta do</th>
<th> <th>
Informacje Informacje
<div>ogólne</div> <div>ogólne</div>
@@ -28,26 +28,42 @@
</tr> </tr>
</thead> </thead>
<tbody>
<tr <tr
class="table-item" class="table-item"
v-for="(station, i) in computedStations" v-for="(station, i) in computedStations"
:key="i + station.stationHash" :key="i + station.stationHash"
@click="() => { setFocusedStation(station.stationName) }" @click="() => { if(station.online) setFocusedStation(station.stationName) }"
> >
<td <td
class="station-name" class="station-name"
:class="station.default && 'default-station'" :class="{'default-station': station.default, 'online': station.online}"
>{{station.stationName}} {{ station.reqLevel ? "| " + (parseInt(station.reqLevel) >= 2 ? station.reqLevel : "L") : "" }}</td> >{{station.stationName}} {{ station.reqLevel ? "| " + (parseInt(station.reqLevel) >= 2 ? station.reqLevel : "L") : "" }}</td>
<td class="disptacher-name">{{station.dispatcherName}}</td>
<td class="dispatcher-exp">
<span :style="calculateStyle(station.dispatcherExp)">{{station.dispatcherExp}}</span>
</td>
<td class="users">{{station.currentUsers}}/{{station.maxUsers}}</td>
<td class="hours"> <td class="hours">
<span class="hour" :class="occupationClasses(station.occupiedTo)">{{station.occupiedTo}}</span> <span
class="hour"
:class="occupationClasses(station.occupiedTo)"
>{{station.occupiedTo}}</span>
</td> </td>
<td class="disptacher-name">{{station.online ? station.dispatcherName : ""}}</td>
<td class="dispatcher-exp">
<span
v-if="station.online"
:style="calculateStyle(station.dispatcherExp)"
>{{station.dispatcherExp}}</span>
</td>
<td
class="users"
>{{station.online ? (station.currentUsers + "/" + station.maxUsers) : ""}}</td>
<td class="info"> <td class="info">
<!-- <img
v-if="station.default"
:src="require(`@/assets/icon-td2.svg`)"
alt="default"
title="Sceneria domyślnie dostępna w grze"
/>-->
<img <img
v-if="station.controlType" v-if="station.controlType"
:src="require(`@/assets/icon-${station.controlType}.svg`)" :src="require(`@/assets/icon-${station.controlType}.svg`)"
@@ -105,6 +121,7 @@
>{{station.routes.oneWay.noCatenary}}</span> >{{station.routes.oneWay.noCatenary}}</span>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@@ -150,6 +167,9 @@ export default Vue.extend({
let className = ""; let className = "";
switch (occupiedTo) { switch (occupiedTo) {
case "WOLNA":
className = "free";
break;
case "KOŃCZY": case "KOŃCZY":
className = "ending"; className = "ending";
break; break;
@@ -193,7 +213,14 @@ export default Vue.extend({
.hour { .hour {
padding: 0.4em; padding: 0.4em;
border-radius: 1rem; border-radius: 1rem;
font-weight: 500; font-weight: bold;
background-color: #00be19;
&.free {
background-color: #8a8a8a;
font-size: 0.95em;
}
&.ending { &.ending {
background-color: $accentCol; background-color: $accentCol;
@@ -202,7 +229,7 @@ export default Vue.extend({
} }
&.no-limit { &.no-limit {
// background-color: #57ae00; background-color: #0077ae;
font-size: 0.85em; font-size: 0.85em;
} }
@@ -229,13 +256,9 @@ export default Vue.extend({
} }
} }
.list {
display: flex;
justify-content: center;
}
.default-station { .default-station {
color: $secondaryCol; font-weight: bold;
color: $accentCol;
} }
.table { .table {
@@ -247,14 +270,14 @@ export default Vue.extend({
white-space: nowrap; white-space: nowrap;
border-collapse: collapse; border-collapse: collapse;
font-size: calc(0.6rem + 0.4vw); font-size: calc(0.6rem + 0.35vw);
@include smallScreen() { @include smallScreen() {
font-size: 0.65rem; font-size: 0.65rem;
} }
thead th { thead th {
padding: 0.2rem; padding: 0.3rem;
background-color: #444; background-color: #444;
} }
@@ -264,19 +287,14 @@ export default Vue.extend({
&:nth-child(even) { &:nth-child(even) {
background-color: rgb(102, 101, 101); background-color: rgb(102, 101, 101);
color: white; color: white;
a {
color: white;
}
} }
&:hover, &:hover,
&:focus { &:focus {
background-color: #818181; background-color: #818181;
// transform: scale(1.2);
} }
& > td { td {
padding: 0.3rem 1rem; padding: 0.3rem 1rem;
margin: 0 3rem; margin: 0 3rem;
text-align: center; text-align: center;
+2 -29
View File
@@ -1,20 +1,14 @@
<template> <template>
<div class="options"> <div class="options">
<div class="option-buttons"> <div class="option-buttons">
<button <button class="button" :class="{'open': filtersOpen}" @click="filtersOpen = !filtersOpen">
class="button-filters"
:class="{'open': filtersOpen}"
@click="filtersOpen = !filtersOpen"
>
<img :src="require('@/assets/icon-filter2.svg')" alt="icon-filter" /> FILTRY <img :src="require('@/assets/icon-filter2.svg')" alt="icon-filter" /> FILTRY
</button> </button>
</div> </div>
<transition name="slide">
<keep-alive> <keep-alive>
<ListFilter v-if="filtersOpen" :exit="() => filtersOpen = !filtersOpen" /> <ListFilter v-if="filtersOpen" :exit="() => filtersOpen = !filtersOpen" />
</keep-alive> </keep-alive>
</transition>
</div> </div>
</template> </template>
@@ -38,36 +32,15 @@ export default Vue.extend({
@import "../../styles/variables.scss"; @import "../../styles/variables.scss";
@import "../../styles/responsive.scss"; @import "../../styles/responsive.scss";
.slide-enter-active,
.slide-leave-active {
transition: all 0.3s ease;
}
.slide-enter,
.slide-leave-to {
transform: translate(-40%, -50%);
opacity: 0;
}
.options { .options {
font-size: calc(0.6rem + 0.9vw); font-size: calc(0.6rem + 0.9vw);
// display: flex;
} }
button { .button {
font-size: 0.8em; font-size: 0.8em;
padding: 0.3em;
img { img {
width: 1.3em; width: 1.3em;
margin: 0.2em;
}
&.open {
color: $accentCol;
border: none;
font-weight: bold;
} }
} }
</style> </style>
+29 -9
View File
@@ -1,4 +1,5 @@
<template> <template>
<transition name="slide">
<div class="list-filter"> <div class="list-filter">
<div class="exit" @click="exitFilters">X</div> <div class="exit" @click="exitFilters">X</div>
<div class="list-filter-title">FILTRY</div> <div class="list-filter-title">FILTRY</div>
@@ -158,10 +159,11 @@
</li> </li>
<li class="grid-row"> <li class="grid-row">
<button @click="reset">RESET FILTRÓW</button> <button class="button" @click="reset">RESET FILTRÓW</button>
</li> </li>
</ul> </ul>
</div> </div>
</transition>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -274,6 +276,13 @@ export default Vue.extend({
content: "historyczna" content: "historyczna"
} }
] ]
},
status: {
title: "Status",
type: "checkbox",
items: []
} }
} }
}), }),
@@ -318,24 +327,34 @@ export default Vue.extend({
@import "../../styles/responsive"; @import "../../styles/responsive";
@import "../../styles/variables"; @import "../../styles/variables";
.slide-enter-active,
.slide-leave-active {
transition: all 0.3s ease;
}
.slide-enter,
.slide-leave-to {
opacity: 0;
}
.list-filter { .list-filter {
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%);
overflow: auto; overflow: auto;
max-height: 90%; max-height: 90%;
padding: 0.4em; padding: 0.5em;
background: rgba(black, 0.85); background: rgba(black, 0.85);
white-space: nowrap; white-space: nowrap;
transform: translate(-50%, -50%);
font-size: calc(0.6rem + 0.4vw); font-size: calc(0.6rem + 0.4vw);
@include smallScreen() { @include smallScreen() {
width: 100vw; width: 100vw;
font-size: 0.75em; font-size: 1em;
} }
} }
@@ -343,9 +362,7 @@ export default Vue.extend({
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: 0.4rem; padding: 0.4rem;
font-size: calc(1rem + 0.4vw); font-size: calc(1rem + 0.4vw);
cursor: pointer; cursor: pointer;
@@ -353,8 +370,7 @@ export default Vue.extend({
.list-filter-title { .list-filter-title {
text-align: center; text-align: center;
padding: 0.3rem; font-size: 1.9em;
font-size: 1.6em;
font-weight: bold; font-weight: bold;
} }
@@ -378,13 +394,17 @@ export default Vue.extend({
-webkit-user-select: none; -webkit-user-select: none;
} }
} }
.item { .item {
&-title { &-title {
text-align: center; text-align: center;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
font-weight: bold; font-weight: bold;
color: $accentCol; color: $accentCol;
} }
} }
button.button {
margin-top: 0.5em;
}
</style> </style>
+138 -107
View File
@@ -4,7 +4,6 @@
"stationURL": "https://td2.info.pl/scenerie/blaszki/", "stationURL": "https://td2.info.pl/scenerie/blaszki/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "d712b295",
"reqLevel": "10", "reqLevel": "10",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -21,7 +20,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "LCS Borowe", "stationName": "LCS Borowe",
@@ -52,7 +52,6 @@
"stationURL": "https://td2.info.pl/scenerie/lcs-gdansk/", "stationURL": "https://td2.info.pl/scenerie/lcs-gdansk/",
"stationLines": "9, 202, 227, 249, 250", "stationLines": "9, 202, 227, 249, 250",
"stationProject": "", "stationProject": "",
"stationHash": "5c3dac7f",
"reqLevel": "10", "reqLevel": "10",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -69,14 +68,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Lębork", "stationName": "Lębork",
"stationURL": "https://td2.info.pl/scenerie/lebork-5834/", "stationURL": "https://td2.info.pl/scenerie/lebork-5834/",
"stationLines": "202, 229, 237", "stationLines": "202, 229, 237",
"stationProject": "", "stationProject": "",
"stationHash": "ea695f02",
"reqLevel": "8", "reqLevel": "8",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -93,14 +92,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Grabów Miasto", "stationName": "Grabów Miasto",
"stationURL": "https://td2.info.pl/scenerie/grabow-miasto-v2/", "stationURL": "https://td2.info.pl/scenerie/grabow-miasto-v2/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "1626cc27",
"reqLevel": "6", "reqLevel": "6",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -117,14 +116,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Parzęczewo", "stationName": "Parzęczewo",
"stationURL": "https://td2.info.pl/scenerie/parzeczewo/", "stationURL": "https://td2.info.pl/scenerie/parzeczewo/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "a7d464d4",
"reqLevel": "6", "reqLevel": "6",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "mieszana", "signalType": "mieszana",
@@ -141,14 +140,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Aleksandrów Kujawski", "stationName": "Aleksandrów Kujawski",
"stationURL": "https://td2.info.pl/scenerie/aleksandrow-kujawski/", "stationURL": "https://td2.info.pl/scenerie/aleksandrow-kujawski/",
"stationLines": "18, 245", "stationLines": "18, 245",
"stationProject": "", "stationProject": "",
"stationHash": "6d72679c",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -165,14 +164,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Arkadia Zdrój 2012", "stationName": "Arkadia Zdrój 2012",
"stationURL": "https://td2.info.pl/scenerie/arkadia-zdroj/", "stationURL": "https://td2.info.pl/scenerie/arkadia-zdroj/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "147375b3",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "mieszana", "signalType": "mieszana",
@@ -189,14 +188,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Buk 2018", "stationName": "Buk 2018",
"stationURL": "https://td2.info.pl/scenerie/buk2/", "stationURL": "https://td2.info.pl/scenerie/buk2/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "4983e8bf",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -213,14 +212,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Jordanowo", "stationName": "Jordanowo",
"stationURL": "https://td2.info.pl/scenerie/jordanowo/", "stationURL": "https://td2.info.pl/scenerie/jordanowo/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "dcb27980",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "mieszana", "signalType": "mieszana",
@@ -237,14 +236,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "LCS Głowno", "stationName": "LCS Głowno",
"stationURL": "https://td2.info.pl/scenerie/glowno-(linia-nr-15-lka)/", "stationURL": "https://td2.info.pl/scenerie/glowno-(linia-nr-15-lka)/",
"stationLines": "15", "stationLines": "15",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "c876ed93",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -261,14 +260,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "LCS Ozorków", "stationName": "LCS Ozorków",
"stationURL": "https://td2.info.pl/scenerie/lcs-ozorkow/", "stationURL": "https://td2.info.pl/scenerie/lcs-ozorkow/",
"stationLines": "16", "stationLines": "16",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "c4de852a",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -285,14 +284,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "LCS Skrzynki", "stationName": "LCS Skrzynki",
"stationURL": "https://td2.info.pl/scenerie/lcs-skrzynki/", "stationURL": "https://td2.info.pl/scenerie/lcs-skrzynki/",
"stationLines": "25", "stationLines": "25",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "46963c3a",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -309,14 +308,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Łask", "stationName": "Łask",
"stationURL": "https://td2.info.pl/scenerie/lask-w-ramach-lka/", "stationURL": "https://td2.info.pl/scenerie/lask-w-ramach-lka/",
"stationLines": "14", "stationLines": "14",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "1da6b1db",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -333,14 +332,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Naterki", "stationName": "Naterki",
"stationURL": "https://td2.info.pl/scenerie/naterki/", "stationURL": "https://td2.info.pl/scenerie/naterki/",
"stationLines": "353", "stationLines": "353",
"stationProject": "", "stationProject": "",
"stationHash": "672ad968",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "kształtowa", "signalType": "kształtowa",
@@ -357,14 +356,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Santok Zdrój", "stationName": "Santok Zdrój",
"stationURL": "https://td2.info.pl/scenerie/santok-zdroj/", "stationURL": "https://td2.info.pl/scenerie/santok-zdroj/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "c876ed93",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -381,14 +380,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Testowo", "stationName": "Testowo",
"stationURL": "https://td2.info.pl/scenerie/testowo-3581", "stationURL": "https://td2.info.pl/scenerie/testowo-3581",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "cfa1069a",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -405,14 +404,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Tłoki", "stationName": "Tłoki",
"stationURL": "https://td2.info.pl/scenerie/podg-tloki", "stationURL": "https://td2.info.pl/scenerie/podg-tloki",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "631aa683",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -429,14 +428,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Witaszyczki", "stationName": "Witaszyczki",
"stationURL": "https://td2.info.pl/scenerie/witaszyczki/", "stationURL": "https://td2.info.pl/scenerie/witaszyczki/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "46963c3a",
"reqLevel": "4", "reqLevel": "4",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -453,14 +452,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Bydgowo", "stationName": "Bydgowo",
"stationURL": "https://td2.info.pl/scenerie/bydgowo/", "stationURL": "https://td2.info.pl/scenerie/bydgowo/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "596cf99d",
"reqLevel": "2", "reqLevel": "2",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -477,14 +476,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Głębce", "stationName": "Głębce",
"stationURL": "https://td2.info.pl/scenerie/glebce", "stationURL": "https://td2.info.pl/scenerie/glebce",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "152274d7",
"reqLevel": "2", "reqLevel": "2",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -501,14 +500,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Hel", "stationName": "Hel",
"stationURL": "https://td2.info.pl/scenerie/hel/", "stationURL": "https://td2.info.pl/scenerie/hel/",
"stationLines": "213", "stationLines": "213",
"stationProject": "", "stationProject": "",
"stationHash": "7baf7401",
"reqLevel": "2", "reqLevel": "2",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -525,14 +524,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Kcynia", "stationName": "Kcynia",
"stationURL": "https://td2.info.pl/scenerie/kcynia", "stationURL": "https://td2.info.pl/scenerie/kcynia",
"stationLines": "281, 356", "stationLines": "281, 356",
"stationProject": "", "stationProject": "",
"stationHash": "a8b3c098",
"reqLevel": "2", "reqLevel": "2",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "kształtowa", "signalType": "kształtowa",
@@ -549,14 +548,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Lewków", "stationName": "Lewków",
"stationURL": "https://td2.info.pl/scenerie/lewkow/", "stationURL": "https://td2.info.pl/scenerie/lewkow/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "ec92d52c",
"reqLevel": "2", "reqLevel": "2",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "mieszana", "signalType": "mieszana",
@@ -573,14 +572,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Cis 2013", "stationName": "Cis 2013",
"stationURL": "https://td2.info.pl/scenerie/cis2", "stationURL": "https://td2.info.pl/scenerie/cis2",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "0f8fe101",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "kształtowa", "signalType": "kształtowa",
@@ -597,14 +596,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Cis 2018", "stationName": "Cis 2018",
"stationURL": "https://td2.info.pl/scenerie/cis2", "stationURL": "https://td2.info.pl/scenerie/cis2",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "9b0b6551",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -621,14 +620,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Glinnik", "stationName": "Glinnik",
"stationURL": "https://td2.info.pl/scenerie/glinnik-(projekt-lka)/", "stationURL": "https://td2.info.pl/scenerie/glinnik-(projekt-lka)/",
"stationLines": "15", "stationLines": "15",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "3d3def6e",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -645,14 +644,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Głogowo", "stationName": "Głogowo",
"stationURL": "https://td2.info.pl/scenerie/glogowo", "stationURL": "https://td2.info.pl/scenerie/glogowo",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "6084e6e8",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -669,14 +668,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Karszynek", "stationName": "Karszynek",
"stationURL": "https://td2.info.pl/scenerie/karszynek/", "stationURL": "https://td2.info.pl/scenerie/karszynek/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "64b3977a",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "historyczna", "signalType": "historyczna",
@@ -693,14 +692,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Imielin 2015", "stationName": "Imielin 2015",
"stationURL": "https://td2.info.pl/scenerie/imielin-2015", "stationURL": "https://td2.info.pl/scenerie/imielin-2015",
"stationLines": "138", "stationLines": "138",
"stationProject": "", "stationProject": "",
"stationHash": "13353c83",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -717,14 +716,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Kolsko", "stationName": "Kolsko",
"stationURL": "https://td2.info.pl/scenerie/kolsko/", "stationURL": "https://td2.info.pl/scenerie/kolsko/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "fd9ba98c",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "kształtowa", "signalType": "kształtowa",
@@ -741,14 +740,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "LCS Bucz Wileński", "stationName": "LCS Bucz Wileński",
"stationURL": "https://td2.info.pl/scenerie/bucz-wilenski/", "stationURL": "https://td2.info.pl/scenerie/bucz-wilenski/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "1e8e451a",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -765,14 +764,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Lisiczki", "stationName": "Lisiczki",
"stationURL": "https://td2.info.pl/scenerie/lisiczki", "stationURL": "https://td2.info.pl/scenerie/lisiczki",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "c3366fd2",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -789,14 +788,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Łęczyca", "stationName": "Łęczyca",
"stationURL": "https://td2.info.pl/scenerie/leczyca-projekt-lka/", "stationURL": "https://td2.info.pl/scenerie/leczyca-projekt-lka/",
"stationLines": "16", "stationLines": "16",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "da6ba7c6",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -813,14 +812,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Poreńsk", "stationName": "Poreńsk",
"stationURL": "https://td2.info.pl/scenerie/porensk/", "stationURL": "https://td2.info.pl/scenerie/porensk/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "4710695a",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -837,14 +836,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Radowice", "stationName": "Radowice",
"stationURL": "https://td2.info.pl/scenerie/radowice", "stationURL": "https://td2.info.pl/scenerie/radowice",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "53d8d684",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "kształtowa", "signalType": "kształtowa",
@@ -861,14 +860,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Witonia", "stationName": "Witonia",
"stationURL": "https://td2.info.pl/scenerie/witonia-(projekt-lka)/", "stationURL": "https://td2.info.pl/scenerie/witonia-(projekt-lka)/",
"stationLines": "16", "stationLines": "16",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "770a09de",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -885,14 +884,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Wola", "stationName": "Wola",
"stationURL": "https://td2.info.pl/scenerie/wola/", "stationURL": "https://td2.info.pl/scenerie/wola/",
"stationLines": "", "stationLines": "",
"stationProject": "", "stationProject": "",
"stationHash": "864d8b89",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "mieszana", "signalType": "mieszana",
@@ -909,14 +908,14 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Zgierz Kontrewers", "stationName": "Zgierz Kontrewers",
"stationURL": "https://td2.info.pl/scenerie/zgierz-kontrewers-6172/", "stationURL": "https://td2.info.pl/scenerie/zgierz-kontrewers-6172/",
"stationLines": "16", "stationLines": "16",
"stationProject": "ŁKA", "stationProject": "ŁKA",
"stationHash": "484f8aef",
"reqLevel": "0", "reqLevel": "0",
"supportersOnly": "NIE", "supportersOnly": "NIE",
"signalType": "współczesna", "signalType": "współczesna",
@@ -933,7 +932,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": true "default": true,
"nonPublic": false
}, },
{ {
"stationName": "Bargowice", "stationName": "Bargowice",
@@ -955,7 +955,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Szklana Poręba", "stationName": "Szklana Poręba",
@@ -977,7 +978,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Wschodna", "stationName": "Wschodna",
@@ -999,7 +1001,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Zabłocie", "stationName": "Zabłocie",
@@ -1021,7 +1024,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Zdroje", "stationName": "Zdroje",
@@ -1043,7 +1047,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Grzybowo", "stationName": "Grzybowo",
@@ -1065,7 +1070,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Zwardoń", "stationName": "Zwardoń",
@@ -1087,7 +1093,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Piaskowo", "stationName": "Piaskowo",
@@ -1109,7 +1116,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Rajcza", "stationName": "Rajcza",
@@ -1131,7 +1139,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Brzezinka", "stationName": "Brzezinka",
@@ -1153,7 +1162,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Torzyn", "stationName": "Torzyn",
@@ -1175,7 +1185,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Wola Nowska", "stationName": "Wola Nowska",
@@ -1197,7 +1208,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Chełmik Wołowski", "stationName": "Chełmik Wołowski",
@@ -1219,7 +1231,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Drzewko", "stationName": "Drzewko",
@@ -1241,7 +1254,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Krzemienice", "stationName": "Krzemienice",
@@ -1263,7 +1277,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Milówka", "stationName": "Milówka",
@@ -1285,7 +1300,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Orniki", "stationName": "Orniki",
@@ -1307,7 +1323,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Otwocko", "stationName": "Otwocko",
@@ -1329,7 +1346,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Skostomłoty", "stationName": "Skostomłoty",
@@ -1351,7 +1369,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Babimost", "stationName": "Babimost",
@@ -1373,7 +1392,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Czerepy", "stationName": "Czerepy",
@@ -1395,7 +1415,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Grabiny", "stationName": "Grabiny",
@@ -1417,7 +1438,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Kieły", "stationName": "Kieły",
@@ -1439,7 +1461,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Lutol Suchy", "stationName": "Lutol Suchy",
@@ -1461,7 +1484,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Raki", "stationName": "Raki",
@@ -1483,7 +1507,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Sieniawka", "stationName": "Sieniawka",
@@ -1505,7 +1530,8 @@
"noCatenary": 1 "noCatenary": 1
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Stefanowo", "stationName": "Stefanowo",
@@ -1527,7 +1553,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Szlichtyngowa", "stationName": "Szlichtyngowa",
@@ -1549,7 +1576,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Tarnowo Górne", "stationName": "Tarnowo Górne",
@@ -1571,7 +1599,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Tartakowo 2013", "stationName": "Tartakowo 2013",
@@ -1593,7 +1622,8 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
}, },
{ {
"stationName": "Wielgowo", "stationName": "Wielgowo",
@@ -1615,6 +1645,7 @@
"noCatenary": 0 "noCatenary": 0
} }
}, },
"default": false "default": false,
"nonPublic": false
} }
] ]
+62 -17
View File
@@ -3,8 +3,10 @@ import data from '@/data/stations.json';
@Module @Module
class Store extends VuexModule { class Store extends VuexModule {
public trainCount: number = 0; private trainCount: number = 0;
public stations: { private stationCount: number = 0;
private stations: {
stationName: string; stationName: string;
stationHash: string; stationHash: string;
maxUsers: number; maxUsers: number;
@@ -21,13 +23,14 @@ class Store extends VuexModule {
signalType: string; signalType: string;
controlType: string; controlType: string;
default: boolean; default: boolean;
nonPublic: boolean; nonPublic: boolean
routes: { oneWay: { catenary: number; noCatenary: number; }, twoWay: { catenary: number; noCatenary: number; } }; routes: { oneWay: { catenary: number; noCatenary: number; }, twoWay: { catenary: number; noCatenary: number; } };
online: boolean;
}[] = []; }[] = [];
public filteredStations: {}[] = []; private filteredStations: {}[] = [];
public filterInitStates = { private filterInitStates = {
"default": false, "default": false,
"notDefault": false, "notDefault": false,
"nonPublic": false, "nonPublic": false,
@@ -49,7 +52,7 @@ class Store extends VuexModule {
"no-2track": false "no-2track": false
} as const; } as const;
public filters = { private filters = {
"default": false, "default": false,
"notDefault": false, "notDefault": false,
"nonPublic": false, "nonPublic": false,
@@ -73,7 +76,7 @@ class Store extends VuexModule {
get getStationCount(): number { get getStationCount(): number {
return this.stations.length; return this.stationCount;
} }
get getTrainCount(): number { get getTrainCount(): number {
@@ -101,7 +104,15 @@ class Store extends VuexModule {
} }
@Action @Action
public async fetchStations() { public async initStations() {
this.context.commit('loadAllStations');
this.context.dispatch('fetchStations');
setInterval(() => this.context.dispatch('fetchStations'), 3000);
}
@Action
private async fetchStations() {
let onlineStations: { let onlineStations: {
stationName: string, stationName: string,
stationHash: string, stationHash: string,
@@ -188,15 +199,14 @@ class Store extends VuexModule {
} }
}) })
this.context.commit('setStations', mappedStations); this.context.commit('updateStations', mappedStations);
this.context.commit('setStationCount');
this.context.commit('filterStations'); this.context.commit('filterStations');
} }
@Mutation @Mutation
public filterStations() { private filterStations() {
this.filteredStations = this.stations.filter(station => { this.filteredStations = this.stations.filter(station => {
if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false; if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false;
if (!station.reqLevel) return true; if (!station.reqLevel) return true;
@@ -230,22 +240,57 @@ class Store extends VuexModule {
} }
@Mutation @Mutation
public resetFilterList() { private loadAllStations() {
this.stations = data.map(stationData => ({
stationProject: "",
spawnString: "",
stationHash: "",
maxUsers: 0,
currentUsers: 0,
dispatcherName: "",
dispatcherRate: 0,
dispatcherExp: 0,
dispatcherId: 0,
online: false,
occupiedTo: "WOLNA",
...stationData,
}))
// WSPARCIE DLA NIEWPISANYCH SCENERII!!!
}
@Mutation
private resetFilterList() {
this.filters = { ...this.filterInitStates }; this.filters = { ...this.filterInitStates };
} }
@Mutation @Mutation
public setStations(stations: []) { private updateStations(updatedStations: []) {
this.stations = stations; for (let i = 0; i < this.stations.length; i++) {
const toUpdate: any = updatedStations.find((updated: any) => updated.stationName === this.stations[i].stationName);
if (!toUpdate) {
this.stations[i].online = false;
continue;
}
this.stations[i] = { ...this.stations[i], ...toUpdate }
this.stations[i].online = true;
}
} }
@Mutation @Mutation
public setTrainCount(count: number) { private setTrainCount(count: number) {
this.trainCount = count; this.trainCount = count;
} }
@Mutation @Mutation
public mutateFilter(payload: { filterName: string, value: number | boolean }) { private setStationCount() {
this.stationCount = this.stations.filter(station => station.online).length;
}
@Mutation
private mutateFilter(payload: { filterName: string, value: number | boolean }) {
this.filters[payload.filterName] = payload.value; this.filters[payload.filterName] = payload.value;
} }