mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
filtry aktywnych RJ
This commit is contained in:
@@ -96,7 +96,7 @@ export const filterStations = (station: Station, filters: Filter) => {
|
|||||||
if (filters['free'] && (!station.onlineInfo || station.onlineInfo.dispatcherId == -1))
|
if (filters['free'] && (!station.onlineInfo || station.onlineInfo.dispatcherId == -1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (station.onlineInfo && station.onlineInfo.dispatcherId != -1) {
|
if (station.onlineInfo) {
|
||||||
const { dispatcherStatus } = station.onlineInfo;
|
const { dispatcherStatus } = station.onlineInfo;
|
||||||
|
|
||||||
const excludeEnding =
|
const excludeEnding =
|
||||||
@@ -112,12 +112,21 @@ export const filterStations = (station: Station, filters: Filter) => {
|
|||||||
const excludeNoSpace =
|
const excludeNoSpace =
|
||||||
dispatcherStatus == Status.ActiveDispatcher.NO_SPACE && filters['noSpaceStatus'];
|
dispatcherStatus == Status.ActiveDispatcher.NO_SPACE && filters['noSpaceStatus'];
|
||||||
|
|
||||||
const excludeOccupied = station.onlineInfo && filters['occupied'];
|
const excludeOccupied = filters['occupied'] && dispatcherStatus != Status.ActiveDispatcher.FREE;
|
||||||
|
|
||||||
// const isActiveFree =
|
const excludeActiveTTs =
|
||||||
// dispatcherStatus == Status.ActiveDispatcher.FREE && filters['withActiveTimetables'];
|
(dispatcherStatus == Status.ActiveDispatcher.FREE ||
|
||||||
|
station.onlineInfo.scheduledTrainCount.all != 0) &&
|
||||||
|
filters['withActiveTimetables'];
|
||||||
|
|
||||||
if (excludeEnding || excludeAFK || excludeNoSpace || excludeNotSigned || excludeOccupied)
|
if (
|
||||||
|
excludeEnding ||
|
||||||
|
excludeAFK ||
|
||||||
|
excludeNoSpace ||
|
||||||
|
excludeNotSigned ||
|
||||||
|
excludeOccupied ||
|
||||||
|
excludeActiveTTs
|
||||||
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -127,6 +136,12 @@ export const filterStations = (station: Station, filters: Filter) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const excludeNoActiveTTs =
|
||||||
|
filters['withoutActiveTimetables'] &&
|
||||||
|
(!station.onlineInfo || station.onlineInfo.scheduledTrainCount.all == 0);
|
||||||
|
|
||||||
|
if (excludeNoActiveTTs) return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(station.generalInfo?.availability == 'nonPublic' || !station.generalInfo) &&
|
(station.generalInfo?.availability == 'nonPublic' || !station.generalInfo) &&
|
||||||
filters['nonPublic']
|
filters['nonPublic']
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Station from '../scripts/interfaces/Station';
|
import Station from '../scripts/interfaces/Station';
|
||||||
import Train from '../scripts/interfaces/Train';
|
import Train from '../scripts/interfaces/Train';
|
||||||
import { API } from '../typings/api';
|
|
||||||
import { ScheduledTrain, StationTrain, StopStatus, TrainStop } from './typings';
|
import { ScheduledTrain, StationTrain, StopStatus, TrainStop } from './typings';
|
||||||
|
|
||||||
export function getLocoURL(locoType: string): string {
|
export function getLocoURL(locoType: string): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user