Show build platform badge on build list and task detail pages

This commit is contained in:
naeeo
2026-09-29 22:38:54 +08:00
parent e8126bdc4a
commit 8568da0e46
7 changed files with 16 additions and 2 deletions
+5
View File
@@ -98,6 +98,11 @@ class GithubRun(models.Model):
"""任务所属构建平台的展示名(用于日志链接等文案)。"""
return "Gitea Actions" if (self.backend or "github") == "gitea" else "GitHub Actions"
@property
def backend_badge_class(self):
"""任务所属构建平台对应的徽章样式类。"""
return "badge-gitea" if (self.backend or "github") == "gitea" else "badge-github"
def short_uuid(self):
return self.uuid[:8] if len(self.uuid) >= 8 else self.uuid