Add file transfer support (#83)

Channel-scoped file browser reachable via right-click on a channel:
navigate directories, create folders, rename/delete, and upload/download
files. Backed by tsclientlib's built-in download_file/upload_file (which
already handles the ftinitdownload/ftinitupload -> TCP data-port dance),
plus raw ftgetfilelist/ftcreatedir/ftdeletefile/ftrenamefile commands for
everything else. Downloads/uploads are buffered whole in memory and
base64-relayed over the existing stdin/WebSocket text protocol - fine for
a channel filebase's typical file sizes, not meant for huge transfers.

Verified against the real server: upload/list/download round-trip reaches
the server correctly (list succeeds, upload correctly surfaces the
guest account's missing permission via the new FiletransferFailed
handling instead of hanging or crashing).

Demo mode gets a small in-memory per-channel filesystem so the file
browser is fully interactive in the GitHub Pages demo too.
This commit is contained in:
Moepchi committed 2026-08-05 22:39:35 +02:00
1 parent 41ac845fbc
commit 7901aafbb1
7 files changed
+862 -4

No files matched your search

+41
View File
@@ -1157,6 +1157,47 @@
overflow-y: auto;
}
.ts-file-browser-dialog {
width: 680px;
}
.ts-file-browser-toolbar {
display: flex;
align-items: center;
gap: 0.4rem;
margin-bottom: 0.5rem;
flex-wrap: wrap;
}
.ts-file-browser-path {
flex: 1;
font-family: monospace;
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ts-file-browser-actions {
display: flex;
gap: 0.25rem;
justify-content: flex-end;
}
.ts-link-button {
background: none;
border: none;
color: var(--accent, #4a9eff);
cursor: pointer;
padding: 0;
font: inherit;
text-align: left;
}
.ts-link-button:hover {
text-decoration: underline;
}
.ts-server-protocol-log-line {
padding: 0.15rem 0.4rem;
border-bottom: 1px solid var(--border-soft);