This commit is contained in:
dekun
2026-05-24 08:44:16 +08:00
parent 8b0607d83f
commit 5935b5449e
4 changed files with 57 additions and 19 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ HUB_BRIDGE_TOKEN = (os.getenv("HUB_BRIDGE_TOKEN") or os.getenv("CONTROL_TOKEN")
_trust_raw = (os.getenv("HUB_TRUST_LAN", "true") or "").strip().lower() _trust_raw = (os.getenv("HUB_TRUST_LAN", "true") or "").strip().lower()
HUB_TRUST_LAN = _trust_raw not in ("0", "false", "no", "off") HUB_TRUST_LAN = _trust_raw not in ("0", "false", "no", "off")
DIR = Path(__file__).resolve().parent DIR = Path(__file__).resolve().parent
HUB_BUILD = "20260525-fullscreen" HUB_BUILD = "20260525-fs-fix"
def _is_local(host: str | None) -> bool: def _is_local(host: str | None) -> bool:
+17
View File
@@ -515,7 +515,24 @@ body.hub-fullscreen-open {
padding: 16px 20px 24px; padding: 16px 20px 24px;
} }
.exchange-fullscreen.hidden {
display: none !important;
}
.exchange-fullscreen-backdrop {
position: fixed;
inset: 0;
z-index: 0;
border: none;
padding: 0;
margin: 0;
background: transparent;
cursor: pointer;
}
.exchange-fullscreen-panel { .exchange-fullscreen-panel {
position: relative;
z-index: 1;
max-width: 820px; max-width: 820px;
margin: 0 auto; margin: 0 auto;
} }
+36 -16
View File
@@ -224,25 +224,29 @@
if (expandedExchangeId && fs && fsInner) { if (expandedExchangeId && fs && fsInner) {
const row = rows.find((r) => String(r.id) === String(expandedExchangeId)); const row = rows.find((r) => String(r.id) === String(expandedExchangeId));
if (row) { if (row) {
fsInner.innerHTML = renderFullscreenExchange(row); try {
fs.classList.remove("hidden"); fsInner.innerHTML = renderFullscreenExchange(row);
fs.setAttribute("aria-hidden", "false"); fs.classList.remove("hidden");
document.body.classList.add("hub-fullscreen-open"); fs.setAttribute("aria-hidden", "false");
bindMonitorInteractions(fsInner); document.body.classList.add("hub-fullscreen-open");
fsInner.querySelectorAll(".btn-expand-back").forEach((btn) => { bindMonitorInteractions(fsInner);
btn.onclick = (ev) => { fsInner.querySelectorAll(".btn-expand-back").forEach((btn) => {
ev.stopPropagation(); btn.onclick = (ev) => {
closeExchangeFullscreen(); ev.stopPropagation();
renderMonitorGrid(lastMonitorRows); closeExchangeFullscreen();
}; renderMonitorGrid(lastMonitorRows);
}); };
});
} catch (err) {
console.error("renderFullscreenExchange", err);
closeExchangeFullscreen();
showToast("全屏渲染失败: " + err, true);
}
} else { } else {
closeExchangeFullscreen(); closeExchangeFullscreen();
} }
} else if (fs) { } else {
fs.classList.add("hidden"); closeExchangeFullscreen();
fs.setAttribute("aria-hidden", "true");
document.body.classList.remove("hub-fullscreen-open");
} }
} }
@@ -749,6 +753,21 @@
} }
} }
function initFullscreen() {
const backdrop = document.getElementById("exchange-fullscreen-backdrop");
if (backdrop) {
backdrop.onclick = () => {
closeExchangeFullscreen();
renderMonitorGrid(lastMonitorRows);
};
}
const fs = document.getElementById("exchange-fullscreen");
if (fs && !expandedExchangeId) {
fs.classList.add("hidden");
fs.setAttribute("aria-hidden", "true");
}
}
function initTpslModal() { function initTpslModal() {
const backdrop = document.getElementById("tpsl-modal-backdrop"); const backdrop = document.getElementById("tpsl-modal-backdrop");
const cancel = document.getElementById("tpsl-cancel"); const cancel = document.getElementById("tpsl-cancel");
@@ -1067,6 +1086,7 @@
}; };
initTpslModal(); initTpslModal();
initFullscreen();
initAuth().then((ok) => { initAuth().then((ok) => {
if (!ok) return; if (!ok) return;
+3 -2
View File
@@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/assets/app.css?v=20260525-fullscreen" /> <link rel="stylesheet" href="/assets/app.css?v=20260525-fs-fix" />
</head> </head>
<body> <body>
<div class="app-bg" aria-hidden="true"></div> <div class="app-bg" aria-hidden="true"></div>
@@ -57,6 +57,7 @@
</div> </div>
<div id="exchange-fullscreen" class="exchange-fullscreen hidden" aria-hidden="true"> <div id="exchange-fullscreen" class="exchange-fullscreen hidden" aria-hidden="true">
<button type="button" id="exchange-fullscreen-backdrop" class="exchange-fullscreen-backdrop" aria-label="关闭全屏"></button>
<div class="exchange-fullscreen-panel"> <div class="exchange-fullscreen-panel">
<div id="exchange-fullscreen-inner"></div> <div id="exchange-fullscreen-inner"></div>
</div> </div>
@@ -107,6 +108,6 @@
</div> </div>
<div id="toast"></div> <div id="toast"></div>
<script src="/assets/app.js?v=20260525-fullscreen"></script> <script src="/assets/app.js?v=20260525-fs-fix"></script>
</body> </body>
</html> </html>