Features: - Web Dashboard: FastAPI-based dashboard with Vue.js frontend - Multi-device support (ADB, HDC, iOS) - Real-time WebSocket updates for task progress - Device management with status tracking - Task queue with execution controls (start/stop/re-execute) - Detailed task information display (thinking, actions, completion messages) - Screenshot viewing per device - LAN deployment support with configurable CORS - Callback Hooks: Interrupt and modify task execution - step_callback: Called after each step with StepResult - before_action_callback: Called before executing action - Support for task interruption and dynamic task switching - Example scripts demonstrating callback usage - Configuration: Environment-based configuration - .env file support for all settings - .env.example template with documentation - Model API configuration (base URL, model name, API key) - Dashboard configuration (host, port, CORS, device type) - Phone agent configuration (delays, max steps, language) Technical improvements: - Fixed forward reference issue with StepResult - Added package exports for callback types and configs - Enhanced dependencies with FastAPI, WebSocket support - Thread-safe task execution with device locking - Async WebSocket broadcasting from sync thread pool Co-Authored-By: Claude <noreply@anthropic.com>
540 lines
9.3 KiB
CSS
540 lines
9.3 KiB
CSS
/* AutoGLM Dashboard Styles */
|
|
|
|
:root {
|
|
--primary-color: #6366f1;
|
|
--primary-hover: #4f46e5;
|
|
--success-color: #10b981;
|
|
--warning-color: #f59e0b;
|
|
--danger-color: #ef4444;
|
|
--bg-color: #0f172a;
|
|
--card-bg: #1e293b;
|
|
--border-color: #334155;
|
|
--text-primary: #f1f5f9;
|
|
--text-secondary: #94a3b8;
|
|
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
|
|
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
background-color: var(--bg-color);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* Header */
|
|
.header {
|
|
background-color: var(--card-bg);
|
|
border-bottom: 1px solid var(--border-color);
|
|
padding: 1rem 2rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.header-content {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.header h1 {
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.stats {
|
|
display: flex;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.stat {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 0.875rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.stat svg {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.ws-status {
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.ws-status.connected {
|
|
color: var(--success-color);
|
|
}
|
|
|
|
.header-actions {
|
|
display: flex;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
/* Main Content */
|
|
.main-content {
|
|
padding: 2rem;
|
|
max-width: 1600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.main-content h2 {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
margin-bottom: 1rem;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
/* Device Grid */
|
|
.device-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
|
gap: 1.5rem;
|
|
margin-bottom: 3rem;
|
|
}
|
|
|
|
.device-card {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 12px;
|
|
padding: 1.25rem;
|
|
transition: box-shadow 0.2s, border-color 0.2s;
|
|
}
|
|
|
|
.device-card:hover {
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
.device-card.busy {
|
|
border-color: var(--warning-color);
|
|
}
|
|
|
|
.device-card.offline {
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.device-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.device-header h3 {
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
word-break: break-all;
|
|
}
|
|
|
|
.status-badge {
|
|
padding: 0.25rem 0.75rem;
|
|
border-radius: 9999px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.status-badge.online {
|
|
background-color: rgba(16, 185, 129, 0.2);
|
|
color: var(--success-color);
|
|
}
|
|
|
|
.status-badge.offline {
|
|
background-color: rgba(239, 68, 68, 0.2);
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.status-badge.busy {
|
|
background-color: rgba(245, 158, 11, 0.2);
|
|
color: var(--warning-color);
|
|
}
|
|
|
|
.device-info {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.device-info p {
|
|
font-size: 0.875rem;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 0.25rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.device-info p svg {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.screenshot {
|
|
margin-bottom: 1rem;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
background-color: #000;
|
|
aspect-ratio: 9/16;
|
|
}
|
|
|
|
.screenshot img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.device-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.device-actions input {
|
|
flex: 1;
|
|
padding: 0.625rem 0.875rem;
|
|
background-color: var(--bg-color);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
color: var(--text-primary);
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.device-actions input:focus {
|
|
outline: none;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
.device-actions input:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Task List */
|
|
.task-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.task-item {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
padding: 1rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: start;
|
|
gap: 1rem;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.task-item.active {
|
|
border-color: var(--primary-color);
|
|
box-shadow: 0 0 0 1px var(--primary-color);
|
|
}
|
|
|
|
.task-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.task-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.task-id {
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
font-family: monospace;
|
|
}
|
|
|
|
.task-status {
|
|
padding: 0.125rem 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.7rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.task-status.running {
|
|
background-color: rgba(99, 102, 241, 0.2);
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.task-status.completed {
|
|
background-color: rgba(16, 185, 129, 0.2);
|
|
color: var(--success-color);
|
|
}
|
|
|
|
.task-status.failed {
|
|
background-color: rgba(239, 68, 68, 0.2);
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.task-status.stopped {
|
|
background-color: rgba(148, 163, 184, 0.2);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.task-description {
|
|
font-size: 0.95rem;
|
|
color: var(--text-primary);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.task-meta {
|
|
display: flex;
|
|
gap: 1rem;
|
|
font-size: 0.8rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.task-progress {
|
|
height: 4px;
|
|
background-color: var(--bg-color);
|
|
border-radius: 2px;
|
|
overflow: hidden;
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.progress-bar {
|
|
height: 100%;
|
|
background-color: var(--primary-color);
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
.task-thinking {
|
|
display: flex;
|
|
align-items: start;
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
padding: 0.5rem;
|
|
background-color: var(--bg-color);
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.task-thinking svg {
|
|
flex-shrink: 0;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.task-action {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
padding: 0.5rem;
|
|
background-color: rgba(99, 102, 241, 0.1);
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.task-action svg {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.task-action strong {
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.task-message {
|
|
display: flex;
|
|
align-items: start;
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
padding: 0.5rem;
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.task-message svg {
|
|
flex-shrink: 0;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.task-message.completed {
|
|
background-color: rgba(16, 185, 129, 0.1);
|
|
color: var(--success-color);
|
|
}
|
|
|
|
.task-message.failed {
|
|
background-color: rgba(239, 68, 68, 0.1);
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.task-message.stopped {
|
|
background-color: rgba(148, 163, 184, 0.1);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.task-actions {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Buttons */
|
|
.btn {
|
|
padding: 0.625rem 1rem;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--primary-color);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover:not(:disabled) {
|
|
background-color: var(--primary-hover);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background-color: var(--card-bg);
|
|
color: var(--text-primary);
|
|
border: 1px solid var(--border-color);
|
|
}
|
|
|
|
.btn-secondary:hover:not(:disabled) {
|
|
background-color: var(--border-color);
|
|
}
|
|
|
|
.btn-danger {
|
|
background-color: var(--danger-color);
|
|
color: white;
|
|
}
|
|
|
|
.btn-danger:hover:not(:disabled) {
|
|
background-color: #dc2626;
|
|
}
|
|
|
|
.btn-sm {
|
|
padding: 0.5rem 0.75rem;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.spinning {
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
from { transform: rotate(0deg); }
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* Empty State */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 4rem 2rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.empty-state svg {
|
|
margin-bottom: 1rem;
|
|
opacity: 0.3;
|
|
}
|
|
|
|
.empty-state p {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.empty-state .hint {
|
|
font-size: 0.875rem;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
/* Toast */
|
|
.toast-container {
|
|
position: fixed;
|
|
bottom: 2rem;
|
|
right: 2rem;
|
|
z-index: 1000;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.toast {
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 8px;
|
|
font-size: 0.875rem;
|
|
box-shadow: var(--shadow-lg);
|
|
animation: slideIn 0.3s ease;
|
|
}
|
|
|
|
.toast.success {
|
|
background-color: var(--success-color);
|
|
color: white;
|
|
}
|
|
|
|
.toast.error {
|
|
background-color: var(--danger-color);
|
|
color: white;
|
|
}
|
|
|
|
.toast.info {
|
|
background-color: var(--primary-color);
|
|
color: white;
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
from {
|
|
transform: translateX(100%);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 768px) {
|
|
.header {
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.header-content {
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
align-items: start;
|
|
}
|
|
|
|
.device-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.main-content {
|
|
padding: 1rem;
|
|
}
|
|
}
|