diff --git a/group/group.go b/group/group.go index 8b230d1..4730121 100644 --- a/group/group.go +++ b/group/group.go @@ -949,7 +949,9 @@ func (desc *Description) GetPermission(group string, c Challengeable) (ClientPer type Public struct { Name string `json:"name"` + DisplayName string `json:"displayName,omitempty"` Description string `json:"description,omitempty"` + Locked bool `json:"locked,omitempty"` ClientCount int `json:"clientCount"` } @@ -957,9 +959,12 @@ func GetPublic() []Public { gs := make([]Public, 0) Range(func(g *Group) bool { if g.Public() { + locked, _ := g.Locked() gs = append(gs, Public{ Name: g.name, + DisplayName: g.DisplayName(), Description: g.description.Description, + Locked: locked, ClientCount: len(g.clients), }) } diff --git a/static/mainpage.js b/static/mainpage.js index 42f75dc..dd81b34 100644 --- a/static/mainpage.js +++ b/static/mainpage.js @@ -60,7 +60,7 @@ async function listPublicGroups() { let td = document.createElement('td'); let a = document.createElement('a'); a.textContent = group.name; - a.href = '/group/' + encodeURIComponent(group.name); + a.href = '/group/' + encodeURIComponent(group.displayName || group.name); td.appendChild(a); tr.appendChild(td); let td2 = document.createElement('td'); @@ -68,7 +68,8 @@ async function listPublicGroups() { td2.textContent = group.description; tr.appendChild(td2); let td3 = document.createElement('td'); - td3.textContent = `(${group.clientCount} clients)`; + let locked = group.locked ? ', locked' : ''; + td3.textContent = `(${group.clientCount} clients${locked})`; tr.appendChild(td3); table.appendChild(tr); }