Files
Kelx/views/index.ejs
T
antonn 78193254ad Security: fix ws-upgrade crash, per-user TOFU eviction, token log leaks; rebuild sshterm
Panel (index.js, client, views):
- upgrade handler: error guard on every upgraded socket (any path) plus a 3s
  zero-byte orphan reaper; engine.io destroyUpgrade disabled — closes the
  unauthenticated ECONNRESET crash of the whole panel and stops engine.io's
  1s timer from killing slow ssh-terminal handshakes
- /api/ssh-terminal/session: per-session token reuse cache in front of the
  rate limiter — floating-terminal auto-restore no longer burns the 10/min
  mint budget (tokens are re-served only to the same panel session + IP)
- global error middleware redacts credential-bearing query params via
  utils/url-sanitize.js — ssh-terminal ?token= values no longer reach logs
- floating-terminal restore consumes the persisted live flag: after the
  frame reported the SSH session dead, restore drops the stored session id
  and starts a clean connect; script cache busters bumped

sshterm (cmd/sshterm/main.go, rebuilt and deployed):
- TOFU store eviction is per-user and offender-pays (per-user caps: 64 pins
  and 256 contributed advisory hosts; total caps remain as backstops that
  evict the largest contributor first) — one user flooding first-use pins
  to hosts they control can no longer evict another user's pinned key or
  suppress their divergence warning
- the store file is reloaded on mtime/size change: admin edits to
  data/ssh_known_hosts.json now take effect on the next connection without
  a restart; corrupt files keep the last good state, deleted files clear
  the store, other read errors fail closed
- regression tests for flood/eviction/reload/healing + negative controls
- also lands the previously uncommitted IP-binding, trusted-proxy,
  allowed-hosts and metadata-blocking hardening; binary rebuilt through
  initialize.sh --repair-sshterm and verified live at
  /usr/local/bin/adpanel-sshterm (sha256 6bc0363479b91e6c49af9b153c8e552fd4ad8f9a5f787d73bbdc238ce0f7579e)
2026-09-23 17:50:40 +00:00

1788 lines
100 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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="dashboard.css?v=<%= typeof themeVersion !== 'undefined' ? themeVersion : Date.now() %>">
<title><%= (branding && branding.appName) ? branding.appName : 'ADPanel' %></title>
<link id="favicon" rel="icon" type="image/webp"
href="<%= (branding && branding.faviconUrl) ? branding.faviconUrl : '/auth-assets/favicon' %>" />
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
integrity="sha384-nRgPTkuX86pH8yjPJUAFuASXQSSl2/bBUiNV47vSYpKFxHJhbcrGnmlYpYJMeD7a"
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="/css/dashboard.css?v=<%= typeof themeVersion !== 'undefined' ? themeVersion : Date.now() %>">
<link rel="stylesheet" href="/css/dashboard-assistant.css?v=20260423-assistant-access-gate">
<link rel="stylesheet" href="/css/ssh-terminal-window.css?v=20260509-floating-terminal-5">
<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;
}
</style>
<style nonce="<%= cspNonce %>">
.top-bar.nav-shell {
--nav-option: clamp(40px, 5.8vh, 52px);
--nav-gap: clamp(6px, 0.7vw, 12px);
--nav-radius: 999px;
--nav-ease: cubic-bezier(0.65, 0, 0.35, 1);
--nav-idle: rgba(255, 255, 255, 0.06);
--nav-active: radial-gradient(50% 50% at 50% 50%, #009BDE 0%, #006D9C 100%);
display: flex;
flex-wrap: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: clamp(12px, 2vw, 32px);
width: auto;
max-width: calc(100% - 40px);
min-height: clamp(68px, 8vh, 92px);
height: auto;
padding: clamp(14px, 5vh, 20px) clamp(14px, 1.8vw, 26px);
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: var(--nav-radius);
-webkit-backdrop-filter: blur(14px) saturate(160%);
backdrop-filter: blur(14px) saturate(160%);
box-shadow: var(--shadow-md);
overflow: hidden;
will-change: auto;
contain: layout;
}
.nav-brand {
display: flex;
flex-direction: row;
align-items: center;
gap: clamp(6px, 0.5vw, 8px);
flex: 0 0 auto;
min-width: 0;
cursor: pointer;
border-radius: 12px;
padding: 4px 8px;
margin: -4px -8px;
transition: background 0.18s ease, transform 0.18s ease;
}
.nav-brand:hover,
.nav-brand:focus-visible {
background: rgba(255, 255, 255, 0.06);
transform: translateY(-1px);
outline: none;
}
.nav-brand:active {
transform: translateY(0);
}
.nav-brand__logo {
width: clamp(42px, 6vh, 58px);
height: clamp(42px, 6vh, 58px);
object-fit: contain;
filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}
.nav-brand__wordmark {
font-family: 'Gilroy', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
font-weight: 500;
font-size: clamp(1.5rem, 3.4vh, 2.1rem);
line-height: 1;
letter-spacing: 0.01em;
color: #FFFFFF;
white-space: nowrap;
}
.nav-alert {
display: flex;
align-items: center;
gap: 8px;
flex: 0 1 auto;
min-width: 0;
padding: 6px 14px;
border-radius: 999px;
background: rgba(255, 100, 100, 0.1);
color: #ffcccc;
pointer-events: none;
}
.nav-alert span {
font-size: 14px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.top-bar.nav-shell .toolbar {
flex: 0 1 auto;
min-width: 0;
gap: 0;
}
.nav-options {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
gap: var(--nav-gap);
min-width: 0;
}
.nav-options .nav-option-wrap {
display: flex;
align-items: center;
flex: none;
}
.nav-option {
order: 5;
position: relative;
flex: none;
height: var(--nav-option);
min-height: var(--nav-option);
display: inline-flex;
flex-direction: row-reverse;
align-items: center;
justify-content: center;
padding: 0;
border: none !important;
outline: none !important;
border-radius: var(--nav-radius);
background: var(--nav-idle);
color: #FFFFFF;
cursor: pointer;
overflow: hidden;
isolation: isolate;
transition:
background 0.4s var(--nav-ease),
transform 0.4s var(--nav-ease);
}
.nav-option::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
background: var(--nav-active);
opacity: 0;
z-index: -1;
transition: opacity 0.4s var(--nav-ease);
}
.nav-option__icon {
flex: none;
width: var(--nav-option);
height: var(--nav-option);
display: grid;
place-items: center;
}
.nav-option__icon i {
font-size: clamp(0.85rem, 1.7vh, 1.1rem);
line-height: 1;
color: #FFFFFF;
}
.nav-option__icon svg {
width: 19px;
height: 19px;
fill: #FFFFFF;
}
.nav-option__icon svg path {
fill: inherit;
}
.nav-option__label {
display: grid;
grid-template-columns: 0fr;
min-width: 0;
overflow: hidden;
font-family: 'Gilroy', 'Manrope', system-ui, sans-serif;
font-weight: 500;
font-size: clamp(0.8rem, 1.6vh, 0.95rem);
line-height: 1;
color: #FFFFFF;
white-space: nowrap;
padding-left: 0;
transition:
grid-template-columns 0.4s var(--nav-ease),
padding 0.4s var(--nav-ease);
}
.nav-option__label > * {
min-width: 0;
overflow: hidden;
}
.nav-option:not(:disabled):hover,
.nav-option:not(:disabled):focus-visible {
background: transparent;
transform: none;
}
.nav-option:not(:disabled):hover::before,
.nav-option:not(:disabled):focus-visible::before {
opacity: 1;
}
.nav-option:not(:disabled):hover .nav-option__label,
.nav-option:not(:disabled):focus-visible .nav-option__label {
grid-template-columns: 1fr;
padding-left: clamp(14px, 1.2vw, 18px);
}
.nav-option:not(:disabled):active {
transform: scale(0.97);
}
.nav-option:disabled {
cursor: not-allowed;
opacity: 0.6;
}
.nav-option--status { order: 0; }
.nav-option--account { order: 1; }
#openSshTerminalBtn.nav-option { order: 2; }
.nav-options .nav-option-wrap { order: 3; }
.nav-option[data-href="/settings"],
.nav-option[title="You are not admin"] { order: 4; }
.nav-option--logout { order: 6; }
.top-bar.nav-shell .account-avatar-btn .nav-option__icon {
overflow: hidden;
border-radius: 50%;
}
.top-bar.nav-shell .account-avatar-btn .account-btn-avatar {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
.nav-option--logout {
background: rgba(255, 0, 0, 0.2);
}
.nav-option--logout::before {
background: radial-gradient(50% 50% at 50% 50%, #ff4d4d 0%, #b30000 100%);
}
.nav-option--logout:not(:disabled):hover,
.nav-option--logout:not(:disabled):focus-visible {
/* no additional styles needed */
}
@media (max-width: 720px) {
.nav-brand__wordmark {
display: none;
}
}
@media (max-width: 520px) {
.nav-option__label {
display: none;
}
}
</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 (_) { }
document.addEventListener('contextmenu', e => {
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;
e.preventDefault();
});
document.addEventListener('dragstart', e => e.preventDefault());
document.addEventListener('selectstart', e => {
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;
e.preventDefault();
});
document.addEventListener('copy', e => {
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;
e.preventDefault();
});
document.addEventListener('cut', e => {
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;
e.preventDefault();
});
document.addEventListener('keydown', e => {
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 %>">
<div id="splash-screen" data-splash-image="/images/hello.webp"></div>
<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 nav-shell" id="topBar">
<div class="nav-brand" data-href="/" role="link" tabindex="0" aria-label="Go to dashboard">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="ADPanel logo"
class="nav-brand__logo" />
<span class="nav-brand__wordmark">Panel</span>
</div>
<% if (typeof globalAlert !=='undefined' && globalAlert && globalAlert.message) { %>
<div class="nav-alert">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/alert.webp" width="25" height="20" alt="">
<span>
<%= globalAlert.message %>
</span>
</div>
<% } %>
<div class="toolbar">
<div class="toolbar-actions nav-options">
<% if (isAdmin) { %>
<button class="nav-option nav-option--status" title="Status" data-href="/status">
<span class="nav-option__icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512" style="fill: #FFFFFF;">
<path d="M0 0 C0.87962402 -0.00705963 1.75924805 -0.01411926 2.66552734 -0.02139282 C39.74674251 -0.25135321 39.74674251 -0.25135321 56.5234375 3.203125 C58.02414795 3.50911621 58.02414795 3.50911621 59.55517578 3.82128906 C97.17915541 11.73182433 131.29288778 27.44362325 161.5234375 51.203125 C162.50957031 51.96496094 163.49570312 52.72679687 164.51171875 53.51171875 C166.52309285 55.06638893 168.5275866 56.6286204 170.5234375 58.203125 C169.94229481 61.81399091 168.60607884 63.50024198 166.05131531 66.06965637 C165.30686157 66.8254599 164.56240784 67.58126343 163.7953949 68.35997009 C162.97305862 69.17937576 162.15072235 69.99878143 161.3034668 70.84301758 C160.44167816 71.71327576 159.57988953 72.58353394 158.69198608 73.48016357 C156.32777778 75.86376968 153.95694147 78.24035489 151.5820806 80.61332154 C149.60122226 82.59406026 147.62472238 84.57912056 145.64809734 86.56408232 C140.98671669 91.24469653 136.31720579 95.9170911 131.64282227 100.5847168 C126.81647883 105.40441124 122.00510426 110.23869294 117.20065182 115.08020097 C113.07707196 119.23442977 108.94393597 123.37897934 104.80305415 127.51596183 C102.32903626 129.98790812 99.85897638 132.46351517 97.3982296 134.94867897 C94.65660976 137.71660086 91.89522782 140.46425607 89.1315918 143.21020508 C88.31532822 144.0397319 87.49906464 144.86925873 86.6580658 145.72392273 C85.90515259 146.46562714 85.15223938 147.20733154 84.37651062 147.97151184 C83.72518001 148.62355496 83.07384939 149.27559809 82.40278149 149.94740009 C80.5234375 151.203125 80.5234375 151.203125 78.42446613 150.9915266 C75.95377333 149.96687177 73.91805533 148.59022109 71.7109375 147.078125 C58.01517302 138.1968503 42.73369114 132.36597865 26.5234375 130.203125 C25.00943359 130.00009766 25.00943359 130.00009766 23.46484375 129.79296875 C7.66750607 128.17416029 -8.42783997 130.26742013 -23.4765625 135.203125 C-25.10078125 135.72519531 -25.10078125 135.72519531 -26.7578125 136.2578125 C-53.72594693 145.74902486 -75.30070438 166.71122871 -87.72827148 192.12670898 C-100.53911051 219.3818096 -101.7888908 249.08712888 -92.08691406 277.50537109 C-87.5601257 289.93094323 -81.31122313 301.32808927 -72.4765625 311.203125 C-71.41308594 312.46189453 -71.41308594 312.46189453 -70.328125 313.74609375 C-52.39318505 334.54433113 -28.35861262 343.73261247 -2.4765625 350.203125 C-2.4765625 393.103125 -2.4765625 436.003125 -2.4765625 480.203125 C-27.04182791 477.86357591 -27.04182791 477.86357591 -36.1015625 475.953125 C-37.14658936 475.73696533 -38.19161621 475.52080566 -39.26831055 475.2980957 C-61.67283043 470.4982272 -83.34762964 462.12085061 -103.4765625 451.203125 C-104.14719727 450.84025391 -104.81783203 450.47738281 -105.50878906 450.10351562 C-121.65372995 441.25008414 -136.53637855 430.5150016 -149.8125 417.75 C-151.937288 415.71867774 -154.0804569 413.81403091 -156.3515625 411.953125 C-159.43551358 409.35293095 -162.0139216 406.4427273 -164.6171875 403.3671875 C-165.86451651 401.91546424 -167.1469038 400.49319662 -168.4609375 399.1015625 C-179.94712209 386.90273142 -189.2840837 372.77381819 -197.4765625 358.203125 C-197.84201172 357.56648926 -198.20746094 356.92985352 -198.58398438 356.27392578 C-218.67479748 321.09759313 -227.93328992 281.16797439 -227.8515625 240.890625 C-227.85135101 239.92568115 -227.85113953 238.9607373 -227.85092163 237.96655273 C-227.81624818 222.06606191 -226.82381751 206.79564166 -223.4765625 191.203125 C-223.28400879 190.29288574 -223.09145508 189.38264648 -222.89306641 188.44482422 C-221.62741948 182.63469068 -220.14656682 176.90958082 -218.4765625 171.203125 C-218.25774414 170.45305176 -218.03892578 169.70297852 -217.81347656 168.93017578 C-204.32896849 123.75022384 -175.72367731 81.21390597 -138.4765625 52.203125 C-137.54070312 51.43871094 -136.60484375 50.67429688 -135.640625 49.88671875 C-113.16838931 31.89159943 -86.93271357 18.6708015 -59.4765625 10.203125 C-58.73954102 9.97044922 -58.00251953 9.73777344 -57.24316406 9.49804688 C-38.85282791 3.75771073 -19.29366163 0.10340623 0 0 Z " fill="#FFFFFF" transform=" translate(243.4765625,15.796875)"/>
<path d="M0 0 C42.9 0 85.8 0 130 0 C126.03469721 41.63567926 115.3675783 80.81564633 92 116 C91.55720703 116.66902344 91.11441406 117.33804688 90.65820312 118.02734375 C76.40148325 139.34397567 58.62920372 159.64103081 38 175 C36.96230469 175.78117188 35.92460937 176.56234375 34.85546875 177.3671875 C-4.04997014 206.1688596 -47.11694982 220.43970951 -95 225 C-95 182.1 -95 139.2 -95 95 C-87.74 93.02 -80.48 91.04 -73 89 C-44.64468925 77.78027273 -21.79680111 58.18783688 -9.13183594 30.07275391 C-4.98485612 20.24876926 -2.61084089 10.44336354 0 0 Z " fill="#FFFFFF" transform="translate(366,271)"/>
<path d="M0 0 C1.81032467 1.95710775 3.4012665 3.87897222 5 6 C5.72413086 6.94516479 5.72413086 6.94516479 6.46289062 7.90942383 C35.41335943 46.07353891 58 94.09567588 58 143 C15.1 143 -27.8 143 -72 143 C-73.98 135.74 -75.96 128.48 -78 121 C-81.52649668 112.08758112 -85.16914316 104.10105786 -90.6171875 96.234375 C-92.01195472 93.98068334 -92.7394619 92.62523424 -93 90 C-91.72586441 88.10224533 -91.72586441 88.10224533 -89.72369385 86.10223389 C-88.97213013 85.33946136 -88.22056641 84.57668884 -87.44622803 83.790802 C-86.18555511 82.55002396 -86.18555511 82.55002396 -84.89941406 81.28417969 C-84.02655762 80.40577423 -83.15370117 79.52736877 -82.25439453 78.62234497 C-79.85420687 76.21235086 -77.44332619 73.81411859 -75.02657032 71.42080593 C-72.5028063 68.9171098 -69.9920067 66.40047387 -67.47943115 63.88555908 C-63.25755464 59.66373619 -59.02592504 55.45188983 -54.78808594 51.24609375 C-49.88476224 46.37966477 -44.99564166 41.4993255 -40.11422181 36.61093211 C-35.42325537 31.91366604 -30.72382002 27.22496958 -26.01995087 22.54062653 C-24.01588078 20.54474308 -22.01458241 18.5461393 -20.01538849 16.54537201 C-17.22512802 13.7540715 -14.42241045 10.97549504 -11.61816406 8.19824219 C-10.78581238 7.3629599 -9.95346069 6.52767761 -9.09588623 5.66708374 C-8.33304321 4.91559052 -7.5702002 4.16409729 -6.78424072 3.38983154 C-6.12201633 2.73133587 -5.45979195 2.07284019 -4.77750015 1.39439011 C-3 0 -3 0 0 0 Z " fill="#FFFFFF" transform="translate(438,98)"/>
</svg></span>
<span class="nav-option__label"><span>Status</span></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" draggable="false">
</span>
<span class="nav-option__label"><span>Account</span></span>
</button>
<button id="openSshTerminalBtn" class="nav-option ssh-terminal-btn"
title="Open SSH Terminal">
<span class="nav-option__icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512" style="fill: #FFFFFF; min-width: 24px; max-width: 24px; min-height: 24px; max-height: 24px;"><path d="M99 110c2.115 1.786 3.975 3.645 5.82 5.707 2.537 2.669 5.269 5.023 8.052 7.43 3.373 2.953 6.621 6.034 9.877 9.113l17.328 16.078 9.359 8.609 1.637 1.512 3.284 3.034L162.5 169l3.25 3 1.625 1.5 32.501 30.001 3.243 2.993 8.237 7.612 1.674 1.548 3.287 3.051c2.485 2.307 4.986 4.55 7.582 6.733 6.364 5.375 10.336 9.869 11.469 18.293.395 8.417-2.205 14.111-7.836 20.313l-4.031 4.145-4.336 4.504-2.151 2.219c-2.758 2.863-5.453 5.782-8.138 8.714L196 297.5l-13 14-14.789 15.914L157 339.5l-14.789 15.914L131 367.5l-14.78 15.89c-2.87 3.054-5.692 6.13-8.423 9.309-6.579 7.59-12.401 13.038-22.859 13.801-7.67-.974-12.916-3.664-17.746-9.719C63.005 390.522 63.233 384.386 64 377c1.058-3.274 2.736-5.434 5-8l2.289-2.621 7.102-7.677 6.77-7.233 5.367-5.746L100 335.5l14.789-15.914L126 307.5l14.789-15.914 12.665-13.665 11.733-12.608L181 248c-5.143-6.466-11.162-11.885-17.262-17.419L155.5 223l-3.25-3-58.5-54-1.627-1.501-3.23-2.985-8.424-7.724-1.76-1.605-3.309-3c-10.908-9.972-10.908-9.972-11.771-17.355-.164-8.859.693-13.949 6.828-20.348 8.495-7.778 19.104-6.863 28.543-1.48zm119.089 251.733l2.743-.014 9.085-.009 6.52-.02 17.703-.024 11.063-.011 38.604-.025 35.97-.051 30.895-.036 18.446-.026 17.352-.005 6.36-.015 8.7.009 2.526-.031c6.649.078 12.882 1.644 17.835 6.305 5.691 6.331 6.621 11.219 6.488 19.732-.69 6.353-3.718 10.154-8.316 14.363-5.888 4.086-11.226 4.418-18.151 4.392l-2.743.014-9.085.009-6.52.02-17.703.024-11.063.011-38.604.025c-11.99-.001-23.98.02-35.97.051l-30.895.036c-6.149-.001-12.298.005-18.446.026l-17.352.005c-2.12-.002-4.24.003-6.36.015-2.9.015-5.799.006-8.7-.009l-2.526.031c-6.649-.078-12.882-1.644-17.835-6.305-5.691-6.331-6.621-11.219-6.488-19.732.69-6.353 3.718-10.154 8.316-14.363 5.888-4.086 11.226-4.418 18.151-4.392z"/></svg></span>
<span class="nav-option__label"><span>Terminal</span></span>
</button>
<% if (showDashboardAssistant) { %>
<div class="toolbar-assistant nav-option-wrap">
<button id="dashboardAssistantButton" class="nav-option dashboard-assistant-trigger"
title="Open ADPanel Assistant" aria-haspopup="dialog" aria-expanded="false">
<span class="nav-option__icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512" style="fill: #FFFFFF; min-width: 24px; max-width: 24px; min-height: 24px; max-height: 24px;">
<path d="M0 0 C0.94177835 -0.00367669 1.8835567 -0.00735338 2.85387379 -0.01114148 C6.01180538 -0.02216036 9.16970405 -0.02601916 12.32765198 -0.02983093 C14.59136052 -0.03609706 16.85506803 -0.042744 19.11877441 -0.04974365 C26.55631292 -0.07077304 33.9938516 -0.08114672 41.43141174 -0.09111023 C43.9945381 -0.09515855 46.55766435 -0.0992755 49.12079048 -0.10346031 C59.78643647 -0.12032896 70.45207907 -0.13496223 81.11773586 -0.14220905 C83.88334594 -0.14411874 86.648956 -0.1460391 89.41456604 -0.147995 C90.4455502 -0.14872061 90.4455502 -0.14872061 91.49736232 -0.14946087 C102.61653024 -0.15775048 113.73559021 -0.18306998 124.85471105 -0.21557567 C136.28841155 -0.2487265 147.72203167 -0.26633295 159.15578514 -0.26985329 C165.56808533 -0.27219944 171.9802149 -0.28110319 178.39246941 -0.30631447 C184.43110991 -0.32967284 190.46946842 -0.33379709 196.50814247 -0.32355309 C198.71631689 -0.32305946 200.92450555 -0.32932821 203.13263702 -0.34310913 C226.60958953 -0.4813493 245.61321943 4.68098597 263.01734924 21.38545227 C282.92724095 42.10937703 284.00209203 67.02931951 283.95094299 94.17842102 C283.95229201 96.70377133 283.95423451 99.22912139 283.95674133 101.75447083 C283.95967712 107.02276111 283.9556359 112.29100022 283.94606018 117.5592804 C283.93513448 123.64033635 283.93873974 129.72125859 283.94971299 135.80231142 C283.95988887 141.67829785 283.95880565 147.55424284 283.95294952 153.43023682 C283.95161595 155.92133605 283.9532505 158.4124387 283.95790863 160.90353394 C283.96298181 164.37611499 283.95525431 167.84843739 283.94410706 171.32099915 C283.94815552 172.34858337 283.95220398 173.3761676 283.95637512 174.43489075 C283.95073547 175.38219055 283.94509583 176.32949036 283.93928528 177.30549622 C283.9381542 178.53426861 283.9381542 178.53426861 283.93700027 179.78786469 C283.54352567 183.47635294 282.51908071 186.28363106 279.93531799 188.95967102 C276.25052277 190.90442405 272.86394906 190.49156535 268.93141174 189.34248352 C268.00457581 188.9892804 267.07773987 188.63607727 266.12281799 188.27217102 C260.59491457 186.29841275 255.3280555 185.40626293 249.49781799 184.83467102 C245.87322528 183.94865947 244.87106434 183.19485148 242.68531799 180.14717102 C242.07972442 176.78523368 242.14240941 173.45356738 242.17115784 170.04536438 C242.1604702 168.50554398 242.1604702 168.50554398 242.14956665 166.93461609 C242.13024389 163.53522136 242.13857646 160.13644646 242.14625549 156.73701477 C242.13634906 154.37010794 242.12440802 152.00320883 242.11051941 149.63632202 C242.07809743 143.39503215 242.06776168 137.15391767 242.06367493 130.91255188 C242.05493614 120.94779387 242.01922915 110.98318071 241.9715004 101.01854134 C241.95897268 97.54719715 241.95966919 94.07603738 241.96177673 90.60467529 C241.95518972 88.45469526 241.94818215 86.30471645 241.94068909 84.15473938 C241.94481308 83.20004257 241.94893707 82.24534576 241.95318604 81.26171875 C241.88531579 69.79221884 240.48012669 59.04671477 232.43531799 50.39717102 C220.82149049 39.57239337 205.44057308 40.85517075 190.61500549 40.88838196 C188.58051936 40.88566889 186.54603421 40.88210619 184.5115509 40.87776184 C179.00749027 40.86867318 173.50350494 40.87216755 167.99944305 40.87852001 C162.22790327 40.88359826 156.45636976 40.87888349 150.68482971 40.87574768 C140.99422554 40.87211335 131.3036519 40.87689314 121.61305237 40.88642883 C110.4238204 40.89731234 99.23466134 40.89378638 88.04543114 40.88277602 C78.42306585 40.87368796 68.80072246 40.87242531 59.17835426 40.87765336 C53.43812999 40.8807647 47.69793994 40.8812054 41.9577179 40.87458038 C36.56009778 40.86878545 31.16257129 40.87284308 25.76496124 40.8843689 C23.78893438 40.88700401 21.81289958 40.88627012 19.83687592 40.88184357 C-1.16708133 40.54162604 -1.16708133 40.54162604 -19.06468201 50.39717102 C-29.99958512 62.15406002 -28.60750467 78.13110813 -28.57347107 93.13154602 C-28.5761848 95.14485297 -28.57974787 97.15815892 -28.58409119 99.17146301 C-28.59317201 104.61355039 -28.58968874 110.05556152 -28.58333302 115.49765015 C-28.57825068 121.20732317 -28.58297066 126.91698991 -28.58610535 132.62666321 C-28.58973849 142.21293808 -28.584963 151.79918209 -28.57542419 161.38545227 C-28.56454092 172.45028533 -28.56806696 183.51504467 -28.57907701 194.57987595 C-28.58816846 204.09951786 -28.58942607 213.61913765 -28.58419967 223.1387825 C-28.58109019 228.81586667 -28.58064247 234.49291625 -28.58727264 240.16999817 C-28.59307253 245.50853914 -28.58900099 250.84698555 -28.57748413 256.18551636 C-28.57485165 258.13854821 -28.57557835 260.0915881 -28.58000946 262.0446167 C-28.98584535 283.54137855 -28.98584535 283.54137855 -19.06468201 301.89717102 C-9.50898083 310.80365259 2.34160779 311.45216214 14.84864807 311.38667297 C16.02225891 311.38868713 17.19586975 311.39070129 18.40504456 311.39277649 C20.93619362 311.3963042 23.46735153 311.39557701 25.99849892 311.39100075 C30.00393372 311.38538343 34.0091871 311.39410914 38.0145874 311.40820312 C49.39661974 311.44578537 60.77856801 311.46410305 72.16065979 311.45259094 C78.46342316 311.44637368 84.76589875 311.45794907 91.0685913 311.48903626 C94.39715492 311.50461515 97.72502319 311.50785503 101.05361366 311.49445534 C104.75918389 311.48016956 108.46346219 311.49635534 112.16896057 311.51948547 C113.2667131 311.50771774 114.36446564 311.49595001 115.4954834 311.48382568 C122.93392606 311.57507991 122.93392606 311.57507991 126.81451416 314.52966309 C128.61876235 317.05405065 130.04694925 319.4698617 131.37281799 322.27217102 C134.29346799 327.93762036 138.09648287 332.08107234 142.61109924 336.54170227 C144.99742141 339.53921053 145.52062488 341.34893599 145.68531799 345.14717102 C143.46178858 350.75893573 143.46178858 350.75893573 140.68531799 352.14717102 C138.7472236 352.25166703 136.80550769 352.29107772 134.86462402 352.30107117 C133.62431931 352.30967163 132.38401459 352.31827209 131.10612488 352.32713318 C129.72358746 352.33156885 128.34104959 352.33586716 126.95851135 352.34004211 C125.50798343 352.34794305 124.05745748 352.35621199 122.60693359 352.36482239 C117.82969547 352.39107728 113.05244853 352.4063688 108.27516174 352.42060852 C106.6268469 352.42596968 104.9785321 352.4313472 103.33021736 352.43674088 C96.46320193 352.45838834 89.59618886 352.47711667 82.72914791 352.48836327 C72.91689158 352.50454123 63.10503519 352.5375464 53.29292959 352.59476411 C46.38142828 352.63367567 39.47003287 352.65302174 32.55842501 352.65828383 C28.43909701 352.66191286 24.32019516 352.67366658 20.20098686 352.70638657 C-7.78527516 352.91780802 -29.27301108 350.30476437 -50.50218201 330.06123352 C-62.75274929 317.18856712 -69.46555782 300.48781868 -69.46185303 282.83248901 C-69.46552972 281.89071066 -69.4692064 280.94893231 -69.47299451 279.97861522 C-69.48401338 276.82068363 -69.48787219 273.66278496 -69.49168396 270.50483704 C-69.49795009 268.2411285 -69.50459702 265.97742099 -69.51159668 263.7137146 C-69.53262607 256.27617609 -69.54299974 248.83863741 -69.55296326 241.40107727 C-69.55701158 238.83795092 -69.56112853 236.27482467 -69.56531334 233.71169853 C-69.58218198 223.04605254 -69.59681526 212.38040994 -69.60406208 201.71475315 C-69.60597177 198.94914308 -69.60789213 196.18353301 -69.60984802 193.41792297 C-69.61033176 192.7306002 -69.6108155 192.04327743 -69.6113139 191.33512669 C-69.6196035 180.21595877 -69.644923 169.09689881 -69.6774287 157.97777797 C-69.71057952 146.54407746 -69.72818598 135.11045735 -69.73170632 123.67670387 C-69.73405247 117.26440369 -69.74295621 110.85227411 -69.7681675 104.44001961 C-69.79152587 98.4013791 -69.79565012 92.3630206 -69.78540611 86.32434654 C-69.78491249 84.11617212 -69.79118124 81.90798346 -69.80496216 79.69985199 C-69.87485006 67.83097857 -69.60494175 57.36876701 -65.31468201 46.14717102 C-65.03969533 45.42474999 -64.76470865 44.70232897 -64.48138905 43.9580164 C-57.04059267 26.09439826 -43.3774657 13.54817041 -26.31468201 5.14717102 C-17.43087696 1.59569596 -9.50600833 -0.00199474 0 0 Z " fill="#ffffff" transform="translate(149.31468200683594,79.85282897949219)"/>
<path d="M0 0 C2.5625 0.375 2.5625 0.375 4.00317383 1.85131836 C6.2117206 5.42572701 7.59395822 9.20675186 9.07421875 13.12890625 C9.75658864 14.88889407 10.43955094 16.6486523 11.12304688 18.40820312 C12.18488615 21.16127342 13.24182137 23.91592697 14.2878418 26.67504883 C20.96486524 44.23209294 27.7096842 57.62404147 45.67333984 65.85961914 C49.27395615 67.43750618 52.91511989 68.90909292 56.5625 70.375 C60.11657513 71.81039988 63.67017022 73.24695038 67.22265625 74.6862793 C69.67779614 75.68063835 72.13638084 76.66450935 74.59765625 77.64379883 C75.72816406 78.09779053 76.85867188 78.55178223 78.0234375 79.01953125 C79.04228027 79.42534424 80.06112305 79.83115723 81.11083984 80.24926758 C83.5625 81.375 83.5625 81.375 85.5625 83.375 C85.6875 86 85.6875 86 85.5625 88.375 C76.63367126 93.11715443 67.3399721 96.67141288 57.90625 100.26953125 C40.9304089 106.81999168 27.4260233 114.10606013 19.73828125 131.39453125 C17.1771581 137.33501146 14.77568696 143.33953839 12.375 149.34619141 C11.56603953 151.36956489 10.75461804 153.39195626 9.94067383 155.41333008 C9.15938202 157.35670734 8.38551927 159.30309125 7.61987305 161.25268555 C7.26449463 162.13867432 6.90911621 163.02466309 6.54296875 163.9375 C6.23254639 164.72253906 5.92212402 165.50757813 5.60229492 166.31640625 C4.46339097 168.57121681 3.65398304 169.9381448 1.5625 171.375 C-0.94580078 171.42993164 -0.94580078 171.42993164 -3.4375 170.375 C-4.99560547 167.85327148 -4.99560547 167.85327148 -6.3046875 164.49609375 C-7.03921143 162.65954224 -7.03921143 162.65954224 -7.78857422 160.78588867 C-8.03766541 160.13639252 -8.28675659 159.48689636 -8.543396 158.81771851 C-9.31485948 156.80634834 -10.10909357 154.8054608 -10.91064453 152.8059082 C-11.9603367 150.18300149 -13.00192119 147.55716723 -14.03515625 144.92773438 C-21.79067089 125.2797105 -29.54312591 112.31680112 -49.4375 103.375 C-52.35206655 102.18519604 -55.28779553 101.05573297 -58.23046875 99.9375 C-58.99464111 99.64585968 -59.75881348 99.35421936 -60.54614258 99.05374146 C-63.7149451 97.84823853 -66.88441541 96.64651067 -70.06762695 95.47949219 C-72.42249583 94.61232043 -74.76407062 93.71530203 -77.10546875 92.8125 C-78.18963326 92.42783569 -78.18963326 92.42783569 -79.29570007 92.03540039 C-81.30151367 91.24609375 -81.30151367 91.24609375 -84.4375 89.375 C-85.39575195 86.16015625 -85.39575195 86.16015625 -85.4375 83.375 C-81.9307407 80.37097765 -77.99726729 78.83554952 -73.7421875 77.1953125 C-72.62095993 76.75335037 -72.62095993 76.75335037 -71.4770813 76.30245972 C-69.09112511 75.36248299 -66.7021685 74.43049466 -64.3125 73.5 C-36.87242516 63.04302389 -36.87242516 63.04302389 -19.43295288 40.16833496 C-16.84927796 34.10857587 -14.4887842 27.96052003 -12.125 21.8125 C-11.05554446 19.05212578 -9.98274823 16.29315119 -8.90400696 13.53639221 C-8.23808522 11.83258787 -7.57785105 10.12654696 -6.92399597 8.41807556 C-6.47761528 7.27031395 -6.47761528 7.27031395 -6.0222168 6.09936523 C-5.76353317 5.42638901 -5.50484955 4.75341278 -5.23832703 4.06004333 C-3.95117816 1.35171613 -2.97381305 0.4575097 0 0 Z " fill="#ffffff" transform="translate(400.4375,303.625)"/>
<path d="M0 0 C1.051875 -0.00257813 2.10375 -0.00515625 3.1875 -0.0078125 C4.280625 -0.00007812 5.37375 0.00765625 6.5 0.015625 C7.593125 0.00789062 8.68625 0.00015625 9.8125 -0.0078125 C10.864375 -0.00523437 11.91625 -0.00265625 13 0 C14.43859375 0.00338379 14.43859375 0.00338379 15.90625 0.00683594 C18.70918382 0.28649613 20.14978576 0.7335569 22.5 2.265625 C23.5947876 4.34519958 23.5947876 4.34519958 24.44628906 6.96264648 C24.77761841 7.95569794 25.10894775 8.94874939 25.45031738 9.97189331 C25.79671265 11.05882477 26.14310791 12.14575623 26.5 13.265625 C26.87120972 14.38373566 27.24241943 15.50184631 27.62487793 16.65383911 C28.88750972 20.46806909 30.12555218 24.28966831 31.359375 28.11328125 C31.82575873 29.55373529 32.29230023 30.99413826 32.75898743 32.43449402 C34.00176966 36.27205537 35.24197052 40.11044607 36.48152542 43.9490509 C37.51228165 47.14010693 38.54446931 50.33069927 39.57658863 53.52131462 C47.72835495 78.72317355 55.86514691 103.93051567 63.87548828 129.17773438 C64.98363872 132.66517121 66.11521576 136.14396995 67.26123047 139.61914062 C67.54260361 140.48255066 67.82397675 141.34596069 68.11387634 142.23553467 C68.64227354 143.85638158 69.17723634 145.47511 69.7202301 147.09112549 C71.06820876 151.25534905 71.97644566 154.83292785 71.5 159.265625 C70.84 160.255625 70.18 161.245625 69.5 162.265625 C66.06410924 162.95033501 62.55859261 162.77490461 59.0625 162.765625 C58.09505859 162.79398438 57.12761719 162.82234375 56.13085938 162.8515625 C49.12695465 162.87100429 49.12695465 162.87100429 46.5703125 160.40234375 C46.21710938 159.36722656 45.86390625 158.33210937 45.5 157.265625 C45.21535889 156.49105957 44.93071777 155.71649414 44.63745117 154.91845703 C43.63986268 152.15438472 42.7201093 149.37295531 41.8125 146.578125 C41.49216797 145.61583984 41.17183594 144.65355469 40.84179688 143.66210938 C38.5 136.54684168 38.5 136.54684168 38.5 134.265625 C17.38 134.595625 -3.74 134.925625 -25.5 135.265625 C-28.14 143.515625 -30.78 151.765625 -33.5 160.265625 C-36.37595556 163.14158056 -38.70548555 162.55628723 -42.63867188 162.58789062 C-43.56228516 162.58466797 -44.48589844 162.58144531 -45.4375 162.578125 C-46.81711914 162.60229492 -46.81711914 162.60229492 -48.22460938 162.62695312 C-49.55008789 162.62791992 -49.55008789 162.62791992 -50.90234375 162.62890625 C-51.71179443 162.63188721 -52.52124512 162.63486816 -53.35522461 162.63793945 C-55.5 162.265625 -55.5 162.265625 -57.34985352 161.24291992 C-59.59534645 157.38254055 -57.9381267 152.92317034 -56.85809326 148.83712769 C-56.03904394 146.04705774 -55.164556 143.27961117 -54.2734375 140.51171875 C-53.76984962 138.91968376 -53.76984962 138.91968376 -53.25608826 137.29548645 C-52.13614371 133.76240416 -51.00579696 130.23274752 -49.875 126.703125 C-49.07994268 124.20487337 -48.28527372 121.70649813 -47.4909668 119.20800781 C-40.83217026 98.28903914 -34.07522976 77.40117948 -27.3125 56.515625 C-27.06705193 55.7575996 -26.82160385 54.9995742 -26.56871796 54.21857834 C-22.18332583 40.67811267 -22.18332583 40.67811267 -20.23187256 34.71339417 C-19.90610355 33.71759763 -19.90610355 33.71759763 -19.57375336 32.701684 C-19.14782358 31.39976115 -18.72180517 30.09786728 -18.29569244 28.7960043 C-16.97126443 24.73953302 -15.68260565 20.67310603 -14.41162109 16.59960938 C-14.0969841 15.60886414 -13.78234711 14.6181189 -13.45817566 13.59735107 C-12.88976774 11.8066174 -12.33258608 10.01226063 -11.789505 8.21368408 C-9.97422914 2.56230675 -9.97422914 2.56230675 -7.56575012 1.05554199 C-4.95094289 0.05567243 -2.79761381 0.00658041 0 0 Z M6.5 36.265625 C3.12330468 44.27868527 0.39002249 52.45948309 -2.265625 60.734375 C-2.70809128 62.10541825 -3.15078337 63.47638864 -3.59368896 64.84729004 C-4.51359575 67.69728112 -5.43105621 70.54804408 -6.34667969 73.39941406 C-7.52140159 77.05708953 -8.7019406 80.71285679 -9.88422012 84.3680954 C-10.79569872 87.18801993 -11.70435079 90.00884878 -12.61211395 92.82997131 C-13.04668287 94.17947529 -13.4820883 95.5287102 -13.91834259 96.87767029 C-14.52425524 98.7528157 -15.12600254 100.62930554 -15.72753906 102.50585938 C-16.07077209 103.57267944 -16.41400513 104.63949951 -16.76763916 105.73864746 C-17.59278741 108.14728984 -17.59278741 108.14728984 -17.5 110.265625 C-1.66 110.265625 14.18 110.265625 30.5 110.265625 C28.82831025 102.69647485 28.82831025 102.69647485 26.66821289 95.35375977 C26.31767349 94.2855751 25.96713409 93.21739044 25.60597229 92.11683655 C25.231978 90.9916008 24.8579837 89.86636505 24.47265625 88.70703125 C23.88828041 86.93053444 23.88828041 86.93053444 23.292099 85.1181488 C22.26224363 81.98929146 21.22883945 78.86163879 20.19342041 75.73461914 C18.73933706 71.34071884 17.29134479 66.94480932 15.84361267 62.54881287 C15.07511541 60.21642928 14.30499606 57.88457931 13.53297424 55.55335999 C11.41977276 49.15244229 9.39466184 42.73473054 7.5 36.265625 C7.17 36.265625 6.84 36.265625 6.5 36.265625 Z " fill="#ffffff" transform="translate(208.5,169.734375)"/>
<path d="M0 0 C0.886875 -0.00257813 1.77375 -0.00515625 2.6875 -0.0078125 C4.0796875 0.00378906 4.0796875 0.00378906 5.5 0.015625 C6.428125 0.00789062 7.35625 0.00015625 8.3125 -0.0078125 C9.6428125 -0.00394531 9.6428125 -0.00394531 11 0 C11.8146875 0.00225586 12.629375 0.00451172 13.46875 0.00683594 C15.5 0.265625 15.5 0.265625 17.5 2.265625 C17.75168228 4.95806122 17.75168228 4.95806122 17.75396729 8.45300293 C17.75708727 9.09441837 17.76020725 9.73583381 17.76342177 10.39668608 C17.77142756 12.55556526 17.76506828 14.71416537 17.75878906 16.87304688 C17.76149779 18.41687689 17.76505805 19.9607056 17.76940918 21.50453186 C17.7785496 25.70485904 17.77498216 29.90508829 17.76865101 34.10541725 C17.76359954 38.49406836 17.76828008 42.88271088 17.77142334 47.2713623 C17.77506548 54.64234935 17.77025739 62.01329637 17.76074219 69.38427734 C17.74985716 77.91509506 17.75338256 86.44581719 17.764395 94.9766326 C17.77346082 102.29130165 17.77475661 109.60594187 17.76951766 116.92061472 C17.76639407 121.29360427 17.76599924 125.66654884 17.77259064 130.03953552 C17.77835325 134.15005929 17.77438722 138.26045941 17.76280212 142.37096977 C17.76014971 143.88270805 17.76093049 145.39445667 17.76532745 146.90619087 C17.77076161 148.9636851 17.76397525 151.02077864 17.75396729 153.07824707 C17.75321323 154.23157784 17.75245918 155.3849086 17.75168228 156.57318878 C17.5 159.265625 17.5 159.265625 15.5 161.265625 C13.46875 161.52441406 13.46875 161.52441406 11 161.53125 C10.113125 161.53382813 9.22625 161.53640625 8.3125 161.5390625 C7.384375 161.53132812 6.45625 161.52359375 5.5 161.515625 C4.571875 161.52335938 3.64375 161.53109375 2.6875 161.5390625 C1.3571875 161.53519531 1.3571875 161.53519531 0 161.53125 C-0.8146875 161.52899414 -1.629375 161.52673828 -2.46875 161.52441406 C-4.5 161.265625 -4.5 161.265625 -6.5 159.265625 C-6.75168228 156.57318878 -6.75168228 156.57318878 -6.75396729 153.07824707 C-6.75864726 152.11612391 -6.75864726 152.11612391 -6.76342177 151.13456392 C-6.77142756 148.97568474 -6.76506828 146.81708463 -6.75878906 144.65820312 C-6.76149779 143.11437311 -6.76505805 141.5705444 -6.76940918 140.02671814 C-6.7785496 135.82639096 -6.77498216 131.62616171 -6.76865101 127.42583275 C-6.76359954 123.03718164 -6.76828008 118.64853912 -6.77142334 114.2598877 C-6.77506548 106.88890065 -6.77025739 99.51795363 -6.76074219 92.14697266 C-6.74985716 83.61615494 -6.75338256 75.08543281 -6.764395 66.5546174 C-6.77346082 59.23994835 -6.77475661 51.92530813 -6.76951766 44.61063528 C-6.76639407 40.23764573 -6.76599924 35.86470116 -6.77259064 31.49171448 C-6.77835325 27.38119071 -6.77438722 23.27079059 -6.76280212 19.16028023 C-6.76014971 17.64854195 -6.76093049 16.13679333 -6.76532745 14.62505913 C-6.77076161 12.5675649 -6.76397525 10.51047136 -6.75396729 8.45300293 C-6.75321323 7.29967216 -6.75245918 6.1463414 -6.75168228 4.95806122 C-6.31387408 0.27449492 -4.18391186 0.0115852 0 0 Z " fill="#ffffff" transform="translate(322.5,170.734375)"/>
</svg></span>
<span class="nav-option__label"><span>Assistant</span></span>
</button>
</div>
<% } %>
<% if (isAdmin) { %>
<button class="nav-option" title="Settings" data-href="/settings">
<span class="nav-option__icon"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512" style="fill: #FFFFFF;"><path d="M186.25 28.125l2.578.133c9.011 2.108 15.041 7.003 21.172 13.68 5.539 5.774 10.652 10.665 18 14.063l2.324 1.156c14.726 7.001 30.887 7.302 46.301 2.156 1.807-.735 3.599-1.507 5.375-2.312l2.75-1.219c8.12-4.148 13.896-10.072 20.024-16.739 5.861-6.229 12-10.244 20.726-10.917l2.531-.242c8.183.323 15.373 3.275 22.781 6.555l3.032 1.336c20.797 9.332 54.869 24.787 65.031 46.789 3.151 9.792 1.197 19.771-1.902 29.281-4.762 15.451-1.522 31.367 5.703 45.456C430.22 171.152 442.28 180.654 457 186c2.877.759 5.777 1.385 8.688 2 9.271 1.999 16.238 4.883 22.25 12.563 9.339 14.688 8.446 36.114 8.375 53l-.005 2.66c-.136 44.491-.136 44.491-12.429 57.067L482 315l-1.598 1.461c-5.232 3.933-11.351 4.755-17.619 6.027-15.957 3.316-30.308 12.087-39.409 25.699-9.91 16.28-12.455 32.042-8.242 50.539.713 2.692 1.545 5.186 2.555 7.773 2.564 7.311 2.646 16.16-.25 23.375-10.22 19.106-34.898 31.405-53.312 41.063l-3.132 1.648c-12.639 6.498-25.145 12.065-39.368 7.54-6.94-2.974-11.465-7.764-16.062-13.625-10.01-12.637-25.401-19.399-41.187-21.25-17.052-1.158-33.65 4.5-46.59 15.66-3.455 3.336-6.385 6.845-9.223 10.715-4.971 6.556-11.39 10.916-19.562 12.375-26.148 3.307-59.774-21.963-79.238-36.848L107 445l-2.355-1.809c-6.73-5.467-10.924-12.12-11.953-20.793-.382-8.964 1.855-16.14 4.898-24.43 5.172-14.232 3.04-30.352-2.91-43.996-7.563-14.733-19.064-25.488-34.678-31.35-3.981-1.239-8.09-1.895-12.189-2.623-9.954-1.775-18.184-4.685-24.57-12.984-8.456-13.722-7.595-31.87-7.558-47.441l-.046-8.225c-.146-41.169-.146-41.169 10.361-54.787 7.287-7.302 16.204-9.862 26.063-11.459C62.894 183.289 71.386 178.635 80 172l3.188-2.312C95.106 158.299 101.08 142.537 102 126.32c0-7.998-1.595-15.329-4.125-22.883-2.673-8.299-3.317-16.96-.094-25.227 12.11-21.969 45.531-36.675 67.906-45.711l2.539-1.026c6.038-2.361 11.479-3.8 18.024-3.349zM198 201c-16.181 16.839-21.57 38.154-21.27 60.898.507 16.315 7.636 32.72 18.27 45.102l1.504 1.934C207.706 322.781 226.335 332.717 244 335c24.37 1.971 46.085-3.509 65.035-19.316 13.914-12.594 24.808-31.136 26.142-50.216.516-22.545-3.045-42.847-18.177-60.467l-1.504-1.934C303.985 188.837 285.929 179.73 268 177l-2.871-.461C239.896 173.458 215.903 183.682 198 201z"/></svg></span>
<span class="nav-option__label"><span>Settings</span></span>
</button>
<% } else { %>
<button class="nav-option" title="You are not admin" disabled>
<span class="nav-option__icon"><i class="fa-solid fa-lock"></i></span>
<span class="nav-option__label"><span>Locked</span></span>
</button>
<% } %>
<button id="logoutBtn" class="nav-option nav-option--logout" title="Log Out">
<span class="nav-option__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="fill: #FFFFFF;"><path d="M325 60c5.53 4.435 10.573 9.424 15.579 14.432l2.178 2.167 7.153 7.134 5.156 5.137 15.403 15.364 7.267 7.252 24.166 24.127 6.251 6.245 1.569 1.568 25.22 25.153 25.928 25.874 14.544 14.508 13.661 13.644 5.016 4.997 6.839 6.842 2.012 1.978c4.802 4.869 8.426 9.853 9.591 16.705L512.5 256l.031 2.875c-1.368 8.046-6.201 13.373-11.85 18.938l-2.239 2.254-7.432 7.408-5.327 5.339-12.97 12.95-15.109 15.089-26.963 26.917-26.152 26.111-1.627 1.627-1.624 1.624-29.785 29.757-10.526 10.517-14.176 14.141-5.204 5.197-7.101 7.077-2.082 2.091c-5.681 5.624-10.496 9.163-18.677 9.337-6.373-.094-11.576-2.422-16.346-6.692-5.139-5.97-5.918-13.011-5.795-20.576l-.002-2.9.065-9.398.017-6.553.099-17.178.079-17.556L292 340l-2.336.011-56.313.196-27.233.095-23.741.075-12.566.047-11.839.03-4.334.024c-8.986.091-15.62-.148-22.661-6.223l-1.352-1.691-1.398-1.684c-2.681-4.107-3.477-7.723-3.494-12.589l-.026-3.453.003-3.761-.02-3.983-.024-10.798-.011-6.754-.025-23.584-.051-21.947-.036-18.872-.026-11.258-.002-12.566-.034-3.743c.058-7.9.955-13.439 6.266-19.594l1.691-1.352 1.684-1.398c4.338-2.832 8.076-3.476 13.213-3.467l3.871-.008 4.224.022 4.465-.001 12.104.025 12.656.016 23.958.043 27.279.043L292 172l-.027-3.66-.18-34.207-.095-17.584-.078-16.981-.043-6.467-.031-9.083-.044-2.679c.045-6.829 1.516-13.047 6.206-18.225 7.832-7.291 18-8.351 27.292-3.114zM91.893 46.823l3.614-.02 11.81-.041 4.077-.012 19.14-.042 22.066-.077 17.083-.048 10.193-.036 11.361-.016 3.402-.039c7.573.051 7.573.051 11.516 2.34 4.474 5.257 4.184 11.988 4.158 18.543l.049 2.422c.005 5.661-.64 11.15-3.361 16.203-2.893 2.599-4.737 3.376-8.608 3.385l-2.79.029-3.04-.014-3.219.021-10.558.02-7.355.04-19.402.072-30.958.122-10.776.023c-20.533.065-37.552.87-53.177 15.982-3.214 3.522-5.802 7.156-8.117 11.32l-1.18 2.109c-6.492 12.984-5.107 28.546-5.079 42.641l-.011 6.859v18.533l-.003 19.448.013 34.74-.002 31.428-.009 36.594-.003 19.335.01 18.182-.003 6.65c-.038 20.848.554 38.451 15.945 54.363 3.522 3.214 7.156 5.802 11.32 8.117l2.109 1.18c12.734 6.367 27.813 5.092 41.638 5.064l10.959.017 31.13.044 19.108.046 7.261-.004 10.129.025 3.018-.036c4.48.06 7.667.185 11.259 3.032 2.836 3.127 3.208 4.454 3.387 8.631l.107 2.112c.099 2.402.127 4.797.143 7.201l.063 2.436c.037 5.692-.567 11.17-3.312 16.252-3.019 2.753-4.984 3.377-9.036 3.388l-3.078.03-3.361-.014-3.554.021-9.653.011c-2.698-.003-5.395.003-8.093.009l-19.143.001a3379 3379 0 0 0-19.627.029l-16.926.023a1780.36 1780.36 0 0 0-10.074.016C73.924 465.637 49.359 459.671 27 438l-1.816-1.594C11.092 423.59 2.474 403.559 0 385c-.148-3.467-.148-6.932-.147-10.402l-.011-3.172-.019-10.521-.02-7.545-.039-22.645-.015-10.685-.039-35.559-.006-9.219-.001-2.314-.066-37.056-.054-38.115-.036-21.371-.017-20.13-.02-7.356C-.647 119.409 6.115 95.547 27 74l1.594-1.816c15.905-17.488 40.33-25.305 63.299-25.361z"/></svg></span>
<span class="nav-option__label"><span>Logout</span></span>
</button>
</div>
</div>
</header>
<section id="dashboardAssistantMenu" class="dashboard-assistant-menu" hidden aria-hidden="true"
aria-label="ADPanel Assistant">
<div class="dashboard-assistant-head">
<div style="display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0;">
<div class="dashboard-assistant-icon">
<i class="fa-solid fa-wand-magic-sparkles"></i>
</div>
<div class="dashboard-assistant-head-copy" style="flex: 1; min-width: 0;">
<h2 class="dashboard-assistant-title">ADPanel Assistant</h2>
<p class="dashboard-assistant-subtitle">
Complexity, simplified.
</p>
</div>
</div>
<div class="dashboard-assistant-head-actions">
<button id="dashboardAssistantConfigToggle" class="dashboard-assistant-head-btn"
title="Assistant settings" hidden>
<i class="fa-solid fa-key"></i>
</button>
<button id="dashboardAssistantReset" class="dashboard-assistant-head-btn"
title="Start a new chat">
<i class="fa-solid fa-rotate-right"></i>
</button>
<button id="dashboardAssistantClose" class="dashboard-assistant-head-btn"
title="Close assistant">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
</div>
<div id="dashboardAssistantConfig" class="dashboard-assistant-config" hidden>
<p class="dashboard-assistant-config-title">Assistant provider</p>
<p class="dashboard-assistant-config-text">
Please put an API Key to make the assistant work.
</p>
<form id="dashboardAssistantTokenForm" class="dashboard-assistant-token-form">
<label class="dashboard-assistant-token-label" for="dashboardAssistantProviderSelect">
Provider
</label>
<select id="dashboardAssistantProviderSelect" class="dashboard-assistant-token-input">
<option value="groq">Groq</option>
<option value="google">Google AI Studio</option>
</select>
<label class="dashboard-assistant-token-label" for="dashboardAssistantTokenInput">
<span id="dashboardAssistantTokenLabel">API key</span>
</label>
<input id="dashboardAssistantTokenInput" class="dashboard-assistant-token-input"
type="password" placeholder="Paste the selected provider API key" autocomplete="off"
spellcheck="false" autocapitalize="off" autocorrect="off">
<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>
<% if (isAdmin) { %>
<div class="dashboard-assistant-access-row">
<div class="dashboard-assistant-access-copy">
<p class="dashboard-assistant-access-title">Allow normal users to access Assistant</p>
<p class="dashboard-assistant-access-text">
ADPanel helps you to deny or allow normal users to access the assistant.
</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>
<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-text-form">
<label class="dashboard-assistant-text-label" for="dashboardAssistantTextInput">
Message
</label>
<div class="dashboard-assistant-text-row">
<textarea id="dashboardAssistantTextInput" class="dashboard-assistant-text-input"
rows="2" placeholder="Ask ADPanel Assistant..." autocomplete="off"></textarea>
<button id="dashboardAssistantSend" class="dashboard-assistant-send-btn" type="submit"
title="Send message">
<i class="fa-solid fa-paper-plane"></i>
</button>
</div>
</form>
<div class="dashboard-assistant-voicepad">
<button id="dashboardAssistantMic" class="dashboard-assistant-voice-btn" type="button"
title="Start voice input">
<span class="dashboard-assistant-voice-icon">
<i class="fa-solid fa-microphone"></i>
</span>
<span class="dashboard-assistant-voice-copy">Tap to talk</span>
</button>
<button id="dashboardAssistantReplay" class="dashboard-assistant-replay-btn" type="button"
title="Replay last assistant reply">
<i class="fa-solid fa-volume-high"></i>
</button>
</div>
<div class="dashboard-assistant-ptt-setting" style="margin-top: 14px; margin-bottom: 4px; font-size: 13px; color: rgba(255,255,255,0.5); text-align: center;">
Push to talk: <button id="dashboardAssistantPttKeyBtn" type="button" style="background: none; border: none; padding: 0; color: #818cf8; cursor: pointer; font-weight: 600; font-family: inherit; font-size: inherit;">None</button>
</div>
<div class="dashboard-assistant-voice-meta">
<div id="dashboardAssistantVoiceState" class="dashboard-assistant-voice-state">
Voice replies are on.
</div>
<div id="dashboardAssistantSpeaking" class="dashboard-assistant-speaking" hidden>
<span class="dashboard-assistant-speaking-wave"></span>
<span class="dashboard-assistant-speaking-wave"></span>
<span class="dashboard-assistant-speaking-wave"></span>
</div>
</div>
<div id="dashboardAssistantTranscript" class="dashboard-assistant-transcript" hidden></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>
<% bots.forEach(function(bot){ const coverStyle=bot.templateImage ?
`--bot-cover:url('${String(bot.templateImage).replace(/'/g, "\\'" )}');` : '' ; const ipPort=bot.port ?
`${bot.ip}:${bot.port}` : bot.ip; const memory=bot.memory || {}; const disk=bot.disk || {}; const
cpuPercent=bot.cpuPercent !==null && bot.cpuPercent !==undefined ? bot.cpuPercent : 0; const
cpuLimit=bot.cpuLimit || 100; const cpuBarWidth=cpuLimit > 0 ? Math.min(100, (cpuPercent / cpuLimit) * 100) : 0; const
statusClass=bot.status==='online' ? 'status-online' : (bot.status==='stopped' ? 'status-stopped'
: 'status-unknown' ) ; const nodeOffline=bot.nodeOnline===false; %>
<article class="bot-card <%= statusClass %><%= nodeOffline ? ' node-offline' : '' %>" data-bot-card
data-name="<%= bot.name.toLowerCase() %>" data-cover="<%= bot.templateImage ? bot.templateImage : '' %>"
data-href="/server/<%= bot.name %>">
<div class="bot-card__offline" data-offline-overlay
style="display: <%= nodeOffline ? 'flex' : 'none' %>;">
<div class="offline-ring"></div>
<div class="offline-text">Can't establish connection to the server</div>
</div>
<div class="bot-card__body">
<div class="bot-card__hero">
<div class="bot-card__hero-bg"></div>
<div class="bot-card__hero-overlay"></div>
<div class="bot-card__hero-content">
<div class="bot-card__title-row">
<div>
<h4>
<%= bot.displayName || bot.name %>
</h4>
<p>Node: <%= bot.nodeName %>
</p>
</div>
<div class="bot-card__status <%= statusClass %>">
<span class="bot-card__status-dot"></span>
</div>
</div>
<div class="bot-card__meta-row">
<span><i class="fa-solid fa-globe"></i>
<%= ipPort %>
</span>
<span><i class="fa-solid fa-cube"></i>
<%= bot.templateId || 'Custom' %>
</span>
</div>
</div>
</div>
<div class="bot-card__stats">
<div class="bot-card__stat">
<div class="bot-card__stat-label">
<div class="bot-card__stat-icon bot-card__stat-icon--memory"><i class="fa-solid fa-memory"></i>
</div>
<div class="bot-card__stat-title">Memory</div>
<div class="bot-card__stat-chip"><i class="fa-solid fa-wave-pulse"></i><span>
<%= memory.label || 'N/A' %>
</span></div>
</div>
<div class="bot-card__progress">
<span style="width:<%= memory.percent != null ? memory.percent : 0 %>%"></span>
</div>
</div>
<div class="bot-card__stat">
<div class="bot-card__stat-label">
<div class="bot-card__stat-icon bot-card__stat-icon--disk"><i
class="fa-solid fa-hard-drive"></i>
</div>
<div class="bot-card__stat-title">Disk</div>
<div class="bot-card__stat-chip"><i class="fa-solid fa-arrows-rotate"></i><span>
<%= disk.label || 'N/A' %>
</span></div>
</div>
<div class="bot-card__progress"><span
style="width:<%= disk.percent != null ? disk.percent : 0 %>%"></span></div>
</div>
<div class="bot-card__stat">
<div class="bot-card__stat-label">
<div class="bot-card__stat-icon bot-card__stat-icon--cpu"><i class="fa-solid fa-microchip"></i>
</div>
<div class="bot-card__stat-title">CPU</div>
<div class="bot-card__stat-chip"><i class="fa-solid fa-signal"></i><span>
<%= bot.cpu || 'N/A' %>
</span></div>
</div>
<div class="bot-card__progress"><span style="width:<%= cpuBarWidth %>%"></span></div>
</div>
</div>
<div class="bot-card__footer">
<div class="bot-card__footer-text">Click to view details</div>
<i class="fa-solid fa-arrow-right bot-card__chevron"></i>
</div>
</div>
</article>
<% }) %>
</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" style="display: none;">
<div class="account-header">
<button id="accountBackBtn" class="account-back-btn">
<i class="fa-solid fa-arrow-left"></i>
<span>Back to Dashboard</span>
</button>
<h2>My Account</h2>
<p>View and manage your account information</p>
</div>
<div class="account-tabs">
<button class="account-tab active" data-account-tab="info">
<i class="fa-solid fa-circle-info"></i>
<span>Info</span>
</button>
<button class="account-tab" data-account-tab="credentials">
<i class="fa-solid fa-key"></i>
<span>Credentials</span>
</button>
</div>
<div id="accountInfoTab" class="account-tab-content active">
<div class="account-card">
<div class="account-card-header">
<div class="account-avatar" id="accountAvatarWrapper" title="Click to change avatar">
<img id="accountAvatarImg" src="<%= avatarUrl %>"
alt="Avatar">
<div class="account-avatar-overlay">
<i class="fa-solid fa-camera"></i>
<span>Change</span>
</div>
</div>
<div class="account-info">
<h3 id="accountUsername">Loading...</h3>
<p id="accountEmail">Loading...</p>
</div>
</div>
<input type="file" id="avatarFileInput" accept="image/jpeg,image/png,image/gif,image/webp"
style="display:none;">
<div class="account-section-title">
<i class="fa-solid fa-circle-info"></i>
Account Details
</div>
<div class="account-row account-row-editable" id="usernameRow">
<span class="account-row-label">Username</span>
<div class="account-row-value-wrap">
<span class="account-row-value" id="accountUsernameValue">—</span>
<input type="text" class="account-row-input" id="usernameInput" style="display:none;" maxlength="30"
placeholder="Enter username">
<button class="account-row-edit-btn" id="usernameEditBtn" title="Edit username">
<i class="fa-solid fa-pencil"></i>
</button>
<button class="account-row-save-btn" id="usernameSaveBtn" style="display:none;" title="Save">
<i class="fa-solid fa-check"></i>
</button>
<button class="account-row-cancel-btn" id="usernameCancelBtn" style="display:none;" title="Cancel">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="account-row-cooldown" id="usernameCooldown" style="display:none;"></div>
</div>
<div class="account-row">
<span class="account-row-label">Email Address</span>
<span class="account-row-value" id="accountEmailValue">—</span>
</div>
<div class="account-row">
<span class="account-row-label">Role</span>
<span class="account-row-value" id="accountRoleValue">—</span>
</div>
<div class="account-row">
<span class="account-row-label">User ID</span>
<span class="account-row-value" id="accountIdValue">—</span>
</div>
<div class="account-row account-row-editable" id="statusRow">
<span class="account-row-label">Status</span>
<div class="account-row-value-wrap">
<span class="account-row-value account-status-value" id="accountStatusValue">
<span class="status-dot"></span>
<span id="accountStatusText">Available</span>
</span>
<button class="account-row-edit-btn" id="statusEditBtn" title="Edit status">
<i class="fa-solid fa-pencil"></i>
</button>
</div>
</div>
</div>
</div>
<div id="accountCredentialsTab" class="account-tab-content">
<div class="account-card">
<div class="credentials-card">
<div class="credentials-info">
<div class="credentials-icon">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="2FA" draggable="false">
</div>
<div class="credentials-text">
<h4>Two-Factor Authentication</h4>
<p>Change your authenticator app 2FA code</p>
</div>
</div>
<button class="credentials-btn" id="change2faBtn">
<i class="fa-solid fa-rotate"></i> Change 2FA
</button>
</div>
</div>
<div class="account-card">
<div class="credentials-card">
<div class="credentials-info">
<div class="credentials-icon">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/change-password.webp" alt="Password"
draggable="false">
</div>
<div class="credentials-text">
<h4>Change Password</h4>
<p>Update your account password</p>
</div>
</div>
<button class="credentials-btn" id="changePasswordBtn">
<i class="fa-solid fa-key"></i> Change Password
</button>
</div>
</div>
<div class="account-card">
<div class="credentials-card">
<div class="credentials-info">
<div class="credentials-icon">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/email.webp" alt="Email" draggable="false">
</div>
<div class="credentials-text">
<h4>Change Email</h4>
<p>Update your account email address</p>
</div>
</div>
<button class="credentials-btn" id="changeEmailBtn">
<i class="fa-solid fa-envelope"></i> Change Email
</button>
</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>
</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">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/email.webp" alt="Email" draggable="false">
</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"
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"
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" 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">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="Recovery"
draggable="false">
</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"
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">
Recovery codes were provided when you created your account. Each code can only be used once.
</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="statusModal">
<div class="recovery-modal">
<div class="recovery-modal-header">
<div class="recovery-modal-header-left">
<div class="recovery-modal-icon" style="background: transparent;">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/clock.webp" alt="Status"
style="width: 70px; height: 70px;">
</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"
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"
style="text-align: left; letter-spacing: normal; font-family: inherit; padding: 12px; background: #0a0c14; color: #fff; border: 1px solid rgba(255,255,255,0.12);">
<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">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/change-password.webp" alt="Password"
draggable="false">
</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"
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"
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"
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"
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">
<img src="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="2FA" draggable="false"
width="20px" height="20px">
</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"
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">
<span class="twofa-secret-code" id="newSecretDisplay">—</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"
autocomplete="off">
</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="/socket.io/socket.io.min.js" defer></script>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/ssh-terminal-window.js?v=20260923-ssh-terminal-restore-7" defer></script>
<script nonce="<%= cspNonce %>" data-cfasync="false" src="/js/dashboard.js?v=20260512-dashboard-timeout-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="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="ADPanel Christmas"
class="christmas-logo" />
<span class="christmas-title">ADPanel</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="https://cdn.jsdelivr.net/gh/antonndev/ADCDn/adpanel-dark.webp" alt="ADPanel"
class="newyear-logo" />
<span class="newyear-title">ADPanel</span>
</div>
<p class="newyear-message">You are here to build amazing things 1 more year with ADPanel</p>
</div>
</div>
</div>
<style nonce="<%= cspNonce %>">
.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 => {
if (img.src && (img.src.includes('ADPanel-dark.webp') || img.src.includes('i.imgur.com/k5agjYf'))) {
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=20260423-assistant-access-gate" defer></script>
<div style="text-align: center; margin: 40px 0 20px 0; color: rgba(255, 255, 255, 0.4); font-size: 13px; font-weight: 500;">
&copy; 2026-<%= new Date().getFullYear() %> ADPanel Dashboard
</div>
<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;
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 (interactive(e.target)) return;
if (scrollableAncestor(e.target)) 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>
</body>
</html>