Commit eedfacca authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add locked and displayName to public-groups.json.

parent 52a26327
......@@ -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),
})
}
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment