# WAHA-OC Admin Panel — Old GUI Feature Inventory (v1.15.2, Legacy HTML/JS)

> Definitive field-level reference for systematic comparison with the new React-based admin panel.
> Every component, field, toggle, dropdown, tooltip, and feature is documented.

---

## Global Elements

| Element | Description |
|---------|-------------|
| Header bar | "WAHA-OC Admin Panel" title (cyan), 7 tab buttons, "Filter OFF" badge (red), theme toggle button (sun/moon icon) |
| Footer | "Created with love by omer nesher - GitHub" with links |
| Theme toggle | Light/dark mode switch (sun icon in dark mode) |
| Filter badge | "Filter ON" (green) or "Filter OFF" (red) indicator in header |

---

## Tab 1: Dashboard

Contains 5 vertically stacked collapsible cards.

### Card 1: DM Keyword Filter (collapsible)

| Element | Type | Details |
|---------|------|---------|
| Session label | text | e.g. "3cf11776_logan" |
| Passed | stat box | Green number |
| Filtered | stat box | Red number |
| Tokens Saved (est) | stat box | Yellow number |
| Patterns | text | Displays current patterns or "none" |
| Recent Events | list | Shows recent filter events or "No events yet" |

### Card 2: Group Keyword Filter (collapsible)

Identical layout to DM Keyword Filter:

| Element | Type | Details |
|---------|------|---------|
| Session label | text | e.g. "3cf11776_logan" |
| Passed | stat box | Green number |
| Filtered | stat box | Red number |
| Tokens Saved (est) | stat box | Yellow number |
| Patterns | text | Displays current patterns or "none" |
| Recent Events | list | Shows recent filter events or "No events yet" |

### Card 3: Presence System

| Element | Type | Details |
|---------|------|---------|
| Enabled | text | true/false (bold value) |
| Words Per Minute | text | Numeric value |
| Read Delay (ms) | text | Numeric value |
| Typing Duration (ms) | text | Numeric value |
| Pause Chance | text | Numeric value |
| Jitter | text | Numeric value |

### Card 4: Access Control

| Element | Type | Details |
|---------|------|---------|
| DM Policy | text | e.g. "allowlist" |
| Group Policy | text | e.g. "allowlist" |
| Allow From | text + badge | Count badge + JID list or "none" |
| Group Allow From | text + badge | Count badge + JID list or "none" |
| Allowed Groups | text + badge | Count badge + JID list or "none" |

### Card 5: Sessions

| Element | Type | Details |
|---------|------|---------|
| Title | text | "Sessions" with health indicator dot (green = healthy) |
| Session ID | text | Per-session identifier |
| Role badge | badge | e.g. "bot" in blue |
| Sub-role badge | badge | e.g. "full-access" in green |
| Health status | dot indicator | Green/red dot with label |
| WAHA Status | text | e.g. "WORKING" |
| Health details | text | "Health: healthy \| Consecutive Failures: 0 \| Last Check: just now" |
| Base URL | text | Connection info |
| Webhook Port | text | Connection info |
| Server Time | text | Connection info |
| Health | text | Health metric |
| Consecutive Failures | text | Health metric |
| Last Success | text | Health metric |
| Last Check | text | Health metric |
| Last refreshed | timestamp | Timestamp of last data fetch |
| Refresh | button | Refreshes session data |

---

## Tab 2: Settings (Plugin Settings)

Contains 10 collapsible sections + 1 info section + 2 action buttons.

### Section 1: Connection

| Field | Type | Tooltip |
|-------|------|---------|
| Base URL | text input | "WAHA server URL. Must be accessible from this host. Example: http://127.0.0.1:3004" |
| Active WAHA Session | dropdown | "WAHA session name. Select from sessions available on your WAHA server." Options: lists available sessions |
| Webhook Port | number input | "Port the webhook HTTP server listens on. Default: 8050. Restart required after change." |
| Webhook Path | text input | "URL path WAHA sends events to. Default: /webhook/waha" |

### Section 2: Trigger Operator

| Field | Type | Tooltip |
|-------|------|---------|
| Trigger Word | text input | "Prefix that activates the bot (e.g. '!' or '!bot'). Messages must start with this to pass through filters. Used for human sessions where all messages are filtered by default. Leave empty to disable trigger-based filtering." |
| Trigger Response Mode | dropdown | "Where the bot responds when triggered in a group. 'dm' = respond via DM to the sender. 'reply-in-chat' = respond in the same group. For DM triggers, the bot always responds in the same DM." Options: "dm", "reply-in-chat" |

### Section 3: Access Control

| Field | Type | Tooltip |
|-------|------|---------|
| DM Policy | dropdown | "How to handle DMs from unknown senders. open: accept all. closed: block all. allowlist: only contacts in Allow From list." Options: "open", "closed", "allowlist" |
| Group Policy | dropdown | "How to handle group messages. allowlist=only allowedGroups, open=all groups, closed=no groups." Options: "allowlist", "open", "closed" |
| Allow From (DMs) | tag input | "JIDs allowed to send DMs. Press Enter or comma to add. Supports @c.us and @lid formats. Example: 972544329000@c.us" |
| Group Allow From | tag input | "JIDs allowed to trigger the bot in groups. Press Enter or comma to add. Include both @c.us and @lid for the same person (NOWEB sends @lid)." |
| Allowed Groups | tag input | "Group JIDs the bot will respond in. Press Enter or comma to add. Leave empty to allow all groups (with open policy)." |
| Can Initiate (Global Default) | toggle | "When enabled, the bot can start new conversations with any contact. When disabled, the bot can only respond to incoming messages unless a per-contact override allows initiation." |

### Section 4: Pairing Mode

| Field | Type | Tooltip |
|-------|------|---------|
| Enable Pairing Mode | toggle | "When enabled, unknown DM senders can enter a passcode to get added to the allow list automatically." |
| Passcode | text + Generate button | "The 6-digit code contacts must enter to get DM access. Click Generate to create a random one." (visible when enabled) |
| Expiry duration | dropdown | "How long pairing-granted access lasts. After this period, access is automatically revoked." (visible when enabled) |
| Welcome message | textarea | "The message sent to unknown DMs asking them to enter the passcode." (visible when enabled) |
| Pairing link generator | text input (JID) | "Share this link to let a specific contact start a pairing flow. Enter their JID below to generate." (visible when enabled) |

### Section 5: Auto-Reply

| Field | Type | Tooltip |
|-------|------|---------|
| Send rejection message to unauthorized DMs | toggle | "When enabled, contacts whose DMs are blocked will receive an automatic reply explaining they are not authorized." |
| Reply message | textarea | "Message sent to blocked DMs. Use {admin_name} to insert the bot owner's name." (visible when enabled) |
| Cooldown minutes | number input | "Minimum minutes between auto-replies to the same contact to prevent spam." (visible when enabled) |

### Section 6: DM Keyword Filter

| Field | Type | Tooltip |
|-------|------|---------|
| Enabled | toggle | "When on, DMs must contain at least one mention pattern to get a response. Reduces noise and token usage." |
| Mention Patterns | tag input | "Regex patterns (case-insensitive). DMs must match at least one. Press Enter or comma to add each pattern." |
| God Mode Bypass | toggle | "When on, super-users bypass the keyword filter entirely (their messages always get a response)." |
| God Mode Scope | dropdown | "Controls which filters god mode bypass applies to. 'All' = bypass both DM and group filters (default for bot sessions). 'DM Only' = bypass DM filter only, NOT group filter (recommended for human sessions). 'Off' = never bypass." Options: "All (DM + Groups)", "DM Only", "Off" |
| Token Estimate | number input | "Estimated tokens saved per dropped DM. Used for stats display only. Default: 2500." |
| God Mode Users | searchable tag input | "JIDs that bypass the DM keyword filter entirely. Search and select contacts. Include both @c.us and @lid formats for NOWEB compatibility." |

### Section 7: Group Keyword Filter

| Field | Type | Tooltip |
|-------|------|---------|
| Enabled | toggle | "When on, group messages must contain at least one mention pattern to get a response. Works the same as DM Keyword Filter but for group messages. Saves tokens by filtering irrelevant group chatter." |
| Mention Patterns | tag input | "Regex patterns (case-insensitive). Group messages must match at least one. Press Enter or comma to add each pattern." |
| God Mode Bypass | toggle | "When on, super-users bypass the group keyword filter entirely." |
| God Mode Scope | dropdown | "Controls which filters god mode bypass applies to. 'All' = bypass both DM and group filters. 'DM Only' = bypass DM filter only, NOT group filter. 'Off' = never bypass. Typically set the same as the DM filter scope." Options: "All (DM + Groups)", "DM Only", "Off" |
| Token Estimate | number input | "Estimated tokens saved per dropped group message. Default: 2500." |
| God Mode Users | searchable tag input | "JIDs that bypass the group keyword filter entirely. Search and select contacts. Supports @c.us and @lid formats." |

### Section 8: Presence (Human Mimicry)

| Field | Type | Tooltip |
|-------|------|---------|
| Enabled | toggle | "Simulate human typing: read delays, typing indicators, pause breaks. Makes responses feel natural." |
| Send Seen | toggle | "Send read receipts (blue ticks) when reading incoming messages. Shows the sender that the bot has seen their message." |
| Words Per Minute | number input | "Typing speed for calculating typing duration. Default: 42. Range: 20-120." |
| Read Delay (ms) | min/max number inputs | "Simulated message reading time range [min, max] before starting to type. Default: [500, 4000]." |
| ms Per Read Char | number input | "Extra read delay per character in the message. Longer messages = longer read time. Default: 30." |
| Typing Duration (ms) | min/max number inputs | "Min/max clamp for typing indicator duration. Actual duration is derived from WPM + message length. Default: [1500, 15000]." |
| Pause Chance | number input | "Probability of a mid-typing pause (0.0 = never, 1.0 = always). Default: 0.3 (30% chance)." |
| Pause Duration (ms) | min/max number inputs | "Duration of a typing pause [min, max]. Default: [500, 2000]." |
| Pause Interval (ms) | min/max number inputs | "How often pauses can occur [min, max interval]. Default: [2000, 5000]." |
| Jitter [min, max] | min/max number inputs | "Random timing multiplier range. 1.0 = no jitter. Default: [0.7, 1.3] = +-30% variation." |

### Section 9: Markdown

| Field | Type | Tooltip |
|-------|------|---------|
| Markdown Enabled | toggle | "Process markdown in outbound messages (bold, italic, code). WhatsApp uses its own formatting syntax." |
| Tables Mode | dropdown | "How to render markdown tables. auto=detect client capability, markdown=always markdown, text=always plain text." Options: "auto", "markdown", "text" |

### Section 10: Features

| Field | Type | Tooltip |
|-------|------|---------|
| Reactions | toggle | "Enable emoji reaction support. When on, the bot can receive and process message reactions." |
| Block Streaming | toggle | "Send responses as a single message instead of streaming chunks. Reduces message spam for long responses." |

### Section 11: Media Preprocessing

| Field | Type | Tooltip |
|-------|------|---------|
| Media Preprocessing | toggle (master) | "Master toggle. When enabled, inbound media messages (audio, images, video, documents, locations, vCards) are preprocessed before being sent to the AI." |
| Audio (Whisper transcription) | toggle (sub) | "Transcribe voice messages to text using Whisper before sending to AI." (visible when master enabled) |
| Images | toggle (sub) | "Analyze image content and generate descriptions before sending to AI." (visible when master enabled) |
| Video | toggle (sub) | "Analyze video content (extracts key frames) before sending to AI." (visible when master enabled) |
| Location | toggle (sub) | "Resolve GPS coordinates to human-readable addresses via OpenStreetMap Nominatim." (visible when master enabled) |
| vCards | toggle (sub) | "Parse vCard contact attachments and extract contact info as structured text." (visible when master enabled) |
| Documents | toggle (sub) | "Extract text content from PDF and document attachments before sending to AI." (visible when master enabled) |
| Poll Handling | read-only info | "Automatic (built-in)" |
| Event Handling | read-only info | "Automatic (built-in)" |

### Action Buttons

| Button | Style | Behavior |
|--------|-------|----------|
| Save Settings | blue | Saves config without restart |
| Save & Restart | orange | Saves config and restarts gateway |

### Info Section: Multi-Session Filtering Guide (collapsible)

Expandable reference guide containing:
- How messages flow through the guardrails (numbered pipeline)
- Scenarios: Bot + Human session in same group, Only human session in group, DMs
- Bot prefix explanation
- God Mode Scope explanation (all/dm/off)
- Per-Group Filter Overrides explanation

---

## Tab 3: Directory (Contact Directory)

### Sub-tabs
- **Contacts** | **Groups** | **Channels**

### Header Area (shared across sub-tabs)

| Element | Type | Details |
|---------|------|---------|
| Sync status | indicator | Checkmark + "Sync not started yet" or sync progress |
| Search | text input | Placeholder: "Search by name or JID..." |
| Refresh | button | Refreshes current sub-tab |
| Refresh All | button | Refreshes all directory data |
| Select | button | Enables multi-select mode |
| Summary counts | text | "Contacts 11  Groups 123  Newsletters 86  Showing X-Y of Z" |

### Contacts Sub-tab

| Element | Type | Details |
|---------|------|---------|
| Contacts per page | dropdown | Options: 10, 25, 50, 100 |

Per-contact row:

| Element | Type | Details |
|---------|------|---------|
| Avatar | circle | Initials, colored background |
| Display name | text | Name or JID if no name |
| JID | text | Below name |
| Last active | timestamp | e.g. "7d ago" |
| Message count | badge | e.g. "292 msgs" |
| Allow DM | button | Toggle DM access |
| Settings | button | Opens per-contact settings |

Expandable per-contact settings panel (click row to expand):

| Field | Type | Tooltip |
|-------|------|---------|
| Mode | dropdown | "Active: bot responds to this contact. Listen Only: messages arrive but bot does not reply." Options: "Active", "Listen Only" |
| Mention Only | checkbox | "When checked, bot only responds if it is explicitly @mentioned in the message." |
| Custom Keywords | tag input | "Regex patterns. Bot responds only if the message matches one. Overrides global keyword filter for this contact. Press Enter to add each keyword." |
| Can Initiate | dropdown | "Override the global Can Initiate setting for this contact. Default: follow the global toggle in Settings. Allow: always allow initiation. Block: never initiate." Options: "Default (use global)", "Allow", "Block" |
| Access Expires | dropdown | "Set how long this contact's DM access lasts. After expiry, access is automatically revoked." Options: "Never", "30 minutes", "1 hour", "4 hours", "24 hours", "7 days", "Custom..." |
| Save | button | Full-width green button |

### Groups Sub-tab

| Element | Type | Details |
|---------|------|---------|
| Groups per page | dropdown | Options: 10, 25, 50, 100 |
| Pagination | button bar | << < 1 2 3 4 5 > >> |

Table columns:

| Column | Details |
|--------|---------|
| Name | Group name |
| JID | Group JID |
| Members | Member count (number or "-") |
| Last Active | Timestamp |
| Participants | Button - lazy-loads group participant list |

Participant expansion: shows participant rows with allow toggles.

### Channels Sub-tab

Same card layout as Contacts sub-tab.

Per-channel row:

| Element | Type | Details |
|---------|------|---------|
| Avatar | circle | Initials |
| Channel name | text | Display name |
| Newsletter JID | text | @newsletter format |
| Last active | timestamp | Relative time |
| Message count | badge | Count |
| Allow DM | button | Toggle access |
| Settings | button | Opens settings panel |

Expandable settings panel: same as Contacts (Mode, Mention Only, Custom Keywords, Can Initiate, Access Expires, Save).

---

## Tab 4: Queue (Inbound Queue)

| Element | Type | Details |
|---------|------|---------|
| DM Depth | stat box | Green |
| Group Depth | stat box | Purple |
| Processed | stat box | Teal |
| DM Overflow Drops | text | Numeric value |
| Group Overflow Drops | text | Numeric value |
| Refresh | button | Refreshes queue stats |

---

## Tab 5: Sessions (Registered Sessions)

Per-session card:

| Element | Type | Details |
|---------|------|---------|
| Avatar | circle | Initials |
| Session name | text | Display name |
| Session ID | text | Identifier |
| Role | dropdown | Options: "bot", "human". bot = AI-controlled session, processes messages automatically. human = User-controlled session, messages monitored but not auto-responded to. |
| Sub-Role | dropdown | Options: "full-access", "listener". full-access = Can send and receive messages. listener = Can only receive/monitor messages, outgoing sends are blocked. |
| Health indicator | dot + label | "healthy"/"unhealthy" |
| WAHA Status | text | e.g. "WORKING" |
| Failures | text | Count |
| Last Check | timestamp | Relative time |

Footer elements:

| Element | Type | Details |
|---------|------|---------|
| Role/Sub-Role explanation | info box | Explains role and sub-role options |
| Note | text | "Changes take effect after gateway restart." |
| Refresh | button | Refreshes session data |
| Save & Restart | button | Saves role/sub-role changes and restarts gateway |

---

## Tab 6: Modules (Registered Modules)

| Element | Type | Details |
|---------|------|---------|
| Title | text | "Registered Modules" |
| Refresh | button | Refreshes module list |
| Module list | list | Module entries or "No modules registered. Modules are loaded at gateway startup." |

---

## Tab 7: Log (Gateway Log)

| Element | Type | Details |
|---------|------|---------|
| Filter | text input | Placeholder: "Filter logs..." |
| Level: All | button | Active blue, shows all levels |
| Level: Error | button | Red, filters to ERROR |
| Level: Warn | button | Yellow, filters to WARN |
| Level: Info | button | Blue, filters to INFO |
| Auto-scroll | checkbox | Checked by default |
| Refresh | button | Refreshes log data |
| Source info | text | "Source: journalctl \| 90 lines" |

Log table columns:

| Column | Details |
|--------|---------|
| Timestamp | e.g. "Mar 20 18:13:05" |
| Level badge | INFO=cyan, WARN=yellow, ERROR=red, DEBUG=gray |
| Message | Full log line content |

---

## Feature Count Summary

| Category | Count |
|----------|-------|
| Tabs | 7 (Dashboard, Settings, Directory, Queue, Sessions, Modules, Log) |
| Collapsible settings sections | 10 + 1 info guide |
| Tooltips across settings | ~55 |
| Directory sub-tabs | 3 (Contacts, Groups, Channels) |
| Per-contact settings fields | 6 (Mode, Mention Only, Custom Keywords, Can Initiate, Access Expires, Save) |
| Dashboard cards | 5 (DM Filter, Group Filter, Presence, Access Control, Sessions) |
| Log level filters | 4 + search + auto-scroll |
| Theme toggle | 1 (light/dark) |
| Filter status badge | 1 (ON/OFF) |

---

## Field-Level Totals by Tab

| Tab | Input Fields | Buttons | Toggles | Dropdowns | Tag Inputs | Text Displays |
|-----|-------------|---------|---------|-----------|------------|---------------|
| Dashboard | 0 | 1 | 0 | 0 | 0 | ~25 |
| Settings | 8 | 3 | 14 | 8 | 6 | 2 |
| Directory | 1 | 5+ | 0 | 2 | 1 | ~10 |
| Queue | 0 | 1 | 0 | 0 | 0 | 5 |
| Sessions | 0 | 2 | 0 | 2/session | 0 | ~8/session |
| Modules | 0 | 1 | 0 | 0 | 0 | 1 |
| Log | 1 | 6 | 1 | 0 | 0 | 2 |
