From c8d56ec4422be4a03e0c0f10e152211e8f8988fe Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 29 Feb 2024 13:31:48 +0100 Subject: [PATCH 01/27] vite config dev --- vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 31ade3f..2fb6b44 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,7 +4,8 @@ import { VitePWA } from 'vite-plugin-pwa'; export default defineConfig({ server: { - port: 5001 + port: 5001, + open: true }, publicDir: 'public', plugins: [ From 7e3c150815a6c46ccc1efc47f3973e3ae82d99b6 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 1 Mar 2024 19:07:00 +0100 Subject: [PATCH 02/27] =?UTF-8?q?usprawnienia=20miniaturek=20pojazd=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Global/StockList.vue | 45 +++++++--- src/components/Global/TrainThumbnail.vue | 85 ------------------- .../JournalTimetables/TimetableExtra.vue | 10 --- src/components/TrainsView/TrainInfo.vue | 17 +--- src/store/apiStore.ts | 14 --- src/typings/api.ts | 16 ---- 6 files changed, 39 insertions(+), 148 deletions(-) delete mode 100644 src/components/Global/TrainThumbnail.vue diff --git a/src/components/Global/StockList.vue b/src/components/Global/StockList.vue index 7e49985..5e07ff9 100644 --- a/src/components/Global/StockList.vue +++ b/src/components/Global/StockList.vue @@ -1,7 +1,7 @@ - - - - diff --git a/src/components/JournalView/JournalTimetables/TimetableExtra.vue b/src/components/JournalView/JournalTimetables/TimetableExtra.vue index 5558533..50b9d3b 100644 --- a/src/components/JournalView/JournalTimetables/TimetableExtra.vue +++ b/src/components/JournalView/JournalTimetables/TimetableExtra.vue @@ -53,7 +53,6 @@ - - diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index 7c772ce..0b9064a 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -97,13 +97,11 @@
- +
- {{ train.locoType }} -  • {{ $t('trains.cars') }}: - {{ train.stockList.length - 1 }} + {{ $t('trains.cars') }}: {{ train.stockList.length - 1 }}
@@ -125,13 +123,13 @@ import styleMixin from '../../mixins/styleMixin'; import trainInfoMixin from '../../mixins/trainInfoMixin'; import Train from '../../scripts/interfaces/Train'; import ProgressBar from '../Global/ProgressBar.vue'; -import TrainThumbnail from '../Global/TrainThumbnail.vue'; import { useMainStore } from '../../store/mainStore'; import { useApiStore } from '../../store/apiStore'; +import StockList from '../Global/StockList.vue'; export default defineComponent({ mixins: [trainInfoMixin, styleMixin], - components: { ProgressBar, TrainThumbnail }, + components: { ProgressBar, StockList }, props: { train: { @@ -153,13 +151,6 @@ export default defineComponent({ }); - - - diff --git a/src/http.ts b/src/http.ts deleted file mode 100644 index 2a8d224..0000000 --- a/src/http.ts +++ /dev/null @@ -1,10 +0,0 @@ -import axios from 'axios'; - -const http = axios.create({ - baseURL: - import.meta.env.VITE_API_MODE === 'development' - ? 'http://localhost:3001' - : 'https://stacjownik.spythere.eu' -}); - -export default http; diff --git a/src/store/apiStore.ts b/src/store/apiStore.ts index 2279f33..49de11a 100644 --- a/src/store/apiStore.ts +++ b/src/store/apiStore.ts @@ -1,12 +1,18 @@ import { defineStore } from 'pinia'; -import http from '../http'; import { API } from '../typings/api'; import { Status } from '../typings/common'; import { StationJSONData } from './typings'; +import axios, { AxiosInstance } from 'axios'; // Update seconds cron for active data scheduler const UPDATE_SECONDS = [3, 23, 43]; +export enum APIMode { + PRODUCTION = 0, + DEV = 1, + MOCK = 2 +} + export const useApiStore = defineStore('apiStore', { state: () => ({ dataStatuses: { @@ -18,11 +24,34 @@ export const useApiStore = defineStore('apiStore', { donatorsData: [] as API.Donators.Response, sceneryData: [] as StationJSONData[], + client: undefined as AxiosInstance | undefined, + activeDataScheduler: undefined as number | undefined }), actions: { async setupAPIData() { + let baseURL = 'https://stacjownik.spythere.eu'; + + switch (import.meta.env.VITE_API_MODE) { + case 'development': + baseURL = 'http://localhost:3001'; + break; + case 'mocking': + baseURL = 'http://localhost:3123'; + break; + default: + break; + } + + this.client = axios.create({ + baseURL + }); + + this.connectToAPI(); + }, + + async connectToAPI() { // Static data this.fetchDonatorsData(); this.fetchStationsGeneralInfo(); @@ -46,7 +75,7 @@ export const useApiStore = defineStore('apiStore', { async fetchActiveData() { try { - const response = await http.get('api/getActiveData'); + const response = await this.client!.get('api/getActiveData'); this.activeData = response.data; this.dataStatuses.connection = Status.Data.Loaded; @@ -60,7 +89,7 @@ export const useApiStore = defineStore('apiStore', { async fetchDonatorsData() { try { - const response = await http.get('api/getDonators'); + const response = await this.client!.get('api/getDonators'); this.donatorsData = response.data; } catch (error) { @@ -69,8 +98,9 @@ export const useApiStore = defineStore('apiStore', { }, async fetchStationsGeneralInfo() { - const sceneryData: StationJSONData[] = (await http.get('api/getSceneries')) - .data; + const sceneryData: StationJSONData[] = ( + await this.client!.get('api/getSceneries') + ).data; if (!sceneryData) { this.dataStatuses.sceneries = Status.Data.Error; diff --git a/src/views/JournalDispatchers.vue b/src/views/JournalDispatchers.vue index 297c5e2..b47fdfb 100644 --- a/src/views/JournalDispatchers.vue +++ b/src/views/JournalDispatchers.vue @@ -37,7 +37,6 @@ diff --git a/src/components/Global/RegionDropdown.vue b/src/components/Global/RegionDropdown.vue index d515ce1..42fc10b 100644 --- a/src/components/Global/RegionDropdown.vue +++ b/src/components/Global/RegionDropdown.vue @@ -59,8 +59,6 @@ export default defineComponent({ 'store.region.id': { handler(regionId) { this.selectedItemIndex = this.regionList.findIndex((reg) => reg.id == regionId); - - console.log('region id', regionId); } }, '$route.query.region': { diff --git a/src/components/Global/StockList.vue b/src/components/Global/StockList.vue index 3a4429b..8ac4d48 100644 --- a/src/components/Global/StockList.vue +++ b/src/components/Global/StockList.vue @@ -98,8 +98,6 @@ export default defineComponent({ fallbackName += isCarPassenger ? 'passenger' : 'cargo'; } - console.log(stockName, fallbackName); - (event.target as HTMLImageElement).src = `/images/icon-${fallbackName}.png`; } } diff --git a/src/components/StationsView/StationFilterCard.vue b/src/components/StationsView/StationFilterCard.vue index ad7f89a..c7baad9 100644 --- a/src/components/StationsView/StationFilterCard.vue +++ b/src/components/StationsView/StationFilterCard.vue @@ -256,8 +256,6 @@ export default defineComponent({ }, handleAuthorsInput() { - console.log(this.authorsInputValue); - this.filterStore.changeFilterValue('authors', this.authorsInputValue); if (this.saveOptions) StorageManager.setStringValue('authors', this.authorsInputValue); diff --git a/src/locales/en.json b/src/locales/en.json index 8630c2c..11ae77d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2,6 +2,7 @@ "donations": { "button-title": "TOSS A COIN", "header": "Toss a coin to Stacjownik!", + "donator-title": "Project is supported by more than {count} people, including:", "p1": "Hello o7! This is Spythere, the creator of Stacjownik, Pojazdownik and several other applications that enhance the gameplay of Train Driver 2!", "p2": "{b1} is a completely free tool, created and continuously developed for the Train Driver 2 simulator community since 2020. However, a part of the project is sustained solely through my private financial contribution. Features such as {b2} or {b3} (operating on my {link} - to which you are warmly invited) must function on a dedicated server where they can collect and process data, and then display it on the website.", "p2-b1": "Stacjownik", diff --git a/src/locales/pl.json b/src/locales/pl.json index 2cfd36d..ecf8f06 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -2,6 +2,7 @@ "donations": { "button-title": "GROSZA DAJ", "header": "Grosza daj Stacjownikowi!", + "donator-title": "Projekt wspiera już ponad {count} osób, w tym:", "p1": "Hej o7! Z tej strony Spythere, twórca Stacjownika, Pojazdownika oraz kilku innych aplikacji wspomagających rozgrywkę symulatora Train Driver 2!", "p2": "{b1} to narzędzie całkowicie darmowe, tworzone i rozwijane dla społeczności symulatora TD2 nieprzerwanie od 2020 roku. Jednakże, część projektu jest podtrzymywana wyłącznie dzięki mojemu prywatnemu wkładowi finansowemu. Funkcje takie jak {b2} czy też {b3} działający na moim {link} (na który serdeczne zapraszam) muszą działać na wydzielonym serwerze, gdzie będą mogły zbierać i przetwarzać dane, aby następnie pokazać je na stronie.", "p2-b1": "Stacjownik", diff --git a/src/styles/global.scss b/src/styles/global.scss index 94e5cef..0d3e79b 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -49,6 +49,9 @@ body { padding: 0; font-family: 'Quicksand', sans-serif; font-weight: 500; + text-rendering: optimizeLegibility !important; + -webkit-font-smoothing: antialiased !important; + overflow-y: scroll; &.no-scroll { diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index f6f419a..e52f9de 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -8,9 +8,18 @@ ref="filterCardRef" /> - + +
@@ -109,4 +118,20 @@ export default defineComponent({ margin-bottom: 0.5em; } + +button.btn-donation { + $btnColor: #254069; + + background-color: $btnColor; + + &:hover { + background-color: lighten($btnColor, 5%); + } + + @include smallScreen { + span { + display: none; + } + } +} From 5f8d7480d114dbc01c40a9dc368e5dd9d1eab7cf Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 14:46:37 +0100 Subject: [PATCH 11/27] fix designu --- src/components/Global/StockList.vue | 26 +++++++++++++++++++++---- src/components/TrainsView/TrainInfo.vue | 10 ++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/Global/StockList.vue b/src/components/Global/StockList.vue index 8ac4d48..bc4bc80 100644 --- a/src/components/Global/StockList.vue +++ b/src/components/Global/StockList.vue @@ -1,6 +1,22 @@ From a7861b361dbb0e4aae48bfdc4f086b9bf44e6869 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 15:10:29 +0100 Subject: [PATCH 12/27] =?UTF-8?q?design=20statystyk=20poci=C4=85gu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TrainsView/TrainInfo.vue | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index d730570..3aae1b5 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -100,17 +100,18 @@
- - - {{ `${~~((train as any)[stat.name] * (stat.multiplier || 1))}${stat.unit}` }} - - -
+ {{ train.speed }}km/h - - {{ $t('trains.cars') }}: {{ train.stockList.length - 1 }} - +
+ {{ train.length }}m + • + {{ (train.mass / 1000).toFixed(1) }}t + + • + {{ $t('trains.cars') }}: {{ train.stockList.length - 1 }} + +
+ @@ -167,7 +168,7 @@ export default defineComponent({ flex-direction: column; text-align: center; - gap: 0.25em; + gap: 0.5em; } .train-info { From 6f45663c6c5f1add2bbf784af29a56dd489ef004 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 19:04:17 +0100 Subject: [PATCH 13/27] design stock listy --- src/components/Global/StockList.vue | 2 +- src/components/TrainsView/TrainInfo.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Global/StockList.vue b/src/components/Global/StockList.vue index bc4bc80..256dceb 100644 --- a/src/components/Global/StockList.vue +++ b/src/components/Global/StockList.vue @@ -150,7 +150,7 @@ img { p { text-align: center; color: #aaa; - font-size: 0.9em; + font-size: 0.95em; margin-bottom: 1em; } diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index 3aae1b5..0e90e00 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -168,7 +168,7 @@ export default defineComponent({ flex-direction: column; text-align: center; - gap: 0.5em; + line-height: 1.5em; } .train-info { From 9f5d882119361d2f8fe91d7bd3651bf1832af269 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 20:30:05 +0100 Subject: [PATCH 14/27] poprawki tabelki scenerii --- src/components/StationsView/StationTable.vue | 164 ++++++++++--------- src/locales/pl.json | 3 +- src/scripts/data/stationHeaderNames.ts | 3 +- 3 files changed, 88 insertions(+), 82 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index def5b98..10f6603 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -9,6 +9,7 @@ :key="headerName" @click="changeSorter(headerName)" class="header-text" + :class="headerName" >
@@ -146,51 +147,49 @@
-
- - {{ station.generalInfo.routes.doubleElectrifiedNames.length }} - + + {{ station.generalInfo.routes.singleElectrifiedNames.length }} + - - {{ station.generalInfo.routes.doubleOtherNames.length }} - -
+ + {{ station.generalInfo.routes.singleOtherNames.length }} + +
+ -
+ +
+ + {{ station.generalInfo.routes.doubleElectrifiedNames.length }} + -
- - {{ station.generalInfo.routes.singleElectrifiedNames.length }} - - - - {{ station.generalInfo.routes.singleOtherNames.length }} - -
+ + {{ station.generalInfo.routes.doubleOtherNames.length }} +
@@ -360,7 +359,7 @@ export default defineComponent({ }, changeSorter(headerName: HeadIdsTypes) { - if (headerName == 'general' || headerName == 'routes') return; + if (headerName == 'general') return; this.stationFiltersStore.changeSorter(headerName); } @@ -405,7 +404,10 @@ $rowCol: #424242; table { border-collapse: collapse; + table-layout: fixed; width: 100%; + min-width: 1200px; + white-space: wrap; @include smallScreen() { min-width: auto; @@ -419,16 +421,41 @@ table { position: sticky; top: 0; - &.header-text { - min-width: 10em; + &.station { + width: 200px; + } + + &.min-lvl { + width: 100px; + } + + &.status { + width: 140px; + } + + &.dispatcher { + width: 230px; + } + + &.dispatcher-lvl { + width: 100px; + } + + &.routes-double, + &.routes-single { + width: 75px; + } + + &.general { + width: 160px; + } + + &.user { + width: 150px; } &.header-image { - min-width: 65px; - - &.user { - min-width: 80px; - } + width: 50px; } padding: 0.5em 0.25em; @@ -467,10 +494,11 @@ tr { } td { - padding: 0.25em 1em; + padding: 0.15em 0; text-align: center; - cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; &.inactive { opacity: 0.2; @@ -534,11 +562,6 @@ tr { } .station-info { - /* Images */ - display: flex; - gap: 5px; - justify-content: center; - .icon-info { vertical-align: middle; line-height: 32px; @@ -546,6 +569,7 @@ tr { width: 32px; height: 32px; font-size: 12px; + margin: 0 3px; outline: 2px solid #2b2b2b; border-radius: 5px; @@ -553,28 +577,6 @@ tr { } .station-tracks { - & > div { - display: grid; - grid-template-columns: 3em 3px 3em; - gap: 5px; - justify-content: center; - - & > div { - display: flex; - gap: 5px; - - &.double-tracks { - justify-content: flex-end; - } - - &.single-tracks { - justify-content: flex-start; - } - } - } - - text-align: center; - .no-catenary { background-color: #939393; } @@ -589,10 +591,12 @@ tr { } .track { - width: 1.25em; + display: inline-block; text-align: center; + width: 1.3em; padding: 0.35em 0; font-size: 1.1em; + margin: 0 0.2em; } } diff --git a/src/locales/pl.json b/src/locales/pl.json index ecf8f06..13b9e4e 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -231,7 +231,8 @@ "status": "Status", "dispatcher": "Dyżurny", "dispatcher-lvl": "Poziom\ndyżurnego", - "routes": "Szlaki\n2tor {'|'} 1tor", + "routes-single": "Szlaki\n1-torowe", + "routes-double": "Szlaki\n2-torowe", "general": "Informacje\nogólne", "user": "Maszyniści online", "spawn": "Otwarte spawny", diff --git a/src/scripts/data/stationHeaderNames.ts b/src/scripts/data/stationHeaderNames.ts index 7c018e4..39d7597 100644 --- a/src/scripts/data/stationHeaderNames.ts +++ b/src/scripts/data/stationHeaderNames.ts @@ -4,7 +4,8 @@ export const headIds = [ 'status', 'dispatcher', 'dispatcher-lvl', - 'routes', + 'routes-single', + 'routes-double', 'general' ] as const; From 40bbdbe4fab16df2b0f966d1c3ddf693519f13d0 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 21:44:39 +0100 Subject: [PATCH 15/27] =?UTF-8?q?sortowanie=20po=20liczbie=20szlak=C3=B3w?= =?UTF-8?q?=20i=20ocenie=20dy=C5=BCurnego?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StationsView/StationTable.vue | 36 ++++++++++---------- src/scripts/data/stationHeaderNames.ts | 1 + src/scripts/utils/filterUtils.ts | 16 +++++++++ src/store/mainStore.ts | 2 ++ 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 10f6603..7ee0ec4 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -240,8 +240,12 @@ {{ station.onlineInfo?.maxUsers || 0 }} - - {{ station.onlineInfo?.spawns.length || 0 }} + + {{ station.onlineInfo?.dispatcherRate ?? 0 }} + + + + {{ station.onlineInfo?.spawns.length ?? 0 }} { const routes = scenery.routesInfo.reduce( (acc, route) => { + if (route.hidden) return acc; + const tracksKey = route.routeTracks == 2 ? 'double' : 'single'; const isElectric = route.isElectric; const routesKey: keyof StationRoutes = `${tracksKey}${ From 17f6f9c8efe8112beafbb46055f970db02eb6cb5 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 3 Mar 2024 22:17:15 +0100 Subject: [PATCH 16/27] poprawki designu scenerii --- src/components/Global/StationStatusBadge.vue | 2 +- .../SceneryInfo/SceneryInfoDispatcher.vue | 90 ++++++++++--------- src/views/SceneryView.vue | 1 + 3 files changed, 51 insertions(+), 42 deletions(-) diff --git a/src/components/Global/StationStatusBadge.vue b/src/components/Global/StationStatusBadge.vue index 6301d27..7e455a4 100644 --- a/src/components/Global/StationStatusBadge.vue +++ b/src/components/Global/StationStatusBadge.vue @@ -86,7 +86,7 @@ $online: #09a116; $unknown: #b93c3c; .status-badge { - border-radius: 1rem; + border-radius: 1em; font-weight: 500; padding: 0.2em 0.55em; diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoDispatcher.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoDispatcher.vue index 231673e..ca5cb42 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoDispatcher.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoDispatcher.vue @@ -1,15 +1,15 @@ @@ -59,45 +66,46 @@ export default defineComponent({ diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index 4429fdd..054d54a 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -236,6 +236,7 @@ button.back-btn { height: 95vh; min-height: 750px; max-height: 1000px; + overflow: auto; display: flex; flex-direction: column; From 986c7ba95ef119f5c10a40cd9a65919b2aa63086 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 17:46:09 +0100 Subject: [PATCH 17/27] asdek --- public/images/icon-ASDEK.svg | 4 ++++ .../SceneryInfo/SceneryInfoIcons.vue | 24 ++++++++++++------- src/components/StationsView/StationTable.vue | 8 +++++++ src/locales/en.json | 3 ++- src/locales/pl.json | 1 + src/scripts/interfaces/Station.ts | 1 + 6 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 public/images/icon-ASDEK.svg diff --git a/public/images/icon-ASDEK.svg b/public/images/icon-ASDEK.svg new file mode 100644 index 0000000..9fc1ac7 --- /dev/null +++ b/public/images/icon-ASDEK.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue index c06f5af..b7c23fc 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue @@ -28,14 +28,6 @@ >
- SUP (RASP-UZK) - + SUP (RASP-UZK) + + dSAT ASDEK + SUP (RASP-UZK) + + dSAT ASDEK diff --git a/src/locales/en.json b/src/locales/en.json index 11ae77d..0039d70 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -251,7 +251,8 @@ "control-type": "Control type: ", "signals-type": "Signals type: ", "SBL": "This scenery has automatic block signalling (ABS/SBL) system on following routes: ", - "SUP": "Requires the SUP application (level crossing remote control simulator)", + "SUP": "Requires the SUP program (level crossing remote control)", + "ASDEK": "Requires the ASDEK program (defect detection of moving rolling stock)", "TWB-all": "This scenery has two-way route blockade on all routes", "TWB-routes": "This scenery has two-way route blockade on following routes: ", "default": "This scenery is available by default", diff --git a/src/locales/pl.json b/src/locales/pl.json index 13b9e4e..2a4e090 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -245,6 +245,7 @@ "signals-type": "Sygnalizacja: ", "SBL": "Sceneria posiada SBL na szlakach: ", "SUP": "Wymaga programu SUP do kontroli systemu RASP-UZK", + "ASDEK": "Wymaga programu ASDEK do detekcji stanów awaryjnych taboru w ruchu", "default": "Sceneria dostępna domyślnie w paczce z grą", "non-public": "Sceneria niepubliczna", "unavailable": "Sceneria niedostępna", diff --git a/src/scripts/interfaces/Station.ts b/src/scripts/interfaces/Station.ts index 921952a..453f07e 100644 --- a/src/scripts/interfaces/Station.ts +++ b/src/scripts/interfaces/Station.ts @@ -21,6 +21,7 @@ export default interface Station { controlType: string; SUP: boolean; + ASDEK: boolean; authors?: string[]; availability: Availability; From b4a9d4ca3bffe5c8942825b387d05dd2489455ec Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 17:50:45 +0100 Subject: [PATCH 18/27] =?UTF-8?q?brakuj=C4=85ce=20t=C5=82umaczenia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en.json | 6 ++++-- src/locales/pl.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 0039d70..c15cdd8 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -235,13 +235,15 @@ "sceneries": { "headers": { "station": "Station", - "min-lvl": "Min. dispatcher\nlevel", + "min-lvl": "Station\nlevel", "status": "Status", "dispatcher": "Dispatcher", "dispatcher-lvl": "Dispatcher\nlevel", - "routes": "Routes\ndouble {'|'} single", + "routes-single": "1-track\nroutes", + "routes-double": "2-track\nroutes", "general": "General info", "user": "Drivers online", + "like": "Dispatcher rating", "spawn": "Spawns online", "timetableAll": "Active timetables", "timetableConfirmed": "Confirmed timetables", diff --git a/src/locales/pl.json b/src/locales/pl.json index 2a4e090..cc8f575 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -227,7 +227,7 @@ "headers": { "station": "Stacja", "abbr": "Skrót\nposterunku", - "min-lvl": "Min. poziom\ndyżurnego", + "min-lvl": "Poziom\nstacji", "status": "Status", "dispatcher": "Dyżurny", "dispatcher-lvl": "Poziom\ndyżurnego", @@ -235,6 +235,7 @@ "routes-double": "Szlaki\n2-torowe", "general": "Informacje\nogólne", "user": "Maszyniści online", + "like": "Ocena dyżurnego", "spawn": "Otwarte spawny", "timetableAll": "Aktywne rozkłady jazdy", "timetableConfirmed": "Zatwierdzone rozkłady jazdy", From 032f82acd2f99ed1a5b62e0f7533a66bfc9f1309 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 18:06:47 +0100 Subject: [PATCH 19/27] =?UTF-8?q?animacje=20status=C3=B3w=20listy=20scener?= =?UTF-8?q?ii;=20fixy=20t=C5=82umacze=C5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StationsView/StationTable.vue | 563 ++++++++++--------- src/locales/en.json | 4 +- src/locales/pl.json | 5 +- 3 files changed, 288 insertions(+), 284 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index fcb063e..6ecd927 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -1,294 +1,298 @@ @@ -400,8 +404,9 @@ $rowCol: #424242; .table_wrapper { overflow: auto; - overflow-y: hidden; font-weight: 500; + height: 90vh; + min-height: 550px; } .no-stations { @@ -430,39 +435,39 @@ table { top: 0; &.station { - width: 200px; + width: 12em; } &.min-lvl { - width: 120px; + width: 4em; } &.status { - width: 140px; + width: 10em; } &.dispatcher { - width: 230px; + width: 12em; } &.dispatcher-lvl { - width: 100px; + width: 6em; } &.routes-double, &.routes-single { - width: 80px; + width: 7em; } &.general { - width: 160px; + width: 10em; } &.header-image { - width: 60px; + width: 3.5em; &.user { - width: 75px; + width: 5em; } } diff --git a/src/locales/en.json b/src/locales/en.json index c15cdd8..2756bdf 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -234,8 +234,8 @@ }, "sceneries": { "headers": { - "station": "Station", - "min-lvl": "Station\nlevel", + "station": "Scenery", + "min-lvl": "Scenery\nlevel", "status": "Status", "dispatcher": "Dispatcher", "dispatcher-lvl": "Dispatcher\nlevel", diff --git a/src/locales/pl.json b/src/locales/pl.json index cc8f575..fe87555 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -225,9 +225,8 @@ }, "sceneries": { "headers": { - "station": "Stacja", - "abbr": "Skrót\nposterunku", - "min-lvl": "Poziom\nstacji", + "station": "Sceneria", + "min-lvl": "Poziom\nscenerii", "status": "Status", "dispatcher": "Dyżurny", "dispatcher-lvl": "Poziom\ndyżurnego", From a19fdbc19d67bcefb9e1754a4ef4dea2ad4f3276 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 18:18:37 +0100 Subject: [PATCH 20/27] hotfix --- src/store/typings.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/typings.ts b/src/store/typings.ts index 78e7349..7bce92a 100644 --- a/src/store/typings.ts +++ b/src/store/typings.ts @@ -53,6 +53,7 @@ export interface StationJSONData { controlType: string; SUP: boolean; + ASDEK: boolean; // routes: string; routesInfo: StationRoutesInfo[]; From 03465a148786397a40826c61cbb2fc3d96cdcc36 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 20:31:54 +0100 Subject: [PATCH 21/27] poprawki --- src/components/StationsView/StationTable.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 6ecd927..ffd4b39 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -246,17 +246,17 @@ - {{ station.onlineInfo?.currentUsers || 0 }} + {{ station.onlineInfo?.currentUsers ?? '-' }} / - {{ station.onlineInfo?.maxUsers || 0 }} + {{ station.onlineInfo?.maxUsers ?? '-' }} - - {{ station.onlineInfo?.dispatcherRate ?? 0 }} + + {{ station.onlineInfo?.dispatcherRate ?? '-' }} - {{ station.onlineInfo?.spawns.length ?? 0 }} + {{ station.onlineInfo?.spawns.length ?? '-' }} - {{ station.onlineInfo?.scheduledTrainCount.all }} + {{ station.onlineInfo?.scheduledTrainCount.all ?? '-' }} - {{ station.onlineInfo?.scheduledTrainCount.unconfirmed }} + {{ station.onlineInfo?.scheduledTrainCount.unconfirmed ?? '-' }} - {{ station.onlineInfo?.scheduledTrainCount.confirmed }} + {{ station.onlineInfo?.scheduledTrainCount.confirmed ?? '-' }} From 41b1ab398c1b7b3bc1dd8b2515787ff214710f29 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 20:32:05 +0100 Subject: [PATCH 22/27] bump: 1.22.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dfb4a91..e84f20f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.21.1", + "version": "1.22.0", "private": true, "scripts": { "dev": "vite", From 20826d905d477146c94ef40f1b49cf67cbcc7955 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 21:10:43 +0100 Subject: [PATCH 23/27] =?UTF-8?q?poprawki=20t=C5=82umacze=C5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n.ts | 19 +++++++++++++++++++ src/locales/pl.json | 2 +- src/main.ts | 18 ++---------------- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 src/i18n.ts diff --git a/src/i18n.ts b/src/i18n.ts new file mode 100644 index 0000000..bf1b9b2 --- /dev/null +++ b/src/i18n.ts @@ -0,0 +1,19 @@ +import enLang from './locales/en.json'; +import plLang from './locales/pl.json'; + +import { createI18n } from 'vue-i18n'; + +const i18n = createI18n({ + locale: 'pl', + legacy: false, + warnHtmlMessage: false, + fallbackLocale: 'pl', + + messages: { + en: enLang, + pl: plLang + }, + enableLegacy: false +}); + +export default i18n; diff --git a/src/locales/pl.json b/src/locales/pl.json index fe87555..4068725 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -2,7 +2,7 @@ "donations": { "button-title": "GROSZA DAJ", "header": "Grosza daj Stacjownikowi!", - "donator-title": "Projekt wspiera już ponad {count} osób, w tym:", + "donator-title": "Projekt ma już ponad {count} wspierających, w tym:", "p1": "Hej o7! Z tej strony Spythere, twórca Stacjownika, Pojazdownika oraz kilku innych aplikacji wspomagających rozgrywkę symulatora Train Driver 2!", "p2": "{b1} to narzędzie całkowicie darmowe, tworzone i rozwijane dla społeczności symulatora TD2 nieprzerwanie od 2020 roku. Jednakże, część projektu jest podtrzymywana wyłącznie dzięki mojemu prywatnemu wkładowi finansowemu. Funkcje takie jak {b2} czy też {b3} działający na moim {link} (na który serdeczne zapraszam) muszą działać na wydzielonym serwerze, gdzie będą mogły zbierać i przetwarzać dane, aby następnie pokazać je na stronie.", "p2-b1": "Stacjownik", diff --git a/src/main.ts b/src/main.ts index eec3e7f..d359bd7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,26 +2,12 @@ import { createApp, Directive, ref } from 'vue'; import App from './App.vue'; import router from './router'; -import enLang from './locales/en.json'; -import plLang from './locales/pl.json'; +import i18n from './i18n'; -import { createI18n } from 'vue-i18n'; import { createPinia } from 'pinia'; import useCustomSW from './mixins/useCustomSW'; -const i18n = createI18n({ - locale: 'pl', - legacy: false, - warnHtmlMessage: false, - fallbackLocale: 'pl', - messages: { - en: enLang, - pl: plLang - }, - enableLegacy: false -}); - -// SW +// Service worker useCustomSW(); const clickOutsideDirective: Directive = { From 17ebdace82f3569726dd0259dfbc316e2a915b7f Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 4 Mar 2024 21:13:12 +0100 Subject: [PATCH 24/27] fix filtrowania ocenami --- src/scripts/utils/{filterUtils.ts => stationFilterUtils.ts} | 4 ++-- src/store/stationFiltersStore.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/scripts/utils/{filterUtils.ts => stationFilterUtils.ts} (100%) diff --git a/src/scripts/utils/filterUtils.ts b/src/scripts/utils/stationFilterUtils.ts similarity index 100% rename from src/scripts/utils/filterUtils.ts rename to src/scripts/utils/stationFilterUtils.ts index 797b16f..6e9f394 100644 --- a/src/scripts/utils/filterUtils.ts +++ b/src/scripts/utils/stationFilterUtils.ts @@ -72,8 +72,8 @@ export const sortStations = ( case 'like': diff = - (b.onlineInfo ? b.onlineInfo.dispatcherRate : -Infinity) - - (a.onlineInfo ? a.onlineInfo.dispatcherRate : -Infinity); + (a.onlineInfo ? a.onlineInfo.dispatcherRate : -Infinity) - + (b.onlineInfo ? b.onlineInfo.dispatcherRate : -Infinity); break; case 'spawn': diff --git a/src/store/stationFiltersStore.ts b/src/store/stationFiltersStore.ts index cc9a253..d8f8af8 100644 --- a/src/store/stationFiltersStore.ts +++ b/src/store/stationFiltersStore.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia'; import inputData from '../data/options.json'; import { useMainStore } from './mainStore'; -import { filterStations, sortStations } from '../scripts/utils/filterUtils'; +import { filterStations, sortStations } from '../scripts/utils/stationFilterUtils'; import { HeadIdsTypes } from '../scripts/data/stationHeaderNames'; import StorageManager from '../managers/storageManager'; import { Filter } from '../components/StationsView/typings'; From 436e3e63f9fe26647e71899f85c277bcc1b205b1 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 5 Mar 2024 15:27:42 +0100 Subject: [PATCH 25/27] hotfixy --- src/App.vue | 6 +++++- src/components/App/UpdateModal.vue | 19 +++++++++++++++++++ src/components/StationsView/StationTable.vue | 2 +- src/components/TrainsView/newFile.ts | 14 -------------- 4 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 src/components/App/UpdateModal.vue delete mode 100644 src/components/TrainsView/newFile.ts diff --git a/src/App.vue b/src/App.vue index 6fdb05c..09c9829 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,8 @@ + +
@@ -47,13 +49,15 @@ import TrainModal from './components/TrainsView/TrainModal.vue'; import StorageManager from './managers/storageManager'; import { useApiStore } from './store/apiStore'; import { Status } from './typings/common'; +import UpdateModal from './components/App/UpdateModal.vue'; export default defineComponent({ components: { Clock, StatusIndicator, AppHeader, - TrainModal + TrainModal, + UpdateModal }, data: () => ({ diff --git a/src/components/App/UpdateModal.vue b/src/components/App/UpdateModal.vue new file mode 100644 index 0000000..dd46a77 --- /dev/null +++ b/src/components/App/UpdateModal.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index ffd4b39..4b84614 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -1,6 +1,6 @@