-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpeers.html
More file actions
203 lines (178 loc) · 4.63 KB
/
peers.html
File metadata and controls
203 lines (178 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="peersky://static/assets/favicon.ico" />
<title>P2P Peers</title>
<style>
@import url("browser://theme/index.css");
:root {
--panel-border: var(--browser-theme-primary-highlight, #3c3c41);
}
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
margin: 0;
padding: 12px;
background: var(--browser-theme-background);
color: var(--browser-theme-text-color);
font-family: var(--browser-theme-font-family);
overflow-y: auto;
}
#app {
display: flex;
flex-direction: column;
gap: 10px;
max-width: 980px;
margin: 0 auto;
}
.panel {
border: 1px solid var(--panel-border);
border-radius: 10px;
padding: 10px;
}
.row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.muted {
opacity: 0.75;
}
.stats {
display: flex;
flex-wrap: wrap;
gap: 12px;
font-size: 0.92rem;
margin-top: 10px;
}
.profile-editor {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.profile-editor button {
cursor: pointer;
}
.role-badge {
display: inline-flex;
align-items: center;
padding: 1px 8px;
border-radius: 999px;
border: 1px solid var(--panel-border);
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.role-badge.host {
color: #ffffff;
border-color: #1f9d62;
background: #1f9d62;
font-weight: 700;
}
.role-badge.client {
color: #ffffff;
border-color: #c28a1b;
background: #c28a1b;
font-weight: 700;
}
.role-badge.viewer {
color: #ffffff;
border-color: #4b5563;
background: #4b5563;
font-weight: 700;
}
.peer-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 8px;
}
.peer-card {
border: 1px solid var(--panel-border);
border-radius: 10px;
padding: 8px;
display: flex;
flex-direction: column;
gap: 5px;
}
.peer-head {
display: flex;
align-items: center;
gap: 8px;
}
.avatar {
width: 24px;
height: 24px;
border-radius: 999px;
display: inline-flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 0.78rem;
font-weight: 600;
flex: 0 0 auto;
}
.activity-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 6px;
max-height: 42vh;
overflow: auto;
}
.activity-item {
border: 1px solid var(--panel-border);
border-radius: 8px;
padding: 6px 8px;
}
.empty {
opacity: 0.7;
font-style: italic;
}
</style>
</head>
<body>
<main id="app">
<section class="panel">
<div class="row">
<strong>Room:</strong>
<code id="roomKey">-</code>
<span id="localRole" class="role-badge">client</span>
</div>
<div class="row muted">
<strong>Local URL:</strong>
<a id="localUrl" target="_blank" rel="noopener noreferrer"></a>
</div>
<div class="profile-editor">
<label for="displayNameEditor"><strong>Username:</strong></label>
<input id="displayNameEditor" type="text" maxlength="32" placeholder="Enter username" />
<button id="saveDisplayName" type="button">Update</button>
<span id="profileHint" class="muted"></span>
</div>
<div id="stats" class="stats"></div>
</section>
<section class="panel">
<h3>Connected Peers</h3>
<div id="peerList" class="peer-list"></div>
</section>
<section class="panel">
<h3>Currently Editing</h3>
<div id="editingList" class="peer-list"></div>
</section>
<section class="panel">
<h3>Edit History</h3>
<ul id="activityList" class="activity-list"></ul>
</section>
</main>
<script type="module" src="./peers.js"></script>
</body>
</html>