env & dev suffix

This commit is contained in:
2023-07-04 23:01:05 +02:00
parent 1fa3d4c3a1
commit 105aeddde1
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -6,6 +6,7 @@ node_modules
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
.env
# Log files # Log files
npm-debug.log* npm-debug.log*
+5 -2
View File
@@ -39,7 +39,7 @@
</div> </div>
&copy; &copy;
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a> <a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
{{ new Date().getUTCFullYear() }} | v{{ VERSION }} {{ new Date().getUTCFullYear() }} | v{{ VERSION }}{{ !isOnProductionHost ? 'dev' : '' }}
</footer> </footer>
</div> </div>
</template> </template>
@@ -69,11 +69,14 @@ export default defineComponent({
data: () => ({ data: () => ({
VERSION: packageInfo.version, VERSION: packageInfo.version,
store: useStore(), store: useStore(),
isOnProductionHost: location.hostname == 'pojazdownik-td2.web.app',
}), }),
async created() { async created() {
const stockData = await ( 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(); ).json();
this.store.stockData = stockData; this.store.stockData = stockData;