feat: 同步构建真实状态并支持在列表停止在途任务
- Gitea 运行未结束时探测作业级结论,修复前置作业失败后可复用工作流父作业/等待标签作业长期挂起导致状态永远构建中 - 打开我的构建/管理仪表盘时主动向构建平台同步在途任务状态;创建超 6 小时仍在途的任务判超时 - 构建中任务列表增加停止按钮(Gitea 需 1.28+ 取消 API,旧版本提示去运行页手动 Cancel),终态任务保留删除 - GitHub/Gitea 后端统一 cancel_run 接口
This commit is contained in:
@@ -76,6 +76,9 @@
|
||||
<symbol id="i-trash" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M3 6h18"/><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" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/>
|
||||
</symbol>
|
||||
<symbol id="i-stop" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="6" y="6" width="12" height="12" rx="2"/>
|
||||
</symbol>
|
||||
<symbol id="i-check-circle" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10"/><path d="m8.5 12 2.5 2.5 5-5"/>
|
||||
</symbol>
|
||||
|
||||
@@ -51,6 +51,15 @@
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if not run.is_finished %}
|
||||
<form method="post" class="inline-form" action="{% url 'stop_build' run.id %}"
|
||||
onsubmit="return confirm('确定停止构建任务「{{ run.filename|default:run.short_uuid|escapejs }}」吗?停止后可在列表中使用「重试」重新发起。');">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-warning btn-sm">
|
||||
<svg class="icon"><use href="#i-stop"/></svg> 停止
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if run.is_finished %}
|
||||
<form method="post" class="inline-form" action="{% url 'delete_my_build' run.id %}"
|
||||
onsubmit="return confirm('确定删除任务「{{ run.filename|default:run.short_uuid|escapejs }}」吗?将同时删除服务器上的安装包文件,且不可恢复。');">
|
||||
|
||||
Reference in New Issue
Block a user