Files
Kelx/views/index.ejs
T
2026-11-30 16:32:37 +00:00

3681 lines
135 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="preload" as="image" href="<%= branding.logoUrl %>" fetchpriority="high">
<link rel="preload" as="font" type="font/woff2" crossorigin href="/vendor/fontawesome/webfonts/fa-solid-900.woff2">
<link rel="preload" as="style" href="/vendor/fontawesome/css/all.min.css?v=6.7.2-swap">
<script nonce="<%= cspNonce %>">
window.__BRANDING__ = Object.freeze({
appName: <%- JSON.stringify((branding && branding.appName) || 'ADPanel').replace(/</g, '\\u003c') %>,
logoUrl: <%- JSON.stringify((branding && branding.logoUrl) || '/images/adpanel-dark.svg').replace(/</g, '\\u003c') %>
});
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description"
content="<%= (branding && branding.appName) ? branding.appName : 'ADPanel' %> dashboard – manage your servers, nodes and resources in one place." />
<title>
<%= (branding && branding.appName) ? branding.appName : 'ADPanel' %>
</title>
<link id="favicon" rel="icon"
type="<%= (branding && branding.faviconMimeType) ? branding.faviconMimeType : 'image/webp' %>"
sizes="<%= (branding && branding.faviconMimeType === 'image/svg+xml') ? 'any' : '16x16' %>"
href="<%= (branding && branding.faviconUrl) ? branding.faviconUrl : (branding && branding.logoUrl ? branding.logoUrl : '/images/adpanel-dark.svg') %>" />
<link rel="alternate icon" type="<%= (branding && branding.faviconMimeType) ? branding.faviconMimeType : 'image/webp' %>" href="<%= (branding && branding.faviconUrl) ? branding.faviconUrl : (branding && branding.logoUrl ? branding.logoUrl : '/images/adpanel-dark.svg') %>" />
<link rel="stylesheet" href="/dashboard.css?v=20260927-select-fix-v3">
<link rel="stylesheet" href="/css/dashboard.css?v=20261121-local-images">
<%# Non-critical styles (icons, assistant, terminal) load async to keep first paint unblocked %>
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css?v=6.7.2-swap" media="print" data-async-css>
<link rel="stylesheet" href="/css/dashboard-assistant.css?v=20261005-assistant-audit-fixes-v53" media="print" data-async-css>
<link rel="stylesheet" href="/css/ssh-terminal-window.css?v=20260509-floating-terminal-5" media="print"
data-async-css>
<noscript>
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css?v=6.7.2-swap">
<link rel="stylesheet" href="/css/dashboard-assistant.css?v=20261005-assistant-audit-fixes-v53">
<link rel="stylesheet" href="/css/ssh-terminal-window.css?v=20260509-floating-terminal-5">
</noscript>
<script nonce="<%= cspNonce %>">
(function () {
var links = document.querySelectorAll('link[data-async-css]');
for (var i = 0; i < links.length; i++) {
(function (l) {
var activate = function () { l.media = 'all'; };
if (l.sheet) { activate(); } else { l.addEventListener('load', activate); }
})(links[i]);
}
})();
</script>
<script nonce="<%= cspNonce %>">
// When this page is restored from the back/forward cache (e.g. pressing ESC
// in Settings after changing the dashboard background), the cached stylesheet
// still references the old background. Re-fetch the dashboard stylesheet so the
// new background appears immediately, without forcing a full reload.
window.addEventListener('pageshow', function (event) {
if (!event.persisted) return;
var links = document.querySelectorAll('link[rel="stylesheet"][href*="dashboard.css"]');
links.forEach(function (link) {
var href = link.getAttribute('href');
if (!href) return;
var fresh = link.cloneNode(false);
fresh.setAttribute('href', href.split('?')[0] + '?v=' + Date.now());
fresh.addEventListener('load', function () {
if (link.parentNode) link.parentNode.removeChild(link);
});
link.parentNode.insertBefore(fresh, link.nextSibling);
});
});
</script>
<style nonce="<%= cspNonce %>">
*,
*::before,
*::after {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
img,
video,
canvas {
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
pointer-events: auto;
}
/* Allow text selection strictly inside credential popups */
.twofa-modal,
.twofa-modal *,
.password-modal,
.password-modal *,
.email-modal,
.email-modal *,
.recovery-modal,
.recovery-modal * {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}
.twofa-secret-display,
.twofa-secret-display *,
.twofa-secret-code,
#newSecretDisplay {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
cursor: text !important;
}
.twofa-modal button,
.twofa-modal button *,
.password-modal button,
.password-modal button *,
.email-modal button,
.email-modal button *,
.recovery-modal button,
.recovery-modal button *,
.twofa-modal svg,
.password-modal svg,
.email-modal svg,
.recovery-modal svg {
-webkit-user-select: none !important;
-moz-user-select: none !important;
user-select: none !important;
}
</style>
<style nonce="<%= cspNonce %>">
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #1E1E1E !important;
background-image: none !important;
padding: 0 !important;
margin: 0 !important;
overflow-x: hidden !important;
}
/* =============================== */
/* Main dashboard cards container */
/* =============================== */
/* Figma: gap between navbar bottom (76px) and cards top (168px) is 92px. */
main.dashboard {
flex: 1;
width: 100% !important;
max-width: 1303px !important;
margin: 0 auto !important;
padding: 0 24px !important;
padding-top: 92px !important;
display: flex !important;
flex-direction: column !important;
gap: 20px !important;
}
#topbar-spacer {
display: none !important;
}
/* ============================== */
/* Top Bar (Header) container */
/* ============================== */
header.top-bar {
position: relative !important;
width: 100% !important;
height: 60px !important;
/* brand bottom = -8 + 56 = 48px; navbar bottom = -4 + 52 = 48px. Parent height 60px prevents backdrop-filter clipping seam. */
margin: 0 !important;
padding: 0 !important;
background: transparent !important;
border: none !important;
box-shadow: none !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
transform: none !important;
will-change: auto !important;
-webkit-backface-visibility: visible !important;
backface-visibility: visible !important;
perspective: none !important;
display: block !important;
flex-wrap: nowrap !important;
pointer-events: none !important;
}
/* ======================== */
/* Brand Logo / Title area */
/* ======================== */
.nav-brand-container {
position: absolute !important;
left: -11px !important;
top: -8px !important;
height: 56px !important;
display: flex !important;
align-items: center !important;
gap: 20px !important;
z-index: 10 !important;
pointer-events: auto !important;
}
.nav-brand {
position: relative !important;
left: 0 !important;
top: 0 !important;
height: 56px !important;
display: flex !important;
align-items: center !important;
gap: 2px !important;
cursor: pointer !important;
background: transparent !important;
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.nav-brand__logo {
width: 56px !important;
height: 56px !important;
object-fit: contain !important;
filter: none !important;
flex-shrink: 0 !important;
}
.nav-brand__title-wrap {
display: flex !important;
align-items: flex-start !important;
}
.nav-brand__wordmark {
font-family: 'Inter' !important;
font-weight: 700 !important;
font-size: 36px !important;
line-height: 36px !important;
color: #FFFFFF !important;
white-space: nowrap !important;
}
.nav-brand__tm {
font-family: 'Inter' !important;
font-weight: 400 !important;
font-size: 10px !important;
line-height: 10px !important;
color: #FFFFFF !important;
margin-top: 1px !important;
/* 3px further down */
margin-left: -2px !important;
/* closer to the Panel text */
}
/* ======================== */
/* Alert Pill (Auto Layout) */
/* ======================== */
.nav-alert {
position: relative !important;
width: auto !important;
height: 35px !important;
background: #323232 !important;
box-shadow: 0px 4px 11.1px -2px rgba(0, 0, 0, 0.25) !important;
border-radius: 11px !important;
z-index: 10 !important;
pointer-events: auto !important;
display: inline-flex !important;
align-items: center !important;
padding-left: 14px !important;
padding-right: 10px !important;
flex-shrink: 0 !important;
overflow: hidden !important;
}
.nav-alert__title {
font-family: 'Inter', sans-serif !important;
font-style: normal !important;
font-weight: 600 !important;
font-size: 16px !important;
line-height: 19px !important;
color: #FFFFFF !important;
white-space: nowrap !important;
margin-right: 11px !important;
flex-shrink: 0 !important;
}
.nav-alert__divider {
width: 1px !important;
height: 35px !important;
background: #4C4C4C !important;
flex-shrink: 0 !important;
}
.nav-alert__message {
font-family: 'Inter', sans-serif !important;
font-style: normal !important;
font-weight: 400 !important;
font-size: 12px !important;
line-height: 15px !important;
color: #FFFFFF !important;
white-space: nowrap !important;
margin-left: 12px !important;
flex-shrink: 0 !important;
}
/* ======================== */
/* Navbar pill on the right */
/* ======================== */
/* Raised up to top: -4px, and right: 77px to be completely visible */
.nav-shell {
position: absolute !important;
top: -4px !important;
right: 77px !important;
width: auto !important;
min-width: auto !important;
max-width: calc(100vw - 300px) !important;
height: 52px !important;
background: rgba(50, 50, 50, 0.59) !important;
box-shadow: 0px 2px 12px -2px rgba(0, 0, 0, 0.28), 0px 1px 3px rgba(0, 0, 0, 0.18) !important;
border-radius: 19px !important;
padding: 0 16px !important;
display: flex !important;
align-items: center !important;
border: none !important;
z-index: 10 !important;
pointer-events: auto !important;
overflow: hidden !important;
}
.nav-shell::before {
content: "" !important;
position: absolute !important;
inset: 0 !important;
border-radius: inherit !important;
backdrop-filter: blur(16.6px) !important;
-webkit-backdrop-filter: blur(16.6px) !important;
z-index: -1 !important;
pointer-events: none !important;
}
/* Toolbar alignment inside nav-shell */
.toolbar {
display: flex !important;
align-items: center !important;
width: auto !important;
justify-content: flex-start !important;
gap: 0 !important;
margin: 0 !important;
padding: 0 !important;
border: none !important;
background: transparent !important;
}
.toolbar-actions {
display: flex !important;
align-items: center !important;
width: auto !important;
justify-content: flex-start !important;
gap: 7px !important;
/* perfectly spaced toolbar items */
margin: 0 !important;
padding: 0 !important;
border: none !important;
background: transparent !important;
}
/* Search bar */
.nav-search-wrap {
flex: 0 0 auto !important;
width: 192px !important;
display: flex !important;
align-items: center !important;
margin: 0 !important;
padding: 0 !important;
}
.nav-search-field {
width: 100% !important;
height: 34px !important;
background: rgba(255, 255, 255, 0.1) !important;
border-radius: 37px !important;
display: flex !important;
align-items: center !important;
padding: 0 12px !important;
gap: 8px !important;
border: none !important;
transition: background 0.2s ease !important;
}
.nav-search-field:focus-within {
background: rgba(255, 255, 255, 0.15) !important;
outline: none !important;
}
.nav-search-icon {
width: 15px !important;
height: 15px !important;
object-fit: contain !important;
opacity: 0.8 !important;
}
.nav-search-input {
width: 100% !important;
background: transparent !important;
border: none !important;
outline: none !important;
color: #FFFFFF !important;
font-family: 'Inter' !important;
font-weight: 400 !important;
font-size: 12px !important;
line-height: 15px !important;
user-select: text !important;
}
.nav-search-input::placeholder {
color: #838383 !important;
}
.nav-option {
background: transparent !important;
border: none !important;
outline: none !important;
cursor: pointer !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
color: #FFFFFF !important;
padding: 0 !important;
margin: 0 !important;
border-radius: 8px !important;
transition: background 0.18s ease, opacity 0.18s ease !important;
width: 34px !important;
height: 34px !important;
min-width: 34px !important;
min-height: 34px !important;
box-shadow: none !important;
}
.nav-option:hover {
background: rgba(255, 255, 255, 0.12) !important;
opacity: 1 !important;
}
.nav-option:active {
opacity: 0.8 !important;
}
.nav-option:disabled {
cursor: not-allowed !important;
opacity: 0.4 !important;
}
.nav-option__icon {
display: flex !important;
align-items: center !important;
justify-content: center !important;
width: auto !important;
height: auto !important;
}
.nav-option__icon i {
color: #FFFFFF !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
/* Icon sizes */
.nav-option--status .nav-option__img-icon {
width: 17px !important;
height: 17px !important;
object-fit: contain !important;
}
.ssh-terminal-btn .nav-option__icon i {
font-size: 12px !important;
}
.toolbar-assistant .nav-option__img-icon {
width: 17px !important;
height: 17px !important;
object-fit: contain !important;
}
/* Assistant button styling override to look like other buttons */
#dashboardAssistantButton,
.dashboard-assistant-trigger {
background: transparent !important;
border: none !important;
outline: none !important;
cursor: pointer !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
color: #FFFFFF !important;
padding: 0 !important;
margin: 0 !important;
border-radius: 8px !important;
transition: background 0.18s ease, opacity 0.18s ease !important;
width: 34px !important;
height: 34px !important;
min-width: 34px !important;
min-height: 34px !important;
box-shadow: none !important;
}
#dashboardAssistantButton::after,
.dashboard-assistant-trigger::after {
display: none !important;
content: none !important;
}
#dashboardAssistantButton:hover,
.dashboard-assistant-trigger:hover {
background: rgba(255, 255, 255, 0.12) !important;
}
.dashboard-assistant-trigger[aria-expanded="true"] {
background: rgba(255, 255, 255, 0.12) !important;
opacity: 1 !important;
}
.nav-option[title="Settings"] .nav-option__icon i {
font-size: 15px !important;
}
.nav-option__label {
display: none !important;
}
.account-btn-avatar {
width: 30px !important;
height: 30px !important;
border-radius: 50% !important;
object-fit: cover !important;
border: none !important;
box-shadow: none !important;
display: block !important;
margin: 0 !important;
padding: 0 !important;
}
.account-avatar-btn {
padding: 0 !important;
margin: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
transform: translateY(-2px) !important;
}
.account-avatar-btn .nav-option__icon {
width: 100% !important;
height: 100% !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
/* ======================== */
/* Bot Grid & Server Cards */
/* ======================== */
.bot-grid,
.bots .bot-grid {
display: flex !important;
flex-direction: column !important;
gap: 13px !important;
width: 100% !important;
max-width: none !important;
margin: 0 !important;
grid-template-columns: none !important;
justify-content: stretch !important;
}
/* Server Card - fixed 65px height */
.bot-card {
position: relative !important;
display: flex !important;
flex-direction: row !important;
align-items: center !important;
width: 100% !important;
height: 65px !important;
background: rgba(44, 44, 44, 0.59) !important;
box-shadow: 0px 2px 8px -1px rgba(0, 0, 0, 0.22), 0px 1px 2px rgba(0, 0, 0, 0.12) !important;
backdrop-filter: blur(16.6px) !important;
-webkit-backdrop-filter: blur(16.6px) !important;
border-radius: 19px !important;
padding: 0 24px !important;
border: 1px solid rgba(255, 255, 255, 0.03) !important;
/* Restore the exact 1px border inline */
cursor: pointer !important;
transition: background 0.4s ease !important;
/* smooth transition over 0.4s */
text-decoration: none !important;
justify-self: stretch !important;
max-width: none !important;
overflow: hidden !important;
/* masks corners perfectly */
}
.bot-card:hover {
background: rgba(255, 255, 255, 0.08) !important;
}
/* Online status uses green left bar via pseudo-element */
.bot-card.status-online::before {
content: '' !important;
position: absolute !important;
left: 0 !important;
top: 4px !important;
bottom: 4px !important;
width: 3px !important;
background: rgba(34, 197, 94, 0.6) !important;
border-radius: 0 2px 2px 0 !important;
z-index: 1 !important;
}
/* Stopped/Offline/Unknown uses red left bar */
.bot-card.status-stopped::before,
.bot-card.status-unknown::before,
.bot-card.node-offline::before,
.bot-card.is-offline::before,
.bot-card.status-online.node-offline::before,
.bot-card.status-online.is-offline::before,
.bot-card.status-online.status-stopped::before,
.bot-card.status-online.status-unknown::before {
content: '' !important;
position: absolute !important;
left: 0 !important;
top: 4px !important;
bottom: 4px !important;
width: 3px !important;
background: rgba(200, 0, 0, 0.6) !important;
border-radius: 0 2px 2px 0 !important;
z-index: 1 !important;
}
/* Left status bar indicator - hidden on desktop, color bar is drawn inside the card's native background gradient */
.bot-card__status,
.bot-card__status-bar,
.bot-card__status-dot {
display: none !important;
}
/* Server Icon Box */
.bot-card__icon-box {
width: 40px !important;
height: 39px !important;
background: #2C2C2C !important;
border-radius: 5px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
margin-left: 7px !important;
/* 4px status bar + 27px spacing = 31px from left edge */
flex-shrink: 0 !important;
overflow: hidden !important;
}
.bot-card__server-icon {
width: 19px !important;
height: 19px !important;
object-fit: contain !important;
}
/* Server Name & Pin */
.bot-card__name-container {
display: flex !important;
align-items: center !important;
margin-left: 16px !important;
min-width: 0 !important;
flex-shrink: 1 !important;
}
.bot-card__name {
font-family: 'Inter' !important;
font-weight: 500 !important;
font-size: 24px !important;
line-height: 29px !important;
color: rgba(255, 255, 255, 0.9) !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
}
.bot-card__pin-btn {
position: relative !important;
width: 14px !important;
height: 20px !important;
background: none !important;
border: none !important;
outline: none !important;
cursor: pointer !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
margin-left: 20px !important;
flex-shrink: 0 !important;
}
.bot-card__pin-img {
position: absolute !important;
width: 14px !important;
height: 20px !important;
object-fit: contain !important;
transition: opacity 0.2s ease-in-out !important;
}
/* Default (unpinned) styles */
.bot-card__pin-btn .bot-card__pin-img--pinned {
opacity: 0 !important;
pointer-events: none !important;
}
.bot-card__pin-btn .bot-card__pin-img--unpinned {
opacity: 0.2 !important;
}
/* Hover states on unpinned: show pinned icon */
.bot-card__pin-btn:not(.is-pinned):not(.just-clicked):hover .bot-card__pin-img--pinned {
opacity: 1 !important;
}
.bot-card__pin-btn:not(.is-pinned):not(.just-clicked):hover .bot-card__pin-img--unpinned {
opacity: 0 !important;
}
/* Pinned styles */
.bot-card__pin-btn.is-pinned .bot-card__pin-img--pinned {
opacity: 1 !important;
pointer-events: auto !important;
}
.bot-card__pin-btn.is-pinned .bot-card__pin-img--unpinned {
opacity: 0 !important;
}
/* Hover states on pinned: show unpinned icon */
.bot-card__pin-btn.is-pinned:not(.just-clicked):hover .bot-card__pin-img--pinned {
opacity: 0 !important;
}
.bot-card__pin-btn.is-pinned:not(.just-clicked):hover .bot-card__pin-img--unpinned {
opacity: 1 !important;
}
/* Stats container */
.bot-card__stats {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
margin-left: auto !important;
gap: 35px !important;
flex-shrink: 0 !important;
background: none !important;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
margin-top: 0 !important;
}
.bot-card__stat {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
background: none !important;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
margin: 0 !important;
gap: 6px !important;
}
.bot-card__stat::before,
.bot-card__stat::after,
.bot-card__stat-icon::before,
.bot-card__stat-icon::after {
display: none !important;
content: none !important;
background: none !important;
}
.bot-card__uptime-wrapper {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
gap: 8px !important;
margin: 0 !important;
padding: 0 !important;
background: none !important;
border: none !important;
box-shadow: none !important;
}
.bot-card__stat-icon {
display: flex !important;
align-items: center !important;
justify-content: center !important;
margin-right: 0 !important;
width: auto !important;
height: 20px !important;
background: none !important;
border: none !important;
box-shadow: none !important;
border-radius: 0 !important;
}
.bot-card__stat-icon i {
color: #CDCDCD !important;
opacity: 0.4 !important;
font-size: 18px !important;
line-height: 1 !important;
display: block !important;
}
.bot-card__stat-img {
height: 20px !important;
width: auto !important;
max-width: 24px !important;
object-fit: contain !important;
opacity: 0.4 !important;
display: block !important;
}
.bot-card__stat-icon--memory .bot-card__stat-img {
height: 38px !important;
width: 38px !important;
max-width: none !important;
transform: translateY(-10px) !important;
opacity: 0.4 !important;
pointer-events: none !important;
}
.bot-card__uptime-wrapper .bot-card__stat-icon {
margin-right: 0 !important;
height: 18px !important;
width: 18px !important;
}
.bot-card__uptime-wrapper .bot-card__stat-icon i {
transform: translateY(1.5px) !important;
}
.bot-card__stat-chip {
background: none !important;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
margin: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
border-radius: 0 !important;
letter-spacing: normal !important;
}
.bot-card__stat-value {
font-family: 'Inter' !important;
font-weight: 500 !important;
font-size: 14px !important;
line-height: 17px !important;
color: #E1E1E1 !important;
white-space: nowrap !important;
text-align: center !important;
}
/* Hide unreachable elements during state updates if required */
.bot-card.is-hidden {
display: none !important;
}
.bot-card__offline {
position: absolute !important;
inset: 0 !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
transform: none !important;
background: rgba(255, 255, 255, 0.01) !important;
border-radius: 19px !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
gap: 6px !important;
z-index: 10 !important;
padding: 0 !important;
box-shadow: none !important;
border: none !important;
/* Transitions & Defaults */
opacity: 0 !important;
visibility: hidden !important;
pointer-events: none !important;
backdrop-filter: blur(0px) !important;
-webkit-backdrop-filter: blur(0px) !important;
transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
visibility 0.4s cubic-bezier(0.25, 1, 0.5, 1),
backdrop-filter 0.4s cubic-bezier(0.25, 1, 0.5, 1),
-webkit-backdrop-filter 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}
/* When offline, make overlay visible and blur backdrop */
.bot-card.node-offline,
.bot-card.is-offline {
background: rgba(40, 40, 40, 0.59) !important;
}
.bot-card.node-offline:hover,
.bot-card.is-offline:hover {
background: rgba(40, 40, 40, 0.59) !important;
}
.bot-card.node-offline .bot-card__offline,
.bot-card.is-offline .bot-card__offline {
opacity: 1 !important;
visibility: visible !important;
pointer-events: auto !important;
backdrop-filter: blur(2.2px) !important;
-webkit-backdrop-filter: blur(2.2px) !important;
}
/* Content container default transition */
.bot-card__icon-box,
.bot-card__name-container,
.bot-card__stats {
transition: filter 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
filter: blur(0px);
}
/* Blur the card contents when offline to prevent browser halo/glowing text rendering bug */
.bot-card.node-offline .bot-card__icon-box,
.bot-card.is-offline .bot-card__icon-box,
.bot-card.node-offline .bot-card__name-container,
.bot-card.is-offline .bot-card__name-container,
.bot-card.node-offline .bot-card__stats,
.bot-card.is-offline .bot-card__stats {
filter: blur(2.2px) !important;
}
.offline-alert-icon {
width: 20px !important;
height: 20px !important;
object-fit: contain !important;
}
.offline-text {
font-family: 'Inter', sans-serif !important;
font-weight: 400 !important;
font-size: 12px !important;
color: #FFFFFF !important;
text-align: center !important;
}
/* Responsive adjustments */
@media (max-width: 1200px) {
.bot-card__stats {
gap: 20px !important;
}
}
/* ================================== */
/* Mobile/Tablet Menu Button & Shell */
.nav-option__text {
display: none !important;
}
/* ================================== */
/* Mobile/Tablet Menu Button & Shell */
/* (For width <= 829px) */
/* ================================== */
.nav-mobile-toggle {
display: none !important;
}
@media (max-width: 829px) {
.nav-brand-container {
left: 24px !important;
top: -4px !important;
}
.nav-brand {
left: 0 !important;
top: 0 !important;
}
.nav-mobile-toggle {
position: absolute !important;
top: -4px !important;
right: 40px !important;
width: 44px !important;
height: 44px !important;
background: rgba(50, 50, 50, 0.59) !important;
box-shadow: -4px 6px 20px -2px rgba(0, 0, 0, 0.3) !important;
backdrop-filter: blur(16.6px) !important;
-webkit-backdrop-filter: blur(16.6px) !important;
border-radius: 15px !important;
border: 1px solid rgba(255, 255, 255, 0.08) !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
cursor: pointer !important;
z-index: 100 !important;
pointer-events: auto !important;
transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease !important;
}
.nav-mobile-toggle:hover {
background: rgba(70, 70, 70, 0.8) !important;
transform: scale(1.04) !important;
}
.nav-mobile-toggle:active {
transform: scale(0.95) !important;
}
.nav-mobile-toggle__icon {
width: 20px !important;
height: 20px !important;
object-fit: contain !important;
display: block !important;
}
.nav-shell {
position: absolute !important;
top: 52px !important;
right: 40px !important;
left: auto !important;
width: 280px !important;
max-width: calc(100vw - 64px) !important;
height: auto !important;
padding: 14px !important;
background: rgba(38, 38, 38, 0.92) !important;
box-shadow: 0px 24px 50px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
backdrop-filter: blur(28px) !important;
-webkit-backdrop-filter: blur(28px) !important;
border-radius: 22px !important;
border: none !important;
z-index: 99 !important;
overflow: hidden !important;
/* Apple Spring Animation */
opacity: 0 !important;
visibility: hidden !important;
pointer-events: none !important;
transform: translateY(-14px) scale(0.94) !important;
transform-origin: top right !important;
transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.nav-shell.is-mobile-open {
opacity: 1 !important;
visibility: visible !important;
pointer-events: auto !important;
transform: translateY(0) scale(1) !important;
}
.nav-shell .toolbar {
width: 100% !important;
}
.nav-shell .toolbar-actions {
flex-direction: column !important;
align-items: stretch !important;
width: 100% !important;
gap: 8px !important;
}
.nav-shell .nav-search-wrap {
width: 100% !important;
margin-bottom: 4px !important;
}
.nav-shell .nav-search-field {
height: 38px !important;
background: rgba(255, 255, 255, 0.08) !important;
}
.nav-shell .toolbar-assistant {
width: 100% !important;
margin: 0 !important;
padding: 0 !important;
background: transparent !important;
display: flex !important;
align-items: center !important;
justify-content: flex-start !important;
}
.nav-shell .nav-option,
.nav-shell .account-avatar-btn,
.nav-shell #dashboardAssistantButton,
.nav-shell .dashboard-assistant-trigger {
width: 100% !important;
height: 38px !important;
min-width: 0 !important;
min-height: 0 !important;
border-radius: 12px !important;
background: rgba(255, 255, 255, 0.05) !important;
display: flex !important;
align-items: center !important;
justify-content: flex-start !important;
padding: 0 12px !important;
gap: 12px !important;
box-shadow: none !important;
border: none !important;
margin: 0 !important;
}
.nav-shell .nav-option:hover,
.nav-shell .account-avatar-btn:hover,
.nav-shell #dashboardAssistantButton:hover,
.nav-shell .dashboard-assistant-trigger:hover {
background: rgba(255, 255, 255, 0.12) !important;
}
.nav-shell .nav-option__icon {
width: 20px !important;
height: 20px !important;
min-width: 20px !important;
min-height: 20px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-shrink: 0 !important;
margin: 0 !important;
}
.nav-shell .nav-option__img-icon {
width: 17px !important;
height: 17px !important;
object-fit: contain !important;
display: block !important;
margin: 0 auto !important;
}
.nav-shell .nav-option__text {
display: inline-block !important;
font-family: 'Inter', sans-serif !important;
font-size: 13px !important;
font-weight: 500 !important;
color: #FFFFFF !important;
margin-left: 2px !important;
white-space: nowrap !important;
}
}
@media (max-width: 600px) {
.nav-brand-container {
left: 16px !important;
}
.nav-mobile-toggle {
right: 16px !important;
}
.nav-shell {
right: 16px !important;
max-width: calc(100vw - 32px) !important;
}
.nav-alert {
display: none !important;
}
}
@media (max-width: 768px) {
main.dashboard {
padding-top: 70px !important;
}
.bot-card {
height: auto !important;
flex-direction: column !important;
align-items: flex-start !important;
padding: 16px !important;
gap: 12px !important;
background: rgba(44, 44, 44, 0.59) !important;
}
.bot-card:hover {
background: rgba(255, 255, 255, 0.08) !important;
}
.bot-card.node-offline,
.bot-card.is-offline {
background: rgba(40, 40, 40, 0.59) !important;
}
.bot-card.node-offline:hover,
.bot-card.is-offline:hover {
background: rgba(40, 40, 40, 0.59) !important;
}
.bot-card__status,
.bot-card__status-bar {
display: none !important;
}
.bot-card__icon-box {
margin-left: 0 !important;
}
.bot-card__name-container {
margin-left: 0 !important;
}
.bot-card__stats {
margin-left: 0 !important;
width: 100% !important;
justify-content: space-between !important;
flex-wrap: wrap !important;
gap: 12px !important;
}
}
</style>
<script nonce="<%= cspNonce %>">
window.__dashboardSplashImage = '/images/hello.webp';
try {
const splashKey = `dashboard-splash-cache:${window.location.origin}:${window.__dashboardSplashImage}`;
window.__dashboardSplashKey = splashKey;
if (localStorage.getItem(splashKey) === '1') {
document.documentElement.classList.add('skip-dashboard-splash');
}
} catch (_) { }
function isSelectable(target) {
if (!target) return false;
var el = (target.nodeType === 3 || target.nodeType === 4) ? target.parentElement : target;
if (!el) return false;
if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA') return true;
if (el.isContentEditable) return true;
if (el.closest) {
if (
el.closest('.twofa-modal, .password-modal, .email-modal, .recovery-modal, .enterprise-modal') ||
el.closest('.twofa-modal-overlay, .password-modal-overlay, .email-modal-overlay, .recovery-modal-overlay') ||
el.closest('#twofaModal, #passwordModal, #emailModal, #recoveryModal, #regenRecoveryModal, #statusModal') ||
el.closest('.twofa-secret-display, .twofa-secret-code, #newSecretDisplay') ||
el.closest('.dashboard-assistant-menu')
) {
return true;
}
}
return false;
}
function isSelectionAllowed(e) {
if (!e) return false;
if (isSelectable(e.target)) return true;
try {
var sel = window.getSelection ? window.getSelection() : null;
if (sel && sel.toString().length > 0) {
if (sel.anchorNode && isSelectable(sel.anchorNode)) return true;
if (sel.focusNode && isSelectable(sel.focusNode)) return true;
}
} catch (_) { }
var openModal = document.querySelector('.twofa-modal-overlay.show, .password-modal-overlay.show, .email-modal-overlay.show, .recovery-modal-overlay.show, .enterprise-modal-overlay.show');
if (openModal) {
var t = e.target && (e.target.nodeType === 3 ? e.target.parentElement : e.target);
if (t && openModal.contains(t)) return true;
}
return false;
}
document.addEventListener('contextmenu', e => {
if (isSelectionAllowed(e)) return;
e.preventDefault();
});
document.addEventListener('dragstart', e => {
if (isSelectionAllowed(e)) return;
e.preventDefault();
});
document.addEventListener('selectstart', e => {
if (isSelectionAllowed(e)) return;
e.preventDefault();
});
document.addEventListener('copy', e => {
if (isSelectionAllowed(e)) return;
e.preventDefault();
});
document.addEventListener('cut', e => {
if (isSelectionAllowed(e)) return;
e.preventDefault();
});
(function () {
document.addEventListener('DOMContentLoaded', function () {
var toggleBtn = document.getElementById('mobileNavToggle');
var navShell = document.querySelector('.nav-shell');
if (!toggleBtn || !navShell) return;
function openMobileNav() {
navShell.classList.add('is-mobile-open');
toggleBtn.setAttribute('aria-expanded', 'true');
}
function closeMobileNav() {
navShell.classList.remove('is-mobile-open');
toggleBtn.setAttribute('aria-expanded', 'false');
}
toggleBtn.addEventListener('click', function (e) {
e.stopPropagation();
if (navShell.classList.contains('is-mobile-open')) {
closeMobileNav();
} else {
openMobileNav();
}
});
document.addEventListener('click', function (e) {
if (navShell.classList.contains('is-mobile-open') && !navShell.contains(e.target) && !toggleBtn.contains(e.target)) {
closeMobileNav();
}
});
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape' && navShell.classList.contains('is-mobile-open')) {
closeMobileNav();
}
});
window.addEventListener('resize', function () {
if (window.innerWidth > 829 && navShell.classList.contains('is-mobile-open')) {
closeMobileNav();
}
});
});
})();
document.addEventListener('keydown', e => {
if (isSelectionAllowed(e)) return;
if (e.target && e.target.tagName === 'INPUT') return;
if (e.target && e.target.tagName === 'TEXTAREA') return;
if (e.target && e.target.closest && e.target.closest('.dashboard-assistant-menu')) return;
if ((e.ctrlKey || e.metaKey) && (e.key === 'c' || e.key === 'C' || e.key === 'a' || e.key === 'A' || e.key === 's' || e.key === 'S' || e.key === 'u' || e.key === 'U')) {
e.preventDefault();
}
});
</script>
</head>
<body data-server-start-time="<%= serverStartTime %>">
<%- include("partials/svg-sprite") %>
<svg xmlns="http://www.w3.org/2000/svg" class="mysvg">
<defs>
<filter id="glass-distortion" x="0%" y="0%" width="100%" height="100%">
<feTurbulence type="fractalNoise" baseFrequency="0.008 0.008" numOctaves="2" seed="92" result="noise" />
<feGaussianBlur in="noise" stdDeviation="2" result="blurred" />
<feDisplacementMap in="SourceGraphic" in2="blurred" scale="77" xChannelSelector="R" yChannelSelector="G" />
</filter>
</defs>
</svg>
<header class="top-bar" id="topBar">
<div class="nav-brand-container">
<div class="nav-brand" data-href="/" role="link" tabindex="0" aria-label="Go to dashboard">
<img src="<%= branding.logoUrl %>" alt="<%= branding.appName %> logo" class="nav-brand__logo" width="91"
height="91" fetchpriority="high" decoding="sync" />
<div class="nav-brand__title-wrap">
<span class="nav-brand__wordmark">Panel</span>
<span class="nav-brand__tm">TM</span>
</div>
</div>
<% if (typeof globalAlert !=='undefined' && globalAlert && globalAlert.message) { %>
<div class="nav-alert">
<span class="nav-alert__title">Alert</span>
<div class="nav-alert__divider"></div>
<span class="nav-alert__message">
<%= globalAlert.message %>
</span>
</div>
<% } %>
</div>
<button id="mobileNavToggle" class="nav-mobile-toggle" aria-label="Toggle navigation menu" aria-expanded="false">
<svg class="nav-mobile-toggle__icon" aria-hidden="true" style="width:20px;height:20px;"><use href="#icon-options-icon"/></svg>
</button>
<nav class="nav-shell">
<div class="toolbar">
<div class="toolbar-actions nav-options">
<div class="nav-search-wrap">
<div class="nav-search-field">
<svg class="nav-search-icon" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-search-icon"/></svg>
<input type="text" id="searchBots" class="nav-search-input" placeholder="Search servers"
aria-label="Search servers" autocomplete="off" spellcheck="false">
</div>
</div>
<% if (isAdmin) { %>
<button class="nav-option nav-option--status" title="Status" data-href="/status">
<span class="nav-option__icon"><svg class="nav-option__img-icon" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-status-icon"/></svg></span>
<span class="nav-option__text">Status</span>
</button>
<% } %>
<button id="accountBtn" class="nav-option nav-option--account account-avatar-btn" title="Manage account">
<span class="nav-option__icon">
<img src="<%= avatarUrl %>" alt="Avatar" class="account-btn-avatar" width="30" height="30"
decoding="async" draggable="false">
</span>
<span class="nav-option__text">Manage Account</span>
</button>
<button id="openSshTerminalBtn" class="nav-option ssh-terminal-btn" title="Open SSH Terminal">
<span class="nav-option__icon"><i class="fa-solid fa-terminal"></i></span>
<span class="nav-option__text">Open SSH Terminal</span>
</button>
<% if (showDashboardAssistant) { %>
<div class="toolbar-assistant nav-option-wrap">
<button id="dashboardAssistantButton" class="nav-option dashboard-assistant-trigger" title="Assistant"
aria-haspopup="dialog" aria-expanded="false">
<span class="nav-option__icon"><svg class="nav-option__img-icon" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-assistent-icon"/></svg></span>
<span class="nav-option__text">Assistant</span>
</button>
</div>
<% } %>
<% if (isAdmin) { %>
<button class="nav-option" title="Settings" data-href="/settings">
<span class="nav-option__icon"><i class="fa-solid fa-gear"></i></span>
<span class="nav-option__text">Settings</span>
</button>
<% } %>
<button id="logoutBtn" class="nav-option nav-option--logout" title="Log Out">
<span class="nav-option__icon"><i class="fa-solid fa-right-from-bracket"></i></span>
<span class="nav-option__text">Log Out</span>
</button>
</div>
</div>
</nav>
</header>
<section id="dashboardAssistantMenu" class="dashboard-assistant-menu" hidden aria-hidden="true"
aria-label="Assistant">
<div class="dashboard-assistant-head">
<div class="dashboard-assistant-head-left">
<button id="dashboardAssistantClose" class="dashboard-assistant-head-close-btn" title="Close assistant">
<svg style="width:14px;height:14px;" aria-hidden="true"><use href="#icon-close-icon"/></svg>
</button>
<h2 class="dashboard-assistant-title">Assistant</h2>
</div>
<div class="dashboard-assistant-head-actions">
<% if (isAdmin) { %>
<button id="dashboardAssistantConfigToggle" class="dashboard-assistant-head-btn" title="Assistant settings"
hidden>
<svg style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-key-icon"/></svg>
</button>
<div class="dashboard-assistant-head-divider"></div>
<% } %>
<button id="dashboardAssistantReset" class="dashboard-assistant-head-btn" title="Start a new chat">
<svg style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-restore-icon"/></svg>
</button>
</div>
</div>
<div class="dashboard-assistant-head-divider-line"></div>
<div id="dashboardAssistantStatus" class="dashboard-assistant-status is-hidden"></div>
<% if (isAdmin) { %>
<div id="dashboardAssistantConfig" class="dashboard-assistant-config" hidden>
<form id="dashboardAssistantTokenForm" class="dashboard-assistant-token-form">
<label class="dashboard-assistant-token-label" for="dashboardAssistantProviderSelect">
Select your provider
</label>
<div class="dashboard-assistant-custom-dropdown" id="dashboardAssistantProviderDropdown">
<div class="dashboard-assistant-dropdown-trigger" id="dashboardAssistantProviderTrigger" role="button" tabindex="0" aria-haspopup="listbox" aria-expanded="false" aria-controls="dashboardAssistantProviderMenu">
<svg id="dashboardAssistantProviderIcon" class="dashboard-assistant-provider-icon" style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-groq-icon"/></svg>
<span class="dashboard-assistant-dropdown-selected-text"
id="dashboardAssistantProviderSelectedText">Groq</span>
<svg class="dashboard-assistant-provider-arrow" style="width:12px;height:8px;" aria-hidden="true"><use href="#icon-down-icon"/></svg>
</div>
<div class="dashboard-assistant-dropdown-menu" id="dashboardAssistantProviderMenu" role="listbox" hidden>
<div class="dashboard-assistant-dropdown-item" data-value="google" role="option" tabindex="-1">
<svg class="dashboard-assistant-item-icon" style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-gemini-svg"/></svg>
<span>Gemini</span>
</div>
</div>
<select id="dashboardAssistantProviderSelect" class="dashboard-assistant-hidden-select">
<option value="groq" selected>Groq</option>
<option value="google">Google AI Studio</option>
</select>
</div>
<label class="dashboard-assistant-token-label" for="dashboardAssistantTokenInput">
<span id="dashboardAssistantTokenLabel">Groq API Key</span>
</label>
<input id="dashboardAssistantTokenInput" class="dashboard-assistant-token-input" type="password"
placeholder="Paste your api key" autocomplete="new-password" spellcheck="false" autocapitalize="off"
autocorrect="off">
<label class="dashboard-assistant-token-label">
Select your intelligence
</label>
<div class="dashboard-assistant-custom-dropdown" id="dashboardAssistantModelDropdown">
<div class="dashboard-assistant-dropdown-trigger" id="dashboardAssistantModelTrigger" role="button" tabindex="0" aria-haspopup="listbox" aria-expanded="false" aria-controls="dashboardAssistantModelMenu">
<span class="dashboard-assistant-dropdown-selected-text" id="dashboardAssistantModelSelectedText">GPT-OSS 120B</span>
<svg class="dashboard-assistant-mark-icon" style="width:10px;height:8px;" aria-hidden="true"><use href="#icon-mark-icon"/></svg>
<svg class="dashboard-assistant-provider-arrow" style="width:12px;height:8px;" aria-hidden="true"><use href="#icon-down-icon"/></svg>
</div>
<div class="dashboard-assistant-dropdown-menu" id="dashboardAssistantModelMenu" role="listbox" hidden>
<div class="dashboard-assistant-dropdown-item" data-value="openai/gpt-oss-20b" role="option" tabindex="-1">
<span>GPT-OSS 20B</span>
</div>
<div class="dashboard-assistant-dropdown-divider"></div>
<div class="dashboard-assistant-dropdown-item" data-value="qwen/qwen3.8-27b" role="option" tabindex="-1">
<span>Qwen 3.8 27B</span>
</div>
<div class="dashboard-assistant-dropdown-divider"></div>
<div class="dashboard-assistant-dropdown-item" data-value="allam-2-7b" role="option" tabindex="-1">
<span>ALLAM 2 7B</span>
</div>
</div>
<select id="dashboardAssistantModelSelect" class="dashboard-assistant-hidden-select">
<option value="openai/gpt-oss-120b" selected>GPT-OSS 120B</option>
<option value="openai/gpt-oss-20b">GPT-OSS 20B</option>
<option value="qwen/qwen3.8-27b">Qwen 3.8 27B</option>
<option value="allam-2-7b">ALLAM 2 7B</option>
</select>
</div>
<div class="dashboard-assistant-access-row">
<div class="dashboard-assistant-access-copy">
<p class="dashboard-assistant-access-title">Allow normal users to acces Assistant?</p>
<p class="dashboard-assistant-access-text">
Grants or restricts access to the Assistant for normal users.
</p>
</div>
<label class="dashboard-assistant-switch" title="Allow normal users to access Assistant">
<input type="checkbox" id="dashboardAssistantAllowUsersToggle">
<span class="dashboard-assistant-switch-slider"></span>
</label>
</div>
<div class="dashboard-assistant-token-foot">
<span id="dashboardAssistantTokenState" class="dashboard-assistant-token-state">
No AI provider key has been saved yet.
</span>
<button id="dashboardAssistantSaveToken" class="dashboard-assistant-save" type="submit">
Save
</button>
</div>
</form>
</div>
<% } %>
<div id="dashboardAssistantNotice" class="dashboard-assistant-notice" hidden></div>
<div id="dashboardAssistantMessages" class="dashboard-assistant-messages" aria-live="polite">
</div>
<div id="dashboardAssistantComposer" class="dashboard-assistant-composer">
<form id="dashboardAssistantComposerForm" class="dashboard-assistant-composer-form">
<label class="dashboard-assistant-text-label" for="dashboardAssistantTextInput" hidden>
Message
</label>
<div class="dashboard-assistant-composer-row">
<div class="dashboard-assistant-input-box">
<textarea id="dashboardAssistantTextInput" class="dashboard-assistant-text-input" rows="1"
placeholder="Type a message" autocomplete="off"></textarea>
</div>
<button id="dashboardAssistantMic" class="dashboard-assistant-composer-btn" type="button"
title="Start voice input">
<svg style="width:15px;height:18px;" aria-hidden="true"><use href="#icon-microphone-icon"/></svg>
</button>
<button id="dashboardAssistantSend" class="dashboard-assistant-composer-btn" type="submit"
title="Send message">
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M0.672262 18.9482C0.270096 18.802 0.0304219 18.4689 0.00604826 18.0139C-0.0142631 17.7458 0.0426089 17.5021 0.826629 14.3743C1.58221 11.3562 1.67564 11.0109 1.77314 10.9134L1.88282 10.7997L5.53075 10.3935C7.53751 10.1701 9.21117 9.97102 9.25586 9.94665C9.5849 9.77198 9.5849 9.22766 9.25586 9.05299C9.21117 9.02862 7.53751 8.82958 5.53075 8.60616L1.88282 8.19996L1.77314 8.08622C1.67564 7.98873 1.58221 7.64751 0.826629 4.63752C-0.042699 1.15225 -0.0670727 1.01414 0.0507333 0.67293C0.249785 0.116425 0.875376 -0.14761 1.43597 0.0839285C1.57003 0.140798 5.20576 1.9078 9.5199 4.01602C13.834 6.12017 17.5998 7.96029 17.8882 8.10247C18.6925 8.49243 18.9647 8.82145 18.9972 9.44295C19.0216 9.85728 18.8875 10.1741 18.5707 10.4707C18.3513 10.6738 17.7541 10.9703 9.92613 14.7886C5.2992 17.0431 1.44816 18.9157 1.35879 18.9482C1.1638 19.0173 0.875376 19.0173 0.672262 18.9482Z"
fill="#EBEBEB" fill-opacity="0.65" />
</svg>
</button>
</div>
</form>
<!-- Keep all the other voice/PTT elements hidden so that JS binds to them successfully without errors -->
<div class="dashboard-assistant-hidden-elements" style="display: none !important;">
<button id="dashboardAssistantReplay" type="button"></button>
<span id="dashboardAssistantVoiceState"></span>
<div id="dashboardAssistantSpeaking"></div>
<div id="dashboardAssistantTranscript"></div>
<button id="dashboardAssistantPttKeyBtn" type="button"></button>
</div>
</div>
</section>
<div id="topbar-spacer" aria-hidden="true" data-topbar-extra-offset="73"></div>
<main class="dashboard" id="mainContent">
<section class="bots" id="servers">
<div class="bot-grid" data-bot-grid data-page="<%= pagination.page %>" data-total-pages="<%= pagination.totalPages %>" data-total="<%= pagination.total %>" data-limit="<%= pagination.limit %>" data-search="<%= pagination.search || '' %>" data-has-more="<%= pagination.hasMore ? 'true' : 'false' %>">
<% bots.forEach(function(bot){ const statusClass=bot.status==='online' || bot.status==='running'
? 'status-online' : (bot.status==='stopped' || bot.status==='exited' ? 'status-stopped' : 'status-unknown' );
const nodeOffline=bot.nodeOnline===false; %>
<article class="bot-card <%= statusClass %><%= nodeOffline ? ' node-offline is-offline' : '' %>" data-bot-card
data-name="<%= bot.name.toLowerCase() %>" data-display-name="<%= (bot.displayName || '').toLowerCase() %>" data-node-id="<%= bot.nodeId || '' %>" data-href="/server/<%= bot.name %>">
<!-- Server Icon Box (40x39) -->
<div class="bot-card__icon-box">
<svg class="bot-card__server-icon" aria-hidden="true" style="width:24px;height:24px;"><use href="#icon-servercard-icon"/></svg>
</div>
<!-- Server Name & Pin Button -->
<div class="bot-card__name-container">
<h3 class="bot-card__name">
<%= bot.displayName || bot.name %>
</h3>
<button class="bot-card__pin-btn" type="button" aria-label="Pin Server">
<svg class="bot-card__pin-img bot-card__pin-img--pinned" aria-hidden="true" style="width:14px;height:14px;"><use href="#icon-pinned-icon"/></svg>
<svg class="bot-card__pin-img bot-card__pin-img--unpinned" aria-hidden="true" style="width:14px;height:14px;"><use href="#icon-unpinned-icon"/></svg>
</button>
</div>
<!-- Stats Row (RAM, CPU, Disk, Uptime) -->
<div class="bot-card__stats">
<!-- Memory Stat -->
<div class="bot-card__stat">
<span class="bot-card__stat-icon bot-card__stat-icon--memory">
<svg class="bot-card__stat-img" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-ram-icon"/></svg>
</span>
<span class="bot-card__stat-chip">
<span class="bot-card__stat-value bot-card__stat-value--memory">
<%= bot.memory && bot.memory.label ? bot.memory.label.split('/')[0].trim() : '0 MB' %>
</span>
</span>
</div>
<!-- CPU Stat -->
<div class="bot-card__stat">
<span class="bot-card__stat-icon bot-card__stat-icon--cpu">
<svg class="bot-card__stat-img" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-cpu-icon"/></svg>
</span>
<span class="bot-card__stat-chip">
<span class="bot-card__stat-value bot-card__stat-value--cpu">
<%= bot.cpu ? bot.cpu : '0%' %>
</span>
</span>
</div>
<!-- Disk Stat -->
<div class="bot-card__stat">
<span class="bot-card__stat-icon bot-card__stat-icon--disk">
<svg class="bot-card__stat-img" aria-hidden="true" style="width:16px;height:16px;"><use href="#icon-storage-icon"/></svg>
</span>
<span class="bot-card__stat-chip">
<span class="bot-card__stat-value bot-card__stat-value--disk">
<%= bot.disk && bot.disk.label ? bot.disk.label.split('/')[0].trim() : '0 MB' %>
</span>
</span>
</div>
<!-- Uptime Stat (dynamic) -->
<div class="bot-card__uptime-wrapper"
style="display: <%= bot.status === 'online' || bot.status === 'running' ? 'flex' : 'none' %>;">
<span class="bot-card__stat-icon bot-card__stat-icon--uptime">
<i class="fa-solid fa-clock"></i>
</span>
<span class="bot-card__stat-chip">
<span class="bot-card__stat-value bot-card__uptime-value">
<% if (bot.uptime && bot.uptime> 0) { %>
<%= (function(seconds) { const days=Math.floor(seconds / 86400); const hours=Math.floor((seconds %
86400) / 3600); const minutes=Math.floor((seconds % 3600) / 60); const parts=[]; if (days> 0)
parts.push(days + 'd');
if (hours > 0) parts.push(hours + 'h');
if (minutes > 0 || parts.length === 0) parts.push(minutes + 'm');
return parts.join(' ');
})(bot.uptime) %>
<% } else { %>
—
<% } %>
</span>
</span>
</div>
</div>
<!-- Unreachable node overlay -->
<div class="bot-card__offline" data-offline-overlay>
<svg class="offline-alert-icon" aria-hidden="true" style="width:18px;height:18px;"><use href="#icon-alert-icon"/></svg>
<div class="offline-text">Can't establish connection to the server</div>
</div>
</article>
<% }) %>
</div>
<div id="dashInfiniteLoader" style="display:none; text-align:center; padding:20px; width:100%;">
<i class="fa-solid fa-circle-notch fa-spin" style="font-size:24px; color:#22d3ee;"></i>
</div>
<div id="infiniteScrollSentinel" style="height:20px; width:100%;"></div>
<% if (pagination && pagination.totalPages> 1) { %>
<div class="nodes-pagination" id="dashPagination" style="margin-top:16px">
<div class="nodes-pagination-inner">
<span class="nodes-pagination-info">
<%= ((pagination.page - 1) * pagination.limit) + 1 %>–<%= Math.min(pagination.page * pagination.limit,
pagination.total) %> of <%= pagination.total %> servers
</span>
<div class="nodes-pagination-btns">
<button class="btn ghost btn-sm" <%=pagination.page <=1 ? 'disabled' : '' %> data-dash-page="<%=
pagination.page - 1 %>"><i class="fa-solid fa-chevron-left"></i></button>
<span class="nodes-pagination-current">Page <%= pagination.page %> / <%= pagination.totalPages %></span>
<button class="btn ghost btn-sm" <%=pagination.page>= pagination.totalPages ? 'disabled' : '' %>
data-dash-page="<%= pagination.page + 1 %>"><i class="fa-solid fa-chevron-right"></i></button>
</div>
</div>
</div>
<% } %>
</section>
</main>
<div id="accountPage" class="account-page-new" style="display: none;">
<!-- Hidden Back Button for JS event binding compatibility -->
<button id="accountBackBtn" style="display: none !important;" aria-hidden="true" type="button"></button>
<div class="account-container-inner">
<!-- Top Title & Tabs Header Bar -->
<div class="account-top-header">
<div class="account-title-group">
<h1 class="account-main-title">Account</h1>
<p class="account-main-subtitle">Manage your profile in one place</p>
</div>
<!-- Rectangle 114: Top Right Tabs Pill -->
<div class="account-tabs-pill">
<button class="account-tab active" data-account-tab="info" type="button">
<svg class="account-tab-icon" style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-information-icon"/></svg>
<span>Info</span>
</button>
<!-- Rectangle 185: Tab Separator -->
<div class="account-tabs-divider"></div>
<button class="account-tab" data-account-tab="credentials" type="button">
<svg style="width:16px;height:16px;" aria-hidden="true"><use href="#icon-key-icon"/></svg>
<span>Credentials</span>
</button>
</div>
</div>
<!-- Account load-failure banner: toggled by dashboard.js when /api/account fails -->
<div id="accountLoadError" role="alert"
style="display:none;box-sizing:border-box;width:780px;max-width:100%;margin:0 0 20px 0;padding:12px 16px;background:rgba(42,42,42,0.6);border:1px solid rgba(239,68,68,0.45);border-radius:14px;align-items:center;gap:12px;flex-wrap:wrap;font-family:'Inter',sans-serif;">
<span style="color:#f87171;font-size:14px;line-height:18px;">Couldn't load your account settings.</span>
<button id="accountLoadRetry" type="button"
style="margin-left:auto;padding:6px 14px;background:rgba(50,50,50,0.59);border:1px solid rgba(239,68,68,0.45);border-radius:10px;color:#f87171;font-family:'Inter',sans-serif;font-size:13px;line-height:16px;cursor:pointer;">Retry</button>
</div>
<!-- Tab Content: Info Scene (Image 1 Replicate) -->
<div id="accountInfoTab" class="account-tab-content active">
<!-- Rectangle 184: Main Card Container -->
<div class="account-card-box">
<!-- Top Avatar Header -->
<div class="account-avatar-header" style="width:724px;max-width:calc(100% - 56px);margin:16px auto 14px auto;display:flex;align-items:center;gap:10px;padding:0;box-sizing:border-box;">
<div class="account-avatar" id="accountAvatarWrapper" title="Click to change avatar">
<img id="accountAvatarImg" src="<%= avatarUrl %>" alt="Avatar" width="107" height="107" loading="lazy"
decoding="async">
<div class="account-avatar-overlay">
<i class="fa-solid fa-camera"></i>
<span>Change</span>
</div>
</div>
<div class="account-user-info">
<h2 id="accountUsername" class="account-username-text">Loading...</h2>
<p id="accountEmail" class="account-email-text">Loading...</p>
</div>
</div>
<input type="file" id="avatarFileInput" accept="image/jpeg,image/png,image/gif,image/webp"
style="display:none;">
<!-- Rectangle 175: Top Divider Line -->
<div class="account-divider-top"></div>
<!-- 5 Info Rows -->
<div class="account-details-list">
<!-- Row 1: Username -->
<div class="account-detail-row">
<span class="account-detail-label">Username</span>
<div class="account-detail-value-wrap" id="usernameRow">
<span class="account-detail-value" id="accountUsernameValue">—</span>
<input type="text" class="account-row-input" id="usernameInput" style="display:none;" maxlength="30"
placeholder="Enter username">
<!-- Rectangle 176: Edit Pen Button -->
<button class="account-row-edit-btn" id="usernameEditBtn" title="Edit username" type="button">
<svg style="width:12px;height:12px;" aria-hidden="true"><use href="#icon-pen-icon"/></svg>
</button>
<button class="account-row-save-btn" id="usernameSaveBtn" style="display:none;" title="Save"
type="button">
<i class="fa-solid fa-check"></i>
</button>
<button class="account-row-cancel-btn" id="usernameCancelBtn" style="display:none;" title="Cancel"
type="button">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="account-row-cooldown" id="usernameCooldown" style="display:none;"></div>
</div>
<!-- Rectangle 177: Separator Line -->
<div class="account-divider-row"></div>
<!-- Row 2: Email -->
<div class="account-detail-row">
<span class="account-detail-label">Email</span>
<span class="account-detail-value" id="accountEmailValue">—</span>
</div>
<!-- Rectangle 178: Separator Line -->
<div class="account-divider-row"></div>
<!-- Row 3: Role -->
<div class="account-detail-row">
<span class="account-detail-label">Role</span>
<span class="account-detail-value" id="accountRoleValue">—</span>
</div>
<!-- Rectangle 179: Separator Line -->
<div class="account-divider-row"></div>
<!-- Row 4: User ID -->
<div class="account-detail-row">
<span class="account-detail-label">User ID</span>
<span class="account-detail-value" id="accountIdValue">—</span>
</div>
<!-- Rectangle 180: Separator Line -->
<div class="account-divider-row"></div>
<!-- Row 5: Status -->
<div class="account-detail-row">
<span class="account-detail-label">Status</span>
<div class="account-detail-value-wrap" id="statusRow">
<span class="account-detail-value account-status-value" id="accountStatusValue">
<span id="accountStatusText">Available</span>
</span>
<!-- Rectangle 183: Edit Pen Button -->
<button class="account-row-edit-btn" id="statusEditBtn" title="Edit status" type="button">
<svg style="width:12px;height:12px;" aria-hidden="true"><use href="#icon-pen-icon"/></svg>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Tab Content: Credentials Scene -->
<div id="accountCredentialsTab" class="account-tab-content">
<!-- Rectangle 184: Main Card Container -->
<div class="account-card-box">
<!-- Top Avatar Header (exact match to Info tab) -->
<div class="account-avatar-header" style="width:724px;max-width:calc(100% - 56px);margin:16px auto 14px auto;display:flex;align-items:center;gap:10px;padding:0;box-sizing:border-box;">
<div class="account-avatar" id="accountAvatarWrapperCred" title="Click to change avatar">
<img id="accountAvatarImgCred" src="<%= avatarUrl %>" alt="Avatar" width="107" height="107" loading="lazy" decoding="async">
<div class="account-avatar-overlay">
<i class="fa-solid fa-camera"></i>
<span>Change</span>
</div>
</div>
<div class="account-user-info">
<h2 id="accountUsernameCred" class="account-username-text">Loading...</h2>
<p id="accountEmailCred" class="account-email-text"><%= typeof user !== 'undefined' && user ? user.email : '' %></p>
</div>
</div>
<!-- Rectangle 175: Top Divider Line -->
<div class="account-divider-top"></div>
<!-- 3 Credentials Rows -->
<div class="account-credentials-list">
<%# Server-rendered 2FA gating: recovery-code management is meaningless without
2FA enabled, so the non-2FA state gets a single activation row instead of
the two management rows. The branch is rendered server-side (not hidden
via client JS) so a tampered client finds no recovery-code DOM at all —
defense in depth with the regenerate API, which already rejects accounts
without 2FA. The Change Password / Change Email rows are identical in
both states and stay outside the conditional. %>
<% if (typeof dashboardHas2FA !== 'undefined' && dashboardHas2FA) { %>
<!-- Row 1: Two-Factor Authentication -->
<div class="account-credential-row">
<div class="credential-row-left">
<div class="credential-icon-box">
<svg class="credential-icon" style="width:18px;height:20px;" aria-hidden="true"><use href="#icon-shield-icon"/></svg>
</div>
<div class="credential-text-block">
<h3 class="credential-title">Two-Factor Authentication</h3>
<p class="credential-desc">Change your authentication app 2FA Code</p>
</div>
</div>
<button class="credential-action-btn" id="change2faBtn" type="button">Change 2FA</button>
</div>
<!-- Separator: Recovery Codes -->
<div class="account-divider-row"></div>
<!-- Row: Recovery Codes -->
<div class="account-credential-row">
<div class="credential-row-left">
<div class="credential-icon-box">
<svg class="credential-icon" style="width:20px;height:20px;" aria-hidden="true"><use href="#icon-restore-icon"/></svg>
</div>
<div class="credential-text-block">
<h3 class="credential-title">Recovery Codes</h3>
<p class="credential-desc">View and regenerate your one-time recovery codes</p>
</div>
</div>
<button class="credential-action-btn" id="regenerateRecoveryBtn" type="button">Recovery Codes</button>
</div>
<% } else { %>
<!-- Row 1: Two-Factor Authentication (activation entry point) -->
<div class="account-credential-row">
<div class="credential-row-left">
<div class="credential-icon-box">
<svg class="credential-icon" style="width:18px;height:20px;" aria-hidden="true"><use href="#icon-shield-icon"/></svg>
</div>
<div class="credential-text-block">
<h3 class="credential-title">Two-Factor Authentication</h3>
<p class="credential-desc">Protect your account with an authenticator app</p>
</div>
</div>
<button class="credential-action-btn" id="change2faBtn" type="button">Enable 2FA</button>
</div>
<% } %>
<!-- Separator 1 -->
<div class="account-divider-row"></div>
<!-- Row 2: Change Password -->
<div class="account-credential-row">
<div class="credential-row-left">
<div class="credential-icon-box">
<svg class="credential-icon" style="width:20px;height:20px;" aria-hidden="true"><use href="#icon-key-icon"/></svg>
</div>
<div class="credential-text-block">
<h3 class="credential-title">Change Password</h3>
<p class="credential-desc">Update your account password</p>
</div>
</div>
<button class="credential-action-btn" id="changePasswordBtn" type="button">Change Password</button>
</div>
<!-- Separator 2 -->
<div class="account-divider-row"></div>
<!-- Row 3: Change Email -->
<div class="account-credential-row">
<div class="credential-row-left">
<div class="credential-icon-box">
<svg class="credential-icon" style="width:27px;height:20px;" aria-hidden="true"><use href="#icon-email-icon"/></svg>
</div>
<div class="credential-text-block">
<h3 class="credential-title">Change Email</h3>
<p class="credential-desc">Update your account email address</p>
</div>
</div>
<button class="credential-action-btn" id="changeEmailBtn" type="button">Change Email</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dashboardAssistantDeleteModal" class="enterprise-modal-overlay dashboard-assistant-confirm-overlay"
aria-hidden="true">
<div class="enterprise-modal dashboard-assistant-confirm-modal" role="dialog" aria-modal="true"
aria-labelledby="dashboardAssistantDeleteTitle">
<div class="enterprise-modal-header">
<div class="enterprise-modal-icon icon-terminal dashboard-assistant-confirm-icon">
<i class="fa-solid fa-trash-can"></i>
</div>
<div class="enterprise-modal-titles">
<div class="enterprise-modal-eyebrow">Assistant Confirmation</div>
<h3 class="enterprise-modal-title" id="dashboardAssistantDeleteTitle">Delete server</h3>
<p class="enterprise-modal-subtitle" id="dashboardAssistantDeleteSubtitle">
Confirm this action before the assistant removes the server.
</p>
</div>
<button id="dashboardAssistantDeleteClose" class="enterprise-modal-close" title="Close">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="enterprise-modal-body">
<div class="dashboard-assistant-confirm-copy">
<p class="dashboard-assistant-confirm-lead">Do you want to delete server <strong
id="dashboardAssistantDeleteName">—</strong>?</p>
<p class="dashboard-assistant-confirm-text">
This removes the server files and its node container. You need to confirm here before the assistant
continues.
</p>
<div class="dashboard-assistant-verify" id="dashboardAssistantDeleteVerify" hidden>
<label class="dashboard-assistant-verify-label" for="dashboardAssistantDeleteCredential"
id="dashboardAssistantDeleteCredentialLabel">Current password</label>
<input class="dashboard-assistant-verify-input" type="password"
id="dashboardAssistantDeleteCredential" autocomplete="current-password" spellcheck="false" />
<p class="dashboard-assistant-verify-hint" id="dashboardAssistantDeleteVerifyHint">
Confirm this destructive action with your admin credential, like the delete window in Settings.
</p>
</div>
<p class="dashboard-assistant-verify-feedback" id="dashboardAssistantDeleteFeedback" hidden></p>
</div>
</div>
<div class="enterprise-modal-footer dashboard-assistant-confirm-footer">
<button id="dashboardAssistantDeleteCancel" class="enterprise-btn-secondary" type="button">Keep server</button>
<button id="dashboardAssistantDeleteConfirm" class="enterprise-btn-primary" type="button">
<i class="fa-solid fa-trash-can"></i>
Delete server
</button>
</div>
</div>
</div>
<div class="email-modal-overlay" id="emailModal">
<div class="email-modal">
<div class="email-modal-header">
<div class="email-modal-header-left">
<div class="email-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-email-icon"/></svg>
</div>
<div>
<h3 class="email-modal-title">Change Email</h3>
<p class="email-modal-subtitle">Update your account email address</p>
</div>
</div>
<button class="email-modal-close" id="emailModalClose">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="email-modal-body">
<div id="emailStep1">
<div class="email-step">
<div class="email-step-label">
<span class="email-step-num">1</span>
Enter your password
</div>
<div class="email-input-wrap">
<input type="password" class="email-input" id="emailPasswordInput" placeholder="Current password"
aria-label="Current password" autocomplete="current-password">
<button type="button" class="email-toggle-eye" data-target="emailPasswordInput" style="display:none;">
<i class="fa-solid fa-eye"></i>
</button>
</div>
</div>
<div class="email-step">
<div class="email-step-label">
<span class="email-step-num">2</span>
Enter your 2FA code
</div>
<input type="text" class="email-input email-code-input" id="email2faInput" placeholder="000000"
aria-label="2FA code" maxlength="6" autocomplete="off">
<div class="forgot-code-link" id="emailForgotLink">
You don't have the code? <span class="forgot-code-click">Click here</span>
</div>
</div>
</div>
<div id="emailStep2" style="display:none;">
<div class="email-step">
<div class="email-step-label">
<span class="email-step-num">3</span>
Enter your new email address
</div>
<input type="email" class="email-input" id="newEmailInput" placeholder="new@email.com"
aria-label="New email address" autocomplete="email">
</div>
</div>
<div class="email-error" id="emailError"></div>
<div class="email-success" id="emailSuccess">
<i class="fa-solid fa-check-circle"></i> Email has been successfully changed!
</div>
</div>
<div class="email-modal-footer">
<button class="email-btn email-btn-cancel" id="emailCancelBtn">Cancel</button>
<button class="email-btn email-btn-confirm" id="emailConfirmBtn">Verify</button>
</div>
</div>
</div>
<div class="recovery-modal-overlay" id="recoveryModal">
<div class="recovery-modal">
<div class="recovery-modal-header">
<div class="recovery-modal-header-left">
<div class="recovery-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-restore-icon"/></svg>
</div>
<div>
<h3 class="recovery-modal-title">Recovery Code</h3>
<p class="recovery-modal-subtitle">Use a one-time recovery code</p>
</div>
</div>
<button class="recovery-modal-close" id="recoveryModalClose">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="recovery-modal-body">
<div class="recovery-step">
<div class="recovery-step-label">
<span class="recovery-step-num">1</span>
Enter one of your recovery codes
</div>
<input type="text" class="recovery-input" id="recoveryCodeInput" placeholder="XXXXXXXX" maxlength="8"
aria-label="Recovery code" autocomplete="off"
style="text-transform: uppercase; letter-spacing: 4px; text-align: center; font-family: 'SF Mono', Monaco, monospace; font-size: 18px;">
</div>
<div class="recovery-hint">
<i class="fa-solid fa-circle-info"></i>
Each code can only be used once. Codes are issued when you enable or change 2FA and can be regenerated from Account > Credentials.
</div>
<div class="recovery-error" id="recoveryError"></div>
</div>
<div class="recovery-modal-footer">
<button class="recovery-btn recovery-btn-cancel" id="recoveryCancelBtn">Cancel</button>
<button class="recovery-btn recovery-btn-confirm" id="recoveryConfirmBtn">Verify Code</button>
</div>
</div>
</div>
<div class="recovery-modal-overlay" id="regenRecoveryModal">
<div class="recovery-modal">
<div class="recovery-modal-header">
<div class="recovery-modal-header-left">
<div class="recovery-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-restore-icon"/></svg>
</div>
<div>
<h3 class="recovery-modal-title">Regenerate Recovery Codes</h3>
<p class="recovery-modal-subtitle">Replace your one-time recovery codes</p>
</div>
</div>
<button class="recovery-modal-close" id="regenRecoveryCloseBtn">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="recovery-modal-body">
<div class="recovery-step" id="regenRecoveryPasswordStep">
<div class="recovery-step-label">
<span class="recovery-step-num">1</span>
Enter your current password
</div>
<input type="password" class="recovery-input" id="regenRecoveryPasswordInput" placeholder="Current password"
maxlength="1024" autocomplete="current-password" spellcheck="false" aria-label="Current password">
<div class="recovery-hint">
Confirm your identity with your account password before new recovery codes are issued.
</div>
</div>
<div class="recovery-step" id="regenRecoveryTotpStep" style="display:none;">
<div class="recovery-step-label">
<span class="recovery-step-num">2</span>
Enter a 6-digit code from your authenticator
</div>
<input type="text" class="recovery-input" id="regenRecoveryTotpInput" placeholder="000000" maxlength="6"
aria-label="2FA code" autocomplete="one-time-code" inputmode="numeric"
style="text-transform: uppercase; letter-spacing: 4px; text-align: center; font-family: 'SF Mono', Monaco, monospace; font-size: 18px;">
<div class="recovery-hint">
This is the code from the authenticator app protecting your account.
</div>
</div>
<div class="recovery-step" id="regenRecoveryCodesStep" style="display:none;">
<div class="recovery-step-label">
<span class="recovery-step-num">3</span>
Your new recovery codes
</div>
<div class="recovery-hint recovery-hint--warning">
<i class="fa-solid fa-triangle-exclamation"></i>Save these codes now — they are
shown only once. Each code works once and replaces all previous codes.
</div>
<div id="regenRecoveryCodesGrid"
style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px;"></div>
</div>
<div class="recovery-error" id="regenRecoveryError"></div>
</div>
<div class="recovery-modal-footer">
<button class="recovery-btn recovery-btn-cancel" id="regenRecoveryCancelBtn">Cancel</button>
<button class="recovery-btn recovery-btn-confirm" id="regenRecoveryConfirmBtn">Confirm</button>
<button class="recovery-btn recovery-btn-confirm" id="regenRecoveryDoneBtn" style="display:none;">Done</button>
</div>
</div>
</div>
<div class="recovery-modal-overlay" id="statusModal">
<div class="recovery-modal">
<div class="recovery-modal-header">
<div class="recovery-modal-header-left">
<div class="recovery-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-pen-icon"/></svg>
</div>
<div>
<h3 class="recovery-modal-title">Update Status</h3>
<p class="recovery-modal-subtitle">Set a custom status message</p>
</div>
</div>
<button class="recovery-modal-close" id="statusModalClose">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="recovery-modal-body">
<div class="recovery-step">
<div class="recovery-step-label">
<span class="recovery-step-num">1</span>
Enter your status
</div>
<input type="text" class="recovery-input" id="statusInput" placeholder="In a flow..." maxlength="80"
aria-label="Status message" autocomplete="off"
style="text-align: left; letter-spacing: normal; font-family: inherit; font-size: 15px;">
</div>
<div class="recovery-step" style="margin-top: 16px;">
<div class="recovery-step-label">
<span class="recovery-step-num">2</span>
Clear after
</div>
<select class="recovery-input" id="statusDuration" aria-label="Clear status after">
<option value="86400000">1 day</option>
<option value="259200000">3 days</option>
<option value="604800000">1 week</option>
<option value="2592000000">1 month</option>
<option value="never">Never</option>
</select>
</div>
<div class="recovery-error" id="statusError"></div>
</div>
<div class="recovery-modal-footer">
<button class="recovery-btn recovery-btn-cancel" id="statusCancelBtn">Cancel</button>
<button class="recovery-btn recovery-btn-confirm" id="statusSaveBtn">Save Status</button>
</div>
</div>
</div>
<div class="password-modal-overlay" id="passwordModal">
<div class="password-modal">
<div class="password-modal-header">
<div class="password-modal-header-left">
<div class="password-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-key-icon"/></svg>
</div>
<div>
<h3 class="password-modal-title">Change Password</h3>
<p class="password-modal-subtitle">Update your account password</p>
</div>
</div>
<button class="password-modal-close" id="passwordModalClose">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="password-modal-body">
<div id="passwordStep1">
<div class="password-step">
<div class="password-step-label">
<span class="password-step-num">1</span>
Enter your current password
</div>
<div class="password-input-wrap">
<input type="password" class="password-input" id="currentPasswordInput" placeholder="Current password"
aria-label="Current password" autocomplete="current-password">
<button type="button" class="password-toggle-eye" data-target="currentPasswordInput"
style="display:none;">
<i class="fa-solid fa-eye"></i>
</button>
</div>
</div>
<div class="password-step">
<div class="password-step-label">
<span class="password-step-num">2</span>
Enter your 2FA code
</div>
<input type="text" class="password-input password-code-input" id="password2faInput" placeholder="000000"
aria-label="2FA code" maxlength="6" autocomplete="off">
<div class="forgot-code-link" id="passwordForgotLink">
You don't have the code? <span class="forgot-code-click">Click here</span>
</div>
</div>
</div>
<div id="passwordStep2" style="display:none;">
<div class="password-step">
<div class="password-step-label">
<span class="password-step-num">3</span>
Enter your new password
</div>
<div class="password-input-wrap">
<input type="password" class="password-input" id="newPasswordInput" placeholder="New password"
aria-label="New password" autocomplete="new-password">
<button type="button" class="password-toggle-eye" data-target="newPasswordInput" style="display:none;">
<i class="fa-solid fa-eye"></i>
</button>
</div>
</div>
<div class="password-step">
<div class="password-step-label">
<span class="password-step-num">4</span>
Confirm your new password
</div>
<div class="password-input-wrap">
<input type="password" class="password-input" id="confirmPasswordInput" placeholder="Confirm new password"
aria-label="Confirm new password" autocomplete="new-password">
<button type="button" class="password-toggle-eye" data-target="confirmPasswordInput"
style="display:none;">
<i class="fa-solid fa-eye"></i>
</button>
</div>
</div>
</div>
<div class="password-error" id="passwordError"></div>
<div class="password-success" id="passwordSuccess">
<i class="fa-solid fa-check-circle"></i> Password has been successfully changed!
</div>
</div>
<div class="password-modal-footer">
<button class="password-btn password-btn-cancel" id="passwordCancelBtn">Cancel</button>
<button class="password-btn password-btn-confirm" id="passwordConfirmBtn">Verify</button>
</div>
</div>
</div>
<div class="twofa-modal-overlay" id="twofaModal">
<div class="twofa-modal">
<div class="twofa-modal-header">
<div class="twofa-modal-header-left">
<div class="twofa-modal-icon">
<svg class="cred-modal-glyph" aria-hidden="true"><use href="#icon-shield-icon"/></svg>
</div>
<div>
<h3 class="twofa-modal-title">Change 2FA Code</h3>
<p class="twofa-modal-subtitle">Update your authenticator app</p>
</div>
</div>
<button class="twofa-modal-close" id="twofaModalClose">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="twofa-modal-body">
<div class="twofa-step" id="twofaStep1">
<div class="twofa-step-label">
<span class="twofa-step-num">1</span>
<span id="twofaStep1Text">Enter your current 2FA code</span>
</div>
<input type="text" class="twofa-input" id="currentCodeInput" placeholder="000000" maxlength="6"
aria-label="Current 2FA code" autocomplete="off">
<div class="forgot-code-link" id="twofaForgotLink">
You don't have the code? <span class="forgot-code-click">Click here</span>
</div>
</div>
<div class="twofa-step" id="qrCodeSection" style="display:none;">
<div class="twofa-step-label">
<span class="twofa-step-num">2</span>
Scan this new QR code with your authenticator
</div>
<div class="twofa-qr-wrap">
<img id="newQrCode" src="" alt="New 2FA QR Code">
<div class="twofa-qr-hint">Scan with Google Authenticator, Authy, etc.</div>
</div>
<div class="twofa-secret-display" style="user-select: text !important; -webkit-user-select: text !important; cursor: text !important;">
<span class="twofa-secret-code" id="newSecretDisplay" style="user-select: text !important; -webkit-user-select: text !important; cursor: text !important;">—</span>
</div>
</div>
<div class="twofa-step" id="confirmSection" style="display:none;">
<div class="twofa-step-label">
<span class="twofa-step-num">3</span>
Enter the code from your new authenticator
</div>
<input type="text" class="twofa-input" id="newCodeInput" placeholder="000000" maxlength="6"
aria-label="New 2FA code" autocomplete="off">
</div>
<div class="twofa-step" id="twofaRecoveryCodesStep" style="display:none;">
<div class="twofa-step-label">
<span class="twofa-step-num">4</span>
Save your new recovery codes
</div>
<div class="twofa-qr-hint twofa-qr-hint--warning">
<i class="fa-solid fa-triangle-exclamation"></i>Save these codes now — they are
shown only once.
</div>
<div id="twofaRecoveryCodesGrid" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;"></div>
</div>
<div class="twofa-error" id="twofaError"></div>
<div class="twofa-success" id="twofaSuccess">
<i class="fa-solid fa-check-circle"></i> 2FA has been successfully updated!
</div>
</div>
<div class="twofa-modal-footer">
<button class="twofa-btn twofa-btn-cancel" id="twofaCancelBtn">Cancel</button>
<button class="twofa-btn twofa-btn-confirm" id="twofaConfirmBtn">Verify Current Code</button>
</div>
</div>
</div>
<template id="empty-state">
<div class="empty-state">
<i class="fa-solid fa-wand-magic-sparkles empty-state__icon"></i>
<h4>No servers found</h4>
<p>
<% if (isAdmin) { %>
Try adjusting your search or create a new server.
<% } else { %>
You don't have access to any servers
<% } %>
</p>
</div>
</template>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/socket.io.min.js?v=4.8.3" defer></script>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/ssh-terminal-window.js?v=20260924-ssh-terminal-per-tab-1"
defer></script>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/dashboard.js?v=20261007-dashboard-fixes-1"
defer></script>
<div class="christmas-modal" id="christmasModal">
<div class="christmas-glass-layer christmas-glass-layer-1"></div>
<div class="christmas-glass-layer christmas-glass-layer-3"></div>
<div class="christmas-popup">
<button class="christmas-close" id="christmasClose" type="button" aria-label="Close">
<i class="fa-solid fa-xmark"></i>
</button>
<div class="christmas-content">
<div class="christmas-brand">
<img src="<%= branding.logoUrl %>" alt="<%= branding.appName %> Christmas" class="christmas-logo" width="64"
height="64" loading="lazy" decoding="async" />
<span class="christmas-title">
<%= branding.appName %>
</span>
</div>
<p class="christmas-message">Wish you merry christmas!</p>
</div>
</div>
</div>
<div class="newyear-modal" id="newyearModal">
<div class="newyear-glass-layer newyear-glass-layer-1"></div>
<div class="newyear-glass-layer newyear-glass-layer-3"></div>
<div class="newyear-popup">
<button class="newyear-close" id="newyearClose" type="button" aria-label="Close">
<i class="fa-solid fa-xmark"></i>
</button>
<div class="newyear-content">
<div class="newyear-brand">
<img src="<%= branding.logoUrl %>" alt="<%= branding.appName %>" class="newyear-logo" width="64" height="64"
loading="lazy" decoding="async" />
<span class="newyear-title">
<%= branding.appName %>
</span>
</div>
<p class="newyear-message">You are here to build amazing things 1 more year with <%= branding.appName %>
</p>
</div>
</div>
</div>
<style nonce="<%= cspNonce %>">
/* ==========================================================================
ACCOUNT PAGE DESIGN - PERFECT 28px FLUSH LEFT ALIGNMENT MATCH
========================================================================== */
/* Hide ONLY server cards and main content when in account scene (navbar stays visible) */
body.account-active #mainContent,
body.account-active #servers,
body.account-active .bots {
display: none !important;
}
.account-page-new {
width: 100%;
box-sizing: border-box;
padding-top: 25px;
padding-bottom: 50px;
display: flex;
justify-content: center;
align-items: flex-start;
}
.account-container-inner {
width: 780px;
max-width: 100%;
margin: 0 auto;
display: flex;
flex-direction: column;
}
/* Top Title & Tabs Header Bar */
.account-top-header {
display: flex;
justify-content: space-between;
align-items: flex-end;
width: 780px;
max-width: 100%;
margin-bottom: 20px;
}
.account-title-group {
display: flex;
flex-direction: column;
}
/* Account title: Inter Medium 32px #FFFFFF */
.account-main-title {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 500;
font-size: 32px;
line-height: 40px;
color: #FFFFFF;
margin: 0;
}
/* Account subtitle: Inter Regular 15px #B3B3B3 opacity 82% */
.account-main-subtitle {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 15px;
line-height: 19px;
color: rgba(179, 179, 179, 0.82);
margin: 2px 0 0 0;
}
/* Rectangle 114: Top Right Tabs Pill Bar */
.account-tabs-pill {
width: 200px;
height: 38px;
background: rgba(50, 50, 50, 0.59);
box-shadow: -9px 6px 36.7px -4px rgba(0, 0, 0, 0.25);
backdrop-filter: blur(16.6px);
-webkit-backdrop-filter: blur(16.6px);
border-radius: 14px;
display: flex;
align-items: center;
justify-content: space-evenly;
padding: 0 8px;
box-sizing: border-box;
}
.account-tabs-pill .account-tab {
background: transparent;
border: none;
outline: none;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 18px;
color: #FFFFFF;
opacity: 0.55;
transition: opacity 0.18s ease;
padding: 0;
}
.account-tabs-pill .account-tab:hover:not(.active) {
opacity: 0.78;
}
.account-tabs-pill .account-tab.active {
opacity: 1;
font-weight: 400;
}
.account-tab-icon {
width: 15px;
height: 15px;
object-fit: contain;
opacity: 0.61;
transition: opacity 0.2s ease;
}
.account-tabs-pill .account-tab.active .account-tab-icon {
opacity: 1;
}
/* Tab Separator */
.account-tabs-divider {
width: 1px;
height: 20px;
background: rgba(92, 92, 92, 0.49);
}
/* Tab Content Visibility */
.account-page-new .account-tab-content {
display: none;
width: 100%;
}
.account-page-new .account-tab-content.active {
display: block;
}
/* Rectangle 184: Main Card Container */
.account-card-box {
width: 780px;
max-width: 100%;
background: rgba(42, 42, 42, 0.6);
border-radius: 20px;
box-sizing: border-box;
display: flex;
flex-direction: column;
position: relative;
padding-bottom: 20px;
}
/* Top Avatar Header: exact same width/margin as .account-detail-row → left edge always flush with Username label */
.account-avatar-header {
width: 684px;
max-width: calc(100% - 96px);
margin: 16px auto 14px auto;
display: flex;
align-items: center;
gap: 10px;
padding: 0;
}
/* Avatar: 68x68px, NO grey/dark box inside or background */
.account-avatar-header .account-avatar {
width: 68px;
height: 68px;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: pointer;
flex-shrink: 0;
background: transparent !important;
border: none !important;
box-shadow: none !important;
transform: none !important;
transition: none !important;
}
.account-avatar-header .account-avatar:hover {
transform: none !important;
}
.account-avatar-header .account-avatar img,
.account-avatar-header .account-avatar:hover img {
width: 68px;
height: 68px;
object-fit: cover;
border-radius: 50%;
display: block;
transform: none !important;
transition: none !important;
}
.account-avatar-header .account-avatar-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.55);
border-radius: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.2s ease;
color: #FFFFFF;
font-family: 'Inter', sans-serif;
font-size: 11px;
}
.account-avatar-header .account-avatar:hover .account-avatar-overlay {
opacity: 1;
}
.account-user-info {
display: flex;
flex-direction: column;
justify-content: center;
}
/* Hide admin badge from top avatar username */
.account-user-info .account-badge,
.account-username-text .account-badge {
display: none !important;
}
/* Username next to avatar: Inter Medium 22px #FFFFFF */
.account-username-text {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 500;
font-size: 22px;
line-height: 28px;
color: #FFFFFF;
margin: 0;
display: flex;
align-items: center;
}
/* Email next to avatar: Inter Regular 14px #B3B3B3 opacity 82% */
.account-email-text {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 18px;
color: rgba(179, 179, 179, 0.82);
margin: 2px 0 0 0;
}
/* Top Divider Line (width 724px, starts at exactly 28px left margin) */
.account-divider-top {
width: 724px;
max-width: calc(100% - 56px);
height: 2px;
background: rgba(92, 92, 92, 0.34);
margin: 0 auto 2px auto;
}
/* 5 Details Rows */
.account-details-list {
display: flex;
flex-direction: column;
width: 100%;
}
.account-detail-row {
width: 684px;
max-width: calc(100% - 96px);
height: 56px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
position: relative;
}
/* Row Left Labels (Username, Email, Role, User ID, Status): Inter Medium 19px #FFFFFF */
.account-detail-label {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 500;
font-size: 19px;
line-height: 24px;
color: #FFFFFF;
}
.account-detail-value-wrap {
display: flex;
align-items: center;
gap: 10px;
}
/* Row Right Values (Administrator, admin@gmail.com, 11, etc): Inter Regular 16px rgba(255,255,255,0.75) */
.account-detail-value {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 21px;
color: rgba(255, 255, 255, 0.75);
text-align: right;
}
/* Pen Edit Button Box (22px x 22px, #353535, border-radius 6px) */
.account-detail-row .account-row-edit-btn {
width: 22px;
height: 22px;
background: #353535;
border-radius: 6px;
border: none;
outline: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
transition: background 0.2s ease;
}
.account-detail-row .account-row-edit-btn:hover {
background: #454545;
}
.account-detail-row .account-row-edit-btn img {
width: 11px;
height: 11px;
display: block;
}
/* Separator Lines */
.account-divider-row {
width: 684px;
max-width: calc(100% - 96px);
height: 1px;
background: rgba(92, 92, 92, 0.34);
margin: 0 auto;
}
/* Editable Input & Buttons */
.account-detail-row .account-row-input {
background: #353535;
border: 1px solid #5C5C5C;
border-radius: 6px;
color: #FFFFFF;
font-family: 'Inter', sans-serif;
font-size: 15px;
padding: 3px 8px;
outline: none;
}
.account-detail-row .account-row-save-btn,
.account-detail-row .account-row-cancel-btn {
width: 22px;
height: 22px;
border-radius: 6px;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
}
.account-detail-row .account-row-save-btn {
background: #10B981;
color: #FFFFFF;
}
.account-detail-row .account-row-cancel-btn {
background: #EF4444;
color: #FFFFFF;
}
.account-detail-row .account-row-save-btn {
background: #10B981;
color: #FFFFFF;
}
.account-detail-row .account-row-cancel-btn {
background: #EF4444;
color: #FFFFFF;
}
/* ==========================================================================
CREDENTIALS TAB DESIGN - EXACT MATCH TO IMAGE 2
========================================================================== */
.account-credentials-list {
display: flex;
flex-direction: column;
width: 100%;
padding-bottom: 6px;
}
.account-credential-row {
width: 684px;
max-width: calc(100% - 96px);
height: 109px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0;
box-sizing: border-box;
}
.account-credentials-list .account-divider-row {
width: 684px;
max-width: calc(100% - 96px);
height: 1px;
background: rgba(92, 92, 92, 0.34);
margin: 0 auto;
}
.credential-row-left {
display: flex;
align-items: center;
gap: 15px;
}
.credential-icon-box {
width: 52px;
height: 52px;
background: rgba(62, 62, 62, 0.67);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.credential-icon-box .credential-icon {
width: 24px;
height: 24px;
object-fit: contain;
opacity: 0.76;
}
.credential-text-block {
display: flex;
flex-direction: column;
}
.credential-title {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 30px;
color: #FFFFFF;
margin: 0;
}
.credential-desc {
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 12.5px;
line-height: 16px;
color: #B3B3B3;
margin: 2px 0 0 0;
}
.credential-action-btn {
background: rgba(62, 62, 62, 0.59);
border: none;
outline: none;
border-radius: 12px;
height: 35px;
padding: 0 15px;
font-family: 'Inter', sans-serif;
font-style: normal;
font-weight: 400; /* Inter Regular 16px */
font-size: 16px;
line-height: 19px;
color: #FFFFFF;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background 0.2s ease, opacity 0.2s ease;
white-space: nowrap;
}
.credential-action-btn:hover {
background: rgba(80, 80, 80, 0.75);
}
.christmas-modal {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
z-index: 100000;
perspective: 1200px;
}
.christmas-modal.show {
display: flex;
}
.christmas-glass-layer {
position: absolute;
inset: 0;
pointer-events: none;
}
.christmas-glass-layer-1 {
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);
opacity: 0;
animation: christmasLayer1In 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.christmas-glass-layer-3 {
background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 30%, transparent 70%, rgba(255, 255, 255, 0.01) 100%);
opacity: 0;
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
animation: christmasLayer3In 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}
@keyframes christmasLayer1In {
from {
opacity: 0;
filter: blur(20px);
}
to {
opacity: 1;
filter: blur(0);
}
}
@keyframes christmasLayer3In {
from {
opacity: 0;
filter: blur(10px);
}
to {
opacity: 1;
filter: blur(0);
}
}
.christmas-popup {
position: relative;
background: linear-gradient(135deg, rgba(20, 25, 30, 0.95) 0%, rgba(15, 18, 22, 0.98) 100%);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 20px;
padding: 40px 50px;
min-width: 320px;
max-width: 90vw;
text-align: center;
transform: translateY(30px) scale(0.95);
opacity: 0;
animation: christmasPopupIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
@keyframes christmasPopupIn {
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
.christmas-close {
position: absolute;
top: 16px;
right: 16px;
width: 32px;
height: 32px;
border: none;
background: rgba(255, 255, 255, 0.06);
border-radius: 8px;
color: rgba(255, 255, 255, 0.6);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
transition: all 0.2s ease;
}
.christmas-close:hover {
background: rgba(255, 255, 255, 0.12);
color: #fff;
}
.christmas-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
.christmas-brand {
display: flex;
align-items: center;
gap: 12px;
}
.christmas-logo {
width: 64px;
height: 64px;
object-fit: contain;
}
.christmas-title {
font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 32px;
font-weight: 800;
color: #fff;
letter-spacing: -0.5px;
}
.christmas-message {
font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 18px;
color: rgba(255, 255, 255, 0.8);
margin: 0;
font-weight: 500;
}
.newyear-modal {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
z-index: 100000;
perspective: 1200px;
}
.newyear-modal.show {
display: flex;
}
.newyear-glass-layer {
position: absolute;
inset: 0;
pointer-events: none;
}
.newyear-glass-layer-1 {
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);
opacity: 0;
animation: newyearLayer1In 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.newyear-glass-layer-3 {
background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 30%, transparent 70%, rgba(255, 255, 255, 0.01) 100%);
opacity: 0;
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
animation: newyearLayer3In 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}
@keyframes newyearLayer1In {
from {
opacity: 0;
filter: blur(20px);
}
to {
opacity: 1;
filter: blur(0);
}
}
@keyframes newyearLayer3In {
from {
opacity: 0;
filter: blur(10px);
}
to {
opacity: 1;
filter: blur(0);
}
}
.newyear-popup {
position: relative;
background: linear-gradient(135deg, rgba(20, 25, 30, 0.95) 0%, rgba(15, 18, 22, 0.98) 100%);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 20px;
padding: 40px 50px;
min-width: 320px;
max-width: 90vw;
text-align: center;
transform: translateY(30px) scale(0.95);
opacity: 0;
animation: newyearPopupIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
@keyframes newyearPopupIn {
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
.newyear-close {
position: absolute;
top: 16px;
right: 16px;
width: 32px;
height: 32px;
border: none;
background: rgba(255, 255, 255, 0.06);
border-radius: 8px;
color: rgba(255, 255, 255, 0.6);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
transition: all 0.2s ease;
}
.newyear-close:hover {
background: rgba(255, 255, 255, 0.12);
color: #fff;
}
.newyear-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
.newyear-brand {
display: flex;
align-items: center;
gap: 12px;
}
.newyear-logo {
width: 64px;
height: 64px;
object-fit: contain;
}
.newyear-title {
font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 32px;
font-weight: 800;
color: #fff;
letter-spacing: -0.5px;
}
.newyear-message {
font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 18px;
color: rgba(255, 255, 255, 0.8);
margin: 0;
font-weight: 500;
}
</style>
<script nonce="<%= cspNonce %>">
(function () {
const CHRISTMAS_IMG = '/images/ADPanel-christmas.png';
const NORMAL_IMG = '/images/ADPanel-dark.png';
function isChristmasPeriod() {
const now = new Date();
const month = now.getMonth();
const day = now.getDate();
return month === 11 && day >= 25 && day <= 28;
}
function isChristmasDay() {
const now = new Date();
return now.getMonth() === 11 && now.getDate() === 25;
}
function applyChristmasTheme() {
if (!isChristmasPeriod()) return;
const favicon = document.getElementById('favicon') || document.querySelector('link[rel="icon"]');
if (favicon) favicon.href = CHRISTMAS_IMG;
document.querySelectorAll('img').forEach(img => {
// adpanel:login-dead-assets — the i.imgur.com legacy-CDN default-logo
// match was removed 2026-11 with the CDN-surface retirement: this
// page's imgs are branding/avatar/server-minted-QR srcs only. The
// ADPanel-owned default-logo match is the case-insensitive,
// basename-anchored test /(^|\/)adpanel-dark\.(svg|webp)(\?|$)/i,
// restored to life 2026-11: it themes BOTH shipped spellings of the
// default logo — the shipped remote-CDN .../adpanel-dark.svg logoUrl
// (including the christmas popup's own brand img, whose default src
// is that logoUrl) and the local /images/adpanel-dark.svg fallback —
// while an operator's custom upload or avatar is never clobbered.
// The anchors are load-bearing: an unanchored substring match also
// themed URLs that merely EMBED the default filename (e.g.
// .../logos/adpanel-dark.svg.png, or a proxy URL carrying the name as
// a query param), so any src whose basename is not exactly the
// ADPanel-owned default filename never matches. The old
// ADPanel-dark.webp-only includes() was dead against the shipped
// svg default: pre-fix the swap never fired on default-branding
// pages.
if (img.src && /(^|\/)adpanel-dark\.(svg|webp)(\?|$)/i.test(img.src)) {
img.src = CHRISTMAS_IMG;
}
});
}
function showChristmasPopup() {
if (!isChristmasDay()) return;
const today = new Date().toDateString();
const seenKey = 'ADPanel_christmas_seen_' + today;
if (localStorage.getItem(seenKey)) return;
const modal = document.getElementById('christmasModal');
if (!modal) return;
modal.classList.add('show');
localStorage.setItem(seenKey, 'true');
const closeBtn = document.getElementById('christmasClose');
if (closeBtn) {
closeBtn.addEventListener('click', () => modal.classList.remove('show'));
}
modal.addEventListener('click', (e) => {
if (e.target === modal || e.target.classList.contains('christmas-glass-layer')) {
modal.classList.remove('show');
}
});
}
function isNewYearDay() {
const now = new Date();
return now.getMonth() === 0 && now.getDate() === 1;
}
function showNewYearPopup() {
if (!isNewYearDay()) return;
const today = new Date().toDateString();
const seenKey = 'ADPanel_newyear_seen_' + today;
if (localStorage.getItem(seenKey)) return;
const modal = document.getElementById('newyearModal');
if (!modal) return;
modal.classList.add('show');
localStorage.setItem(seenKey, 'true');
const closeBtn = document.getElementById('newyearClose');
if (closeBtn) {
closeBtn.addEventListener('click', () => modal.classList.remove('show'));
}
modal.addEventListener('click', (e) => {
if (e.target === modal || e.target.classList.contains('newyear-glass-layer')) {
modal.classList.remove('show');
}
});
}
document.addEventListener('DOMContentLoaded', () => {
applyChristmasTheme();
showChristmasPopup();
showNewYearPopup();
});
})();
</script>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/dashboard-assistant.js?v=20261006-assistant-audit-fixes-v54"
defer></script>
<script nonce="<%= cspNonce %>">
(function () {
if (window.matchMedia('(hover: none) and (pointer: coarse)').matches) return;
// passive:false support (Safari <10)
var canPF = false;
try {
var _o = Object.defineProperty({}, 'passive', { get: function () { canPF = true; } });
window.addEventListener('_', null, _o); window.removeEventListener('_', null, _o);
} catch (_) { }
var PF = canPF ? { passive: false } : false;
var PT = canPF ? { passive: true } : false;
// ── State ─────────────────────────────────────────────────────────────
var y = window.scrollY || window.pageYOffset; // animated float
var dest = y; // target destination
var raf = null;
var prevT = null;
// After wheel stops, coast for COAST_MS then ease to a stop
var COAST_MS = 200;
var coastT = null;
var coasting = false; // true = decelerating after user stopped
// Lerp strength: lower = smoother/slower, higher = snappier
// Active scroll: tight follow. Coasting: loose glide.
var LERP_ACTIVE = 0.22;
var LERP_COAST = 0.10;
function clamp(v) {
return Math.max(0, Math.min(document.body.scrollHeight - window.innerHeight, v));
}
// ── RAF loop ──────────────────────────────────────────────────────────
function loop(now) {
if (prevT === null) prevT = now;
var dt = Math.min(now - prevT, 50) / 16.667;
prevT = now;
var lerp = coasting ? LERP_COAST : LERP_ACTIVE;
var f = 1 - Math.pow(1 - lerp, dt);
var diff = dest - y;
if (Math.abs(diff) < 0.25) {
y = dest;
window.scrollTo(0, y);
raf = null; prevT = null; coasting = false;
return;
}
y += diff * f;
window.scrollTo(0, y);
raf = requestAnimationFrame(loop);
}
function go() {
if (!raf) { prevT = null; raf = requestAnimationFrame(loop); }
}
// ── Helpers ───────────────────────────────────────────────────────────
function scrollableAncestor(el) {
while (el && el !== document.body) {
var ov = getComputedStyle(el).overflowY;
if ((ov === 'auto' || ov === 'scroll') && el.scrollHeight > el.clientHeight) return true;
el = el.parentElement;
}
return false;
}
function interactive(el) {
var TAGS = { BUTTON: 1, A: 1, INPUT: 1, TEXTAREA: 1, SELECT: 1, LABEL: 1 };
while (el && el !== document.body) {
if (TAGS[el.tagName]) return true;
var role = el.getAttribute && el.getAttribute('role');
if (role === 'button' || role === 'link') return true;
if (el.closest && el.closest('.twofa-modal, .password-modal, .email-modal, .recovery-modal, .enterprise-modal')) return true;
el = el.parentElement;
}
return false;
}
// ── Wheel ─────────────────────────────────────────────────────────────
window.addEventListener('wheel', function (e) {
if (e.ctrlKey || e.metaKey) return;
if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
if (scrollableAncestor(e.target)) return;
e.preventDefault();
var d = e.deltaY;
if (e.deltaMode === 1) d *= 32;
else if (e.deltaMode === 2) d *= window.innerHeight;
// Move dest by exactly what the browser would — no amplification
dest = clamp(dest + d);
coasting = false;
// After COAST_MS of silence, switch to loose lerp for a smooth finish
clearTimeout(coastT);
coastT = setTimeout(function () {
coasting = true;
}, COAST_MS);
go();
}, PF);
// ── Drag-to-scroll ────────────────────────────────────────────────────
var drag = null;
document.addEventListener('mousedown', function (e) {
if (e.button !== 0) return;
if (typeof isSelectionAllowed === 'function' && isSelectionAllowed(e)) return;
var el = e.target && (e.target.nodeType === 3 ? e.target.parentElement : e.target);
if (!el) return;
if (el.closest && (
el.closest('.twofa-modal, .password-modal, .email-modal, .recovery-modal, .enterprise-modal') ||
el.closest('.twofa-modal-overlay, .password-modal-overlay, .email-modal-overlay, .recovery-modal-overlay') ||
el.closest('#twofaModal, #passwordModal, #emailModal, #recoveryModal, #regenRecoveryModal, #statusModal') ||
el.closest('.twofa-secret-display, .twofa-secret-code, #newSecretDisplay')
)) return;
if (document.querySelector('.twofa-modal-overlay.show, .password-modal-overlay.show, .email-modal-overlay.show, .recovery-modal-overlay.show, .enterprise-modal-overlay.show')) return;
if (interactive(el)) return;
if (scrollableAncestor(el)) return;
dest = y;
drag = { startY: e.clientY, startScroll: y, lastY: e.clientY, lastT: performance.now(), vel: 0 };
clearTimeout(coastT); coasting = false;
document.body.style.userSelect = 'none';
document.body.style.cursor = 'grabbing';
e.preventDefault();
}, PF);
document.addEventListener('mousemove', function (e) {
if (!drag) return;
var now = performance.now();
var dt = now - drag.lastT || 1;
drag.vel = (e.clientY - drag.lastY) / dt;
drag.lastY = e.clientY;
drag.lastT = now;
y = clamp(drag.startScroll + (drag.startY - e.clientY));
dest = y;
window.scrollTo(0, y);
}, PT);
function endDrag() {
if (!drag) return;
document.body.style.userSelect = '';
document.body.style.cursor = '';
// Throw with momentum, then coast to stop
var throw_ = -drag.vel * 16.667 * 1.2;
dest = clamp(y + throw_);
coasting = true;
drag = null;
if (Math.abs(throw_) > 1) go();
}
document.addEventListener('mouseup', endDrag);
document.addEventListener('mouseleave', endDrag);
// Sync when external code scrolls (scrollIntoView, account page, etc.)
window.addEventListener('scroll', function () {
if (!raf && !drag) {
y = window.scrollY || window.pageYOffset;
dest = y;
}
}, PT);
})();
</script>
<script nonce="<%= cspNonce %>">
document.addEventListener('DOMContentLoaded', function () {
const grid = document.querySelector('[data-bot-grid]');
if (!grid) return;
// JSON.stringify renders the email as a properly escaped JS string
// literal (EJS output escaping leaves backslashes alone, so an email
// ending in "\" terminated this whole script block with a SyntaxError);
// the "<" replacement matches bot.ejs/settings.ejs and keeps a hostile
// value from closing the script element early.
const currentUserEmail = <%- JSON.stringify(String(user && user.email || "")).replace(/</g, "\\u003c") %>;
const pinStorageKey = currentUserEmail ? `pinned_servers_${currentUserEmail}` : 'pinned_servers';
function getPinnedServers() {
try {
const parsed = JSON.parse(localStorage.getItem(pinStorageKey) || '[]');
return Array.isArray(parsed) ? parsed : [];
} catch (e) {
return [];
}
}
function setPinnedServers(arr) {
try {
localStorage.setItem(pinStorageKey, JSON.stringify(arr));
} catch (e) { }
}
function updateCardOrder() {
const pinned = getPinnedServers();
const cards = Array.from(grid.querySelectorAll('[data-bot-card]'));
// 1. FIRST: Get initial bounding rects
const firstPositions = new Map();
cards.forEach(card => {
firstPositions.set(card, card.getBoundingClientRect());
});
// 2. Sort the cards array
cards.sort((a, b) => {
const aName = a.getAttribute('data-name');
const bName = b.getAttribute('data-name');
const aPinned = pinned.includes(aName) ? 1 : 0;
const bPinned = pinned.includes(bName) ? 1 : 0;
if (aPinned !== bPinned) return bPinned - aPinned;
const aDisp = (a.querySelector('.bot-card__name')?.textContent || '').trim().toLowerCase();
const bDisp = (b.querySelector('.bot-card__name')?.textContent || '').trim().toLowerCase();
return aDisp.localeCompare(bDisp);
});
// 3. Reorder DOM nodes and update is-pinned class
cards.forEach(card => {
grid.appendChild(card);
const pinBtn = card.querySelector('.bot-card__pin-btn');
if (pinBtn) {
const isPinned = pinned.includes(card.getAttribute('data-name'));
if (isPinned) {
pinBtn.classList.add('is-pinned');
} else {
pinBtn.classList.remove('is-pinned');
}
// Add a one-time mouseleave listener to clear just-clicked class
if (!pinBtn.dataset.hasLeaveListener) {
pinBtn.dataset.hasLeaveListener = 'true';
pinBtn.addEventListener('mouseleave', () => {
pinBtn.classList.remove('just-clicked');
});
}
}
});
// 4. INVERT: Calculate deltas and apply non-transitioned translation
const movingCards = [];
cards.forEach(card => {
const firstRect = firstPositions.get(card);
const lastRect = card.getBoundingClientRect();
const deltaX = firstRect.left - lastRect.left;
const deltaY = firstRect.top - lastRect.top;
if (deltaX !== 0 || deltaY !== 0) {
card.style.transition = 'none';
card.style.transform = `translate(${deltaX}px, ${deltaY}px)`;
movingCards.push({ card, deltaX, deltaY });
}
});
// Force a single reflow to apply the inline styles
if (movingCards.length > 0) {
grid.offsetHeight;
// 5. PLAY: Enable transition and animate to 0,0
movingCards.forEach(({ card }) => {
card.style.transition = 'transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), background 0.4s ease';
card.style.transform = 'translate(0, 0)';
// Clean up styles after animation ends
setTimeout(() => {
card.style.transition = '';
card.style.transform = '';
}, 450);
});
}
}
updateCardOrder();
// The infinite-scroll loader in dashboard.js appends page 2+ cards after
// this script has run; expose the sort so each appended page merges into
// the same pinned-first/alphabetical order (and gets its is-pinned
// state applied) instead of trailing in backend order until a pin click.
window.updateCardOrder = updateCardOrder;
grid.addEventListener('click', function (e) {
const pinBtn = e.target.closest('.bot-card__pin-btn');
if (!pinBtn) return;
e.stopPropagation();
const card = pinBtn.closest('[data-bot-card]');
if (!card) return;
// Add just-clicked class to prevent hover state conflict
pinBtn.classList.add('just-clicked');
const name = card.getAttribute('data-name');
let pinned = getPinnedServers();
if (pinned.includes(name)) {
pinned = pinned.filter(p => p !== name);
} else {
pinned.push(name);
}
setPinnedServers(pinned);
updateCardOrder();
});
});
</script>
</body>
</html>