global: snapshot

This commit is contained in:
nym21
2025-05-28 16:53:18 +02:00
parent 9bbf3a027f
commit 99818924ee
32 changed files with 171 additions and 129 deletions
+6 -6
View File
@@ -875,9 +875,9 @@ function createPartialOptions(colors) {
}
/**
* @typedef {"-ratio"} RatioCapSuffix
* @typedef {EndsWith<RatioCapSuffix>} VecIdRatioCap
* @typedef {WithoutSuffix<VecIdRatioCap, RatioCapSuffix>} VecIdRatioCapBase
* @typedef {"-ratio-zscore"} RatioZScoreCapSuffix
* @typedef {EndsWith<RatioZScoreCapSuffix>} VecIdRatioZScoreCap
* @typedef {WithoutSuffix<VecIdRatioZScoreCap, RatioZScoreCapSuffix>} VecIdRatioZScoreCapBase
*/
/**
@@ -886,7 +886,7 @@ function createPartialOptions(colors) {
* @param {string} args.name
* @param {string} args.legend
* @param {string} args.title
* @param {VecIdRatioCapBase} args.key
* @param {VecIdRatioZScoreCapBase} args.key
* @param {Color} [args.color]
*/
function createPriceWithRatio({ name, title, legend, key, color }) {
@@ -1230,7 +1230,7 @@ function createPartialOptions(colors) {
color: useGroupName ? color : colors.green,
}),
createBaseSeries({
key: `${key}realized-profit-sum`,
key: `${key}realized-profit`,
name: useGroupName ? name : "Profit",
color: useGroupName ? color : colors.green,
}),
@@ -1249,7 +1249,7 @@ function createPartialOptions(colors) {
color: useGroupName ? color : colors.red,
}),
createBaseSeries({
key: `${key}realized-loss-sum`,
key: `${key}realized-loss`,
name: useGroupName ? name : "Loss",
color: useGroupName ? color : colors.red,
}),
+15 -13
View File
@@ -1,23 +1,19 @@
const version = "v1";
self.addEventListener("install", (_event) => {
/** @type {ServiceWorkerGlobalScope} */
const sw = /** @type {any} */ (self);
sw.addEventListener("install", (_event) => {
console.log("sw: install");
// The worker skips waiting and becomes active immediately
self.skipWaiting();
sw.skipWaiting();
});
self.addEventListener("activate", (event) => {
sw.addEventListener("activate", (event) => {
console.log("sw: active");
event.waitUntil(
// Claim clients, so the SW starts controlling pages immediately
self.clients.claim(),
);
event.waitUntil(sw.clients.claim());
});
self.addEventListener("fetch", (_event) => {
const event = /** @type {any} */ (_event);
/** @type {Request} */
sw.addEventListener("fetch", (event) => {
let request = event.request;
const method = request.method;
let url = request.url;
@@ -67,7 +63,13 @@ self.addEventListener("fetch", (_event) => {
.catch(() => {
console.log("service-worker: offline");
return cachedResponse;
return (
cachedResponse ||
new Response("Offline", {
status: 503,
statusText: "Service Unavailable",
})
);
});
}),
);
+2 -1
View File
@@ -4,7 +4,8 @@
"strict": true,
"target": "ESNext",
"module": "ESNext",
"outDir": "/tmp/kibo"
"outDir": "/tmp/kibo",
"lib": ["DOM", "DOM.Iterable", "ESNext", "WebWorker"]
},
"exclude": ["assets", "packages", "ignore"]
}