-
@@ -223,9 +222,6 @@ export default defineComponent({
.filter-actions {
display: flex;
- gap: 0.5em;
- width: 100%;
-
margin-top: 1em;
> * {
diff --git a/src/data/options.json b/src/data/options.json
index 64badce..be322e2 100644
--- a/src/data/options.json
+++ b/src/data/options.json
@@ -4,6 +4,7 @@
"timetables",
"reality",
"package-access",
+ "station-type",
"access",
"control",
"blockades",
@@ -61,6 +62,20 @@
"value": false,
"defaultValue": false
},
+ {
+ "id": "junction",
+ "name": "junction",
+ "section": "station-type",
+ "value": true,
+ "defaultValue": true
+ },
+ {
+ "id": "nonJunction",
+ "name": "nonJunction",
+ "section": "station-type",
+ "value": true,
+ "defaultValue": true
+ },
{
"id": "SPK",
"name": "SPK",
diff --git a/src/locales/en.json b/src/locales/en.json
index 4443ce5..c0143cb 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -174,6 +174,7 @@
"sections": {
"quick": "QUICK FILTERS",
+ "station-type": "STATION TYPE",
"reality": "SCENERY REALITY",
"package-access": "IN-GAME AVAILABILITY",
"access": "GENERAL AVAILABILITY",
@@ -233,6 +234,9 @@
"withActiveTimetables": "ACTIVE",
"withoutActiveTimetables": "NO ACTIVE",
+ "junction": "JUNCTIONS",
+ "nonJunction": "OTHER",
+
"sliders": {
"min-lvl": "MIN. REQUIRED DISPATCHER LEVEL",
"max-lvl": "MAX. REQUIRED DISPATCHER LEVEL",
@@ -299,11 +303,10 @@
"station-stats": {
"u-factor": "U-factor",
"u-factor-tooltip": "(?) Current server traffic factor (driver count divided by dispatcher count)",
- "avg-timetable-count": "Average timetable count for one dispatcher:",
- "single-track-count": "Available single track routes:",
- "double-track-count": "Available double track routes:",
- "electrified": "(electrified)",
- "not-electrified": "(not electr.)",
+ "med-timetable-count": "Median of scenery timetables:",
+ "single-track-count": "Single track routes:",
+ "double-track-count": "Double track routes:",
+ "cross-sceneries": "Cross-track sceneries (1-track <-> 2-track)",
"open-spawns": "Open spawns:"
},
"trains": {
diff --git a/src/locales/pl.json b/src/locales/pl.json
index 17573ae..9ad41ee 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -108,8 +108,8 @@
"filters": "FILTRY",
"donate": "WESPRZYJ",
- "search-button": "Szukaj",
- "reset-button": "Zresetuj",
+ "search-button": "SZUKAJ",
+ "reset-button": "ZRESETUJ",
"sort-title": "SORTUJ WG:",
"filter-title": "FILTRUJ WG:",
@@ -171,6 +171,7 @@
"sections": {
"quick": "SZYBKIE FILTRY",
+ "station-type": "RODZAJ STACJI",
"reality": "FIKCYJNOŚĆ SCENERII",
"package-access": "DOSTĘPNOŚĆ W PACZCE",
"access": "DOSTĘPNOŚĆ OGÓLNA",
@@ -229,6 +230,9 @@
"withActiveTimetables": "AKTYWNE",
"withoutActiveTimetables": "BEZ AKTYWNYCH",
+ "junction": "WĘZŁOWE",
+ "nonJunction": "INNE",
+
"sliders": {
"min-lvl": "MIN. WYMAGANY POZIOM DYŻURNEGO",
"max-lvl": "MAKS. WYMAGANY POZIOM DYŻURNEGO",
@@ -292,11 +296,10 @@
"station-stats": {
"u-factor": "Współczynnik Ugla",
"u-factor-tooltip": "(?) Współczynnik ruchu na serwerze (liczba maszynistów online dzielona na liczbę dyżurnych ruchu)",
- "avg-timetable-count": "Średnia liczba rozkładów jazdy na dyżurnego:",
- "single-track-count": "Dostępne szlaki jednotorowe:",
- "double-track-count": "Dostępne szlaki dwutorowe:",
- "electrified": "(zelektr.)",
- "not-electrified": "(niezelektr.)",
+ "med-timetable-count": "Mediana rozkładów jazdy na sceneriach:",
+ "single-track-count": "Szlaki jednotorowe:",
+ "double-track-count": "Szlaki dwutorowe:",
+ "cross-sceneries": "Scenerie przejściowe (1-tor <-> 2-tor):",
"open-spawns": "Otwarte spawny:"
},
"trains": {
diff --git a/src/main.ts b/src/main.ts
index d359bd7..a58eb39 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -5,10 +5,15 @@ import router from './router';
import i18n from './i18n';
import { createPinia } from 'pinia';
-import useCustomSW from './mixins/useCustomSW';
+import { registerSW } from 'virtual:pwa-register';
// Service worker
-useCustomSW();
+registerSW({
+ immediate: true,
+ onNeedRefresh() {
+ console.log('Needs refresh!');
+ }
+});
const clickOutsideDirective: Directive = {
mounted(el, binding) {
diff --git a/src/mixins/useCustomSW.ts b/src/mixins/useCustomSW.ts
deleted file mode 100644
index a8d03d0..0000000
--- a/src/mixins/useCustomSW.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { useRegisterSW } from 'virtual:pwa-register/vue';
-
-export default () => {
- const { needRefresh, updateServiceWorker, offlineReady } = useRegisterSW({
- immediate: true
- });
-
- return {
- needRefresh,
- updateServiceWorker,
- offlineReady
- };
-};
diff --git a/src/scripts/utils/stationFilterUtils.ts b/src/scripts/utils/stationFilterUtils.ts
index 1bc04a1..d483f89 100644
--- a/src/scripts/utils/stationFilterUtils.ts
+++ b/src/scripts/utils/stationFilterUtils.ts
@@ -229,6 +229,13 @@ export const filterStations = (station: Station, filters: Filter) => {
!authors?.map((a) => a.toLocaleLowerCase()).includes(filters['authors'].toLocaleLowerCase())
)
return false;
+
+ const singleTracks = routes.single.filter((r) => !r.isInternal);
+ const doubleTracks = routes.double.filter((r) => !r.isInternal);
+
+ let isJunction = singleTracks.length > 0 && doubleTracks.length > 0;
+ if (filters['junction'] && isJunction) return false;
+ if (filters['nonJunction'] && !isJunction) return false;
}
return true;
diff --git a/src/store/stationFiltersStore.ts b/src/store/stationFiltersStore.ts
index f3b570b..191ddba 100644
--- a/src/store/stationFiltersStore.ts
+++ b/src/store/stationFiltersStore.ts
@@ -30,12 +30,6 @@ const filterInitStates: Filter = {
mieszana: false,
SBL: false,
PBL: false,
- minLevel: 0,
- maxLevel: 20,
- minOneWayCatenary: 0,
- minOneWay: 0,
- minTwoWayCatenary: 0,
- minTwoWay: 0,
'include-selected': false,
'no-1track': false,
'no-2track': false,
@@ -52,10 +46,20 @@ const filterInitStates: Filter = {
unsignedStatus: false,
withActiveTimetables: false,
withoutActiveTimetables: false,
+
+ junction: false,
+ nonJunction: false,
+
maxVmax: 200,
minVmax: 0,
authors: '',
- onlineFromHours: 0
+ onlineFromHours: 0,
+ minLevel: 0,
+ maxLevel: 20,
+ minOneWayCatenary: 0,
+ minOneWay: 0,
+ minTwoWayCatenary: 0,
+ minTwoWay: 0
};
export const useStationFiltersStore = defineStore('stationFiltersStore', {
diff --git a/src/store/utils.ts b/src/store/utils.ts
index 43c131c..36413e1 100644
--- a/src/store/utils.ts
+++ b/src/store/utils.ts
@@ -9,12 +9,6 @@ import {
ScenerySpawnType
} from '../typings/common';
-export function getLocoURL(locoType: string): string {
- return `https://rj.td2.info.pl/dist/img/thumbnails/${
- locoType.includes('EN') ? locoType + 'rb' : locoType
- }.png`;
-}
-
export function getStatusTimestamp(stationStatus: any): number {
if (!stationStatus) return -2;
diff --git a/src/styles/global.scss b/src/styles/global.scss
index c6ce8e6..12fa47c 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -121,8 +121,6 @@ input {
height: 7px;
background-color: lightgreen;
border-radius: 50%;
-
- margin-left: 10px;
}
a {
diff --git a/src/views/JournalDispatchers.vue b/src/views/JournalDispatchers.vue
index b47fdfb..785ef21 100644
--- a/src/views/JournalDispatchers.vue
+++ b/src/views/JournalDispatchers.vue
@@ -17,8 +17,9 @@
-
- {{ $t('journal.data-refreshed-at') }}: {{ dataRefreshedAt.toLocaleString($i18n.locale) }}
+
+ {{ $t('journal.data-refreshed-at') }}:
+ {{ dataRefreshedAt?.toLocaleString($i18n.locale) ?? '---' }}
diff --git a/src/views/JournalTimetables.vue b/src/views/JournalTimetables.vue
index 519f0a6..9a72e0e 100644
--- a/src/views/JournalTimetables.vue
+++ b/src/views/JournalTimetables.vue
@@ -17,8 +17,9 @@
-
- {{ $t('journal.data-refreshed-at') }}: {{ dataRefreshedAt.toLocaleString($i18n.locale) }}
+
+ {{ $t('journal.data-refreshed-at') }}:
+ {{ dataRefreshedAt?.toLocaleString($i18n.locale) ?? '---' }}
diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue
index d67209a..6a4c20d 100644
--- a/src/views/StationsView.vue
+++ b/src/views/StationsView.vue
@@ -84,6 +84,7 @@ export default defineComponent({
.stations-options {
display: flex;
justify-content: space-between;
+ flex-wrap: wrap;
gap: 0.5em;
margin-bottom: 0.5em;
diff --git a/vite.config.ts b/vite.config.ts
index 58c5daa..2452fc7 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -20,8 +20,8 @@ export default defineConfig({
cleanupOutdatedCaches: true,
runtimeCaching: [
{
- urlPattern: new RegExp('^https://stacjownik.spythere.eu/api/getSceneries', 'i'),
- handler: 'CacheFirst',
+ urlPattern: /^https:\/\/stacjownik.spythere.eu\/api\/getSceneries/i,
+ handler: 'StaleWhileRevalidate',
options: {
cacheName: 'spythere-sceneries-cache',
cacheableResponse: {
@@ -30,20 +30,10 @@ export default defineConfig({
}
},
{
- urlPattern: new RegExp('^https://rj.td2.info.pl/dist/img/thumbnails/*', 'i'),
+ urlPattern: /^https:\/\/static.spythere.eu\/.*/i,
handler: 'CacheFirst',
options: {
- cacheName: 'swdr-images-cache',
- cacheableResponse: {
- statuses: [0, 200, 404]
- }
- }
- },
- {
- urlPattern: new RegExp('^https://static.spythere.eu/images/*', 'i'),
- handler: 'CacheFirst',
- options: {
- cacheName: 'spythere-images-cache',
+ cacheName: 'spythere-static-cache',
cacheableResponse: {
statuses: [0, 200]
}