feat(web-console): rebuild intelligent cockpit sync interface
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const CACHE_VERSION = "cognitive-agent-pad-v120";
|
||||
const CACHE_VERSION = "cognitive-agent-pad-v163";
|
||||
const SHELL_CACHE = `${CACHE_VERSION}-shell`;
|
||||
const RUNTIME_CACHE = `${CACHE_VERSION}-runtime`;
|
||||
const APP_SHELL = [
|
||||
@@ -6,21 +6,15 @@ const APP_SHELL = [
|
||||
"/index.html",
|
||||
"/styles.css?v=dual-seat-9",
|
||||
"/network.js?v=android-pad-1",
|
||||
"/app.js?v=dual-seat-82",
|
||||
"/gesture-control.js?v=android-pad-7",
|
||||
"/pwa.js?v=android-pad-1",
|
||||
"/console-v2.css?v=desktop-refactor-107",
|
||||
"/console-v2.js?v=desktop-refactor-36",
|
||||
"/self-evolution.css?v=seat-weighing-5",
|
||||
"/self-evolution.js?v=seat-weighing-2",
|
||||
"/self-extension.css?v=extension-19",
|
||||
"/self-extension.js?v=extension-21",
|
||||
"/self-calibration.css?v=calibration-12",
|
||||
"/self-calibration.js?v=calibration-8",
|
||||
"/self-repair.css?v=repair-21",
|
||||
"/self-repair.js?v=repair-21",
|
||||
"/self-repair-seat3d.js?v=repair-21",
|
||||
"/assets/models/n7_seat.glb?v=e7f50f03",
|
||||
"/app.js?v=dual-seat-85",
|
||||
"/gesture-control.js?v=android-pad-8",
|
||||
"/pwa.js?v=android-pad-2",
|
||||
"/console-v2.css?v=sync-layout-11",
|
||||
"/console-v2.js?v=sync-layout-11",
|
||||
"/self-extension.css?v=sync-layout-11",
|
||||
"/self-extension.js?v=sync-layout-11",
|
||||
"/assets/pets/self-extension-cat.png?v=3",
|
||||
"/assets/pets/self-extension-cat-entrance.png?v=3",
|
||||
"/manifest.webmanifest",
|
||||
"/icons/app-icon-192.png",
|
||||
"/icons/app-icon-512.png",
|
||||
@@ -39,6 +33,7 @@ self.addEventListener("install", (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(SHELL_CACHE)
|
||||
.then((cache) => cache.addAll(APP_SHELL))
|
||||
.then(() => self.skipWaiting())
|
||||
.then(() => self.clients.matchAll({ includeUncontrolled: true }))
|
||||
.then((clients) => clients.forEach((client) => client.postMessage({ type: "OFFLINE_READY" })))
|
||||
);
|
||||
@@ -57,12 +52,13 @@ self.addEventListener("activate", (event) => {
|
||||
});
|
||||
|
||||
async function cacheFirst(request) {
|
||||
const cached = await caches.match(request);
|
||||
const shellCache = await caches.open(SHELL_CACHE);
|
||||
const runtimeCache = await caches.open(RUNTIME_CACHE);
|
||||
const cached = (await shellCache.match(request)) || (await runtimeCache.match(request));
|
||||
if (cached) return cached;
|
||||
const response = await fetch(request);
|
||||
if (response.ok) {
|
||||
const cache = await caches.open(RUNTIME_CACHE);
|
||||
await cache.put(request, response.clone());
|
||||
await runtimeCache.put(request, response.clone());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@@ -76,7 +72,11 @@ async function navigationResponse(request) {
|
||||
}
|
||||
return response;
|
||||
} catch (_error) {
|
||||
return (await caches.match("/index.html")) || Response.error();
|
||||
const shellCache = await caches.open(SHELL_CACHE);
|
||||
const runtimeCache = await caches.open(RUNTIME_CACHE);
|
||||
return (await runtimeCache.match("/index.html"))
|
||||
|| (await shellCache.match("/index.html"))
|
||||
|| Response.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user