Browse Source

Hide sync ssh keys button on admin dashboard if ssh disabled or builtin-ssh enabled (#13072)

Co-authored-by: zeripath <art27@cantab.net>
tags/v1.13.0-rc1
Lunny Xiao 3 years ago
parent
commit
f06ee37e24
No account linked to committer's email address
2 changed files with 3 additions and 0 deletions
  1. 1
    0
      routers/admin/admin.go
  2. 2
    0
      templates/admin/dashboard.tmpl

+ 1
- 0
routers/admin/admin.go View File

@@ -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)
}


+ 2
- 0
templates/admin/dashboard.tmpl View File

@@ -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>

Loading…
Cancel
Save