feat: loading overlay on dashboard, RDP pooled session routing fix
- dashboard.html: overlay div moved before <script> so getElementById works; double rAF ensures browser paints spinner before navigation - main.py: pooled_rdp route fix — session_status now returns /svc/<slug>/ route and redirect_url for POOL: RDP sessions (was always ready instantly) - docker-compose.yml: parametrise env vars via .env for easier tuning Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,6 +103,18 @@
|
||||
</section>
|
||||
<footer class="made-by-wrap"><a class="made-by" href="mailto:rgalyaviev@mont.com">Made by Galyaviev</a></footer>
|
||||
</main>
|
||||
<style>
|
||||
#loading-overlay{display:none;position:fixed;inset:0;z-index:8888;background:rgba(10,18,28,.88);
|
||||
backdrop-filter:blur(4px);flex-direction:column;align-items:center;justify-content:center;gap:1.2rem}
|
||||
#loading-overlay .lo-spinner{width:52px;height:52px;border:4px solid rgba(220,232,245,.15);
|
||||
border-top-color:#2a8cd6;border-radius:50%;animation:lo-spin .85s linear infinite}
|
||||
#loading-overlay .lo-text{color:#a0b8cc;font:600 1rem sans-serif}
|
||||
@keyframes lo-spin{to{transform:rotate(360deg)}}
|
||||
</style>
|
||||
<div id="loading-overlay">
|
||||
<div class="lo-spinner"></div>
|
||||
<div class="lo-text">Ожидайте...</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
const username = {{ user.username|tojson }};
|
||||
@@ -153,16 +165,30 @@
|
||||
return sp;
|
||||
}
|
||||
|
||||
const loadingOverlay = document.getElementById('loading-overlay');
|
||||
|
||||
document.querySelectorAll('a.tile[href^="/go/"]').forEach(function (link) {
|
||||
link.addEventListener('click', function () {
|
||||
link.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
let href = link.getAttribute('href');
|
||||
try {
|
||||
const url = new URL(link.getAttribute('href'), window.location.origin);
|
||||
const url = new URL(href, window.location.origin);
|
||||
const params = currentScreenParams();
|
||||
url.search = params.toString();
|
||||
link.setAttribute('href', url.pathname + '?' + url.searchParams.toString());
|
||||
href = url.pathname + '?' + url.searchParams.toString();
|
||||
} catch (e) {}
|
||||
if (loadingOverlay) loadingOverlay.style.display = 'flex';
|
||||
requestAnimationFrame(function () {
|
||||
requestAnimationFrame(function () {
|
||||
window.location.href = href;
|
||||
});
|
||||
});
|
||||
}, { capture: true });
|
||||
});
|
||||
|
||||
window.addEventListener('pageshow', function (e) {
|
||||
if (loadingOverlay) loadingOverlay.style.display = 'none';
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user