Show build platform badge on build list and task detail pages
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user