mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-22 23:44:55 +01:00
alemidev
6653024bad
Committing current state, which is a simple full screen plot with some basic features. It compiles for both native and web. There's a basic generic datasource impl. It currently plots random data for demo.
25 lines
600 B
JavaScript
25 lines
600 B
JavaScript
var cacheName = 'egui-template-pwa';
|
|
var filesToCache = [
|
|
'./',
|
|
'./index.html',
|
|
'./eframe_template.js',
|
|
'./eframe_template_bg.wasm',
|
|
];
|
|
|
|
/* Start the service worker and cache all of the app's content */
|
|
self.addEventListener('install', function (e) {
|
|
e.waitUntil(
|
|
caches.open(cacheName).then(function (cache) {
|
|
return cache.addAll(filesToCache);
|
|
})
|
|
);
|
|
});
|
|
|
|
/* Serve cached content when offline */
|
|
self.addEventListener('fetch', function (e) {
|
|
e.respondWith(
|
|
caches.match(e.request).then(function (response) {
|
|
return response || fetch(e.request);
|
|
})
|
|
);
|
|
});
|