-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
3,717 additions
and
757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
/.quasar | ||
/node_modules | ||
.eslintrc.cjs | ||
**/.eslintrc.js | ||
**/sw.js | ||
/quasar.config.*.temporary.compiled* |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { resolve } = require('path'); | ||
|
||
module.exports = { | ||
parserOptions: { | ||
project: resolve(__dirname, './tsconfig.json'), | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['custom-service-worker.ts'], | ||
|
||
env: { | ||
serviceworker: true, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file (which will be your service worker) | ||
* is picked up by the build system ONLY if | ||
* quasar.config.js > pwa > workboxMode is set to "injectManifest" | ||
*/ | ||
|
||
declare const self: ServiceWorkerGlobalScope & | ||
typeof globalThis & { skipWaiting: () => void }; | ||
|
||
import { clientsClaim } from 'workbox-core'; | ||
import { | ||
precacheAndRoute, | ||
cleanupOutdatedCaches, | ||
createHandlerBoundToURL, | ||
} from 'workbox-precaching'; | ||
import { registerRoute, NavigationRoute } from 'workbox-routing'; | ||
|
||
self.skipWaiting(); | ||
clientsClaim(); | ||
|
||
// Use with precache injection | ||
precacheAndRoute(self.__WB_MANIFEST); | ||
|
||
cleanupOutdatedCaches(); | ||
|
||
// Non-SSR fallback to index.html | ||
// Production SSR fallback to offline.html (except for dev) | ||
if (process.env.MODE !== 'ssr' || process.env.PROD) { | ||
registerRoute( | ||
new NavigationRoute( | ||
createHandlerBoundToURL(process.env.PWA_FALLBACK_HTML), | ||
{ denylist: [/sw\.js$/, /workbox-(.)*\.js$/] } | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"orientation": "portrait", | ||
"background_color": "#ffffff", | ||
"theme_color": "#027be3", | ||
"icons": [ | ||
{ | ||
"src": "icons/icon-128x128.png", | ||
"sizes": "128x128", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/icon-256x256.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/icon-384x384.png", | ||
"sizes": "384x384", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* eslint-disable */ | ||
|
||
declare namespace NodeJS { | ||
interface ProcessEnv { | ||
SERVICE_WORKER_FILE: string; | ||
PWA_FALLBACK_HTML: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* eslint-disable */ | ||
// THIS FEATURE-FLAG FILE IS AUTOGENERATED, | ||
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING | ||
import "quasar/dist/types/feature-flag"; | ||
|
||
declare module "quasar/dist/types/feature-flag" { | ||
interface QuasarFeatureFlags { | ||
pwa: true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { register } from 'register-service-worker'; | ||
|
||
// The ready(), registered(), cached(), updatefound() and updated() | ||
// events passes a ServiceWorkerRegistration instance in their arguments. | ||
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration | ||
|
||
register(process.env.SERVICE_WORKER_FILE, { | ||
// The registrationOptions object will be passed as the second argument | ||
// to ServiceWorkerContainer.register() | ||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter | ||
|
||
// registrationOptions: { scope: './' }, | ||
|
||
ready (/* registration */) { | ||
console.log('Service worker is active.') // TEST | ||
}, | ||
|
||
registered (/* registration */) { | ||
console.log('Service worker has been registered.') // TEST | ||
}, | ||
|
||
cached (/* registration */) { | ||
console.log('Content has been cached for offline use.') // TEST | ||
}, | ||
|
||
updatefound (/* registration */) { | ||
console.log('New content is downloading.') // TEST | ||
}, | ||
|
||
updated (/* registration */) { | ||
console.log('New content is available; please refresh.') // TEST | ||
}, | ||
|
||
offline () { | ||
console.log('No internet connection found. App is running in offline mode.') // TEST | ||
}, | ||
|
||
error (err) { | ||
console.error('Error during service worker registration:', err) // TEST | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"lib": ["WebWorker", "ESNext"] | ||
}, | ||
"include": ["*.ts", "*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,68 @@ | ||
<template> | ||
<router-view /> | ||
|
||
<q-dialog v-model="showPrompt"> | ||
<q-card> | ||
<q-card-section> | ||
<div class="text-h6">Install our App</div> | ||
</q-card-section> | ||
<q-card-section> | ||
<div v-if="os === 'iOS'"> | ||
To install this app on your iOS device, tap the share icon and select "Add to Home Screen". | ||
</div> | ||
<div v-if="os === 'Android'"> | ||
To install this app on your Android device, tap the menu button and select "Add to Home Screen". | ||
</div> | ||
<div v-if="os === 'Windows' || os === 'MacOS'"> | ||
To install this app on your computer, click on the install icon in the address bar or go to settings and select "Install". | ||
</div> | ||
</q-card-section> | ||
<q-card-actions align="right"> | ||
<q-btn flat label="Close" @click="showPrompt = false" /> | ||
</q-card-actions> | ||
</q-card> | ||
</q-dialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref, onMounted } from 'vue'; | ||
defineOptions({ | ||
name: 'App', | ||
}); | ||
// Installation prompt below | ||
const showPrompt = ref(false); | ||
const os = ref('unknown'); | ||
function detectOS() { | ||
const userAgent = navigator.userAgent || navigator.vendor; | ||
if (/android/i.test(userAgent)) { | ||
return 'Android'; | ||
} | ||
else if (/iPad|iPhone|iPod/.test(userAgent)) { | ||
return 'iOS'; | ||
} | ||
else if (/Win(dows )?/.test(userAgent)) { | ||
return 'Windows'; | ||
} | ||
else if (/Mac/.test(userAgent)) { | ||
return 'MacOS'; | ||
} | ||
else { | ||
return 'unknown'; | ||
} | ||
} | ||
onMounted(() => { | ||
os.value = detectOS(); | ||
// Only show the install prompt once | ||
if (localStorage.getItem('promptShown') !== 'true') { | ||
if (os.value !== 'unknown') { | ||
showPrompt.value = true; | ||
} | ||
localStorage.setItem('promptShown', 'true'); | ||
} | ||
}); | ||
</script> |
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.