Per-backend log labels: show Gitea Actions text on waiting/failure pages and footer
This commit is contained in:
@@ -93,6 +93,11 @@ class GithubRun(models.Model):
|
|||||||
return get_backend(self.backend or 'github').log_url(self.github_run_id)
|
return get_backend(self.backend or 'github').log_url(self.github_run_id)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def backend_label(self):
|
||||||
|
"""任务所属构建平台的展示名(用于日志链接等文案)。"""
|
||||||
|
return "Gitea Actions" if (self.backend or "github") == "gitea" else "GitHub Actions"
|
||||||
|
|
||||||
def short_uuid(self):
|
def short_uuid(self):
|
||||||
return self.uuid[:8] if len(self.uuid) >= 8 else self.uuid
|
return self.uuid[:8] if len(self.uuid) >= 8 else self.uuid
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
RustDesk 客户端定制平台 · 自定义客户端由 GitHub Actions 自动构建
|
RustDesk 客户端定制平台 · 自定义客户端由 {{ build_platform_label|default:"GitHub" }} Actions 自动构建
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<div class="info-box" style="text-align:left">
|
<div class="info-box" style="text-align:left">
|
||||||
<strong>构建过程异常终止,部分安装包可能并未生成。</strong><br>
|
<strong>构建过程异常终止,部分安装包可能并未生成。</strong><br>
|
||||||
你可以先尝试下载下方已经产出的文件(不存在的文件将提示 404),或查看 GitHub Actions 日志定位原因后重新提交构建。
|
你可以先尝试下载下方已经产出的文件(不存在的文件将提示 404),或查看 {{ backend_label }} 日志定位原因后重新提交构建。
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="download-list">
|
<div class="download-list">
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<p style="margin-top:22px">
|
<p style="margin-top:22px">
|
||||||
{% if log_url %}
|
{% if log_url %}
|
||||||
<a href="{{ log_url }}" target="_blank" rel="noopener"><svg class="icon"><use href="#i-external"/></svg> 查看 GitHub Actions 日志,了解具体失败原因</a>
|
<a href="{{ log_url }}" target="_blank" rel="noopener"><svg class="icon"><use href="#i-external"/></svg> 查看 {{ backend_label }} 日志,了解具体失败原因</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="page-head">
|
<div class="page-head">
|
||||||
<h1 class="page-title">定制 RustDesk 客户端</h1>
|
<h1 class="page-title">定制 RustDesk 客户端</h1>
|
||||||
<p class="page-subtitle">填写以下配置并提交,系统将通过 GitHub Actions 自动构建专属客户端,通常需要 30~45 分钟,可在「我的构建」中随时查看进度。</p>
|
<p class="page-subtitle">填写以下配置并提交,系统将通过 {{ build_platform_label|default:"GitHub" }} Actions 自动构建专属客户端,通常需要 30~45 分钟,可在「我的构建」中随时查看进度。</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="myForm" action="/generator" method="post" enctype="multipart/form-data">
|
<form id="myForm" action="/generator" method="post" enctype="multipart/form-data">
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
{% if log_url %}
|
{% if log_url %}
|
||||||
<div style="margin-top:8px">
|
<div style="margin-top:8px">
|
||||||
<a href="{{ log_url }}" target="_blank" rel="noopener">
|
<a href="{{ log_url }}" target="_blank" rel="noopener">
|
||||||
<svg class="icon"><use href="#i-external"/></svg> 技术排查:查看 GitHub Actions 构建日志
|
<svg class="icon"><use href="#i-external"/></svg> 技术排查:查看 {{ backend_label }} 构建日志
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -427,7 +427,8 @@ def generator_view(request):
|
|||||||
'status_label': status_label,
|
'status_label': status_label,
|
||||||
'status_badge': status_badge,
|
'status_badge': status_badge,
|
||||||
'platform': result['platform'],
|
'platform': result['platform'],
|
||||||
'log_url': result['log_url']
|
'log_url': result['log_url'],
|
||||||
|
'backend_label': result['run'].backend_label,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
messages.error(request, result['error'])
|
messages.error(request, result['error'])
|
||||||
@@ -471,6 +472,7 @@ def check_for_file(request):
|
|||||||
'status_label': status_label,
|
'status_label': status_label,
|
||||||
'status_badge': status_badge,
|
'status_badge': status_badge,
|
||||||
'log_url': github_log_url,
|
'log_url': github_log_url,
|
||||||
|
'backend_label': gh_run.backend_label,
|
||||||
}
|
}
|
||||||
|
|
||||||
if gh_run.status == "success":
|
if gh_run.status == "success":
|
||||||
|
|||||||
Reference in New Issue
Block a user