前端ui
This commit is contained in:
@@ -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()
|
||||
HUB_TRUST_LAN = _trust_raw not in ("0", "false", "no", "off")
|
||||
DIR = Path(__file__).resolve().parent
|
||||
HUB_BUILD = "20260525-fullscreen"
|
||||
HUB_BUILD = "20260525-fs-fix"
|
||||
|
||||
|
||||
def _is_local(host: str | None) -> bool:
|
||||
|
||||
@@ -515,7 +515,24 @@ body.hub-fullscreen-open {
|
||||
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 {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
max-width: 820px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@@ -224,25 +224,29 @@
|
||||
if (expandedExchangeId && fs && fsInner) {
|
||||
const row = rows.find((r) => String(r.id) === String(expandedExchangeId));
|
||||
if (row) {
|
||||
fsInner.innerHTML = renderFullscreenExchange(row);
|
||||
fs.classList.remove("hidden");
|
||||
fs.setAttribute("aria-hidden", "false");
|
||||
document.body.classList.add("hub-fullscreen-open");
|
||||
bindMonitorInteractions(fsInner);
|
||||
fsInner.querySelectorAll(".btn-expand-back").forEach((btn) => {
|
||||
btn.onclick = (ev) => {
|
||||
ev.stopPropagation();
|
||||
closeExchangeFullscreen();
|
||||
renderMonitorGrid(lastMonitorRows);
|
||||
};
|
||||
});
|
||||
try {
|
||||
fsInner.innerHTML = renderFullscreenExchange(row);
|
||||
fs.classList.remove("hidden");
|
||||
fs.setAttribute("aria-hidden", "false");
|
||||
document.body.classList.add("hub-fullscreen-open");
|
||||
bindMonitorInteractions(fsInner);
|
||||
fsInner.querySelectorAll(".btn-expand-back").forEach((btn) => {
|
||||
btn.onclick = (ev) => {
|
||||
ev.stopPropagation();
|
||||
closeExchangeFullscreen();
|
||||
renderMonitorGrid(lastMonitorRows);
|
||||
};
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("renderFullscreenExchange", err);
|
||||
closeExchangeFullscreen();
|
||||
showToast("全屏渲染失败: " + err, true);
|
||||
}
|
||||
} else {
|
||||
closeExchangeFullscreen();
|
||||
}
|
||||
} else if (fs) {
|
||||
fs.classList.add("hidden");
|
||||
fs.setAttribute("aria-hidden", "true");
|
||||
document.body.classList.remove("hub-fullscreen-open");
|
||||
} else {
|
||||
closeExchangeFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
const backdrop = document.getElementById("tpsl-modal-backdrop");
|
||||
const cancel = document.getElementById("tpsl-cancel");
|
||||
@@ -1067,6 +1086,7 @@
|
||||
};
|
||||
|
||||
initTpslModal();
|
||||
initFullscreen();
|
||||
|
||||
initAuth().then((ok) => {
|
||||
if (!ok) return;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<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 rel="stylesheet" href="/assets/app.css?v=20260525-fullscreen" />
|
||||
<link rel="stylesheet" href="/assets/app.css?v=20260525-fs-fix" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-bg" aria-hidden="true"></div>
|
||||
@@ -57,6 +57,7 @@
|
||||
</div>
|
||||
|
||||
<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 id="exchange-fullscreen-inner"></div>
|
||||
</div>
|
||||
@@ -107,6 +108,6 @@
|
||||
</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>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user