核心组件: - Orchestrator: 意图理解、任务拆分、竞标管理、结果验证 - Worker: 竞标任务、执行交付 - TaskBoard: 状态管理、信息存储 - BidEvaluator: 竞标评估算法 - ExecutionMonitor: 执行监控、超时处理 - LLMClient: 大模型接口调用 功能特性: - 竞标机制:Agent主动竞争任务 - 动态调度:串行/并行任务智能调度 - 智能容错:超时切换、验证重试 - 质量保证:结果验证、历史追踪 Web界面:首页、请求列表、任务列表、Agent管理 API接口:请求/任务/Agent管理、测试接口 端口:19015
139 lines
6.1 KiB
HTML
139 lines
6.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>任务列表 - 多智能体竞标调度系统</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
|
<style>
|
|
body { background-color: #f5f7fa; }
|
|
.task-card {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 20px;
|
|
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
|
|
margin-bottom: 15px;
|
|
}
|
|
.status-badge {
|
|
padding: 5px 12px;
|
|
border-radius: 15px;
|
|
font-size: 0.8rem;
|
|
}
|
|
.status-pending { background: #ffeaa7; color: #6c5ce7; }
|
|
.status-published { background: #dfe6e9; color: #2d3436; }
|
|
.status-bidding { background: #fdcb6e; color: white; }
|
|
.status-assigned { background: #74b9ff; color: white; }
|
|
.status-executing { background: #a29bfe; color: white; }
|
|
.status-completed { background: #00b894; color: white; }
|
|
.status-failed { background: #e17055; color: white; }
|
|
.type-badge {
|
|
background: #e1e5eb;
|
|
padding: 3px 8px;
|
|
border-radius: 10px;
|
|
font-size: 0.75rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="/"><i class="ri-robot-2-line"></i> 多智能体竞标调度系统</a>
|
|
<div class="collapse navbar-collapse">
|
|
<ul class="navbar-nav ms-auto">
|
|
<li class="nav-item"><a class="nav-link" href="/">首页</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="/requests">请求列表</a></li>
|
|
<li class="nav-item"><a class="nav-link active" href="/tasks">任务列表</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="/agents">Agent管理</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container py-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4><i class="ri-task-line"></i> 任务列表</h4>
|
|
<div>
|
|
<select id="status-filter" class="form-select form-select-sm" style="width: auto;" onchange="loadTasks()">
|
|
<option value="">全部状态</option>
|
|
<option value="pending">待发布</option>
|
|
<option value="published">已发布</option>
|
|
<option value="bidding">竞标中</option>
|
|
<option value="executing">执行中</option>
|
|
<option value="completed">已完成</option>
|
|
<option value="failed">已失败</option>
|
|
</select>
|
|
<button class="btn btn-outline-primary btn-sm ms-2" onclick="loadTasks()">
|
|
<i class="ri-refresh-line"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="tasks-list">
|
|
<div class="text-center text-muted py-5">
|
|
<i class="ri-loader-4-line fs-1"></i>
|
|
<p>加载中...</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
function loadTasks() {
|
|
const status = document.getElementById('status-filter').value;
|
|
fetch('/api/tasks')
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
if (status) {
|
|
data = data.filter(t => t.status === status);
|
|
}
|
|
|
|
const list = document.getElementById('tasks-list');
|
|
|
|
if (!data.length) {
|
|
list.innerHTML = `
|
|
<div class="text-center text-muted py-5">
|
|
<i class="ri-inbox-line fs-1"></i>
|
|
<p>暂无任务</p>
|
|
</div>
|
|
`;
|
|
return;
|
|
}
|
|
|
|
list.innerHTML = data.map(t => `
|
|
<div class="task-card">
|
|
<div class="d-flex justify-content-between align-items-start">
|
|
<div>
|
|
<span class="text-muted small">#${t.id}</span>
|
|
<span class="type-badge ms-2">${t.type}</span>
|
|
<p class="mt-2">${t.description.substring(0, 80)}${t.description.length > 80 ? '...' : ''}</p>
|
|
</div>
|
|
<span class="status-badge status-${t.status}">${t.status}</span>
|
|
</div>
|
|
<div class="mt-3 text-muted small">
|
|
<i class="ri-time-line"></i> ${new Date(t.created_at * 1000).toLocaleString()}
|
|
${t.dependencies.length ? ` · <i class="ri-link"></i> 依赖: ${t.dependencies.join(', ')}` : ''}
|
|
· <i class="ri-timer-line"></i> 超时: ${t.timeout}秒
|
|
</div>
|
|
<div class="mt-2">
|
|
<a href="#" class="btn btn-outline-secondary btn-sm" onclick="showDetail('${t.id}')">
|
|
<i class="ri-eye-line"></i> 详情
|
|
</a>
|
|
</div>
|
|
</div>
|
|
`).join('');
|
|
});
|
|
}
|
|
|
|
function showDetail(id) {
|
|
fetch(`/api/task/${id}`)
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
alert(JSON.stringify(data, null, 2));
|
|
});
|
|
}
|
|
|
|
loadTasks();
|
|
</script>
|
|
</body>
|
|
</html> |