feat(server): working friend page
This commit is contained in:
parent
83433186f3
commit
0b17c760cb
2126 changed files with 35620 additions and 42 deletions
59
server/static/js/service_worker.js
Normal file
59
server/static/js/service_worker.js
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
let g_permanent = [
|
||||
'/static/css/bootstrap.min.css',
|
||||
'/static/js/popper.min.js',
|
||||
'/static/js/bootstrap.min.js',
|
||||
'/static/fontawesome/css/fontawesome.min.css',
|
||||
'/static/fontawesome/css/solid.min.css',
|
||||
'/static/fontawesome/css/regular.min.css',
|
||||
'/static/fontawesome/css/brands.min.css',
|
||||
'/static/fontawesome/webfonts/fa-solid-900.woff2'
|
||||
];
|
||||
|
||||
let g_temp = [
|
||||
'/static/css/common.css',
|
||||
'/static/css/friends.css',
|
||||
'/static/css/index.css',
|
||||
'/static/js/common.js',
|
||||
'/',
|
||||
'/friends/',
|
||||
'/settings/',
|
||||
]
|
||||
|
||||
self.addEventListener('install', function (e) {
|
||||
/*
|
||||
e.waitUntil(
|
||||
caches.open('fft').then(function (cache) {
|
||||
return cache.addAll([...g_temp, ...g_permanent]);
|
||||
})
|
||||
);
|
||||
*/
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', function (event) {
|
||||
/*
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(async function (response) {
|
||||
if (event.request.url in g_temp)
|
||||
{
|
||||
let r = await fetch(event.request);
|
||||
if (r.status === 200)
|
||||
return r;
|
||||
return response;
|
||||
}
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
*/
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(
|
||||
caches.keys().then((cacheNames) => {
|
||||
return Promise.all(
|
||||
cacheNames.map((cacheName) => {
|
||||
return caches.delete(cacheName);
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue