feat(ui): Task pool toggle, sortable columns, worker slot visualization

Tasks Dashboard:
- Add clickable Pool Open/Paused toggle button in header
- Add sortable columns (ID, Role, Store, Status, Worker, Duration, Created)
- Show menu_type and pool badges under Store column
- Add Pool column to Schedules table
- Filter stores by platform in Create Task modal

Workers Dashboard:
- Redesign pod visualization to show 3 worker slots per pod
- Each slot shows preflight checklist (Overload? Terminating? Pool Query?)
- Once qualified, shows City/State, Proxy IP, Antidetect status
- Hover shows full fingerprint data (browser, platform, bot detection)

Backend:
- Add menu_type to listTasks query
- Add pool_id/pool_name to schedules query with task_pools JOIN
- Migration 114: Add pool_id column to task_schedules table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-14 03:00:19 -07:00
parent 15a5a4239e
commit e7b392141a
6 changed files with 392 additions and 148 deletions

View File

@@ -214,27 +214,29 @@ router.get('/schedules', async (req: Request, res: Response) => {
const enabledOnly = req.query.enabled === 'true';
let query = `
SELECT id, name, role, description, enabled, interval_hours,
priority, state_code, platform, method,
COALESCE(is_immutable, false) as is_immutable,
last_run_at, next_run_at,
last_task_count, last_error, created_at, updated_at
FROM task_schedules
SELECT ts.id, ts.name, ts.role, ts.description, ts.enabled, ts.interval_hours,
ts.priority, ts.state_code, ts.pool_id, tp.display_name as pool_name,
ts.platform, ts.method,
COALESCE(ts.is_immutable, false) as is_immutable,
ts.last_run_at, ts.next_run_at,
ts.last_task_count, ts.last_error, ts.created_at, ts.updated_at
FROM task_schedules ts
LEFT JOIN task_pools tp ON tp.id = ts.pool_id
`;
if (enabledOnly) {
query += ` WHERE enabled = true`;
query += ` WHERE ts.enabled = true`;
}
query += ` ORDER BY
CASE role
CASE ts.role
WHEN 'store_discovery' THEN 1
WHEN 'product_discovery' THEN 2
WHEN 'analytics_refresh' THEN 3
ELSE 4
END,
state_code NULLS FIRST,
name`;
ts.state_code NULLS FIRST,
ts.name`;
const result = await pool.query(query);
res.json({ schedules: result.rows });

View File

@@ -453,6 +453,7 @@ class TaskService {
t.*,
d.name as dispensary_name,
d.slug as dispensary_slug,
d.menu_type as menu_type,
${poolColumns}
w.friendly_name as worker_name
FROM worker_tasks t