summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-12-16 15:55:12 +0000
committerGitHub <noreply@github.com>2021-12-16 23:55:12 +0800
commite0e3ba6c12c4094dfb1ff0dc5f290214cf9bfe54 (patch)
tree4284180ee25635036097234172f748718cb23bac /templates
parent3a3cbcfdf077242cf788d8c9a9ac68bd77cb4ff5 (diff)
downloadgitea-e0e3ba6c12c4094dfb1ff0dc5f290214cf9bfe54.tar.gz
gitea-e0e3ba6c12c4094dfb1ff0dc5f290214cf9bfe54.zip
Add Reindex buttons to repository settings page (#17494)
This PR adds reindexing request buttons to the repository settings page. Fix #3796 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/settings/options.tmpl41
1 files changed, 40 insertions, 1 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 5a4c8ace69..4389b63559 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -558,11 +558,50 @@
</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 class="ui divider"></div>
+ <form class="ui form" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="admin_index">
+ {{if .CodeIndexerEnabled}}
+ <h4 class="ui header">{{.i18n.Tr "repo.settings.admin_code_indexer"}}</h4>
+ <div class="inline fields">
+ <label>{{.i18n.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ <span class="field">
+ {{if .CodeIndexerStatus}}
+ <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
+ <span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
+ </a>
+ {{else}}
+ <span>{{.i18n.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+ {{end}}
+ </span>
+ <div class="field">
+ <button class="ui green button" name="request_reindex_type" value="code">{{$.i18n.Tr "repo.settings.reindex_button"}}</button>
+ </div>
+ </div>
+ {{end}}
+ <h4 class="ui header">{{.i18n.Tr "repo.settings.admin_stats_indexer"}}</h4>
+ <div class="inline fields">
+ <label>{{.i18n.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ <span class="field">
+ {{if .StatsIndexerStatus}}
+ <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
+ <span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
+ </a>
+ {{else}}
+ <span>{{.i18n.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+ {{end}}
+ </span>
+ <div class="field">
+ <button class="ui green button" name="request_reindex_type" value="stats">{{$.i18n.Tr "repo.settings.reindex_button"}}</button>
+ </div>
+ </div>
+ </form>
</div>
{{end}}