-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththreads.js
More file actions
27 lines (23 loc) · 826 Bytes
/
Copy paththreads.js
File metadata and controls
27 lines (23 loc) · 826 Bytes
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
function renderThreads(threads) {
const chatArea = document.getElementById("interactive_logs")
if (!chatArea) return
chatArea.innerHTML =`
<div class="emptyChannel">
<span>[Choose a thread]</span>
</div>
`
const rows = threads
.filter(t => t.name)
.map((t, i) => {
const idx = String(i).padStart(2, "0")
const name = `<span onclick="runcmd('cd ${state._currentChannel}/${idx}')">${t.name}</span>`;
return `${idx} | ${name}`
})
const table = "Choose a thread: (click)<br>" + rows.join("<br>") + "<br><br>You can also call <kbd>cd [channel_name], [thread_id]</kbd>"
document.getElementById("logspane").appendChild(
MessageBuilder.action({
icon: "wand_stars",
action: table
})
)
}