diff --git a/package.json b/package.json
index 1a322ec..a4b30fd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stacjownik",
- "version": "1.13.0",
+ "version": "1.14.0",
"private": true,
"scripts": {
"dev": "vite",
diff --git a/src/App.scss b/src/App.scss
index 1033d9d..49e4daf 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -91,6 +91,11 @@ footer.app_footer {
max-width: 100%;
padding: 0.5em;
+ img {
+ width: 1.1em;
+ vertical-align: text-bottom;
+ }
+
z-index: 10;
background: #111;
diff --git a/src/App.vue b/src/App.vue
index 2e91da7..3f7db36 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -23,6 +23,8 @@
Spythere
{{ new Date().getUTCFullYear() }} |
v{{ VERSION }}{{ isOnProductionHost ? '' : 'dev' }}
+
+ {{ $t('footer.discord') }}
| changeSorter(i)"> + |
-
+
|
- changeSorter(i + 7)"> + |
- | + {{ station.generalInfo?.abbr }} + | +
({
- headIds: ['station', 'min-lvl', 'status', 'dispatcher', 'dispatcher-lvl', 'routes', 'general'],
- headIconsIds: ['user', 'spawn', 'timetable'],
+ headIconsIds,
+ headIds,
lastSelectedStationName: '',
}),
@@ -291,8 +296,10 @@ export default defineComponent({
window.open(url, '_blank');
},
- changeSorter(i: number) {
- this.stationFiltersStore.changeSorter(i);
+ changeSorter(headerName: HeadIdsTypes) {
+ if (headerName == 'general' || headerName == 'routes') return;
+
+ this.stationFiltersStore.changeSorter(headerName);
},
},
});
@@ -349,7 +356,7 @@ table {
position: sticky;
top: 0;
- min-width: 75px;
+ min-width: 80px;
padding: 0.5em;
background-color: $bgCol;
diff --git a/src/components/TrainsView/TrainSchedule.vue b/src/components/TrainsView/TrainSchedule.vue
index 29b9d86..a47a719 100644
--- a/src/components/TrainsView/TrainSchedule.vue
+++ b/src/components/TrainsView/TrainSchedule.vue
@@ -202,7 +202,6 @@ ul.stock-list {
img {
max-height: 60px;
- max-width: 320px;
}
}
diff --git a/src/locales/en.json b/src/locales/en.json
index 34e4e54..1a940bc 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -15,6 +15,9 @@
"migration-confirm": "Roger that!",
"offline": "App is in the offline mode!"
},
+ "footer": {
+ "discord": "Stacjownik Discord server"
+ },
"update": {
"title": "New version of the app is available!",
"paragraph1": "Enjoy the application and may the green signal be with you!",
@@ -202,6 +205,7 @@
},
"sceneries": {
"station": "Station",
+ "abbr": "Station\nabbrev.",
"min-lvl": "Min. dispatcher\nlevel",
"status": "Status",
"dispatcher": "Dispatcher",
@@ -214,7 +218,7 @@
"no-stations": "No stations to show here!",
"scenery-search": "Search for scenery..."
},
- "trains": {
+ "trains": {
"no-trains": "No trains to show here!",
"loading": "Loading train data...",
"offline": "Offline ride",
@@ -284,7 +288,7 @@
"stock-info": "EXTRA INFO",
"stock-length": "Length",
"stock-mass": "Mass",
- "stock-max-speed": "Maximum registered speed",
+ "stock-max-speed": "Max. speed",
"load-data": "Load further data...",
@@ -368,7 +372,18 @@
"end": "Timetable terminates here",
"terminated": "Timetable terminated",
"begins": "BEGINS HERE",
- "terminates": "TERMINATES\nHERE"
+ "terminates": "TERMINATES\nHERE",
+
+ "from": "FROM",
+ "to": "TO",
+
+ "desc-arriving": "The train is not here yet. It's going to come from: {prevStationName} (szlak {prevDepartureLine})",
+ "desc-online": "The train is at the station. It's going to leave to: {nextStationName} (szlak {nextArrivalLine})",
+ "desc-stopped": "The train is at the station and is stopped. It's going to leave towards: {nextStationName} (szlak {nextArrivalLine})",
+ "desc-next-arrival": "Leaves towards: {nextStationName} (szlak {nextArrivalLine})",
+ "desc-departed": "The train is at the station and it's been departed. Leaves towards: {nextStationName} (szlak {nextArrivalLine})",
+ "desc-departed-away": "The train has been departed to: {nextStationName} (szlak {nextArrivalLine})",
+ "desc-end": "The train terminates here"
},
"history": {
"title": "TIMETABLE JOURNAL",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index dc321d4..496bddf 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -15,7 +15,9 @@
"migration-confirm": "Przyjąłem!",
"offline": "Aplikacja w trybie offline!"
},
-
+ "footer": {
+ "discord": "Serwer Discord Stacjownika"
+ },
"update": {
"title": "Nowa wersja Stacjownika jest dostępna!",
"paragraph1": "Miłego korzystania z aplikacji i niech S2 będzie z wami!",
@@ -23,7 +25,6 @@
"confirm-button": "ZAKTUALIZUJ",
"later-button": "PÓŹNIEJ"
},
-
"data-status": {
"S1-offline": "Sygnał S1 Aplikacja działa w trybie offline!", "S1a-connection": "Sygnał S1a Błąd podczas próby połączenia się z API Stacjownika!", @@ -136,7 +137,7 @@ }, "filters": { "desc": " • Kliknięcie: zaznaczenie / odznaczenie filtru • Podwójne kliknięcie: odznaczenie reszty filtrów z grupy • RESET: zresetowanie filtrów z grupy", - + "sections": { "reality": "FIKCYJNOŚĆ SCENERII", "package-access": "DOSTĘPNOŚĆ W PACZCE", @@ -207,6 +208,7 @@ }, "sceneries": { "station": "Stacja", + "abbr": "Skrót\nposterunku", "min-lvl": "Min. poziom\ndyżurnego", "status": "Status", "dispatcher": "Dyżurny", @@ -290,7 +292,7 @@ "stock-info": "DODATKOWE INFORMACJE", "stock-length": "Długość", "stock-mass": "Masa", - "stock-max-speed": "Maks. zarejestrowana prędkość", + "stock-max-speed": "Prędkość maks.", "load-data": "Pobierz dalszą historię...", @@ -374,7 +376,18 @@ "end": "Koniec rozkładu jazdy", "terminated": "Rozkład jazdy zakończony", "begins": "ROZPOCZYNA\nBIEG", - "terminates": "KOŃCZY BIEG" + "terminates": "KOŃCZY BIEG", + + "from": "Z", + "to": "DO", + + "desc-arriving": "Pociągu nie ma jeszcze na tej scenerii. Przyjedzie z: {prevStationName} (szlak {prevDepartureLine})", + "desc-online": "Pociąg jest na tej scenerii. Odjedzie do: {nextStationName} (szlak {nextArrivalLine})", + "desc-stopped": "Pociąg jest na tej scenerii i odbywa postój. Odjedzie do: {nextStationName} (szlak {nextArrivalLine})", + "desc-next-arrival": "Odjeżdża do: {nextStationName} (szlak {nextArrivalLine})", + "desc-departed": "Pociąg jest na tej scenerii i został odprawiony. Odjeżdża do: {nextStationName} (szlak {nextArrivalLine})", + "desc-departed-away": "Pociąg został odprawiony i odjechał do: {nextStationName} (szlak {nextArrivalLine})", + "desc-end": "Pociąg kończy bieg" }, "history": { "title": "DZIENNIK ROZKŁADÓW JAZDY" diff --git a/src/scripts/data/stationHeaderNames.ts b/src/scripts/data/stationHeaderNames.ts new file mode 100644 index 0000000..6ebd0a2 --- /dev/null +++ b/src/scripts/data/stationHeaderNames.ts @@ -0,0 +1,14 @@ +export const headIds = [ + 'station', + 'abbr', + 'min-lvl', + 'status', + 'dispatcher', + 'dispatcher-lvl', + 'routes', + 'general', +] as const; + +export const headIconsIds = ['user', 'spawn', 'timetable'] as const; + +export type HeadIdsTypes = typeof headIds[number] | typeof headIconsIds[number]; diff --git a/src/scripts/interfaces/ScheduledTrain.ts b/src/scripts/interfaces/ScheduledTrain.ts index e03a44f..3c537e8 100644 --- a/src/scripts/interfaces/ScheduledTrain.ts +++ b/src/scripts/interfaces/ScheduledTrain.ts @@ -1,32 +1,41 @@ -import TrainStop from "./TrainStop"; +import TrainStop from './TrainStop'; -export default interface ScheduledTrain { - trainId: string; - trainNo: number; - - driverName: string; - driverId: number; - currentStationName: string; - currentStationHash: string; - category: string; - stopInfo: TrainStop; +export enum StopStatus { + 'arriving' = 'arriving', + 'departed' = 'departed', + 'departed-away' = 'departed-away', + 'online' = 'online', + 'stopped' = 'stopped', + 'terminated' = 'terminated', +} - terminatesAt: string; - beginsAt: string; +export interface ScheduledTrain { + trainId: string; + trainNo: number; - prevStationName: string; - nextStationName: string; + driverName: string; + driverId: number; + currentStationName: string; + currentStationHash: string; + category: string; + stopInfo: TrainStop; - arrivingLine: string | null; - departureLine: string | null; + terminatesAt: string; + beginsAt: string; - prevDepartureLine: string | null; - nextArrivalLine: string | null; + prevStationName: string; + nextStationName: string; - signal: string; - connectedTrack: string; + arrivingLine: string | null; + departureLine: string | null; - stopLabel: string; - stopStatus: string; - stopStatusID: number; -} \ No newline at end of file + prevDepartureLine: string | null; + nextArrivalLine: string | null; + + signal: string; + connectedTrack: string; + + stopLabel: string; + stopStatus: StopStatus; + stopStatusID: number; +} diff --git a/src/scripts/interfaces/Station.ts b/src/scripts/interfaces/Station.ts index ac1f07f..e3eac88 100644 --- a/src/scripts/interfaces/Station.ts +++ b/src/scripts/interfaces/Station.ts @@ -1,5 +1,5 @@ -import { Availability } from '../../store/storeTypes'; -import ScheduledTrain from './ScheduledTrain'; +import { Availability } from './store/storeTypes'; +import {ScheduledTrain} from './ScheduledTrain'; import StationRoutes from './StationRoutes'; export default interface Station { @@ -8,9 +8,11 @@ export default interface Station { generalInfo?: { name: string; url: string; - + abbr: string; + reqLevel: number; // supportersOnly: boolean; + lines: string; project: string; diff --git a/src/scripts/interfaces/api/TimetablesAPIData.ts b/src/scripts/interfaces/api/TimetablesAPIData.ts index 2defce9..11859f6 100644 --- a/src/scripts/interfaces/api/TimetablesAPIData.ts +++ b/src/scripts/interfaces/api/TimetablesAPIData.ts @@ -38,6 +38,8 @@ export interface TimetableHistory { stopsString?: string; stockString?: string; + stockHistory: string[]; + stockMass?: number; stockLength?: number; maxSpeed?: number; diff --git a/src/store/storeTypes.ts b/src/scripts/interfaces/store/storeTypes.ts similarity index 71% rename from src/store/storeTypes.ts rename to src/scripts/interfaces/store/storeTypes.ts index f874743..41cdd87 100644 --- a/src/store/storeTypes.ts +++ b/src/scripts/interfaces/store/storeTypes.ts @@ -1,78 +1,79 @@ -import { Socket } from 'socket.io-client'; -import { DataStatus } from '../scripts/enums/DataStatus'; -import StationAPIData from '../scripts/interfaces/api/StationAPIData'; -import { TrainAPIData } from '../scripts/interfaces/api/TrainAPIData'; -import Station from '../scripts/interfaces/Station'; -import Train from '../scripts/interfaces/Train'; -import { DispatcherStatsAPIData } from '../scripts/interfaces/api/DispatcherStatsAPIData'; -import { DriverStatsAPIData } from '../scripts/interfaces/api/DriverStatsAPIData'; - -export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault'; - -export interface StoreState { - stationList: Station[]; - trainList: Train[]; - apiData: APIData; - - lastDispatcherStatuses: { hash: string; statusTimestamp: number; statusID: string }[]; - - sceneryData: any[][]; - - region: { id: string; value: string }; - trainCount: number; - stationCount: number; - - webSocket?: Socket; - isOffline: boolean; - - dispatcherStatsName: string; - dispatcherStatsData?: DispatcherStatsAPIData; - - driverStatsName: string; - driverStatsData?: DriverStatsAPIData; - driverStatsStatus: DataStatus; - - chosenModalTrainId?: string; - - currentStatsTab: 'daily' | 'driver'; - - dataStatuses: { - connection: DataStatus; - sceneries: DataStatus; - timetables: DataStatus; - dispatchers: DataStatus; - trains: DataStatus; - }; - - listenerLaunched: boolean; - blockScroll: boolean; -} - -export interface APIData { - stations?: StationAPIData[]; - dispatchers?: string[][]; - trains?: TrainAPIData[]; - connectedSocketCount: number; -} - -export interface StationJSONData { - name: string; - url: string; - lines: string; - project: string; - projectUrl: string; - - reqLevel: number; - - signalType: string; - controlType: string; - - SUP: boolean; - - routes: string; - - checkpoints: string | null; - authors?: string; - - availability: Availability; -} +import { Socket } from 'socket.io-client'; +import { DataStatus } from '../../enums/DataStatus'; +import StationAPIData from '../api/StationAPIData'; +import { TrainAPIData } from '../api/TrainAPIData'; +import Station from '../Station'; +import Train from '../Train'; +import { DispatcherStatsAPIData } from '../api/DispatcherStatsAPIData'; +import { DriverStatsAPIData } from '../api/DriverStatsAPIData'; + +export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault'; + +export interface StoreState { + stationList: Station[]; + trainList: Train[]; + apiData: APIData; + + lastDispatcherStatuses: { hash: string; statusTimestamp: number; statusID: string }[]; + + sceneryData: any[][]; + + region: { id: string; value: string }; + trainCount: number; + stationCount: number; + + webSocket?: Socket; + isOffline: boolean; + + dispatcherStatsName: string; + dispatcherStatsData?: DispatcherStatsAPIData; + + driverStatsName: string; + driverStatsData?: DriverStatsAPIData; + driverStatsStatus: DataStatus; + + chosenModalTrainId?: string; + + currentStatsTab: 'daily' | 'driver'; + + dataStatuses: { + connection: DataStatus; + sceneries: DataStatus; + timetables: DataStatus; + dispatchers: DataStatus; + trains: DataStatus; + }; + + listenerLaunched: boolean; + blockScroll: boolean; +} + +export interface APIData { + stations?: StationAPIData[]; + dispatchers?: string[][]; + trains?: TrainAPIData[]; + connectedSocketCount: number; +} + +export interface StationJSONData { + name: string; + abbr: string; + url: string; + lines: string; + project: string; + projectUrl: string; + + reqLevel: number; + + signalType: string; + controlType: string; + + SUP: boolean; + + routes: string; + + checkpoints: string | null; + authors?: string; + + availability: Availability; +} diff --git a/src/scripts/utils/apiURLs.ts b/src/scripts/utils/apiURLs.ts index fe47142..afe5bb2 100644 --- a/src/scripts/utils/apiURLs.ts +++ b/src/scripts/utils/apiURLs.ts @@ -1,7 +1,7 @@ export const URLs = { stacjownikAPI: import.meta.env.VITE_APP_API_DEV == 1 && !import.meta.env.PROD - ? 'http://localhost:3000' + ? 'http://localhost:3001' : 'https://spythere.pl', stacjownikAPIDev: 'localhost:3000', }; diff --git a/src/scripts/utils/storeUtils.ts b/src/scripts/utils/storeUtils.ts index 57d0062..06b2ca7 100644 --- a/src/scripts/utils/storeUtils.ts +++ b/src/scripts/utils/storeUtils.ts @@ -1,4 +1,4 @@ -import ScheduledTrain from '../interfaces/ScheduledTrain'; +import { ScheduledTrain, StopStatus } from '../interfaces/ScheduledTrain'; import Train from '../interfaces/Train'; import TrainStop from '../interfaces/TrainStop'; @@ -74,32 +74,32 @@ export const parseSpawns = (spawnString: string) => { export const getTimestamp = (date: string | null): number => (date ? new Date(date).getTime() : 0); export const getTrainStopStatus = (stopInfo: TrainStop, currentStationName: string, stationName: string) => { - let stopStatus = '', + let stopStatus = StopStatus['arriving'], stopLabel = '', stopStatusID = -1; if (stopInfo.terminatesHere && stopInfo.confirmed) { - stopStatus = 'terminated'; + stopStatus = StopStatus['terminated']; stopLabel = 'Skończył bieg'; stopStatusID = 5; } else if (!stopInfo.terminatesHere && stopInfo.confirmed && currentStationName == stationName) { - stopStatus = 'departed'; + stopStatus = StopStatus['departed']; stopLabel = 'Odprawiony'; stopStatusID = 2; } else if (!stopInfo.terminatesHere && stopInfo.confirmed && currentStationName != stationName) { - stopStatus = 'departed-away'; + stopStatus = StopStatus['departed-away']; stopLabel = 'Odjechał'; stopStatusID = 4; } else if (currentStationName == stationName && !stopInfo.stopped) { - stopStatus = 'online'; + stopStatus = StopStatus['online']; stopLabel = 'Na stacji'; stopStatusID = 0; } else if (currentStationName == stationName && stopInfo.stopped) { - stopStatus = 'stopped'; + stopStatus = StopStatus['stopped']; stopLabel = 'Postój'; stopStatusID = 1; } else if (currentStationName != stationName) { - stopStatus = 'arriving'; + stopStatus = StopStatus['arriving']; stopLabel = 'W drodze'; stopStatusID = 3; } @@ -122,7 +122,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN for (let i = trainStopIndex - 1; i >= 0; i--) { if (/strong|podg/g.test(followingStops[i].stopName)) { - prevStationName = followingStops[i].stopNameRAW.replace(/,.*/g,""); + prevStationName = followingStops[i].stopNameRAW.replace(/,.*/g, ''); break; } @@ -130,7 +130,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN for (let i = trainStopIndex + 1; i < followingStops.length; i++) { if (/strong|podg/g.test(followingStops[i].stopName)) { - nextStationName = followingStops[i].stopNameRAW.replace(/,.*/g,""); + nextStationName = followingStops[i].stopNameRAW.replace(/,.*/g, ''); break; } @@ -172,7 +172,6 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN signal: train.signal, connectedTrack: train.connectedTrack, - driverName: train.driverName, driverId: train.driverId, currentStationName: train.currentStationName, diff --git a/src/store/stationFiltersStore.ts b/src/store/stationFiltersStore.ts index ca48eb9..9deda5c 100644 --- a/src/store/stationFiltersStore.ts +++ b/src/store/stationFiltersStore.ts @@ -1,18 +1,18 @@ import { defineStore } from 'pinia'; import inputData from '../data/options.json'; -import Filter from '../scripts/interfaces/Filter'; import Station from '../scripts/interfaces/Station'; import StorageManager from '../scripts/managers/storageManager'; import { useStore } from './store'; import { filterInitStates } from './constants/initFilterStates'; import { filterStations, sortStations } from './utils/filterUtils'; +import { HeadIdsTypes } from '../scripts/data/stationHeaderNames'; export const useStationFiltersStore = defineStore('stationFiltersStore', { state() { return { inputs: inputData, filters: { ...filterInitStates }, - sorterActive: { index: 0, dir: 1 }, + sorterActive: { headerName: 'station' as HeadIdsTypes, dir: 1 }, store: useStore(), lastClickedFilterId: '', }; @@ -89,13 +89,11 @@ export const useStationFiltersStore = defineStore('stationFiltersStore', { }); }, - changeSorter(index: number) { - if (index > 4 && index < 7) return; - - if (index == this.sorterActive.index) this.sorterActive.dir = -1 * this.sorterActive.dir; + changeSorter(headerName: HeadIdsTypes) { + if (headerName == this.sorterActive.headerName) this.sorterActive.dir = -1 * this.sorterActive.dir; else this.sorterActive.dir = 1; - this.sorterActive.index = index; + this.sorterActive.headerName = headerName; }, }, }); diff --git a/src/store/store.ts b/src/store/store.ts index 7af3b94..96a4ef8 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -3,7 +3,7 @@ import { defineStore } from 'pinia'; import { io } from 'socket.io-client'; import { DataStatus } from '../scripts/enums/DataStatus'; import StationAPIData from '../scripts/interfaces/api/StationAPIData'; -import ScheduledTrain from '../scripts/interfaces/ScheduledTrain'; +import {ScheduledTrain} from '../scripts/interfaces/ScheduledTrain'; import Station from '../scripts/interfaces/Station'; import StationRoutes from '../scripts/interfaces/StationRoutes'; import Train from '../scripts/interfaces/Train'; @@ -15,7 +15,7 @@ import { getScheduledTrain, parseSpawns, } from '../scripts/utils/storeUtils'; -import { APIData, StationJSONData, StoreState } from './storeTypes'; +import { APIData, StationJSONData, StoreState } from '../scripts/interfaces/store/storeTypes'; export const useStore = defineStore('store', { state: () => diff --git a/src/store/utils/filterUtils.ts b/src/store/utils/filterUtils.ts index 02a3c7b..8755bfe 100644 --- a/src/store/utils/filterUtils.ts +++ b/src/store/utils/filterUtils.ts @@ -1,34 +1,40 @@ +import { HeadIdsTypes } from '../../scripts/data/stationHeaderNames'; import Filter from '../../scripts/interfaces/Filter'; import Station from '../../scripts/interfaces/Station'; -export const sortStations = (a: Station, b: Station, sorter: { index: number; dir: number }) => { - switch (sorter.index) { - case 0: +export const sortStations = (a: Station, b: Station, sorter: { headerName: HeadIdsTypes; dir: number }) => { + switch (sorter.headerName) { + case 'station': return sorter.dir == 1 ? a.name.localeCompare(b.name) : b.name.localeCompare(a.name); - case 1: + case 'abbr': + if ((a.generalInfo?.abbr || '') > (b.generalInfo?.abbr || '')) return sorter.dir; + if ((a.generalInfo?.abbr || '') < (b.generalInfo?.abbr || '')) return -sorter.dir; + break; + + case 'min-lvl': if ((a.generalInfo?.reqLevel || 0) > (b.generalInfo?.reqLevel || 0)) return sorter.dir; if ((a.generalInfo?.reqLevel || 0) < (b.generalInfo?.reqLevel || 0)) return -sorter.dir; break; - case 2: + case 'status': if ((a.onlineInfo?.statusTimestamp || 0) > (b.onlineInfo?.statusTimestamp || 0)) return sorter.dir; if ((a.onlineInfo?.statusTimestamp || 0) < (b.onlineInfo?.statusTimestamp || 0)) return -sorter.dir; break; - case 3: + case 'dispatcher': if ((a.onlineInfo?.dispatcherName.toLowerCase() || '') > (b.onlineInfo?.dispatcherName.toLowerCase() || '')) return sorter.dir; if ((a.onlineInfo?.dispatcherName.toLowerCase() || '') < (b.onlineInfo?.dispatcherName.toLowerCase() || '')) return -sorter.dir; break; - case 4: + case 'dispatcher-lvl': if ((a.onlineInfo?.dispatcherExp || 0) > (b.onlineInfo?.dispatcherExp || 0)) return sorter.dir; if ((a.onlineInfo?.dispatcherExp || 0) < (b.onlineInfo?.dispatcherExp || 0)) return -sorter.dir; break; - case 7: + case 'user': if ((a.onlineInfo?.currentUsers || 0) > (b.onlineInfo?.currentUsers || 0)) return sorter.dir; if ((a.onlineInfo?.currentUsers || 0) < (b.onlineInfo?.currentUsers || 0)) return -sorter.dir; @@ -36,13 +42,13 @@ export const sortStations = (a: Station, b: Station, sorter: { index: number; di if ((a.onlineInfo?.maxUsers || 0) < (b.onlineInfo?.maxUsers || 0)) return -sorter.dir; break; - case 8: + case 'spawn': if ((a.onlineInfo?.spawns.length || 0) > (b.onlineInfo?.spawns.length || 0)) return sorter.dir; if ((a.onlineInfo?.spawns.length || 0) < (b.onlineInfo?.spawns.length || 0)) return -sorter.dir; break; - case 9: + case 'timetable': if ((a.onlineInfo?.scheduledTrains?.length || 0) > (b.onlineInfo?.scheduledTrains?.length || 0)) return sorter.dir; if ((a.onlineInfo?.scheduledTrains?.length || 0) < (b.onlineInfo?.scheduledTrains?.length || 0)) diff --git a/src/styles/badge.scss b/src/styles/badge.scss index f574e18..bc00ce0 100644 --- a/src/styles/badge.scss +++ b/src/styles/badge.scss @@ -4,12 +4,11 @@ display: inline-block; padding: 0; - background: #585858; - margin: 0.25em; span { display: inline-block; + background: #585858; padding: 0.2em 0.4em; } diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index 0a257c0..b9d2f73 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -52,17 +52,6 @@ export default defineComponent({ mounted() { this.filterStore.setupFilters(); - // this.filterStore.inputs.options.forEach((option) => { - // const value = StorageManager.getBooleanValue(option.name); - // option.value = value; - // this.filterStore.changeFilterValue({ name: option.name, value: value }); - // }); - - // this.filterStore.inputs.sliders.forEach((slider) => { - // const value = StorageManager.getNumericValue(slider.name); - // slider.value = value; - // this.filterStore.changeFilterValue({ name: slider.name, value: value }); - // }); }, }); |
|---|