Skip to content

Commit 310e85b

Browse files
committed
add tooltip
1 parent 9e5326e commit 310e85b

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

models/actions/runner.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,26 @@ func (r *ActionRunner) Type() RunnerType {
7676
return RunnerTypeGlobal
7777
}
7878

79-
func (r RunnerType) String() string {
80-
switch r {
79+
func (rt RunnerType) String() string {
80+
switch rt {
8181
case RunnerTypeGlobal:
8282
return "Global"
8383
case RunnerTypeOrganization:
8484
return "Organization"
8585
case RunnerTypeRepository:
8686
return "Repository"
8787
}
88-
return fmt.Sprintf("Unknown Type %d", r)
88+
return fmt.Sprintf("Unknown Type %d", rt)
89+
}
90+
91+
func (r *ActionRunner) BelongsTo() string {
92+
if r.RepoID != 0 {
93+
return r.Repo.FullName()
94+
}
95+
if r.OwnerID != 0 {
96+
return r.Owner.Name
97+
}
98+
return ""
8999
}
90100

91101
func (r *ActionRunner) Status() runnerv1.RunnerStatus {

templates/shared/actions/runner_edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
<div class="field gt-dib gt-mr-4 disabled">
2727
<label>{{.locale.Tr "actions.runners.owner_type"}}</label>
28-
<span>{{.Runner.Type.String}}</span>
28+
<span data-tooltip-content="{{.BelongsTo}}">{{.Runner.Type.String}}</span>
2929
</div>
3030
</div>
3131

templates/shared/actions/runner_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<td>{{.ID}}</td>
6666
<td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>
6767
<td>{{.Version}}</td>
68-
<td>{{.Type.String}}</td>
68+
<td><span data-tooltip-content="{{.BelongsTo}}">{{.Type.String}}<span></td>
6969
<td class="runner-tags">
7070
{{range .AllLabels}}<span class="ui label">{{.}}</span>{{end}}
7171
</td>

0 commit comments

Comments
 (0)