Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file listing for CP 9 #162

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ <h1>Select USB Host Folder</h1>
<tbody>
<tr>
<td>Board:</td>
<td><a id="board"></a></td>
<td><a id="board" target="_blank"></a></td>
</tr>
<tr>
<td>Version:</td>
Expand Down
14 changes: 9 additions & 5 deletions js/common/web-file-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ class FileTransferClient {

const response = await this._fetch(`/fs${path}`, {headers: {"Accept": "application/json"}});
const results = await response.json();
for (let result of results) {
let listings = results
if (results.files !== undefined) {
listings = results.files;
}
for (let listing of listings) {
contents.push({
path: result.name,
isDir: result.directory,
fileSize: result.file_size,
fileDate: Number(result.modified_ns / 1000000),
path: listing.name,
isDir: listing.directory,
fileSize: listing.file_size,
fileDate: Number(listing.modified_ns / 1000000),
});
}

Expand Down