mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add repository setting to enable/disable health checks (#3607)
New Feature:
  * Repository struct field for IsFsckEnabled (default true of course)
  * Admin Settings section on repo options page, accessible only by
    admin users
Possible Enhancements:
  * There's no way to force running health checks on all repos
    regardless of their IsFsckEnabled setting. This would be useful if
    there were an admin API or dashboard button to run fsck immediately.
Issue: https://github.com/go-gitea/gitea/issues/1712
Signed-off-by: Allen Wild <allenwild93@gmail.com>
			
			
This commit is contained in:
		@@ -236,6 +236,29 @@
 | 
			
		||||
			</form>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		{{if .IsAdmin}}
 | 
			
		||||
		<h4 class="ui top attached header">
 | 
			
		||||
			{{.i18n.Tr "repo.settings.admin_settings"}}
 | 
			
		||||
		</h4>
 | 
			
		||||
		<div class="ui attached segment">
 | 
			
		||||
			<form class="ui form" method="post">
 | 
			
		||||
				{{.CsrfTokenHtml}}
 | 
			
		||||
				<input type="hidden" name="action" value="admin">
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<div class="ui checkbox">
 | 
			
		||||
						<input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
 | 
			
		||||
						<label>{{.i18n.Tr "repo.settings.admin_enable_health_check"}}</label>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
 | 
			
		||||
				<div class="ui divider"></div>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
 | 
			
		||||
				</div>
 | 
			
		||||
			</form>
 | 
			
		||||
		</div>
 | 
			
		||||
		{{end}}
 | 
			
		||||
 | 
			
		||||
		{{if .IsRepositoryOwner}}
 | 
			
		||||
		<h4 class="ui top attached warning header">
 | 
			
		||||
			{{.i18n.Tr "repo.settings.danger_zone"}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user