ssb: Indicate connection status with some colors in the connections list in the sidebar. #122
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
Cory McWilliams 2025-05-31 11:28:09 -04:00
parent 6f71ffb477
commit 2408e076ff
2 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&F7YXac7Ds65INEMv9txEFoRALIuQzhu03Ke+ZrTt9A8=.sha256" "previous": "&Or8fTzbrcxzdGAtSI3AZNQbS97+mJ/zVkGJx+uIzBeY=.sha256"
} }

View File

@ -235,12 +235,18 @@ class TfTabNewsElement extends LitElement {
<h4 style="margin: 0">Connections</h4> <h4 style="margin: 0">Connections</h4>
</a> </a>
${this.connections ${this.connections
.filter((x) => x.id && !x.destroy_reason) .filter((x) => x.id)
.map( .map(
(x) => html` (x) => html`
<tf-user <tf-user
class="w3-bar-item" class="w3-bar-item"
style="max-width: 100%" style=${x.destroy_reason
? 'border-left: 4px solid red; border-right: 4px solid red'
: x.connected
? x.flags?.one_shot
? 'border-left: 4px solid blue; border-right: 4px solid blue'
: 'border-left: 4px solid green; border-right: 4px solid green'
: ''}
id=${x.id} id=${x.id}
fallback_name=${x.host} fallback_name=${x.host}
.users=${this.users} .users=${this.users}