Skip to content

Commit e33f112

Browse files
authored
resolve issue with sort icons on admin/users and admin/runners (#24360)
Fixes #24327 to avoid the sort icon changing the table header over multiple lines and adds missing sort icons on the runners page.
1 parent e481638 commit e33f112

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

models/actions/runner.go

+6
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ func (opts FindRunnerOptions) toOrder() string {
189189
return "last_online ASC"
190190
case "alphabetically":
191191
return "name ASC"
192+
case "reversealphabetically":
193+
return "name DESC"
194+
case "newest":
195+
return "id DESC"
196+
case "oldest":
197+
return "id ASC"
192198
}
193199
return "last_online DESC"
194200
}

routers/web/shared/actions/runners.go

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func RunnersList(ctx *context.Context, opts actions_model.FindRunnerOptions) {
5353
ctx.Data["RegistrationToken"] = token.Token
5454
ctx.Data["RunnerOwnerID"] = opts.OwnerID
5555
ctx.Data["RunnerRepoID"] = opts.RepoID
56+
ctx.Data["SortType"] = opts.Sort
5657

5758
pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
5859

templates/shared/actions/runner_list.tmpl

+12-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,18 @@
4545
<table class="ui very basic striped table unstackable">
4646
<thead>
4747
<tr>
48-
<th data-sortt-asc="online" data-sortt-desc="offline">{{.locale.Tr "actions.runners.status"}}</th>
49-
<th data-sortt-asc="alphabetically">{{.locale.Tr "actions.runners.id"}}</th>
50-
<th>{{.locale.Tr "actions.runners.name"}}</th>
48+
<th data-sortt-asc="online" data-sortt-desc="offline">
49+
{{.locale.Tr "actions.runners.status"}}
50+
{{SortArrow "online" "offline" .SortType false}}
51+
</th>
52+
<th data-sortt-asc="newest" data-sortt-desc="oldest">
53+
{{.locale.Tr "actions.runners.id"}}
54+
{{SortArrow "oldest" "newest" .SortType false}}
55+
</th>
56+
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
57+
{{.locale.Tr "actions.runners.name"}}
58+
{{SortArrow "alphabetically" "reversealphabetically" .SortType false}}
59+
</th>
5160
<th>{{.locale.Tr "actions.runners.version"}}</th>
5261
<th>{{.locale.Tr "actions.runners.owner_type"}}</th>
5362
<th>{{.locale.Tr "actions.runners.labels"}}</th>

0 commit comments

Comments
 (0)