feat(frontend): M9 模态 UI(mode 系统+共享 store+WS 客户端 + chat(思维链/工具回显/情绪徽标)/code/Agent 监控/后台思考页 + Miuix 设计 token + PWA);tsc+vite build 通过
This commit is contained in:
1 parent
b3ffd51736
commit
4c48e94659
40 files changed
+5321
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48">
|
||||
<defs>
|
||||
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#3d6bff" />
|
||||
<stop offset="1" stop-color="#6a8dff" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect x="4" y="4" width="40" height="40" rx="12" fill="url(#g)" />
|
||||
<circle cx="24" cy="24" r="10" fill="#0c0c0c" />
|
||||
<circle cx="24" cy="24" r="4" fill="#f5f5f7" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 452 B |
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Cyrene · 昔涟",
|
||||
"short_name": "Cyrene",
|
||||
"description": "Cyrene v2 用户前端(M9 模态 UI)",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#0c0c0c",
|
||||
"theme_color": "#161616",
|
||||
"orientation": "any",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon.svg",
|
||||
"type": "image/svg+xml",
|
||||
"sizes": "any",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/* Cyrene v2 PWA service worker — core-resource caching + offline shell. */
|
||||
const CACHE = "cyrene-web-v1";
|
||||
const PRECACHE = ["/", "/index.html", "/manifest.json", "/icon.svg"];
|
||||
|
||||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.open(CACHE)
|
||||
.then((cache) => cache.addAll(PRECACHE))
|
||||
.then(() => self.skipWaiting())
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.keys()
|
||||
.then((keys) =>
|
||||
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
|
||||
)
|
||||
.then(() => self.clients.claim())
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const req = event.request;
|
||||
if (req.method !== "GET") return;
|
||||
|
||||
const url = new URL(req.url);
|
||||
if (url.origin !== self.location.origin) return; // let API/WS pass through
|
||||
|
||||
// Network-first for document navigations so the shell stays fresh, falling
|
||||
// back to cached index.html when offline.
|
||||
if (req.mode === "navigate") {
|
||||
event.respondWith(
|
||||
fetch(req)
|
||||
.then((res) => {
|
||||
const copy = res.clone();
|
||||
caches.open(CACHE).then((cache) => cache.put("/index.html", copy));
|
||||
return res;
|
||||
})
|
||||
.catch(() => caches.match("/index.html"))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache-first for static assets (hashed by Vite) with background refresh.
|
||||
event.respondWith(
|
||||
caches.match(req).then((cached) => {
|
||||
const fetched = fetch(req)
|
||||
.then((res) => {
|
||||
if (res && res.status === 200) {
|
||||
const copy = res.clone();
|
||||
caches.open(CACHE).then((cache) => cache.put(req, copy));
|
||||
}
|
||||
return res;
|
||||
})
|
||||
.catch(() => cached);
|
||||
return cached || fetched;
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user