Skip to content

Commit f06ee37

Browse files
lunnyzeripath
andauthored
Hide sync ssh keys button on admin dashboard if ssh disabled or builtin-ssh enabled (#13072)
Co-authored-by: zeripath <[email protected]>
1 parent 529c5ff commit f06ee37

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

routers/admin/admin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func Dashboard(ctx *context.Context) {
131131
// FIXME: update periodically
132132
updateSystemStatus()
133133
ctx.Data["SysStatus"] = sysStatus
134+
ctx.Data["SSH"] = setting.SSH
134135
ctx.HTML(200, tplDashboard)
135136
}
136137

templates/admin/dashboard.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
<td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td>
3636
<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>
3737
</tr>
38+
{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
3839
<tr>
3940
<td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/>
4041
{{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
4142
<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>
4243
</tr>
44+
{{end}}
4345
<tr>
4446
<td>{{.i18n.Tr "admin.dashboard.resync_all_hooks"}}</td>
4547
<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>

0 commit comments

Comments
 (0)