refactor(vehicles): replaced URL for fetching vehicles data; changed vehicle group finding

This commit is contained in:
2026-01-05 22:45:30 +01:00
parent 0d55a10ec2
commit a8cac9ebe9
8 changed files with 94 additions and 64 deletions
+4 -40
View File
@@ -1,5 +1,6 @@
import { RouteLocationRaw } from 'vue-router';
import { StationJSONData } from '../store/typings';
import { API } from './api';
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
export type ScenerySpawnType = 'passenger' | 'freight' | 'loco' | 'all';
@@ -169,7 +170,7 @@ export interface ActiveScenery {
confirmed: number;
unconfirmed: number;
};
missingCheckpoints: string[];
missingCheckpoints: string[];
}
export interface ScenerySpawn {
@@ -214,45 +215,8 @@ export interface CheckpointTrain {
}
// Vehicles Data
export interface VehicleData {
id: number;
name: string;
type: string;
cabinName: string | null;
restrictions: Record<string, any> | null;
vehicleGroupsId: number;
group: VehiclesGroup;
}
export interface VehiclesGroup {
id: number;
name: string;
speed: number;
speedLoaded?: number;
speedLoco?: number;
length: number;
weight: number;
cargoTypes: VehicleCargo[] | null;
locoProps: {
coldStart: boolean;
doubleManned: boolean;
} | null;
massSpeeds: VehicleGroupMassSpeeds | null;
}
export interface VehicleGroupMassSpeeds {
passenger: Record<string, number> | null;
cargo: Record<string, number> | null;
none: number | null;
}
export interface VehicleCargo {
id: string;
weight: number;
}
export type Vehicle = API.VehiclesData.VehicleObject;
export type VehicleGroup = API.VehiclesData.VehicleGroupObject;
export interface TooltipUserTrain {
driverName: string;