Skip to content

Commit

Permalink
Hide sync ssh keys button on admin dashboard if ssh disabled or built…
Browse files Browse the repository at this point in the history
…in-ssh enabled (#13072)

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
lunny and zeripath authored Oct 8, 2020
1 parent 529c5ff commit f06ee37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions routers/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func Dashboard(ctx *context.Context) {
// FIXME: update periodically
updateSystemStatus()
ctx.Data["SysStatus"] = sysStatus
ctx.Data["SSH"] = setting.SSH
ctx.HTML(200, tplDashboard)
}

Expand Down
2 changes: 2 additions & 0 deletions templates/admin/dashboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
<td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td>
<td><button type="submit" class="ui green button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
<tr>
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/>
{{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
<td><button type="submit" class="ui green button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
{{end}}
<tr>
<td>{{.i18n.Tr "admin.dashboard.resync_all_hooks"}}</td>
<td><button type="submit" class="ui green button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td>
Expand Down

0 comments on commit f06ee37

Please sign in to comment.