This commit is contained in:
2025-03-27 13:26:28 +00:00
parent 2037953000
commit 77cb64b260
1973 changed files with 3529 additions and 10479 deletions

40
frontend/src/App.svelte Normal file
View File

@@ -0,0 +1,40 @@
<script lang="ts">
import { metricCall } from "./config"
import { location } from "./lib/store"
export let url = ""
if (url) {
// ssr
let l = url.split("?")
$location = {
path: l[0],
search: l.length > 1 ? l[1] : "",
hash: "",
push: false,
pop: false,
}
}
// metrics
let oldPath: string
$: if (metricCall && typeof window !== "undefined" && oldPath !== $location.path) {
const ref = oldPath ? document.location.protocol + "//" + document.location.host + oldPath : document.referrer
oldPath = $location.path
const fetchPath = oldPath + (oldPath.includes("?") ? "&" : "?") + "metrics"
fetch(fetchPath, {
headers: {
"x-ssr-skip": "204",
"x-ssr-ref": ref,
"x-ssr-res": `${window.innerWidth}x${window.innerHeight}`,
// no cache
"cache-control": "no-cache, no-store, must-revalidate",
},
})
}
</script>
<h1>Tibi Svelte Starter</h1>
<style lang="less" global>
@import "./css/style.less";
</style>