2 files changed,
12 insertions(+),
6 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-03-17 15:19:59 +0200
Authored at:
2026-03-17 15:09:01 +0200
Change ID:
ypsovyvospxtonqlrqvvnutrutwqtyvx
Parent:
d798b4b
M
internal/handlers/repo.go
路路路 73 73 } 74 74 75 75 p := RepoIndex{Desc: desc, IsEmpty: repo.IsEmpty()} 76 + if isMirror, merr := repo.IsMirror(); isMirror && merr == nil { 77 + p.IsMirror = true 78 + p.MirrorURL, _ = repo.RemoteURL() 79 + p.MirrorLastSync, _ = repo.LastSync() 80 + } 81 + 76 82 if p.IsEmpty { 77 83 h.templ(w, "repo_index", h.pageData(repo, p)) 78 84 return 路路路 98 104 99 105 if len(p.Commits) >= 3 { 100 106 p.Commits = p.Commits[:3:3] 101 - } 102 - 103 - if isMirror, err := repo.IsMirror(); isMirror && err == nil { 104 - p.IsMirror = true 105 - p.MirrorURL, _ = repo.RemoteURL() 106 - p.MirrorLastSync, _ = repo.LastSync() 107 107 } 108 108 109 109 p.SSHUser = h.c.SSH.User
M
web/templates/repo_index.html
路路路 10 10 <main> 11 11 {{ if .P.IsEmpty }} 12 12 <h3>Repository is empty</h3> 13 + {{ if .P.IsMirror }} 14 + <p> 15 + Awaiting initial sync from: 16 + <a class="link" href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a> 17 + </p> 18 + {{ end }} 13 19 {{ else }} 14 20 <section class="repo-index"> 15 21 <div class="repo-index-main">