From 105aeddde1e06ceff7607c66d54632c5d7d0103b Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 4 Jul 2023 23:01:05 +0200 Subject: [PATCH 1/7] env & dev suffix --- .gitignore | 3 ++- src/App.vue | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c937749..6999898 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ node_modules # local env files .env.local .env.*.local +.env # Log files npm-debug.log* @@ -21,4 +22,4 @@ pnpm-debug.log* *.njsproj *.sln *.sw? -node_modules \ No newline at end of file +node_modules diff --git a/src/App.vue b/src/App.vue index b42774d..54bce06 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,7 +39,7 @@ © Spythere - {{ new Date().getUTCFullYear() }} | v{{ VERSION }} + {{ new Date().getUTCFullYear() }} | v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }} @@ -69,11 +69,14 @@ export default defineComponent({ data: () => ({ VERSION: packageInfo.version, store: useStore(), + isOnProductionHost: location.hostname == 'pojazdownik-td2.web.app', }), async created() { const stockData = await ( - await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json?t=${Math.floor(Date.now() / 60000)}`) + await fetch( + `https://spythere.github.io/api/td2/data/stockInfo${import.meta.env['VITE_STOCK_DEV'] == '1' ? 'Dev' : ''}.json` + ) ).json(); this.store.stockData = stockData; From 79d5413638d12f54c74796ca7c48daeb16912620 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 4 Jul 2023 23:01:36 +0200 Subject: [PATCH 2/7] bump: 1.4.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df1029f..bbef498 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pojazdownik", - "version": "1.4.2", + "version": "1.4.3", "private": true, "scripts": { "dev": "vite", From 5ba9e95547cb0a587f7333050406488b7e4cc736 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 4 Jul 2023 23:44:06 +0200 Subject: [PATCH 3/7] =?UTF-8?q?=C5=9Brodowisko=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ src/App.vue | 14 +++++++------- src/types.ts | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 6999898..3331163 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ pnpm-debug.log* *.sln *.sw? node_modules + +# Dev files +stockInfoDev.json \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 54bce06..ad9d7d3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,13 +73,13 @@ export default defineComponent({ }), async created() { - const stockData = await ( - await fetch( - `https://spythere.github.io/api/td2/data/stockInfo${import.meta.env['VITE_STOCK_DEV'] == '1' ? 'Dev' : ''}.json` - ) - ).json(); - - this.store.stockData = stockData; + if (import.meta.env['VITE_STOCK_DEV'] == '1') { + const data = await import('../stockInfoDev.json'); + this.store.stockData = data.default as any; + } else { + const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json(); + this.store.stockData = stockData; + } // routing switch (window.location.pathname) { diff --git a/src/types.ts b/src/types.ts index c817477..2f4d482 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,7 +42,7 @@ export interface IStockProps { export interface IStockData { generator: { - passenger: []; + passenger: any; cargo: { [key: string]: string[]; }; From 7c3eb12a316d2c6c8b0deccae2ba8a5af2b2d349 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 4 Jul 2023 23:58:25 +0200 Subject: [PATCH 4/7] pobieranie wersji z api --- src/App.vue | 4 ++-- src/types.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index ad9d7d3..3057c75 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,8 +34,8 @@ regulaminem symulatora Train Driver 2! -
- Strona jest kompletna dla wersji 2022.2.2 symulatora TD2 +
+ Strona jest kompletna dla wersji {{ store.stockData.version }} symulatora TD2
© Spythere diff --git a/src/types.ts b/src/types.ts index 2f4d482..711fc89 100644 --- a/src/types.ts +++ b/src/types.ts @@ -41,6 +41,8 @@ export interface IStockProps { } export interface IStockData { + version: string; + generator: { passenger: any; cargo: { From 956f77cab528daee29ef54e358e2a0d726cbf356 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 5 Jul 2023 00:03:12 +0200 Subject: [PATCH 5/7] hotfix speedLimits bug --- src/constants/speedLimits.json | 9 +++++++++ src/mixins/stockMixin.ts | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/constants/speedLimits.json b/src/constants/speedLimits.json index a838c40..7da7436 100644 --- a/src/constants/speedLimits.json +++ b/src/constants/speedLimits.json @@ -7,6 +7,14 @@ "2000": 70 } }, + "EU07E": { + "passenger": { + "650": 125 + }, + "cargo": { + "2000": 70 + } + }, "EP07": { "passenger": { "650": 125 @@ -51,3 +59,4 @@ } } + diff --git a/src/mixins/stockMixin.ts b/src/mixins/stockMixin.ts index 5b5565c..0723596 100644 --- a/src/mixins/stockMixin.ts +++ b/src/mixins/stockMixin.ts @@ -35,6 +35,8 @@ export default defineComponent({ addVehicle(vehicle: Vehicle | null, cargo?: ICargo | null) { if (!vehicle) return; + console.log(vehicle); + const stock = this.getStockObject(vehicle, cargo); From 31745cf4dd0351059a102790b138da431ce90f56 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 5 Jul 2023 00:03:41 +0200 Subject: [PATCH 6/7] hotfix speedLimits bug cd --- src/mixins/stockMixin.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mixins/stockMixin.ts b/src/mixins/stockMixin.ts index 0723596..5b5565c 100644 --- a/src/mixins/stockMixin.ts +++ b/src/mixins/stockMixin.ts @@ -35,8 +35,6 @@ export default defineComponent({ addVehicle(vehicle: Vehicle | null, cargo?: ICargo | null) { if (!vehicle) return; - console.log(vehicle); - const stock = this.getStockObject(vehicle, cargo); From 4884b3af2ce913030af9a6eeeb57b2fa4945cfa9 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 5 Jul 2023 00:05:04 +0200 Subject: [PATCH 7/7] hotfix import stockInfoDev --- src/App.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3057c75..5c35709 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,13 +73,13 @@ export default defineComponent({ }), async created() { - if (import.meta.env['VITE_STOCK_DEV'] == '1') { - const data = await import('../stockInfoDev.json'); - this.store.stockData = data.default as any; - } else { - const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json(); - this.store.stockData = stockData; - } + /* dev info testing */ + // if (import.meta.env['VITE_STOCK_DEV'] == '1') { + // const data = await import('../stockInfoDev.json'); + // this.store.stockData = data.default as any; + // } + const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json(); + this.store.stockData = stockData; // routing switch (window.location.pathname) {