From b0219603be30ef5cad077fc427692175e1e52c13 Mon Sep 17 00:00:00 2001 From: naeeo Date: Wed, 30 Sep 2026 12:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=88=97=E8=A1=A8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8C=89=E9=92=AE=E4=BF=AE=E6=AD=A3=EF=BC=9A=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E4=BB=BB=E5=8A=A1=E4=B8=8D=E5=86=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=87=8D=E8=AF=95=EF=BC=8C=E7=BB=9F=E4=B8=80=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=88=97=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 成功状态的构建记录不再显示「重试」按钮,仅保留下载产物/日志/删除; 失败、取消、超时仍保留一键重试(线上核对确认仅新快照成功任务误显示) - retry_build 后端增加 success 状态拦截,防止绕过页面直接 POST - 操作列改为统一 flex 容器(flex-wrap + gap),按钮数量随状态变化时 间距一致、左对齐、窄屏自动换行;后台任务管理页同款统一 --- rdgenerator/static/rdgenerator/css/app.css | 8 ++++++++ rdgenerator/templates/dashboard.html | 4 +++- rdgenerator/templates/my_builds.html | 6 ++++-- rdgenerator/web_views.py | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/rdgenerator/static/rdgenerator/css/app.css b/rdgenerator/static/rdgenerator/css/app.css index 714bf6f..85c448f 100644 --- a/rdgenerator/static/rdgenerator/css/app.css +++ b/rdgenerator/static/rdgenerator/css/app.css @@ -396,6 +396,14 @@ input[type="file"].form-control::-webkit-file-upload-button { .btn-row { display: flex; gap: 10px; flex-wrap: wrap; } .inline-form { display: inline-flex; vertical-align: middle; } .table .btn + .btn, .table .btn + .inline-form { margin-left: 8px; } +/* 表格操作列:按钮数量随任务状态变化,用单一 flex 容器统一间距与换行, + 避免各行 2~4 个按钮时排列参差 */ +.col-actions { min-width: 168px; } +.table .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } +.table .row-actions > .btn, +.table .row-actions > .inline-form { margin-left: 0; } +.table .row-actions .inline-form { margin: 0; } +.table .row-actions .btn { white-space: nowrap; } /* ===== 平台选择卡 ===== */ .platform-grid { diff --git a/rdgenerator/templates/dashboard.html b/rdgenerator/templates/dashboard.html index 238f479..c6a685d 100644 --- a/rdgenerator/templates/dashboard.html +++ b/rdgenerator/templates/dashboard.html @@ -49,7 +49,8 @@ {{ run.platform_label }} {{ run.status_label }} {{ run.short_uuid }} - + +
查看
删除 +
{% endfor %} diff --git a/rdgenerator/templates/my_builds.html b/rdgenerator/templates/my_builds.html index 3ea0ba2..adeea8c 100644 --- a/rdgenerator/templates/my_builds.html +++ b/rdgenerator/templates/my_builds.html @@ -32,7 +32,8 @@ {{ run.backend_label }} {{ run.status_label }} {{ run.short_uuid }} - + +
{% if run.status == 'success' %} 下载产物{% elif run.is_finished %} 查看详情{% else %} 查看进度{% endif %} @@ -42,7 +43,7 @@ 日志 {% endif %} - {% if run.is_finished and run.config_data %} + {% if run.is_finished and run.status != 'success' and run.config_data %}
{% csrf_token %} @@ -69,6 +70,7 @@
{% endif %} +
{% endfor %} diff --git a/rdgenerator/web_views.py b/rdgenerator/web_views.py index c37c7ab..1a4ec5e 100644 --- a/rdgenerator/web_views.py +++ b/rdgenerator/web_views.py @@ -93,6 +93,9 @@ def retry_build(request, run_id): if not run.is_finished(): messages.error(request, "该任务尚未结束,无需重试。") return redirect('my_builds') + if run.status == 'success': + messages.info(request, "该任务已构建成功,请直接下载产物;如需重新生成请重新提交配置。") + return redirect('my_builds') if not run.config_data: messages.error(request, "该任务提交时未保存配置快照(较早的历史任务),无法一键重试,请重新填写配置后提交。") return redirect('my_builds')