mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Poprawki statystyk
This commit is contained in:
+2
-1
@@ -62,7 +62,7 @@ export const useStore = defineStore('store', {
|
||||
if (!trains) return [];
|
||||
|
||||
this.trainList = trains
|
||||
.filter((train) => train.region === this.region.id && train.online)
|
||||
.filter((train) => train.region === this.region.id)
|
||||
.map((train) => {
|
||||
const stock = train.stockString.split(';');
|
||||
const locoType = stock ? stock[0] : train.stockString;
|
||||
@@ -206,6 +206,7 @@ export const useStore = defineStore('store', {
|
||||
const prevDispatcherStatuses: StoreState['lastDispatcherStatuses'] = [];
|
||||
|
||||
this.apiData.stations?.forEach((stationAPIData) => {
|
||||
|
||||
if (stationAPIData.region !== this.region.id || !stationAPIData.isOnline) return;
|
||||
const station = this.stationList.find((s) => s.name === stationAPIData.stationName);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DataStatus } from '@/scripts/enums/DataStatus';
|
||||
import { DispatcherStatsResponse } from '@/scripts/interfaces/api/DispatcherStatsAPIData';
|
||||
import { DriverStatsResponse } from '@/scripts/interfaces/api/DriverStatsAPIData';
|
||||
import { DispatcherStatsAPIData } from '@/scripts/interfaces/api/DispatcherStatsAPIData';
|
||||
import { DriverStatsAPIData } from '@/scripts/interfaces/api/DriverStatsAPIData';
|
||||
import StationAPIData from '@/scripts/interfaces/api/StationAPIData';
|
||||
import TrainAPIData from '@/scripts/interfaces/api/TrainAPIData';
|
||||
import Station from '@/scripts/interfaces/Station';
|
||||
@@ -25,10 +25,10 @@ export interface StoreState {
|
||||
webSocket?: Socket;
|
||||
|
||||
dispatcherStatsName: string;
|
||||
dispatcherStatsData?: DispatcherStatsResponse;
|
||||
dispatcherStatsData?: DispatcherStatsAPIData;
|
||||
|
||||
driverStatsName: string;
|
||||
driverStatsData?: DriverStatsResponse;
|
||||
driverStatsData?: DriverStatsAPIData;
|
||||
|
||||
dataStatuses: {
|
||||
connection: DataStatus;
|
||||
|
||||
Reference in New Issue
Block a user