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