๐จ Complete Web UI Guide¶
Overview¶
Sloth Runner's Web UI is a modern, responsive, and intuitive interface for managing workflows, agents, hooks, events, and monitoring. Built with Bootstrap 5, Chart.js, and WebSockets for real-time updates.
Access URL: http://localhost:8080
(default port)
๐ Starting the Web UI¶
# Method 1: UI command
sloth-runner ui --port 8080
# Method 2: With specific bind
sloth-runner ui --port 8080 --bind 0.0.0.0
# Method 3: With environment variable
export SLOTH_RUNNER_UI_PORT=8080
sloth-runner ui
๐ฑ Pages and Features¶
1. ๐ Main Dashboard (/
)¶
Features:
- System overview - Cards with main statistics
- Total workflows
- Total active/inactive agents
- Recent executions
-
Success rate
-
Interactive charts (Chart.js)
- Executions per day (last 7 days)
- Success vs failure rate
- Agent resource usage
-
Workflow distribution
-
Real-time activity feed
- Workflows started/completed
- Agents connected/disconnected
- System events
-
WebSocket updates
-
Quick Actions (floating button)
- Execute workflow
- Create new workflow
- View agents
- Settings
Modern features: - ๐จ Dark/light mode (automatic toggle) - ๐ Responsive charts - ๐ Auto-refresh every 30 seconds - ๐ฏ Smooth animations (fade-in, hover effects) - ๐ฑ Mobile-first design
2. ๐ค Agent Management (/agents
)¶
Features:
Agent Cards¶
Each agent is displayed in a modern card with:
- Visual status
- ๐ข Online (green with pulse animation)
- ๐ด Offline (gray)
-
๐ก Connecting (yellow)
-
Real-time metrics
- CPU Usage (%) - animated progress chart
- Memory Usage (%) - animated progress chart
- Disk Usage (%) - animated progress chart
-
Load Average - converted to % based on CPU cores
-
Agent information
- Name and address
- Agent version
- Formatted uptime (d/h/m/s)
- Registration date
-
Last heartbeat
-
Sparklines (mini trend graphs)
- CPU usage last 24h
- Memory usage last 24h
-
Rendered with Canvas API
-
Action buttons
- ๐ Dashboard - go to agent dashboard
- โน๏ธ Details - modal with full details
- ๐ Logs - view agent logs
- ๐ Restart - restart agent (only if online)
General Statistics¶
- Total agents
- Active agents
- Inactive agents
- Uptime rate (%)
Advanced Features¶
- Auto-refresh - updates list every 10 seconds
- WebSocket - real-time notifications when agents connect/disconnect
- Filters - filter by status (all/active/inactive)
- Search - search agents by name
- Responsive grid - cards automatically reorganize
- Skeleton loaders - professional loading states
Layout:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Stats Cards โ
โ โโโโโโโโ โโโโโโโโ โโโโโโโโ โโโโโโโโ โ
โ โTotal โ โActiveโ โInact.โ โUptimeโ โ
โ โโโโโโโโ โโโโโโโโ โโโโโโโโ โโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ค Agent Cards โ
โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ
โ โ Agent 1 โ โ Agent 2 โ โ Agent 3 โ โ
โ โ ๐ข 80% โ โ ๐ข 45% โ โ ๐ด N/A โ โ
โ โ [graph] โ โ [graph] โ โ [graph] โ โ
โ โ [btns] โ โ [btns] โ โ [btns] โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3. ๐๏ธ Agent Control (/agent-control
)¶
Features:
Dedicated page for detailed control of each agent.
- Agent list with expanded cards
- Detailed metrics
- CPU cores, load average
- Memory total/used/free
- Disk total/used/free
- Network interfaces
-
Detailed uptime
-
Control actions
- Start/Stop/Restart agent
- Update agent version
- Check modules
- Run command remotely
-
View logs
-
Gauge charts (circular charts)
- CPU usage
- Memory usage
- Disk usage
- With dynamic colors based on thresholds
Color thresholds: - ๐ข Green: 0-40% - ๐ต Blue: 40-70% - ๐ก Yellow: 70-90% - ๐ด Red: 90-100%
4. ๐ Agent Dashboard (/agent-dashboard
)¶
Features:
Individual dashboard for each agent with advanced metrics.
- Time-series charts (Chart.js)
- CPU usage over time (line chart)
- Memory usage over time (area chart)
- Disk I/O (bar chart)
-
Network traffic (line chart)
-
System information
- OS name, version, kernel
- CPU model, cores, architecture
- Total memory, swap
-
Mounted filesystems
-
Process list
- Top processes by CPU
- Top processes by Memory
-
Real-time updates
-
Real-time logs
- Agent log stream
- Filters by level (debug/info/warn/error)
- Auto-scroll
-
Log download
-
Time range selector
- Last 1 hour
- Last 6 hours
- Last 24 hours
- Last 7 days
- Custom range
5. ๐ Workflows (/workflows
)¶
Features:
Workflow List¶
- Workflow cards with:
- Name and description
- Tags/labels
- Last execution
- Success rate
-
Buttons: Run, Edit, Delete
-
Filters
- By tags
- By status (active/inactive)
-
By execution frequency
-
Search - search by name/description
Workflow Editor¶
Editor features:
- Professional code editor
- Syntax highlighting for YAML/Sloth DSL
- Line numbers
- Auto-indent
- Bracket matching
- Keywords:
tasks
,name
,exec
,delegate_to
, etc. -
Custom colors (Sloth theme)
-
Keyboard shortcuts
Tab
- indentation (2 spaces)Shift+Tab
- de-indentationCtrl+S
/Cmd+S
- save-
Shift+Alt+F
- format -
Templates
- Basic workflow
- Multi-task workflow
- Distributed workflow (with delegate_to)
- Docker deployment
-
Full example workflow
-
Real-time validation
- Syntax checking
- Linting
-
Inline warnings and errors
-
Preview
- View workflow structure
- Task dependencies
- Variables used
Syntax highlighting example:
# Keywords in purple
tasks:
- name: Deploy App # Strings in green
exec:
script: | # Pipe in orange
pkg.install("nginx") # Functions in blue
# Comments in gray
delegate_to: web-01 # Keys in light blue
6. โก Executions (/executions
)¶
Features:
Complete history of workflow executions.
- Execution list with:
- Workflow name
- Status (success/failed/running)
- Started/completed time
- Duration
- Triggered by (user/schedule/hook)
-
Agent name (if delegated)
-
Advanced filters
- By status
- By workflow
- By agent
- By date/time
-
By user
-
Execution details
- Complete output
- Structured logs
- Task-by-task breakdown
- Variables used
-
Performance metrics
-
Actions
- Re-run workflow
- Download logs
- Share execution (link)
-
Compare with previous
-
Status indicators
- ๐ข Success (green)
- ๐ด Failed (red)
- ๐ก Running (yellow with spinner)
- โธ๏ธ Paused (gray)
7. ๐ฃ Hooks (/hooks
)¶
Features:
Complete hook (event handler) management.
- Hook list
- Hook name
- Event type
- Script path
- Priority
- Enabled/disabled status
-
Last triggered
-
Event types
workflow.started
workflow.completed
workflow.failed
task.started
task.completed
task.failed
agent.connected
-
agent.disconnected
-
Create/Edit hook
- Form with fields:
- Name
- Event type (dropdown)
- Script (code editor)
- Priority (0-100)
- Enabled (toggle)
- Syntax highlighting for Lua/Bash
-
Validation
-
Test hook
- Dry-run with test payload
- View output without executing actions
-
Debug mode
-
Hook history
- When triggered
- Payload received
- Script output
- Success/failure
8. ๐ก Events (/events
)¶
Features:
Real-time system event monitoring.
- Event feed
- Timestamp
- Event type
- Source (workflow/agent/system)
- Details/payload
-
Status
-
WebSocket stream
- Events appear in real-time
- Sound notifications (optional)
-
Desktop notifications (optional)
-
Filters
- By event type
- By source
- By status
-
By time range
-
Export events
- JSON
- CSV
-
Log format
-
Statistics
- Events per hour
- Events by type
- Top sources
9. ๐
Scheduler (/scheduler
)¶
Features:
Workflow scheduling (cron-like).
- Scheduled jobs
- Job name
- Associated workflow
- Cron expression
- Next run time
- Last run status
-
Enabled/disabled
-
Create job
-
Form with:
- Name
- Workflow (dropdown)
- Schedule (cron or visual builder)
- Variables
- Notifications (on success/failure)
-
Visual cron builder
- Minute/hour/day/month selector
- Preview: "Runs every day at 3:00 AM"
-
Common templates:
- Every hour
- Every day at midnight
- Every Monday at 9 AM
- Custom
-
Execution history
- Per scheduled job
- Success rate
- Average duration
10. ๐ Logs (/logs
)¶
Features:
Centralized log viewing.
- Advanced filters
- By level (debug/info/warn/error)
- By source (agent/workflow/system)
- By time range
-
By text (search)
-
Live tail
- Real-time stream
- Auto-scroll
- Pause/resume
-
Highlight patterns
-
Structured logs
- JSON format
- Expandable fields
-
Syntax highlighting
-
Export
- Download as .log
- Copy to clipboard
-
Share link
-
Log levels with colors
- ๐ต DEBUG (blue)
- ๐ข INFO (green)
- ๐ก WARN (yellow)
- ๐ด ERROR (red)
11. ๐ฅ๏ธ Interactive Terminal (/terminal
)¶
Features:
Interactive web terminal for remote agents.
- xterm.js - complete terminal
- SSH-like experience
- Multiple sessions (tabs)
- Command history (arrow keys โโ)
- Auto-complete (Tab)
- Copy/paste (Ctrl+Shift+C/V)
- Themes - Solarized, Monokai, Dracula, etc.
Special commands: - .clear
- clear terminal - .exit
- close session - .upload <file>
- upload file - .download <file>
- download file
12. ๐ฆ Saved Sloths (/sloths
)¶
Features:
Repository of saved workflows.
- Sloth list
- Name
- Description
- Tags
- Created/updated date
- Active/inactive status
-
Use count
-
Actions
- Run sloth
- Edit content
- Clone sloth
- Export (YAML)
- Delete
-
Activate/Deactivate
-
Tag management
- Create tags
- Color tags
-
Filter by tags
-
Versioning
- View version history
- Compare versions (diff)
- Restore previous version
13. โ๏ธ Settings (/settings
)¶
Features:
General Settings¶
- Server info
- Master address
- gRPC port
- Web UI port
-
Database path
-
Preferences
- Theme (light/dark/auto)
- Language (en/pt/zh)
- Timezone
- Date format
Notifications¶
- Email settings
- SMTP host, port
- Username/password
-
From address
-
Slack integration
- Webhook URL
- Default channel
-
Mentions
-
Telegram/Discord
- Bot token
- Chat ID / Webhook
Security¶
- Authentication
- Enable/disable auth
- User management
-
API tokens
-
TLS/SSL
- Enable HTTPS
- Certificate upload
- Auto-renewal (Let's Encrypt)
Database¶
- Backup settings
- Auto-backup enabled
- Backup schedule
-
Retention policy
-
Maintenance
- Vacuum database
- View stats
- Clear old data
๐จ Modern Visual Features¶
Dark Mode / Light Mode¶
Auto-detection based on system preference + manual toggle
Themes:
/* Light Mode */
--bg-primary: #ffffff
--text-primary: #212529
--accent: #4F46E5
/* Dark Mode */
--bg-primary: #1a1d23
--text-primary: #e9ecef
--accent: #818CF8
Toggle: Button in navbar with icons โ๏ธ (light) / ๐ (dark)
Animations and Transitions¶
- Fade-in when loading pages
- Hover effects on cards and buttons
- Pulse animation on status indicators
- Skeleton loaders during loading
- Smooth scrolling
- Ripple effect on buttons (Material Design)
- Smooth page transitions
Glassmorphism¶
Cards with frosted glass effect:
.glass-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
Toasts / Notifications¶
Modern notification system:
- Types:
- โน๏ธ Info (blue)
- โ Success (green)
- โ ๏ธ Warning (yellow)
- โ Error (red)
-
โณ Loading (with spinner)
-
Positions:
- Top-right (default)
- Top-left
- Bottom-right
- Bottom-left
-
Center
-
Features:
- Auto-dismiss (configurable)
- Close button
- Progress bar
- Action buttons
- Multiple toast stacking
Confetti Effects¶
Confetti effects on special events:
- โ Workflow completed successfully
- ๐ค New agent connected
- ๐ฏ Milestone reached
- ๐ Deploy completed
Drag & Drop¶
- Reorder tasks in workflows
- File upload (drop zone)
- Reorganize dashboard widgets
โจ๏ธ Command Palette (Ctrl+Shift+P)¶
Quick access to all actions:
๐ Search commands...
> Run Workflow
> View Agents
> Create Workflow
> Open Terminal
> View Logs
> Settings
> Toggle Dark Mode
> Export Data
...
Features: - Fuzzy search - Keyboard navigation (โโ Enter) - Recent commands - Visible shortcuts - Context-aware (shows actions based on current page)
๐ Charts and Visualizations¶
Chart.js Components¶
Chart types:
- Line Charts - temporal metrics
- Bar Charts - comparisons
- Doughnut Charts - distributions
- Area Charts - trends
- Sparklines - inline mini charts
Features: - Responsive - Interactive tooltips - Legends - Zoom/pan - Export as PNG - Dark/light themes
๐ WebSocket Real-Time Updates¶
WebSocket connection for real-time updates:
Real-time events: - Agent connected/disconnected - Workflow started/completed - New logs - System alerts - Metrics updates
URL: ws://localhost:8080/ws
Auto-reconnect if connection drops
๐ฑ Mobile Responsive¶
Mobile-first design:
- Breakpoints:
- Mobile: < 768px
- Tablet: 768px - 1024px
-
Desktop: > 1024px
-
Mobile features:
- Hamburger menu
- Touch-friendly buttons
- Swipe gestures
- Simplified charts
- Bottom navigation
๐ Authentication (Optional)¶
Login page if auth is enabled:
- Username/password
- Remember me
- Forgot password
- OAuth (GitHub, Google, etc.)
JWT tokens for API
Roles: - Admin - full access - Operator - execute workflows - Viewer - view only
๐ ๏ธ Developer Tools¶
API Explorer¶
Explore and test REST API:
Features: - Try it out (execute in browser) - Request/response examples - Authentication headers - cURL examples
Logs Browser¶
Browse system logs:
- Server logs
- Agent logs
- Application logs
- Audit logs
๐ Quick Guides¶
Quick Start Tour¶
Interactive tour for new users:
- Welcome โ Agents page
- Create your first workflow
- Run a workflow
- View execution results
- Set up notifications
Features: - Tooltips with tips - Highlight elements - Skip/Next buttons - Don't show again (cookie)
๐ก Usage Tips¶
Keyboard Shortcuts¶
Global:
Ctrl+Shift+P - Command palette
Ctrl+K - Search
Ctrl+/ - Help
Esc - Close modals
Editor:
Ctrl+S - Save
Ctrl+F - Find
Ctrl+Z - Undo
Ctrl+Y - Redo
Bookmarklets¶
Save important pages:
Dashboard: /
My Workflows: /workflows
Active Executions: /executions?status=running
Agent Metrics: /agent-dashboard
Browser Extensions¶
Available: - Chrome Extension - quick access - Firefox Add-on
๐ง Customization¶
Custom CSS¶
Add custom CSS in Settings:
Custom Widgets¶
Create custom widgets for dashboard:
- Custom charts
- External integrations
- Iframe embeds
๐ Next Steps¶
๐ Troubleshooting¶
Web UI won't load¶
# Check if server is running
lsof -i :8080
# View logs
sloth-runner ui --port 8080 --verbose
# Clear browser cache
Ctrl+Shift+Del
WebSocket won't connect¶
Metrics not appearing¶
# Check if agent is sending metrics
sloth-runner agent metrics <agent-name>
# Restart agent
sloth-runner agent restart <agent-name>
Last updated: 2025-10-07
Built with: Bootstrap 5, Chart.js, xterm.js, WebSockets, Canvas API