feat: implement job management UI templates for editing and viewing backup job details

This commit is contained in:
Rizqi 2026-06-23 01:13:07 +07:00
parent 1ee23bd436
commit a1e084cb4b
3 changed files with 22 additions and 16 deletions

View File

@ -470,11 +470,6 @@
</div>
<div class="action-bar">
<button class="btn btn-danger" type="submit" form="deleteForm" style="margin-right: auto;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 6px; vertical-align: middle;"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
Delete Job
</button>
<a href="/job/{{ job.id }}" class="btn btn-ghost">Cancel</a>
<button type="submit" id="submitBtn" class="btn btn-primary">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 6px; vertical-align: middle;"><polyline points="20 6 9 17 4 12"/></svg>
@ -482,10 +477,6 @@
</button>
</div>
</form>
<form id="deleteForm" method="post" action="/job/{{ job.id }}/delete"
onsubmit="return confirm('Are you sure you want to delete this job? This will cancel any active schedule and delete the job logs.')">
</form>
</div>
</div>
{% endblock %}

View File

@ -146,7 +146,7 @@
{% if job.status != 'running' and job.status != 'queued' %}
<form method="post" action="/job/{{ job.id }}/run" style="margin: 0;">
<button class="btn btn-primary btn-sm" type="submit">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;"><polygon points="5 3 19 12 5 21 5 3"/></svg>
<span style="margin-right: 4px; font-size: 11px; line-height: 1;">&#x25B6;&#xFE0E;</span>
Run Now
</button>
</form>
@ -154,6 +154,14 @@
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>
Edit Job
</a>
<form method="post" action="/job/{{ job.id }}/delete"
style="margin: 0;"
onsubmit="return confirm('Are you sure you want to delete this job? This will cancel any active schedule and delete the job logs.')">
<button class="btn btn-danger btn-sm" type="submit">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
Delete
</button>
</form>
{% endif %}
{% if job.status == 'running' or job.status == 'queued' %}
<form method="post" action="/job/{{ job.id }}/stop"

View File

@ -146,8 +146,8 @@
</td>
<td>
{% if job.schedule_type and job.schedule_type != 'now' %}
<span class="schedule-tag" style="margin-bottom: 4px;">
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;"><path d="M23 4v6h-6"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
<span class="schedule-tag" style="margin-bottom: 4px; display: inline-flex; align-items: center;">
<span style="margin-right: 4px; font-size: 11px; line-height: 1;">&#x1F4C5;&#xFE0E;</span>
{{ job.schedule_type|capitalize }}
</span>
{% if job.schedule_id %}
@ -156,7 +156,10 @@
<span class="badge badge-red" style="font-size: 10px; padding: 2px 6px; display: inline-block;">Cancelled</span>
{% endif %}
{% else %}
<span class="text-muted text-small" style="display: block; margin-bottom: 4px;">One-time</span>
<span class="text-muted text-small" style="display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px;">
<span style="font-size: 11px; line-height: 1;">&#x26A1;&#xFE0E;</span>
One-time
</span>
{% endif %}
<div class="text-muted" style="font-size:11px; margin-top: 2px;">
{% if job.retention_type == 'keep_count' %}
@ -172,11 +175,15 @@
{{ job.started_fmt }}
</td>
<td>
<div class="job-actions" style="display: flex; gap: 8px;">
<a href="/job/{{ job.id }}" class="btn btn-ghost btn-sm">View</a>
<div class="job-actions" style="display: flex; gap: 8px; align-items: center;">
<a href="/job/{{ job.id }}" class="btn btn-ghost btn-sm">
<span style="margin-right: 4px; font-size: 12px; line-height: 1;">&#x1F441;&#xFE0E;</span>View
</a>
{% if job.status != 'running' and job.status != 'queued' %}
<form method="post" action="/job/{{ job.id }}/run" style="margin: 0;">
<button class="btn btn-primary btn-sm" type="submit">Run Now</button>
<button class="btn btn-primary btn-sm" type="submit">
<span style="margin-right: 4px; font-size: 11px; line-height: 1;">&#x25B6;&#xFE0E;</span>Run Now
</button>
</form>
{% endif %}
{% if job.status == 'running' or job.status == 'queued' %}