chore: update debug proxy html
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
392135b8c4
commit
24ae08e5c7
|
|
@ -1,94 +1,45 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- FOLLOW VITE BUILD INJECT -->
|
||||
|
||||
<script>
|
||||
<script type="module">
|
||||
const host = "https://localhost:2233"
|
||||
|
||||
const createRefreshRuntimeScript = `
|
||||
import RefreshRuntime from "${host}/@react-refresh";
|
||||
RefreshRuntime.injectIntoGlobalHook(window);
|
||||
window.$RefreshReg$ = () => {};
|
||||
window.$RefreshSig$ = () => (type) => type;
|
||||
window.__vite_plugin_react_preamble_installed__ = true;
|
||||
`
|
||||
|
||||
const $script = document.createElement("script")
|
||||
$script.innerHTML = createRefreshRuntimeScript
|
||||
$script.type = "module"
|
||||
document.head.appendChild($script)
|
||||
|
||||
createModuleScript(`${host}/@vite/client`)
|
||||
createModuleScript(`${host}/src/main.tsx`)
|
||||
function createModuleScript(src) {
|
||||
const $script = document.createElement("script")
|
||||
$script.src = src
|
||||
$script.type = "module"
|
||||
document.head.appendChild($script)
|
||||
}
|
||||
|
||||
globalThis["__DEBUG_PROXY__"] = true
|
||||
</script>
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
/>
|
||||
fetch(`${host}`)
|
||||
.then((res) => res.text())
|
||||
.then((html) => {
|
||||
const parser = new DOMParser()
|
||||
const doc = parser.parseFromString(html, "text/html")
|
||||
document.head.innerHTML = doc.head.innerHTML
|
||||
document.body.innerHTML = doc.body.innerHTML
|
||||
|
||||
<meta name="theme-color" content="#ff5c00" />
|
||||
<!-- favicon -->
|
||||
<link rel="icon" href="/favicon-dev.ico" type="image/x-icon" />
|
||||
<title>Follow</title>
|
||||
<script>
|
||||
function setTheme() {
|
||||
let e = "follow:color-mode",
|
||||
t = document.documentElement,
|
||||
a = localStorage.getItem(e)
|
||||
function h() {
|
||||
return window.matchMedia
|
||||
? window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? "dark"
|
||||
: window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
? "light"
|
||||
: void 0
|
||||
: void 0
|
||||
}
|
||||
if (!a) {
|
||||
t.dataset.theme = h() || "light"
|
||||
return
|
||||
}
|
||||
switch ((a = JSON.parse(a))) {
|
||||
case "dark":
|
||||
t.dataset.theme = "dark"
|
||||
break
|
||||
case "light":
|
||||
t.dataset.theme = "light"
|
||||
break
|
||||
case "system":
|
||||
t.dataset.theme = h() || "light"
|
||||
}
|
||||
}
|
||||
setTheme()
|
||||
</script>
|
||||
<script>
|
||||
;(function () {
|
||||
var e = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches,
|
||||
t = localStorage.getItem("theme") || '"system"'
|
||||
t && t !== '"system"' && (document.documentElement.dataset.theme = t)
|
||||
t && t === '"system"' && e && (document.documentElement.dataset.theme = "dark")
|
||||
})()
|
||||
const scripts = doc.querySelectorAll("script")
|
||||
scripts.forEach((script) => {
|
||||
const $script = document.createElement("script")
|
||||
if (!script.innerHTML) return
|
||||
$script.innerHTML = script.innerHTML
|
||||
|
||||
$script.type = "module"
|
||||
|
||||
$script.crossOrigin = script.crossOrigin
|
||||
|
||||
document.body.appendChild($script)
|
||||
})
|
||||
|
||||
const srcScripts = doc.querySelectorAll("script[src]")
|
||||
srcScripts.forEach((script) => {
|
||||
fetch(`${script.src}`)
|
||||
.then((res) => res.text())
|
||||
.then((text) => {
|
||||
const $script = document.createElement("script")
|
||||
$script.innerHTML = text
|
||||
$script.type = "module"
|
||||
document.body.appendChild($script)
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root">
|
||||
<!-- Skeleton -->
|
||||
<div class="h-full w-full flex">
|
||||
<div class="w-64 shrink-0 h-full"></div>
|
||||
<div class="grow w-full h-full bg-theme-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<body></body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -5281,6 +5281,15 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
status: 200;
|
||||
};
|
||||
};
|
||||
} & {
|
||||
"/metrics": {
|
||||
$get: {
|
||||
input: {};
|
||||
output: {};
|
||||
outputFormat: string;
|
||||
status: 200;
|
||||
};
|
||||
};
|
||||
} & {
|
||||
"/lists": {
|
||||
$get: {
|
||||
|
|
@ -6424,20 +6433,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
status: 200;
|
||||
};
|
||||
};
|
||||
"/feeds/reset": {
|
||||
$get: {
|
||||
input: {
|
||||
query: {
|
||||
id: string | string[];
|
||||
};
|
||||
};
|
||||
output: {
|
||||
code: 0;
|
||||
};
|
||||
outputFormat: "json" | "text";
|
||||
status: 200;
|
||||
};
|
||||
};
|
||||
} & {
|
||||
"/entries/inbox": {
|
||||
$post: {
|
||||
|
|
@ -7048,9 +7043,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
input: {
|
||||
query: {
|
||||
category?: string | string[] | undefined;
|
||||
categories?: string | string[] | undefined;
|
||||
namespace?: string | string[] | undefined;
|
||||
lang?: string | string[] | undefined;
|
||||
};
|
||||
};
|
||||
output: {
|
||||
|
|
@ -7059,7 +7052,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
description: string;
|
||||
name: string;
|
||||
url: string;
|
||||
lang: string;
|
||||
routes: {
|
||||
[x: string]: {
|
||||
description: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue