This commit is contained in:
root
2026-05-17 14:06:06 +00:00
parent a3e8a4a96c
commit a91188ca68
29 changed files with 442 additions and 58 deletions

View File

@@ -6,6 +6,7 @@ import { type ChangeEvent, type MouseEvent, useCallback, useEffect, useMemo, use
import OverviewCharts from "@/components/OverviewCharts";
import { ConfigAdvisorPanel } from "@/components/console/ConfigAdvisorPanel";
import { fetchJsonResponse, readErrorMessage } from "@/lib/fetchJson";
import { extractNekoBrowserLinks, formatNekoPorts } from "@/lib/nekoLinks";
import { normalizeBrowserReachableHttpUrl } from "@/lib/panelUrls";
type Lang = "zh" | "en";
@@ -302,6 +303,8 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:
}
return out;
}, [stack]);
const nekoLinks = useMemo(() => extractNekoBrowserLinks(qlNorm), [qlNorm]);
const nekoPortsLabel = useMemo(() => formatNekoPorts(nekoLinks), [nekoLinks]);
const rawAndroidPanelUrl = useMemo(() => {
const baseUrl =
@@ -1084,11 +1087,11 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:
🧪 {tr("Chromium RemoteDebug (9222)", "Chromium RemoteDebug")}
</a>
) : null}
{qlNorm.neko_browser ? (
<a className="link-tile link-tile-warn" href={qlNorm.neko_browser} target="_blank" rel="noreferrer">
🐱 Neko / {tr("Docker Chromium 桌面", "Docker Chromium desktop")}
{nekoLinks.map((link) => (
<a key={link.key} className="link-tile link-tile-warn" href={link.url} target="_blank" rel="noreferrer">
🐱 {link.label} / {tr("Docker Chromium 桌面", "Docker Chromium desktop")}
</a>
) : null}
))}
{qlNorm.webtty ? (
<a className="link-tile" href={qlNorm.webtty} target="_blank" rel="noreferrer">
⌨️ WebTTY
@@ -1560,8 +1563,12 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:
</div>
<p className="mt-2 text-xs leading-relaxed text-slate-500">
{tr(
"内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)在 ENABLE_NEKO=1 且容器运行后一般为 9200 端口。",
"Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium is often :9200 when ENABLE_NEKO=1 and the container is up.",
nekoPortsLabel
? `内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)实例通常为 ${nekoPortsLabel}。`
: "内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)在 ENABLE_NEKO=1 且容器运行后一般为 9200 端口。",
nekoPortsLabel
? `Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium instances are usually on ${nekoPortsLabel}.`
: "Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium is often :9200 when ENABLE_NEKO=1 and the container is up.",
)}
</p>
<iframe className="mt-4 h-[30rem] w-full rounded-2xl border border-white/10 bg-black" src={rawAndroidPanelUrl} title="ws-scrcpy" />