2025-12-04 12:30:07 -03:00
|
|
|
|
<!doctype html>
|
2025-12-03 18:42:22 -03:00
|
|
|
|
<html lang="en">
|
2025-12-04 12:30:07 -03:00
|
|
|
|
<head>
|
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
|
<title>{% block title %}General Bots Suite{% endblock %}</title>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- HTMX (local) -->
|
|
|
|
|
|
<script src="/js/vendor/htmx.min.js"></script>
|
|
|
|
|
|
<script src="/js/vendor/htmx-ws.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Styles -->
|
refactor: Extract inline CSS/JS to separate files for monitoring module
- Create individual CSS files: monitoring.css, alerts.css, health.css, logs.css, metrics.css, resources.css
- Create individual JS files: monitoring.js, alerts.js, health.js, logs.js, metrics.js, resources.js
- Update HTML files to reference external CSS/JS files
- Add CSS/JS files for other modules (analytics, chat, mail, meet, tasks, etc.)
- Remove obsolete implementation plan files
2025-12-07 09:56:27 -03:00
|
|
|
|
<link rel="stylesheet" href="/css/base.css" />
|
2025-12-04 12:30:07 -03:00
|
|
|
|
<link rel="stylesheet" href="/css/app.css" />
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<!-- Skip navigation link for accessibility -->
|
|
|
|
|
|
<a href="#main-content" class="skip-link">Skip to main content</a>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ARIA live region for dynamic updates -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
id="aria-live"
|
|
|
|
|
|
class="sr-only"
|
|
|
|
|
|
aria-live="polite"
|
|
|
|
|
|
aria-atomic="true"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
|
|
|
|
|
|
<header class="app-header" role="banner">
|
2025-12-04 12:30:07 -03:00
|
|
|
|
<div class="header-left">
|
|
|
|
|
|
<a href="/" class="logo">
|
|
|
|
|
|
<div class="logo-icon">🤖</div>
|
|
|
|
|
|
<span>General Bots</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
|
<!-- Apps Menu -->
|
|
|
|
|
|
<div class="apps-menu">
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="header-btn"
|
|
|
|
|
|
id="apps-btn"
|
|
|
|
|
|
aria-label="Applications"
|
|
|
|
|
|
aria-expanded="false"
|
|
|
|
|
|
>
|
|
|
|
|
|
<svg
|
|
|
|
|
|
width="20"
|
|
|
|
|
|
height="20"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
>
|
|
|
|
|
|
<circle cx="5" cy="5" r="2"></circle>
|
|
|
|
|
|
<circle cx="12" cy="5" r="2"></circle>
|
|
|
|
|
|
<circle cx="19" cy="5" r="2"></circle>
|
|
|
|
|
|
<circle cx="5" cy="12" r="2"></circle>
|
|
|
|
|
|
<circle cx="12" cy="12" r="2"></circle>
|
|
|
|
|
|
<circle cx="19" cy="12" r="2"></circle>
|
|
|
|
|
|
<circle cx="5" cy="19" r="2"></circle>
|
|
|
|
|
|
<circle cx="12" cy="19" r="2"></circle>
|
|
|
|
|
|
<circle cx="19" cy="19" r="2"></circle>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<nav class="apps-dropdown" id="apps-dropdown" role="menu">
|
|
|
|
|
|
<div class="apps-dropdown-title">Applications</div>
|
|
|
|
|
|
<div class="apps-grid">
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#chat"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/chat/chat.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#3b82f6,
|
|
|
|
|
|
#1d4ed8
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
💬
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Chat</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#drive"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/drive/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#f59e0b,
|
|
|
|
|
|
#d97706
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📁
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Drive</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#tasks"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/tasks/tasks.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#22c55e,
|
|
|
|
|
|
#16a34a
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
✓
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Tasks</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#mail"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/mail/mail.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#ef4444,
|
|
|
|
|
|
#dc2626
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
✉️
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Mail</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#calendar"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/calendar/calendar.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#a855f7,
|
|
|
|
|
|
#7c3aed
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📅
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Calendar</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#meet"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/meet/meet.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#06b6d4,
|
|
|
|
|
|
#0891b2
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
🎥
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Meet</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#paper"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/paper/paper.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#eab308,
|
|
|
|
|
|
#ca8a04
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📝
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Paper</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#research"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/research/research.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#ec4899,
|
|
|
|
|
|
#db2777
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
🔍
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Research</span>
|
|
|
|
|
|
</a>
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<a
|
|
|
|
|
|
href="#sources"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/sources/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#14b8a6,
|
|
|
|
|
|
#0d9488
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📚
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Sources</span>
|
|
|
|
|
|
</a>
|
2025-12-04 12:30:07 -03:00
|
|
|
|
<a
|
|
|
|
|
|
href="#analytics"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/analytics/analytics.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#6366f1,
|
|
|
|
|
|
#4f46e5
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📊
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Analytics</span>
|
|
|
|
|
|
</a>
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<a
|
|
|
|
|
|
href="#admin"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/admin/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#f43f5e,
|
|
|
|
|
|
#e11d48
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
⚙️
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Admin</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#monitoring"
|
|
|
|
|
|
class="app-item"
|
|
|
|
|
|
role="menuitem"
|
|
|
|
|
|
hx-get="/monitoring/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="app-item-icon"
|
|
|
|
|
|
style="
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
#84cc16,
|
|
|
|
|
|
#65a30d
|
|
|
|
|
|
);
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
📈
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>Monitoring</span>
|
|
|
|
|
|
</a>
|
2025-12-04 12:30:07 -03:00
|
|
|
|
</div>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<!-- Settings Panel (Gear Icon) -->
|
|
|
|
|
|
<div class="settings-menu">
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="header-btn"
|
|
|
|
|
|
id="settings-btn"
|
|
|
|
|
|
aria-label="Settings"
|
|
|
|
|
|
aria-expanded="false"
|
2025-12-04 12:30:07 -03:00
|
|
|
|
>
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<svg
|
|
|
|
|
|
width="20"
|
|
|
|
|
|
height="20"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
|
stroke-linecap="round"
|
|
|
|
|
|
stroke-linejoin="round"
|
|
|
|
|
|
>
|
|
|
|
|
|
<circle cx="12" cy="12" r="3" />
|
|
|
|
|
|
<path
|
|
|
|
|
|
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<div class="settings-panel" id="settings-panel" role="menu">
|
|
|
|
|
|
<div class="settings-panel-title">Quick Settings</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Theme Selection -->
|
|
|
|
|
|
<div class="settings-section">
|
|
|
|
|
|
<div class="settings-section-title">Theme</div>
|
|
|
|
|
|
<div class="theme-grid">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-dark"
|
|
|
|
|
|
data-theme="dark"
|
|
|
|
|
|
title="Dark"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name">Dark</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-light"
|
|
|
|
|
|
data-theme="light"
|
|
|
|
|
|
title="Light"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name">Light</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-blue"
|
|
|
|
|
|
data-theme="blue"
|
|
|
|
|
|
title="Ocean"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name">Ocean</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-purple"
|
|
|
|
|
|
data-theme="purple"
|
|
|
|
|
|
title="Violet"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name"
|
|
|
|
|
|
>Violet</span
|
|
|
|
|
|
>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-green"
|
|
|
|
|
|
data-theme="green"
|
|
|
|
|
|
title="Forest"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name"
|
|
|
|
|
|
>Forest</span
|
|
|
|
|
|
>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option theme-orange"
|
|
|
|
|
|
data-theme="orange"
|
|
|
|
|
|
title="Sunset"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="theme-option-inner">
|
|
|
|
|
|
<div class="theme-option-header">
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
<div class="theme-option-dot"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="theme-option-body">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 80%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="theme-option-line"
|
|
|
|
|
|
style="width: 70%"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="theme-option-name"
|
|
|
|
|
|
>Sunset</span
|
|
|
|
|
|
>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="settings-divider"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Quick Toggles -->
|
|
|
|
|
|
<div class="settings-section">
|
|
|
|
|
|
<div class="settings-section-title">
|
|
|
|
|
|
Quick Toggles
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="quick-toggles">
|
|
|
|
|
|
<div class="quick-toggle">
|
|
|
|
|
|
<span class="quick-toggle-label"
|
|
|
|
|
|
>Desktop Notifications</span
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="toggle-switch active"
|
|
|
|
|
|
id="toggle-notifications"
|
|
|
|
|
|
onclick="toggleQuickSetting(this)"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="quick-toggle">
|
|
|
|
|
|
<span class="quick-toggle-label"
|
|
|
|
|
|
>Sound Effects</span
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="toggle-switch active"
|
|
|
|
|
|
id="toggle-sound"
|
|
|
|
|
|
onclick="toggleQuickSetting(this)"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="quick-toggle">
|
|
|
|
|
|
<span class="quick-toggle-label"
|
|
|
|
|
|
>Compact Mode</span
|
|
|
|
|
|
>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="toggle-switch"
|
|
|
|
|
|
id="toggle-compact"
|
|
|
|
|
|
onclick="toggleQuickSetting(this)"
|
|
|
|
|
|
></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="settings-divider"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Shortcuts -->
|
|
|
|
|
|
<div class="settings-section">
|
|
|
|
|
|
<div class="settings-section-title">
|
|
|
|
|
|
Configuration
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#settings"
|
|
|
|
|
|
class="settings-shortcut"
|
|
|
|
|
|
hx-get="/settings/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="settings-shortcut-icon">
|
|
|
|
|
|
<svg
|
|
|
|
|
|
width="16"
|
|
|
|
|
|
height="16"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
|
>
|
|
|
|
|
|
<circle cx="12" cy="12" r="3" />
|
|
|
|
|
|
<path
|
|
|
|
|
|
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c.26.604.852.997 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-text">
|
|
|
|
|
|
<div class="settings-shortcut-title">
|
|
|
|
|
|
All Settings
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-desc">
|
|
|
|
|
|
Account, sync, appearance & more
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="settings-shortcut-arrow">→</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#admin"
|
|
|
|
|
|
class="settings-shortcut"
|
|
|
|
|
|
hx-get="/admin/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="settings-shortcut-icon">
|
|
|
|
|
|
<svg
|
|
|
|
|
|
width="16"
|
|
|
|
|
|
height="16"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
|
>
|
|
|
|
|
|
<path d="M12 4.5v15m7.5-7.5h-15" />
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-text">
|
|
|
|
|
|
<div class="settings-shortcut-title">
|
|
|
|
|
|
Admin Console
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-desc">
|
|
|
|
|
|
Bot management & configuration
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="settings-shortcut-arrow">→</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="#monitoring"
|
|
|
|
|
|
class="settings-shortcut"
|
|
|
|
|
|
hx-get="/monitoring/index.html"
|
|
|
|
|
|
hx-target="#main-content"
|
|
|
|
|
|
hx-push-url="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="settings-shortcut-icon">
|
|
|
|
|
|
<svg
|
|
|
|
|
|
width="16"
|
|
|
|
|
|
height="16"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
|
>
|
|
|
|
|
|
<path d="M3 3v18h18" />
|
|
|
|
|
|
<path d="M18 9l-5 5-4-4-3 3" />
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-text">
|
|
|
|
|
|
<div class="settings-shortcut-title">
|
|
|
|
|
|
Monitoring
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-desc">
|
|
|
|
|
|
System health & performance
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="settings-shortcut-arrow">→</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
href="/keyboard-shortcuts"
|
|
|
|
|
|
class="settings-shortcut"
|
|
|
|
|
|
onclick="showKeyboardShortcuts(); return false;"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="settings-shortcut-icon">
|
|
|
|
|
|
<svg
|
|
|
|
|
|
width="16"
|
|
|
|
|
|
height="16"
|
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
|
>
|
|
|
|
|
|
<rect
|
|
|
|
|
|
x="2"
|
|
|
|
|
|
y="4"
|
|
|
|
|
|
width="20"
|
|
|
|
|
|
height="16"
|
|
|
|
|
|
rx="2"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<path
|
|
|
|
|
|
d="M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-text">
|
|
|
|
|
|
<div class="settings-shortcut-title">
|
|
|
|
|
|
Keyboard Shortcuts
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-shortcut-desc">
|
|
|
|
|
|
View all available shortcuts
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="settings-shortcut-arrow">→</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-12-04 12:30:07 -03:00
|
|
|
|
|
|
|
|
|
|
<!-- User Avatar -->
|
|
|
|
|
|
<button class="user-avatar" aria-label="User menu">
|
|
|
|
|
|
{{ user_initial|default("U") }}
|
|
|
|
|
|
</button>
|
2025-12-03 18:42:22 -03:00
|
|
|
|
</div>
|
2025-12-04 12:30:07 -03:00
|
|
|
|
</header>
|
|
|
|
|
|
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<main class="app-main" role="main">
|
|
|
|
|
|
<div id="main-content" aria-busy="false" tabindex="-1">
|
|
|
|
|
|
{% block content %}{% endblock %}
|
|
|
|
|
|
</div>
|
2025-12-04 12:30:07 -03:00
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="notifications-container" id="notifications"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
const appsBtn = document.getElementById("apps-btn");
|
|
|
|
|
|
const appsDropdown = document.getElementById("apps-dropdown");
|
2025-12-06 11:09:12 -03:00
|
|
|
|
const settingsBtn = document.getElementById("settings-btn");
|
|
|
|
|
|
const settingsPanel = document.getElementById("settings-panel");
|
2025-12-04 12:30:07 -03:00
|
|
|
|
|
|
|
|
|
|
appsBtn.addEventListener("click", (e) => {
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
const isOpen = appsDropdown.classList.toggle("show");
|
|
|
|
|
|
appsBtn.setAttribute("aria-expanded", isOpen);
|
2025-12-06 11:09:12 -03:00
|
|
|
|
settingsPanel.classList.remove("show");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
settingsBtn.addEventListener("click", (e) => {
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
const isOpen = settingsPanel.classList.toggle("show");
|
|
|
|
|
|
settingsBtn.setAttribute("aria-expanded", isOpen);
|
|
|
|
|
|
appsDropdown.classList.remove("show");
|
2025-12-04 12:30:07 -03:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener("click", (e) => {
|
|
|
|
|
|
if (
|
|
|
|
|
|
!appsDropdown.contains(e.target) &&
|
|
|
|
|
|
!appsBtn.contains(e.target)
|
|
|
|
|
|
) {
|
|
|
|
|
|
appsDropdown.classList.remove("show");
|
|
|
|
|
|
appsBtn.setAttribute("aria-expanded", "false");
|
|
|
|
|
|
}
|
2025-12-06 11:09:12 -03:00
|
|
|
|
if (
|
|
|
|
|
|
!settingsPanel.contains(e.target) &&
|
|
|
|
|
|
!settingsBtn.contains(e.target)
|
|
|
|
|
|
) {
|
|
|
|
|
|
settingsPanel.classList.remove("show");
|
|
|
|
|
|
settingsBtn.setAttribute("aria-expanded", "false");
|
|
|
|
|
|
}
|
2025-12-04 12:30:07 -03:00
|
|
|
|
});
|
2025-12-03 18:42:22 -03:00
|
|
|
|
|
2025-12-04 12:30:07 -03:00
|
|
|
|
document.addEventListener("keydown", (e) => {
|
|
|
|
|
|
if (e.key === "Escape") {
|
|
|
|
|
|
appsDropdown.classList.remove("show");
|
2025-12-06 11:09:12 -03:00
|
|
|
|
settingsPanel.classList.remove("show");
|
2025-12-04 12:30:07 -03:00
|
|
|
|
appsBtn.setAttribute("aria-expanded", "false");
|
2025-12-06 11:09:12 -03:00
|
|
|
|
settingsBtn.setAttribute("aria-expanded", "false");
|
2025-12-03 18:42:22 -03:00
|
|
|
|
}
|
2025-12-04 12:30:07 -03:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener("keydown", (e) => {
|
|
|
|
|
|
if (e.altKey && !e.ctrlKey && !e.shiftKey) {
|
|
|
|
|
|
const shortcuts = {
|
|
|
|
|
|
1: "chat",
|
|
|
|
|
|
2: "drive",
|
|
|
|
|
|
3: "tasks",
|
|
|
|
|
|
4: "mail",
|
|
|
|
|
|
5: "calendar",
|
|
|
|
|
|
6: "meet",
|
2025-12-06 11:09:12 -03:00
|
|
|
|
7: "paper",
|
|
|
|
|
|
8: "research",
|
|
|
|
|
|
9: "sources",
|
|
|
|
|
|
0: "analytics",
|
|
|
|
|
|
a: "admin",
|
|
|
|
|
|
m: "monitoring",
|
2025-12-04 12:30:07 -03:00
|
|
|
|
};
|
|
|
|
|
|
if (shortcuts[e.key]) {
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
const link = document.querySelector(
|
|
|
|
|
|
`a[href="#${shortcuts[e.key]}"]`,
|
|
|
|
|
|
);
|
|
|
|
|
|
if (link) link.click();
|
|
|
|
|
|
appsDropdown.classList.remove("show");
|
|
|
|
|
|
}
|
2025-12-06 11:09:12 -03:00
|
|
|
|
if (e.key === ",") {
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
settingsPanel.classList.toggle("show");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (e.key === "s") {
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
const settingsLink =
|
|
|
|
|
|
document.querySelector(`a[href="#settings"]`);
|
|
|
|
|
|
if (settingsLink) settingsLink.click();
|
|
|
|
|
|
}
|
2025-12-04 12:30:07 -03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.body.addEventListener("htmx:afterSwap", (e) => {
|
|
|
|
|
|
if (e.detail.target.id === "main-content") {
|
|
|
|
|
|
const hash = window.location.hash || "#chat";
|
|
|
|
|
|
document.querySelectorAll(".app-item").forEach((item) => {
|
|
|
|
|
|
item.classList.toggle(
|
|
|
|
|
|
"active",
|
|
|
|
|
|
item.getAttribute("href") === hash,
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
2025-12-06 11:09:12 -03:00
|
|
|
|
settingsPanel.classList.remove("show");
|
2025-12-04 12:30:07 -03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-12-06 11:09:12 -03:00
|
|
|
|
// Theme handling
|
|
|
|
|
|
const themeOptions = document.querySelectorAll(".theme-option");
|
|
|
|
|
|
const savedTheme = localStorage.getItem("gb-theme") || "dark";
|
|
|
|
|
|
document.body.setAttribute("data-theme", savedTheme);
|
|
|
|
|
|
document
|
|
|
|
|
|
.querySelector(`.theme-option[data-theme="${savedTheme}"]`)
|
|
|
|
|
|
?.classList.add("active");
|
|
|
|
|
|
|
|
|
|
|
|
themeOptions.forEach((option) => {
|
|
|
|
|
|
option.addEventListener("click", () => {
|
|
|
|
|
|
const theme = option.getAttribute("data-theme");
|
|
|
|
|
|
document.body.setAttribute("data-theme", theme);
|
|
|
|
|
|
localStorage.setItem("gb-theme", theme);
|
|
|
|
|
|
themeOptions.forEach((o) => o.classList.remove("active"));
|
|
|
|
|
|
option.classList.add("active");
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function toggleQuickSetting(el) {
|
|
|
|
|
|
el.classList.toggle("active");
|
|
|
|
|
|
const setting = el.id.replace("toggle-", "");
|
2025-12-04 12:30:07 -03:00
|
|
|
|
localStorage.setItem(
|
2025-12-06 11:09:12 -03:00
|
|
|
|
`gb-${setting}`,
|
|
|
|
|
|
el.classList.contains("active"),
|
2025-12-04 12:30:07 -03:00
|
|
|
|
);
|
2025-12-06 11:09:12 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Load quick toggle states
|
|
|
|
|
|
["notifications", "sound", "compact"].forEach((setting) => {
|
|
|
|
|
|
const saved = localStorage.getItem(`gb-${setting}`);
|
|
|
|
|
|
const toggle = document.getElementById(`toggle-${setting}`);
|
|
|
|
|
|
if (toggle && saved !== null) {
|
|
|
|
|
|
toggle.classList.toggle("active", saved === "true");
|
|
|
|
|
|
}
|
2025-12-04 12:30:07 -03:00
|
|
|
|
});
|
|
|
|
|
|
|
2025-12-06 11:09:12 -03:00
|
|
|
|
function showKeyboardShortcuts() {
|
|
|
|
|
|
window.showNotification(
|
|
|
|
|
|
"Alt+1-9,0 for apps, Alt+A Admin, Alt+M Monitoring, Alt+S Settings, Alt+, quick settings",
|
|
|
|
|
|
"info",
|
|
|
|
|
|
8000,
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Accessibility: Announce page changes to screen readers
|
|
|
|
|
|
function announceToScreenReader(message) {
|
|
|
|
|
|
const liveRegion = document.getElementById("aria-live");
|
|
|
|
|
|
if (liveRegion) {
|
|
|
|
|
|
liveRegion.textContent = message;
|
|
|
|
|
|
// Clear after announcement
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
liveRegion.textContent = "";
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
}
|
2025-12-03 18:42:22 -03:00
|
|
|
|
}
|
2025-12-04 12:30:07 -03:00
|
|
|
|
|
2025-12-06 11:09:12 -03:00
|
|
|
|
// HTMX accessibility hooks
|
|
|
|
|
|
document.body.addEventListener("htmx:beforeRequest", function (e) {
|
|
|
|
|
|
const target = e.detail.target;
|
|
|
|
|
|
if (target && target.id === "main-content") {
|
|
|
|
|
|
target.setAttribute("aria-busy", "true");
|
|
|
|
|
|
announceToScreenReader("Loading content...");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.body.addEventListener("htmx:afterSwap", function (e) {
|
|
|
|
|
|
const target = e.detail.target;
|
|
|
|
|
|
if (target && target.id === "main-content") {
|
|
|
|
|
|
target.setAttribute("aria-busy", "false");
|
|
|
|
|
|
// Focus management: move focus to main content after navigation
|
|
|
|
|
|
target.focus();
|
|
|
|
|
|
announceToScreenReader("Content loaded");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.body.addEventListener("htmx:responseError", function (e) {
|
|
|
|
|
|
const target = e.detail.target;
|
|
|
|
|
|
if (target) {
|
|
|
|
|
|
target.setAttribute("aria-busy", "false");
|
|
|
|
|
|
}
|
|
|
|
|
|
announceToScreenReader(
|
|
|
|
|
|
"Error loading content. Please try again.",
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Keyboard navigation for apps grid
|
|
|
|
|
|
document.addEventListener("keydown", function (e) {
|
|
|
|
|
|
const appsGrid = document.querySelector(".apps-grid");
|
|
|
|
|
|
if (!appsGrid || !appsGrid.closest(".show")) return;
|
|
|
|
|
|
|
|
|
|
|
|
const items = Array.from(
|
|
|
|
|
|
appsGrid.querySelectorAll(".app-item"),
|
|
|
|
|
|
);
|
|
|
|
|
|
const currentIndex = items.findIndex(
|
|
|
|
|
|
(item) => item === document.activeElement,
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (currentIndex === -1) return;
|
|
|
|
|
|
|
|
|
|
|
|
let newIndex = currentIndex;
|
|
|
|
|
|
const columns = 3; // Grid has 3 columns on desktop
|
|
|
|
|
|
|
|
|
|
|
|
switch (e.key) {
|
|
|
|
|
|
case "ArrowRight":
|
|
|
|
|
|
newIndex = Math.min(currentIndex + 1, items.length - 1);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "ArrowLeft":
|
|
|
|
|
|
newIndex = Math.max(currentIndex - 1, 0);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "ArrowDown":
|
|
|
|
|
|
newIndex = Math.min(
|
|
|
|
|
|
currentIndex + columns,
|
|
|
|
|
|
items.length - 1,
|
|
|
|
|
|
);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "ArrowUp":
|
|
|
|
|
|
newIndex = Math.max(currentIndex - columns, 0);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "Home":
|
|
|
|
|
|
newIndex = 0;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "End":
|
|
|
|
|
|
newIndex = items.length - 1;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (newIndex !== currentIndex) {
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
items[newIndex].focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-12-04 12:30:07 -03:00
|
|
|
|
window.showNotification = function (
|
|
|
|
|
|
message,
|
|
|
|
|
|
type = "info",
|
|
|
|
|
|
duration = 5000,
|
|
|
|
|
|
) {
|
|
|
|
|
|
const container = document.getElementById("notifications");
|
|
|
|
|
|
const notification = document.createElement("div");
|
|
|
|
|
|
notification.className = `notification ${type}`;
|
|
|
|
|
|
notification.innerHTML = `
|
2025-12-06 11:09:12 -03:00
|
|
|
|
<div class="notification-content">
|
|
|
|
|
|
<div class="notification-message">${message}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<button class="notification-close" onclick="this.parentElement.remove()" style="background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:1.25rem;">×</button>
|
|
|
|
|
|
`;
|
2025-12-04 12:30:07 -03:00
|
|
|
|
container.appendChild(notification);
|
|
|
|
|
|
if (duration > 0) {
|
|
|
|
|
|
setTimeout(() => notification.remove(), duration);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-12-06 11:09:12 -03:00
|
|
|
|
|
|
|
|
|
|
// Global HTMX error handling with retry mechanism
|
|
|
|
|
|
const htmxRetryConfig = {
|
|
|
|
|
|
maxRetries: 3,
|
|
|
|
|
|
retryDelay: 1000,
|
|
|
|
|
|
retryCount: new Map(),
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function getRetryKey(elt) {
|
|
|
|
|
|
return (
|
|
|
|
|
|
elt.getAttribute("hx-get") ||
|
|
|
|
|
|
elt.getAttribute("hx-post") ||
|
|
|
|
|
|
elt.getAttribute("hx-put") ||
|
|
|
|
|
|
elt.getAttribute("hx-delete") ||
|
|
|
|
|
|
elt.id ||
|
|
|
|
|
|
Math.random().toString(36)
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showErrorState(target, errorMessage, retryCallback) {
|
|
|
|
|
|
const errorHtml = `
|
|
|
|
|
|
<div class="error-state">
|
|
|
|
|
|
<svg class="error-state-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
|
|
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
|
|
|
|
<line x1="12" y1="8" x2="12" y2="12"></line>
|
|
|
|
|
|
<line x1="12" y1="16" x2="12.01" y2="16"></line>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<div class="error-state-title">Something went wrong</div>
|
|
|
|
|
|
<div class="error-state-message">${errorMessage}</div>
|
|
|
|
|
|
<div class="error-state-actions">
|
|
|
|
|
|
<button class="btn-retry" onclick="window.retryLastRequest(this)">
|
|
|
|
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
|
|
|
|
<path d="M23 4v6h-6"></path>
|
|
|
|
|
|
<path d="M1 20v-6h6"></path>
|
|
|
|
|
|
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10"></path>
|
|
|
|
|
|
<path d="M20.49 15a9 9 0 0 1-14.85 3.36L1 14"></path>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
Try Again
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
`;
|
|
|
|
|
|
target.innerHTML = errorHtml;
|
|
|
|
|
|
target.dataset.retryCallback = retryCallback;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.retryLastRequest = function (btn) {
|
|
|
|
|
|
const target = btn.closest(".error-state").parentElement;
|
|
|
|
|
|
const retryCallback = target.dataset.retryCallback;
|
|
|
|
|
|
|
|
|
|
|
|
btn.disabled = true;
|
|
|
|
|
|
btn.innerHTML = '<span class="spinner"></span> Retrying...';
|
|
|
|
|
|
|
|
|
|
|
|
if (retryCallback && window[retryCallback]) {
|
|
|
|
|
|
window[retryCallback]();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// Try to re-trigger HTMX request
|
|
|
|
|
|
const triggers = target.querySelectorAll(
|
|
|
|
|
|
"[hx-get], [hx-post]",
|
|
|
|
|
|
);
|
|
|
|
|
|
if (triggers.length > 0) {
|
|
|
|
|
|
htmx.trigger(triggers[0], "htmx:trigger");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// Reload the current app
|
|
|
|
|
|
const activeApp =
|
|
|
|
|
|
document.querySelector(".app-item.active");
|
|
|
|
|
|
if (activeApp) {
|
|
|
|
|
|
activeApp.click();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Handle HTMX errors globally
|
|
|
|
|
|
document.body.addEventListener("htmx:responseError", function (e) {
|
|
|
|
|
|
const target = e.detail.target;
|
|
|
|
|
|
const xhr = e.detail.xhr;
|
|
|
|
|
|
const retryKey = getRetryKey(e.detail.elt);
|
|
|
|
|
|
|
|
|
|
|
|
let currentRetries =
|
|
|
|
|
|
htmxRetryConfig.retryCount.get(retryKey) || 0;
|
|
|
|
|
|
|
|
|
|
|
|
// Auto-retry for network errors (status 0) or server errors (5xx)
|
|
|
|
|
|
if (
|
|
|
|
|
|
(xhr.status === 0 || xhr.status >= 500) &&
|
|
|
|
|
|
currentRetries < htmxRetryConfig.maxRetries
|
|
|
|
|
|
) {
|
|
|
|
|
|
htmxRetryConfig.retryCount.set(
|
|
|
|
|
|
retryKey,
|
|
|
|
|
|
currentRetries + 1,
|
|
|
|
|
|
);
|
|
|
|
|
|
const delay =
|
|
|
|
|
|
htmxRetryConfig.retryDelay *
|
|
|
|
|
|
Math.pow(2, currentRetries);
|
|
|
|
|
|
|
|
|
|
|
|
window.showNotification(
|
|
|
|
|
|
`Request failed. Retrying in ${delay / 1000}s... (${currentRetries + 1}/${htmxRetryConfig.maxRetries})`,
|
|
|
|
|
|
"warning",
|
|
|
|
|
|
delay,
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
htmx.trigger(e.detail.elt, "htmx:trigger");
|
|
|
|
|
|
}, delay);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// Max retries reached or client error - show error state
|
|
|
|
|
|
htmxRetryConfig.retryCount.delete(retryKey);
|
|
|
|
|
|
|
|
|
|
|
|
let errorMessage = "We couldn't load the content.";
|
|
|
|
|
|
if (xhr.status === 401) {
|
|
|
|
|
|
errorMessage =
|
|
|
|
|
|
"Your session has expired. Please log in again.";
|
|
|
|
|
|
} else if (xhr.status === 403) {
|
|
|
|
|
|
errorMessage =
|
|
|
|
|
|
"You don't have permission to access this resource.";
|
|
|
|
|
|
} else if (xhr.status === 404) {
|
|
|
|
|
|
errorMessage = "The requested content was not found.";
|
|
|
|
|
|
} else if (xhr.status >= 500) {
|
|
|
|
|
|
errorMessage =
|
|
|
|
|
|
"The server is experiencing issues. Please try again later.";
|
|
|
|
|
|
} else if (xhr.status === 0) {
|
|
|
|
|
|
errorMessage =
|
|
|
|
|
|
"Unable to connect. Please check your internet connection.";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (target && target.id === "main-content") {
|
|
|
|
|
|
showErrorState(target, errorMessage);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
window.showNotification(errorMessage, "error", 8000);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Clear retry count on successful request
|
|
|
|
|
|
document.body.addEventListener("htmx:afterRequest", function (e) {
|
|
|
|
|
|
if (e.detail.successful) {
|
|
|
|
|
|
const retryKey = getRetryKey(e.detail.elt);
|
|
|
|
|
|
htmxRetryConfig.retryCount.delete(retryKey);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Handle timeout errors
|
|
|
|
|
|
document.body.addEventListener("htmx:timeout", function (e) {
|
|
|
|
|
|
window.showNotification(
|
|
|
|
|
|
"Request timed out. Please try again.",
|
|
|
|
|
|
"warning",
|
|
|
|
|
|
5000,
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Handle send errors (network issues before request sent)
|
|
|
|
|
|
document.body.addEventListener("htmx:sendError", function (e) {
|
|
|
|
|
|
window.showNotification(
|
|
|
|
|
|
"Network error. Please check your connection.",
|
|
|
|
|
|
"error",
|
|
|
|
|
|
5000,
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
2025-12-04 12:30:07 -03:00
|
|
|
|
</script>
|
2025-12-03 18:42:22 -03:00
|
|
|
|
|
2025-12-04 12:30:07 -03:00
|
|
|
|
{% block scripts %}{% endblock %}
|
|
|
|
|
|
</body>
|
2025-12-03 18:42:22 -03:00
|
|
|
|
</html>
|