mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-27 07:44:43 +02:00
chore: rename to NumActionRuns
This commit is contained in:
parent
6148e4c940
commit
95167fd0a2
@ -106,11 +106,11 @@ func (run *ActionRun) GetPushEventPayload() (*api.PushPayload, error) {
|
|||||||
|
|
||||||
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
|
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
|
||||||
_, err := db.GetEngine(ctx).ID(repo.ID).
|
_, err := db.GetEngine(ctx).ID(repo.ID).
|
||||||
SetExpr("num_runs",
|
SetExpr("num_action_runs",
|
||||||
builder.Select("count(*)").From("action_run").
|
builder.Select("count(*)").From("action_run").
|
||||||
Where(builder.Eq{"repo_id": repo.ID}),
|
Where(builder.Eq{"repo_id": repo.ID}),
|
||||||
).
|
).
|
||||||
SetExpr("num_closed_runs",
|
SetExpr("num_closed_action_runs",
|
||||||
builder.Select("count(*)").From("action_run").
|
builder.Select("count(*)").From("action_run").
|
||||||
Where(builder.Eq{
|
Where(builder.Eq{
|
||||||
"repo_id": repo.ID,
|
"repo_id": repo.ID,
|
||||||
|
@ -93,8 +93,8 @@ func AddActionsTables(x *xorm.Engine) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Repository struct {
|
type Repository struct {
|
||||||
NumRuns int `xorm:"NOT NULL DEFAULT 0"`
|
NumActionRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
NumClosedRuns int `xorm:"NOT NULL DEFAULT 0"`
|
NumClosedActionRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionRunIndex db.ResourceIndex
|
type ActionRunIndex db.ResourceIndex
|
||||||
|
@ -141,9 +141,9 @@ type Repository struct {
|
|||||||
NumProjects int `xorm:"NOT NULL DEFAULT 0"`
|
NumProjects int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
NumClosedProjects int `xorm:"NOT NULL DEFAULT 0"`
|
NumClosedProjects int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
NumOpenProjects int `xorm:"-"`
|
NumOpenProjects int `xorm:"-"`
|
||||||
NumRuns int `xorm:"NOT NULL DEFAULT 0"`
|
NumActionRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
NumClosedRuns int `xorm:"NOT NULL DEFAULT 0"`
|
NumClosedActionRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||||
NumOpenRuns int `xorm:"-"`
|
NumOpenActionRuns int `xorm:"-"`
|
||||||
|
|
||||||
IsPrivate bool `xorm:"INDEX"`
|
IsPrivate bool `xorm:"INDEX"`
|
||||||
IsEmpty bool `xorm:"INDEX"`
|
IsEmpty bool `xorm:"INDEX"`
|
||||||
@ -236,7 +236,7 @@ func (repo *Repository) AfterLoad() {
|
|||||||
repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
|
repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
|
||||||
repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
|
repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
|
||||||
repo.NumOpenProjects = repo.NumProjects - repo.NumClosedProjects
|
repo.NumOpenProjects = repo.NumProjects - repo.NumClosedProjects
|
||||||
repo.NumOpenRuns = repo.NumRuns - repo.NumClosedRuns
|
repo.NumOpenActionRuns = repo.NumActionRuns - repo.NumClosedActionRuns
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadAttributes loads attributes of the repository.
|
// LoadAttributes loads attributes of the repository.
|
||||||
|
@ -96,7 +96,7 @@ func List(ctx *context.Context) {
|
|||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.Data["NumOpenRuns"] = numOpenRuns
|
ctx.Data["NumOpenActionRuns"] = numOpenRuns
|
||||||
|
|
||||||
// closed counts
|
// closed counts
|
||||||
opts.IsClosed = util.OptionalBoolTrue
|
opts.IsClosed = util.OptionalBoolTrue
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<div class="ui compact tiny menu">
|
<div class="ui compact tiny menu">
|
||||||
<a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open">
|
<a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open">
|
||||||
{{svg "octicon-issue-opened" 16 "mr-3"}}
|
{{svg "octicon-issue-opened" 16 "mr-3"}}
|
||||||
{{.locale.Tr "actions.open_tab" $.NumOpenRuns}}
|
{{.locale.Tr "actions.open_tab" $.NumOpenActionRuns}}
|
||||||
</a>
|
</a>
|
||||||
<a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=closed">
|
<a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=closed">
|
||||||
{{svg "octicon-issue-closed" 16 "mr-3"}}
|
{{svg "octicon-issue-closed" 16 "mr-3"}}
|
||||||
{{.locale.Tr "actions.closed_tab" $.NumClosedRuns}}
|
{{.locale.Tr "actions.closed_tab" $.NumClosedActionRuns}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -186,8 +186,8 @@
|
|||||||
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
|
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
|
||||||
<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
|
<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
|
||||||
{{svg "octicon-play"}} {{.locale.Tr "actions.actions"}}
|
{{svg "octicon-play"}} {{.locale.Tr "actions.actions"}}
|
||||||
{{if .Repository.NumOpenRuns}}
|
{{if .Repository.NumOpenActionRuns}}
|
||||||
<span class="ui blue small label">{{CountFmt .Repository.NumOpenRuns}}</span>
|
<span class="ui blue small label">{{CountFmt .Repository.NumOpenActionRuns}}</span>
|
||||||
{{end}}
|
{{end}}
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user