mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
chore: added internal station routes filters
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
</section>
|
||||
|
||||
<section class="card_sliders">
|
||||
<div class="slider" v-for="(slider, i) in initSliders" :key="i">
|
||||
<div class="slider" v-for="(slider, i) in sliderStates" :key="i">
|
||||
<input
|
||||
class="slider-input"
|
||||
type="range"
|
||||
@@ -178,7 +178,7 @@ import StorageManager from '../../managers/storageManager';
|
||||
|
||||
import {
|
||||
filtersSections,
|
||||
initSliders,
|
||||
sliderStates,
|
||||
initFilters,
|
||||
getChangedFilters
|
||||
} from '../../managers/stationFilterManager';
|
||||
@@ -197,7 +197,7 @@ export default defineComponent({
|
||||
saveOptions: false,
|
||||
|
||||
filtersSections,
|
||||
initSliders,
|
||||
sliderStates,
|
||||
|
||||
minimumHours: 0,
|
||||
authors: '',
|
||||
@@ -567,7 +567,8 @@ h3.section-header {
|
||||
}
|
||||
|
||||
.slider {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 50px 1fr;
|
||||
align-items: center;
|
||||
gap: 0.25em;
|
||||
|
||||
@@ -576,6 +577,7 @@ h3.section-header {
|
||||
&-value {
|
||||
color: $accentCol;
|
||||
padding: 0.1em 0.2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&-input {
|
||||
@@ -602,7 +604,8 @@ h3.section-header {
|
||||
border-radius: 50%;
|
||||
|
||||
background: white;
|
||||
border: 4px solid $accentCol;
|
||||
border: 3px solid $accentCol;
|
||||
background-color: #333;
|
||||
|
||||
@include smallScreen() {
|
||||
width: 15px;
|
||||
@@ -658,6 +661,7 @@ h3.section-header {
|
||||
|
||||
@include smallScreen {
|
||||
.slider {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ function filterSliderValues(filters: Record<string, any>, generalInfo: StationGe
|
||||
const otherAvailability =
|
||||
availability == 'nonPublic' || availability == 'unavailable' || availability == 'abandoned';
|
||||
|
||||
const internalRoutes = routes.all.filter((r) => r.isInternal && !r.isRouteSBL && !r.hidden);
|
||||
|
||||
return (
|
||||
filters['minLevel'] > reqLevel + (otherAvailability ? 1 : 0) ||
|
||||
filters['maxLevel'] < reqLevel + (otherAvailability ? 1 : 0) ||
|
||||
@@ -130,7 +132,13 @@ function filterSliderValues(filters: Record<string, any>, generalInfo: StationGe
|
||||
filters['minOneWayCatenary'] > routes.singleElectrifiedNames.length ||
|
||||
filters['minOneWay'] > routes.singleOtherNames.length ||
|
||||
filters['minTwoWayCatenary'] > routes.doubleElectrifiedNames.length ||
|
||||
filters['minTwoWay'] > routes.doubleOtherNames.length
|
||||
// filters['minTwoWay'] > routes.doubleOtherNames.length ||
|
||||
filters['minOneWayCatenaryInt'] >
|
||||
internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == true).length ||
|
||||
filters['minOneWayInt'] >
|
||||
internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == false).length ||
|
||||
filters['minTwoWayCatenaryInt'] >
|
||||
internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == true).length
|
||||
);
|
||||
}
|
||||
|
||||
@@ -235,7 +243,7 @@ export const sortStations = (a: Station, b: Station, sorter: ActiveSorter) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
};
|
||||
|
||||
export const filterStations = (station: Station, filters: Record<string, any>) => {
|
||||
export const filterStations = (station: Station, filters: Record<string, any>) => {
|
||||
if (filters['free'] && (!station.onlineInfo || station.onlineInfo.dispatcherId == -1))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user