From 199d42aeb29c9ff956fb40320a29d216fdb0c3a6 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 27 Apr 2022 19:21:08 +0200 Subject: [PATCH] Dodano filtr 'wycofana' --- src/assets/icon-abandoned.svg | 4 +++ src/components/StationsView/StationTable.vue | 28 +++++++++++--------- src/data/options.json | 9 ++++++- src/locales/en.json | 2 ++ src/locales/pl.json | 4 ++- src/scripts/interfaces/Filter.ts | 1 + src/scripts/interfaces/Station.ts | 1 + src/scripts/managers/stationFilterManager.ts | 14 ++++++---- 8 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 src/assets/icon-abandoned.svg diff --git a/src/assets/icon-abandoned.svg b/src/assets/icon-abandoned.svg new file mode 100644 index 0000000..7682de1 --- /dev/null +++ b/src/assets/icon-abandoned.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 1c56583..a79b448 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -70,6 +70,10 @@ {{ station.generalInfo.reqLevel >= 2 ? station.generalInfo.reqLevel : 'L' }} + + non-public + + non-public @@ -87,7 +91,9 @@ {{ $t(`status.${station.onlineInfo.statusID}`) }} - {{ station.onlineInfo.statusID == 'online' ? timestampToString(station.onlineInfo.statusTimestamp) : '' }} + {{ + station.onlineInfo.statusID == 'online' ? timestampToString(station.onlineInfo.statusTimestamp) : '' + }} @@ -100,21 +106,20 @@ - + {{ 2 > station.onlineInfo.dispatcherExp ? 'L' : station.onlineInfo.dispatcherExp }} - {{ station.generalInfo.routes.twoWayCatenaryRouteNames.length }} + {{ station.generalInfo.routes.twoWayCatenaryRouteNames.length }} { if (station.onlineInfo && filters['occupied']) return returnMode; if (!station.onlineInfo && filters['free']) return returnMode; - if (station.generalInfo?.unavailable && filters['unavailable']) return returnMode; + if (station.generalInfo?.unavailable && filters['unavailable'] && !station.onlineInfo) return returnMode; if (station.generalInfo) { const routes = station.generalInfo.routes; + if (filters['abandoned'] && station.generalInfo.abandoned) return returnMode; + if (station.generalInfo.default && filters['default']) return returnMode; - if (!station.generalInfo.default && filters['notDefault']) return returnMode; + if (!station.generalInfo.default && filters['notDefault'] && (!station.generalInfo.abandoned && !station.generalInfo.unavailable)) return returnMode; if (filters['real'] && station.generalInfo.lines != '') return returnMode; - if (filters['fictional'] && station.generalInfo.lines == '') return returnMode; + if (filters['fictional'] && station.generalInfo.lines == '' && (!station.generalInfo.abandoned && !station.generalInfo.unavailable)) return returnMode; - if (station.generalInfo.reqLevel + ((station.generalInfo.nonPublic || station.generalInfo.unavailable) ? 1 : 0) < filters['minLevel']) return returnMode; - if (station.generalInfo.reqLevel + ((station.generalInfo.nonPublic || station.generalInfo.unavailable) ? 1 : 0) > filters['maxLevel']) return returnMode; + + if (station.generalInfo.reqLevel + ((station.generalInfo.nonPublic || station.generalInfo.unavailable || station.generalInfo.abandoned) ? 1 : 0) < filters['minLevel']) return returnMode; + if (station.generalInfo.reqLevel + ((station.generalInfo.nonPublic || station.generalInfo.unavailable || station.generalInfo.abandoned) ? 1 : 0) > filters['maxLevel']) return returnMode; if (filters['no-1track'] && (routes.oneWayCatenaryRouteNames.length != 0 || routes.oneWayNoCatenaryRouteNames.length != 0)) return returnMode; if (filters['no-2track'] && (routes.twoWayCatenaryRouteNames.length != 0 || routes.twoWayNoCatenaryRouteNames.length != 0)) return returnMode; @@ -148,6 +151,7 @@ export default class StationFilterManager { ending: false, nonPublic: false, unavailable: true, + abandoned: true, afkStatus: false, endingStatus: false, noSpaceStatus: false,