all repos

mugit @ d68c296e92a2380a0a9db1296c49f90d2f0f9142

馃惍 git server that your cow will love
2 files changed, 15 insertions(+), 5 deletions(-)
ui: show remote urls on empty repo page
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-03-20 18:32:47 +0200
Authored at: 2026-03-20 18:10:40 +0200
Change ID: lknzpztlnlwxmlnkqrsvnpsxymsttqvo
Parent: bb41a2d
M internal/handlers/repo.go
路路路
        70
        70
         		return

      
        71
        71
         	}

      
        72
        72
         

      
        73
        
        -	p := RepoIndex{Desc: desc, IsEmpty: repo.IsEmpty()}

      
        
        73
        +	p := RepoIndex{

      
        
        74
        +		Desc:    desc,

      
        
        75
        +		IsEmpty: repo.IsEmpty(),

      
        
        76
        +		SSHUser: h.c.SSH.User,

      
        
        77
        +	}

      
        
        78
        +

      
        74
        79
         	if isMirror, merr := repo.IsMirror(); isMirror && merr == nil {

      
        75
        80
         		p.IsMirror = true

      
        76
        81
         		p.MirrorURL, _ = repo.RemoteURL()

      路路路
        104
        109
         		p.Commits = p.Commits[:3:3]

      
        105
        110
         	}

      
        106
        111
         

      
        107
        
        -	p.SSHUser = h.c.SSH.User

      
        108
        112
         	h.templ(w, "repo_index", h.pageData(repo, p))

      
        109
        113
         }

      
        110
        114
         

      
M web/templates/repo_index.html
路路路
        
        1
        +{{ define "_remote_urls" }}

      
        
        2
        +<h2>Clone urls</h2>

      
        
        3
        +<pre>https://{{.Meta.Host}}/{{.RepoName}}</pre>

      
        
        4
        +{{ if .Meta.SSHEnabled }}<pre>{{.P.SSHUser}}@{{.Meta.Host}}:{{.RepoName}}</pre>{{ end }}

      
        
        5
        +{{ end }}

      
        
        6
        +

      
        1
        7
         {{ define "repo_index" }}

      
        2
        8
         <!DOCTYPE html>

      
        3
        9
         <html>

      路路路
        15
        21
                 Awaiting initial sync from:

      
        16
        22
                 <a class="link" href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>

      
        17
        23
               </p>

      
        
        24
        +      <br>

      
        
        25
        +      {{ template "_remote_urls" . }}

      
        18
        26
               {{ end }}

      
        19
        27
               {{ else }}

      
        20
        28
               <section class="repo-index">

      路路路
        39
        47
                 </div>

      
        40
        48
         

      
        41
        49
                 <div class="repo-index-side">

      
        42
        
        -          <h2>Clone urls</h2>

      
        43
        
        -          <pre>https://{{.Meta.Host}}/{{.RepoName}}</pre>

      
        44
        
        -          {{ if .Meta.SSHEnabled }}<pre>{{.P.SSHUser}}@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}}

      
        
        50
        +          {{ template "_remote_urls" . }}

      
        45
        51
                   {{ if .P.IsMirror }}

      
        46
        52
                   <br>

      
        47
        53
                   <h2>Mirror status</h2>