Skip to content

resolve issue with sort icons on admin/users and admin/runners #24360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions models/actions/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ func (opts FindRunnerOptions) toOrder() string {
return "last_online ASC"
case "alphabetically":
return "name ASC"
case "reversealphabetically":
return "name DESC"
case "newest":
return "id DESC"
case "oldest":
return "id ASC"
}
return "last_online DESC"
}
Expand Down
1 change: 1 addition & 0 deletions routers/web/shared/actions/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func RunnersList(ctx *context.Context, tplName base.TplName, opts actions_model.
ctx.Data["RegistrationToken"] = token.Token
ctx.Data["RunnerOnwerID"] = opts.OwnerID
ctx.Data["RunnerRepoID"] = opts.RepoID
ctx.Data["SortType"] = opts.Sort

pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
ctx.Data["Page"] = pager
Expand Down
15 changes: 12 additions & 3 deletions templates/shared/actions/runner_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,18 @@
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th data-sortt-asc="online" data-sortt-desc="offline">{{.locale.Tr "actions.runners.status"}}</th>
<th data-sortt-asc="alphabetically">{{.locale.Tr "actions.runners.id"}}</th>
<th>{{.locale.Tr "actions.runners.name"}}</th>
<th data-sortt-asc="online" data-sortt-desc="offline">
{{.locale.Tr "actions.runners.status"}}
{{SortArrow "online" "offline" .SortType false}}
</th>
<th data-sortt-asc="newest" data-sortt-desc="oldest">
{{.locale.Tr "actions.runners.id"}}
{{SortArrow "oldest" "newest" .SortType false}}
</th>
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
{{.locale.Tr "actions.runners.name"}}
{{SortArrow "alphabetically" "reversealphabetically" .SortType false}}
</th>
<th>{{.locale.Tr "actions.runners.version"}}</th>
<th>{{.locale.Tr "actions.runners.owner_type"}}</th>
<th>{{.locale.Tr "actions.runners.labels"}}</th>
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

.admin.user .email {
max-width: 200px;
max-width: 130px;
}

.admin dl.admin-dl-horizontal {
Expand Down
7 changes: 7 additions & 0 deletions web_src/css/runner.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@
background-color: var(--color-yellow);
color: var(--color-white);
}

.runner-container .runner-tags {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 200px;
}