feat: add per-account web UI with account tabs

- Account tab bar with tab switching (loadAccounts, switchAccount)
- Per-account dashboard panel showing auth status, channels, jobs, continuous
- Settings dialog with account management (add/delete accounts, credentials)
- Auth forms per account (QR, phone, password, set credentials)
- All action buttons with error handling (alert on failure)
- AMOLED dark theme with Telegram-style message bubbles
- Account tab and account list CSS styles
This commit is contained in:
2026-06-27 15:20:49 +02:00
parent bb4e28a710
commit 62a6a492e0
3 changed files with 1017 additions and 444 deletions
+303 -98
View File
@@ -1,17 +1,24 @@
:root {
color-scheme: dark;
--bg-color: #050505;
--panel: #0c0c0c;
--panel-alt: #080808;
--text-color: #e0e0e0;
--accent: #ffffff;
--dim: #6f6f6f;
--line: #2a2a2a;
--danger: #ff6b6b;
--ok: #7ee787;
--warn: #f0c674;
--info: #8ab4f8;
--font-mono: "Courier New", Courier, monospace;
--bg-color: #000000;
--panel: #0b0b0b;
--panel-solid: #101010;
--panel-alt: #050505;
--text-color: #f2f3f5;
--accent: #1fb9aa;
--accent-2: #58a6ff;
--bubble-own: #12342f;
--bubble-other: #171717;
--dim: #9aa0a6;
--line: #242424;
--danger: #ff7373;
--ok: #65e6a4;
--warn: #f6c969;
--info: #8ec7ff;
--radius: 18px;
--shadow: none;
--font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
--font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
* {
@@ -20,11 +27,11 @@
body {
margin: 0;
background: var(--bg-color);
background: #000;
color: var(--text-color);
font-family: var(--font-mono);
font-size: 16px;
line-height: 1.55;
font-family: var(--font-ui);
font-size: 15px;
line-height: 1.5;
}
a {
@@ -35,8 +42,9 @@ a {
a:hover,
button:hover {
background: var(--text-color);
color: var(--bg-color);
border-color: #333;
background: #151515;
color: var(--text-color);
}
code,
@@ -50,19 +58,19 @@ button {
height: 100vh;
overflow: hidden;
display: grid;
grid-template-columns: 300px minmax(0, 1fr);
grid-template-columns: 308px minmax(0, 1fr);
}
.sidebar {
background: var(--panel-alt);
border-right: 1px dashed var(--line);
padding: 28px 24px;
background: #050505;
border-right: 1px solid var(--line);
padding: 24px 20px;
}
.content {
overflow-y: auto;
padding: 28px;
max-width: 1320px;
padding: 24px;
max-width: 1440px;
width: 100%;
}
@@ -70,21 +78,16 @@ button {
.dialog-header h2 {
margin: 0;
color: var(--accent);
font-size: 1.45rem;
text-transform: uppercase;
letter-spacing: 0;
font-size: 1.5rem;
letter-spacing: -0.04em;
}
.eyebrow,
.section-title {
color: var(--dim);
font-size: 0.78rem;
font-size: 0.75rem;
text-transform: uppercase;
}
.eyebrow::before,
.section-title::before {
content: "./";
letter-spacing: 0.08em;
}
.muted {
@@ -112,8 +115,9 @@ input,
.content-tab,
.viewer-channel-item {
border: 1px solid var(--line);
background: var(--panel);
background: #101010;
color: var(--text-color);
border-radius: 999px;
}
.nav-link,
@@ -125,21 +129,23 @@ input,
min-height: 42px;
padding: 9px 13px;
cursor: pointer;
transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.nav-link.active,
.button.primary,
.content-tab.active {
border-color: var(--accent);
color: var(--accent);
box-shadow: inset 3px 0 0 var(--accent);
border-color: #0f6f67;
color: #ffffff;
background: #0f6f67;
box-shadow: none;
}
.nav-link.active:hover,
.button.primary:hover,
.content-tab.active:hover {
background: var(--panel);
color: var(--accent);
background: #128277;
color: #ffffff;
}
.button.danger {
@@ -164,7 +170,9 @@ input,
.message-card,
.settings-dialog {
background: var(--panel);
border: 1px dashed var(--line);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.status-card,
@@ -185,10 +193,10 @@ input,
.status-badge {
display: inline-flex;
padding: 4px 8px;
padding: 6px 10px;
border: 1px solid var(--line);
border-radius: 999px;
color: var(--ok);
text-transform: uppercase;
}
.content-tabs {
@@ -228,8 +236,9 @@ input,
.stat-value {
margin-top: 8px;
font-size: 2rem;
font-size: 2.25rem;
font-weight: 700;
letter-spacing: -0.05em;
}
.stat-compact {
@@ -250,8 +259,9 @@ input,
input {
min-width: 160px;
padding: 9px 11px;
padding: 10px 13px;
outline: 0;
border-radius: 14px;
}
input:focus {
@@ -286,7 +296,8 @@ input:focus {
position: absolute;
inset: 0;
border: 1px solid var(--line);
background: #101010;
background: rgba(255, 255, 255, 0.06);
border-radius: 999px;
}
.switch-slider::before {
@@ -297,6 +308,7 @@ input:focus {
width: 16px;
height: 16px;
background: var(--dim);
border-radius: 50%;
transition: transform 0.16s ease, background-color 0.16s ease;
}
@@ -323,11 +335,11 @@ td {
padding: 12px 10px;
text-align: left;
vertical-align: top;
border-bottom: 1px dashed var(--line);
border-bottom: 1px solid var(--line);
}
tbody tr:hover {
background: #101010;
background: #111;
}
.action-row {
@@ -375,7 +387,9 @@ tbody tr:hover {
gap: 10px;
min-height: 38px;
padding: 8px;
border: 1px dashed var(--line);
border: 1px solid var(--line);
border-radius: 14px;
background: #0f0f0f;
}
.checkbox-row input {
@@ -391,7 +405,8 @@ tbody tr:hover {
max-height: 420px;
overflow: auto;
border: 1px solid var(--line);
background: #030303;
background: rgba(0, 0, 0, 0.2);
border-radius: 16px;
}
.log-line {
@@ -404,7 +419,7 @@ tbody tr:hover {
}
.log-line:hover {
background: #101010;
background: #111;
}
.log-time,
@@ -455,13 +470,14 @@ tbody tr:hover {
.settings-section {
margin-top: 18px;
padding-top: 16px;
border-top: 1px dashed var(--line);
border-top: 1px solid var(--line);
}
.qr-wrap {
margin-top: 14px;
padding: 12px;
border: 1px dashed var(--line);
border: 1px solid var(--line);
border-radius: 16px;
}
.qr-wrap img {
@@ -481,18 +497,18 @@ tbody tr:hover {
.viewer-shell {
display: grid;
grid-template-columns: 300px minmax(0, 1fr);
grid-template-columns: 360px minmax(0, 1fr);
height: 100vh;
overflow: hidden;
}
.viewer-sidebar {
background: var(--panel-alt);
border-right: 1px dashed var(--line);
padding: 28px 24px;
background: #050505;
border-right: 1px solid var(--line);
padding: 14px 10px;
display: flex;
flex-direction: column;
gap: 20px;
gap: 12px;
overflow-y: auto;
}
@@ -505,48 +521,104 @@ tbody tr:hover {
align-items: flex-start;
justify-content: space-between;
gap: 16px;
padding: 10px 6px 8px;
}
.viewer-sidebar-head h1 {
margin: 0;
color: var(--accent);
font-size: 1.45rem;
text-transform: uppercase;
letter-spacing: 0;
letter-spacing: -0.04em;
}
.viewer-channel-list {
display: grid;
gap: 10px;
gap: 2px;
}
.viewer-channel-item {
display: grid;
gap: 4px;
grid-template-columns: 52px minmax(0, 1fr);
align-items: center;
gap: 10px;
width: 100%;
padding: 12px;
min-height: 68px;
padding: 8px 10px;
text-align: left;
cursor: pointer;
border: 1px solid var(--line);
background: var(--panel);
border: 1px solid transparent;
background: transparent;
color: var(--text-color);
border-radius: 12px;
}
.viewer-channel-item.active {
border-color: var(--accent);
box-shadow: inset 3px 0 0 var(--accent);
border-color: transparent;
background: #12342f;
box-shadow: none;
}
.viewer-channel-item:hover {
background: #111;
}
.viewer-channel-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
border-radius: 50%;
background: #5f6b70;
color: white;
font-weight: 700;
letter-spacing: -0.03em;
}
.viewer-channel-copy {
display: grid;
gap: 3px;
min-width: 0;
}
.viewer-channel-row {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 8px;
min-width: 0;
}
.viewer-channel-name {
color: var(--accent);
color: var(--text-color);
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.viewer-channel-meta {
.viewer-channel-time,
.viewer-channel-preview {
color: var(--dim);
font-size: 0.82rem;
}
.viewer-channel-preview {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.viewer-channel-count {
min-width: 22px;
padding: 2px 7px;
border-radius: 999px;
background: #12342f;
color: var(--accent);
font-size: 0.76rem;
text-align: center;
}
/* ---------- Main panel ---------- */
.viewer-main {
@@ -554,27 +626,31 @@ tbody tr:hover {
flex-direction: column;
height: 100vh;
overflow: hidden;
background:
radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.025) 1px, transparent 1.5px),
radial-gradient(circle at 58px 54px, rgba(255, 255, 255, 0.018) 1px, transparent 1.5px),
#000;
background-size: auto, 84px 84px, 84px 84px, auto;
}
.viewer-header {
flex-shrink: 0;
padding: 20px 28px;
border-bottom: 1px dashed var(--line);
background: var(--panel-alt);
padding: 16px 24px;
border-bottom: 1px solid var(--line);
background: #050505;
}
.viewer-header h2 {
margin: 0;
color: var(--accent);
font-size: 1.45rem;
text-transform: uppercase;
letter-spacing: 0;
letter-spacing: -0.04em;
}
.messages-list {
flex: 1;
overflow-y: auto;
padding: 12px 28px 20px;
padding: 18px 34px 22px;
display: flex;
flex-direction: column;
}
@@ -594,9 +670,7 @@ tbody tr:hover {
gap: 12px;
margin: 12px 0;
font-size: 0.78rem;
color: var(--dim);
text-transform: uppercase;
letter-spacing: 0.03em;
color: #d6e6e8;
flex-shrink: 0;
}
@@ -605,7 +679,14 @@ tbody tr:hover {
content: "";
flex: 1;
height: 1px;
background: var(--line);
background: #242424;
}
.chat-date-sep {
align-self: center;
padding: 5px 12px;
border-radius: 999px;
background: #111;
}
.chat-date-sep:empty {
@@ -627,15 +708,16 @@ tbody tr:hover {
/* ---------- Chat bubble ---------- */
.chat-bubble {
max-width: 75%;
padding: 7px 11px;
background: #1c1c1c;
border: 1px solid var(--line);
border-radius: 1px;
margin-bottom: 4px;
max-width: min(680px, 74%);
padding: 8px 12px 7px;
background: var(--bubble-other);
border: 1px solid #242424;
border-radius: 18px 18px 18px 6px;
margin-bottom: 6px;
overflow-wrap: anywhere;
word-break: break-word;
position: relative;
box-shadow: none;
}
.chat-bubble::before {
@@ -647,19 +729,20 @@ tbody tr:hover {
.chat-bubble-wrap:not(.chat-bubble-wrap--own) .chat-bubble::before {
left: -12px;
border-right-color: #1c1c1c;
border-right-color: var(--bubble-other);
border-left: 0;
}
.chat-bubble-wrap--own .chat-bubble::before {
right: -12px;
border-left-color: #1e3a5f;
border-left-color: var(--bubble-own);
border-right: 0;
}
.chat-bubble-wrap--own .chat-bubble {
background: #1e3a5f;
border-color: #2b5278;
background: var(--bubble-own);
border-color: #1f5b52;
border-radius: 18px 18px 6px 18px;
}
.chat-bubble--highlight {
@@ -675,7 +758,7 @@ tbody tr:hover {
.chat-sender {
font-size: 0.82rem;
color: var(--info);
color: var(--accent);
font-weight: 700;
margin-bottom: 2px;
}
@@ -690,8 +773,10 @@ tbody tr:hover {
display: flex;
gap: 6px;
margin-bottom: 4px;
padding: 4px 0;
padding: 6px 8px;
cursor: pointer;
border-radius: 10px;
background: rgba(0, 0, 0, 0.18);
}
.chat-reply.hidden {
@@ -702,7 +787,7 @@ tbody tr:hover {
flex-shrink: 0;
width: 2px;
background: var(--accent);
border-radius: 1px;
border-radius: 999px;
opacity: 0.5;
}
@@ -729,6 +814,7 @@ tbody tr:hover {
.chat-text {
white-space: pre-wrap;
line-height: 1.45;
font-size: 0.96rem;
}
.chat-text:empty {
@@ -749,7 +835,8 @@ tbody tr:hover {
.chat-media video {
display: block;
max-width: 100%;
border: 1px solid var(--line);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 14px;
}
/* ---------- Footer ---------- */
@@ -783,7 +870,7 @@ tbody tr:hover {
}
.api-method {
border-top: 1px dashed var(--line);
border-top: 1px solid var(--line);
padding-top: 12px;
}
@@ -827,7 +914,7 @@ tbody tr:hover {
.sidebar,
.viewer-sidebar {
border-right: 0;
border-bottom: 1px dashed var(--line);
border-bottom: 1px solid var(--line);
}
.panel-grid {
@@ -835,6 +922,124 @@ tbody tr:hover {
}
}
/* ── Account Tabs ─────────────────────────────────────── */
.account-tabs {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid var(--line);
}
.account-tab {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 38px;
padding: 7px 14px;
border: 1px solid var(--line);
border-radius: 999px;
background: #101010;
color: var(--text-color);
cursor: pointer;
font: inherit;
font-size: 0.88rem;
}
.account-tab.active {
border-color: #0f6f67;
color: #ffffff;
background: #0f6f67;
}
.account-tab .account-tab-status {
font-size: 0.72rem;
opacity: 0.7;
}
.account-tab .account-tab-status.ok {
color: var(--ok);
}
.account-tab .account-tab-status.errored {
color: var(--danger);
}
/* ── Account Panels ──────────────────────────────────── */
.account-panel {
display: block;
}
.account-panel.hidden {
display: none;
}
/* ── Settings: Account List ──────────────────────────── */
.accounts-list {
display: grid;
gap: 8px;
margin-bottom: 12px;
}
.account-list-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
border: 1px solid var(--line);
border-radius: 16px;
background: #0f0f0f;
}
.account-list-info {
display: grid;
gap: 2px;
min-width: 0;
}
.account-list-label {
font-weight: 700;
}
.account-list-id {
font-size: 0.82rem;
}
.account-list-auth-status {
font-size: 0.78rem;
}
.account-list-actions {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.add-account-form {
display: grid;
gap: 8px;
margin-top: 8px;
padding: 12px;
border: 1px solid var(--line);
border-radius: 16px;
background: #0f0f0f;
}
/* ── Active Account Card ─────────────────────────────── */
#active-account-name {
word-break: break-all;
}
#active-account-status {
margin-top: 6px;
}
/* ---------- Mobile: tablet & phone ---------- */
@media (max-width: 768px) {
@@ -844,13 +1049,13 @@ tbody tr:hover {
.viewer-sidebar {
position: fixed;
left: -300px;
left: -360px;
top: 0;
bottom: 0;
width: 280px;
width: 340px;
z-index: 100;
transition: left 0.2s ease;
border-right: 1px dashed var(--line);
border-right: 1px solid var(--line);
border-bottom: 0;
}
@@ -939,7 +1144,7 @@ tbody tr:hover {
}
.viewer-sidebar {
width: 260px;
width: 300px;
padding: 16px;
}