feat: Implement task monitoring web application
This commit is contained in:
65
monitor/templates/task_detail.html
Normal file
65
monitor/templates/task_detail.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Task Detail: {{ task_id }}</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
||||
<link rel="stylesheet" href="/static/task_detail.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="/" class="back-link"><i class="fas fa-arrow-left"></i> Back to Home</a>
|
||||
<h1>Task Detail <span class="task-id">{{ task_id }}</span></h1>
|
||||
<div class="task-info">
|
||||
<h2><i class="fas fa-info-circle"></i> Basic Information</h2>
|
||||
<dl>
|
||||
<dt>Task ID</dt>
|
||||
<dd>{{ task_id }}</dd>
|
||||
<dt>Task Type</dt>
|
||||
<dd>{{ task_type }}</dd>
|
||||
<dt>Instruction</dt>
|
||||
<dd>{{ task_info.instruction }}</dd>
|
||||
<dt>Status</dt>
|
||||
<dd class="status status-{{ task_status.status|lower|replace(' ', '-') }}">{{ task_status.status }}</dd>
|
||||
<dt>Current Step</dt>
|
||||
<dd>{{ task_status.progress }}</dd>
|
||||
<dt>Last Update</dt>
|
||||
<dd>{{ task_status.last_update or 'None' }}</dd>
|
||||
<dt>Result</dt>
|
||||
<dd>{{ task_status.result }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="task-steps">
|
||||
<h2><i class="fas fa-list-ol"></i> Execution Steps</h2>
|
||||
<div id="steps-container">
|
||||
{% if task_status.steps %}
|
||||
{% for step in task_status.steps %}
|
||||
<div class="step-card">
|
||||
<div class="step-header">
|
||||
<div class="step-title"><i class="fas fa-check-circle"></i> Step {{ step.step_num }}</div>
|
||||
<div class="step-time"><i class="far fa-clock"></i> {{ step.action_timestamp }}</div>
|
||||
</div>
|
||||
<pre>{{ step.action.action }}</pre>
|
||||
{% if step.screenshot_file %}
|
||||
<div>
|
||||
<img src="/task/{{ task_type }}/{{ task_id }}/screenshot/{{ step.screenshot_file }}"
|
||||
alt="Step {{ step.step_num }} Screenshot" class="step-image">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="no-steps"><i class="far fa-frown"></i> No step data available</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="fab fab-refresh" onclick="refreshPage()" title="Refresh"><i class="fas fa-sync-alt"></i></button>
|
||||
<script>
|
||||
function refreshPage() {
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user