New admin portal build

This commit is contained in:
hillelcoren 2020-06-03 20:40:05 +00:00
parent 90d359f157
commit 86bd746fa9
4 changed files with 116406 additions and 98731 deletions

16118
public/assets/NOTICES Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,12 @@ const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
"favicon.ico": "51636d3a390451561744c42188ccd628",
"main.dart.js": "cd8c6f1e43fbc5cda9be0da815856f01",
"main.dart.js": "c45ffe246b532ed8fbb547787d71472e",
"assets/web/assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
"assets/NOTICES": "67284a1832789e462331a222ed497150",
"assets/fonts/MaterialIcons-Regular.ttf": "56d3ffdef7a25659eab6a68a3fbfaf16",
"assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
"assets/FontManifest.json": "280b2f61f6810d59bd1bcd4cf01d3bf4",
"assets/LICENSE": "b38d6c1f865e1dac156600e592904647",
"assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf": "5a37ae808cf9f652198acde612b5328d",
"assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf": "2bca5ec802e40d3f4b60343e346cedde",
"assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf": "2aa350bd2aeab88b601a593f793734c0",
@ -23,8 +23,8 @@ const RESOURCES = {
// The application shell files that are downloaded before a service worker can
// start.
const CORE = [
"main.dart.js",
"/",
"/",
"main.dart.js",
"index.html",
"assets/LICENSE",
"assets/AssetManifest.json",
@ -34,7 +34,8 @@ const CORE = [
self.addEventListener("install", (event) => {
return event.waitUntil(
caches.open(TEMP).then((cache) => {
return cache.addAll(CORE);
// Provide a no-cache param to ensure the latest version is downloaded.
return cache.addAll(CORE.map((value) => new Request(value, {'cache': 'no-cache'})));
})
);
});
@ -53,6 +54,7 @@ self.addEventListener("activate", function(event) {
// When there is no prior manifest, clear the entire cache.
if (!manifest) {
await caches.delete(CACHE_NAME);
contentCache = await caches.open(CACHE_NAME);
for (var request of await tempCache.keys()) {
var response = await tempCache.match(request);
await contentCache.put(request, response);
@ -102,6 +104,10 @@ self.addEventListener("activate", function(event) {
self.addEventListener("fetch", (event) => {
var origin = self.location.origin;
var key = event.request.url.substring(origin.length + 1);
// Redirect URLs to the index.html
if (event.request.url == origin || event.request.url.startsWith(origin + '/#')) {
key = '/';
}
// If the URL is not the the RESOURCE list, skip the cache.
if (!RESOURCES[key]) {
return event.respondWith(fetch(event.request));
@ -110,8 +116,10 @@ self.addEventListener("fetch", (event) => {
.then((cache) => {
return cache.match(event.request).then((response) => {
// Either respond with the cached resource, or perform a fetch and
// lazily populate the cache.
return response || fetch(event.request).then((response) => {
// lazily populate the cache. Ensure the resources are not cached
// by the browser for longer than the service worker expects.
var modifiedRequest = new Request(event.request, {'cache': 'no-cache'});
return response || fetch(modifiedRequest).then((response) => {
cache.put(event.request, response.clone());
return response;
});
@ -120,3 +128,35 @@ self.addEventListener("fetch", (event) => {
);
});
self.addEventListener('message', (event) => {
// SkipWaiting can be used to immediately activate a waiting service worker.
// This will also require a page refresh triggered by the main worker.
if (event.message == 'skipWaiting') {
return self.skipWaiting();
}
if (event.message = 'downloadOffline') {
downloadOffline();
}
});
// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
var resources = [];
var contentCache = await caches.open(CACHE_NAME);
var currentContent = {};
for (var request of await contentCache.keys()) {
var key = request.url.substring(origin.length + 1);
if (key == "") {
key = "/";
}
currentContent[key] = true;
}
for (var resourceKey in Object.keys(RESOURCES)) {
if (!currentContent[resourceKey]) {
resources.add(resourceKey);
}
}
return Cache.addAll(resources);
}

198953
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long