Skip to content

Commit

Permalink
<table>
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner committed Mar 9, 2024
1 parent 1fc6a2d commit 2a36093
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ will be encrypted to all members. So - private actor, basically

## Bugs

Nicks are reset every startup.
There is a nil pointer reference in ther, which make the closet stay closed.

### Pinning
We should probably handle pinning. Maybe not for DID Docs, as they have timestamp, so wont be reused.
8 changes: 5 additions & 3 deletions mode/actor/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func webHandler(w http.ResponseWriter, _ *http.Request, p *p2p.P2P, e *entity.En
func (d *WebHandlerDocument) String() string {

html := "<!DOCTYPE html>\n<html>\n<head>\n"
html += "<style>table, th, td {border: 1px solid black;}</style>"
if d.Title != "" {
html += "<title>" + d.Title + "</title>\n"
}
Expand All @@ -81,11 +82,12 @@ func (d *WebHandlerDocument) String() string {
// Info leak? Not really important anyways.
// // Addresses
if len(d.Addrs) > 0 {
html += "<h2>Addresses</h2>\n<ul>\n"
html += "<h2>Addresses</h2>\n"
html += "<table>\n"
for _, addr := range d.Addrs {
html += "<li>" + addr.String() + "</li>\n"
html += "<tr><td>" + addr.String() + "</td></tr>\n"
}
html += "</ul>\n"
html += "</table>\n"
}

// Peers with Same Rendezvous
Expand Down
8 changes: 4 additions & 4 deletions mode/mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ func UnorderedListFromPeerIDSlice(peers p2peer.IDSlice) string {
}
sort.Strings(keys)

list := "<ul>\n"
list := "<table>\n"
for _, v := range keys {
if peersMap[v] == v {
list += "<li>" + v + "</li>\n"
list += "<tr><td span=2>" + v + "</td></tr>\n"
} else {
list += "<li>" + v + "(" + peersMap[v] + ")</li>\n"
list += "<tr><td>" + v + "</td><td>" + peersMap[v] + ")</td></tr>\n"
}
}
list += "</ul>\n"
list += "</table>\n"
return list
}

0 comments on commit 2a36093

Please sign in to comment.