mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
Aktualizacja 1.2.2
Aktualizacja 1.2.2
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ export default defineComponent({
|
||||
}),
|
||||
|
||||
async created() {
|
||||
const stockData = await (await fetch('https://spythere.github.io/api/stockData.json')).json();
|
||||
const stockData = await (await fetch('https://spythere.github.io/api/stockDataNew.json')).json();
|
||||
|
||||
this.store.stockData = stockData;
|
||||
},
|
||||
|
||||
@@ -3,18 +3,20 @@
|
||||
<div class="train-image__wrapper">
|
||||
<div class="train-image__content">
|
||||
<transition name="img-message-anim">
|
||||
<div class="empty-message" v-if="store.imageLoading">ŁADOWANIE OBRAZU...</div>
|
||||
<div class="empty-message" v-if="store.imageLoading && store.chosenVehicle?.imageSrc">ŁADOWANIE OBRAZU...</div>
|
||||
</transition>
|
||||
|
||||
<div class="no-img" v-if="!store.chosenVehicle">PODGLĄD WYBRANEGO POJAZDU</div>
|
||||
|
||||
<img
|
||||
v-if="store.chosenVehicle"
|
||||
v-if="store.chosenVehicle && store.chosenVehicle.imageSrc"
|
||||
:src="store.chosenVehicle.imageSrc"
|
||||
:alt="store.chosenVehicle.type"
|
||||
@load="onImageLoad"
|
||||
@click="onImageClick"
|
||||
/>
|
||||
|
||||
<div class="empty-message" v-if="store.chosenVehicle && !store.chosenVehicle.imageSrc">Ten pojazd nie ma jeszcze podglądu!</div>
|
||||
</div>
|
||||
|
||||
<div class="train-image__info" v-if="store.chosenVehicle">
|
||||
|
||||
@@ -48,7 +48,7 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
|
||||
previewStock(stock: IStock) {
|
||||
previewStock(stock: IStock) {
|
||||
if (this.store.chosenVehicle?.imageSrc != stock.imgSrc) this.store.imageLoading = true;
|
||||
|
||||
if (stock.isLoco) {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ export interface IStock {
|
||||
isLoco: boolean;
|
||||
supportersOnly: boolean;
|
||||
count: number;
|
||||
imgSrc: string;
|
||||
imgSrc?: string;
|
||||
}
|
||||
|
||||
export interface IReadyStockList {
|
||||
|
||||
+19
-19
@@ -9,25 +9,25 @@ export default defineConfig({
|
||||
vue(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
// workbox: {
|
||||
// globPatterns: ['**/*.{js,css,html,png,svg,img}'],
|
||||
// runtimeCaching: [
|
||||
// {
|
||||
// urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`),
|
||||
// handler: 'NetworkFirst',
|
||||
// options: {
|
||||
// cacheName: 'github-api-cache',
|
||||
// expiration: {
|
||||
// maxEntries: 400,
|
||||
// maxAgeSeconds: 60 * 60 * 24 * 30, // <== 30 days
|
||||
// },
|
||||
// cacheableResponse: {
|
||||
// statuses: [0, 200],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`),
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'github-api-cache',
|
||||
expiration: {
|
||||
maxEntries: 2,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
|
||||
},
|
||||
cacheableResponse: {
|
||||
statuses: [0, 200],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user