UI/runtime polish, session rotation limit, login errors, docs update
This commit is contained in:
+15
-4
@@ -29,7 +29,7 @@ cat > /opt/portal/index.html <<HTML
|
||||
<style>
|
||||
html,body,#screen{margin:0;height:100%;background:#111}
|
||||
.nav-panel{
|
||||
position:fixed;left:16px;top:16px;z-index:99;display:flex;gap:10px;
|
||||
position:fixed;left:16px;top:34px;z-index:99;display:flex;gap:10px;
|
||||
background:linear-gradient(180deg,rgba(15,24,36,.78),rgba(9,14,22,.86));border:1px solid rgba(255,255,255,.22);backdrop-filter: blur(5px);
|
||||
box-shadow:0 10px 28px rgba(0,0,0,.36);padding:9px 10px;border-radius:14px
|
||||
}
|
||||
@@ -44,8 +44,8 @@ cat > /opt/portal/index.html <<HTML
|
||||
<body>
|
||||
<div id="screen"></div>
|
||||
<div class="nav-panel">
|
||||
<button class="nav-btn" id="btn-back" type="button">Назад</button>
|
||||
<button class="nav-btn" id="btn-home" type="button">Главная</button>
|
||||
<button class="nav-btn" id="btn-back" type="button" title="Назад">←</button>
|
||||
<button class="nav-btn" id="btn-home" type="button" title="Главная">⌂</button>
|
||||
</div>
|
||||
<script type="module">
|
||||
import RFB from './core/rfb.js';
|
||||
@@ -60,6 +60,7 @@ cat > /opt/portal/index.html <<HTML
|
||||
rfb.resizeSession = true;
|
||||
const enableHeartbeat = "${ENABLE_HEARTBEAT}" === "1";
|
||||
const SESSION_CLOSED_URL = '/?session_closed=idle';
|
||||
const CLOSE_PATH = '${TOUCH_PATH}'.replace(/\/touch$/, '/close');
|
||||
function goSessionClosed() {
|
||||
try {
|
||||
if (window.top && window.top !== window) {
|
||||
@@ -77,9 +78,19 @@ cat > /opt/portal/index.html <<HTML
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
let closing = false;
|
||||
async function closeSessionNow() {
|
||||
if (closing) return;
|
||||
closing = true;
|
||||
try {
|
||||
await fetch(CLOSE_PATH, {method: 'POST', credentials: 'include', keepalive: true});
|
||||
} catch (e) {}
|
||||
}
|
||||
if (enableHeartbeat) {
|
||||
setInterval(touch, 60000);
|
||||
setInterval(touch, 15000);
|
||||
touch();
|
||||
window.addEventListener('pagehide', closeSessionNow);
|
||||
window.addEventListener('beforeunload', closeSessionNow);
|
||||
}
|
||||
function keyTap(keysym, code) {
|
||||
rfb.sendKey(keysym, code, true);
|
||||
|
||||
Reference in New Issue
Block a user