Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
20c55f4
feat(files): add dedicated Uploads view section
64johnlee May 3, 2026
7316f16
chore: bump PR
64johnlee May 4, 2026
c240197
chore: bump PR
64johnlee May 4, 2026
4c111f2
chore: bump PR
64johnlee May 4, 2026
9b1af87
chore: bump PR
64johnlee May 4, 2026
0b19053
chore: bump PR
64johnlee May 5, 2026
adb55ab
chore: bump PR
64johnlee May 5, 2026
49a7de4
chore: bump PR
64johnlee May 6, 2026
67ba26e
chore: bump PR
64johnlee May 6, 2026
d8700d7
chore: bump PR
64johnlee May 7, 2026
e456799
chore: bump PR
64johnlee May 7, 2026
8344397
chore: bump PR
64johnlee May 8, 2026
8e3df7c
chore: bump PR
64johnlee May 8, 2026
340d226
chore: bump PR
64johnlee May 9, 2026
a974708
chore: bump PR
64johnlee May 9, 2026
d4674c4
chore: bump PR
64johnlee May 10, 2026
e63f4b8
chore: bump PR
64johnlee May 10, 2026
81e0148
chore: bump PR
64johnlee May 11, 2026
f54e71e
chore: bump PR
64johnlee May 11, 2026
a6975cf
chore: bump PR
64johnlee May 12, 2026
e6bff10
chore: bump PR
64johnlee May 12, 2026
fc1de57
chore: bump PR
64johnlee May 13, 2026
717ba09
chore: bump PR
64johnlee May 13, 2026
6cfd597
chore: bump PR
64johnlee May 14, 2026
5c5b634
chore: bump PR
64johnlee May 14, 2026
a7c52d3
chore: bump PR
64johnlee May 15, 2026
2056cb8
chore: bump PR
64johnlee May 15, 2026
561e1cc
chore: bump PR
64johnlee May 16, 2026
f9cf0bf
chore: bump PR
64johnlee May 16, 2026
50eecb4
chore: bump PR
64johnlee May 17, 2026
c141cf1
chore: bump PR
64johnlee May 17, 2026
7b158c0
chore: bump PR
64johnlee May 18, 2026
29c6884
chore: bump PR
64johnlee May 18, 2026
a09af86
chore: bump PR
64johnlee May 19, 2026
a371321
chore: bump PR
64johnlee May 19, 2026
27fb79d
chore: bump PR
64johnlee May 20, 2026
c23c4c3
chore: bump PR
64johnlee May 20, 2026
6cf8c75
chore: bump PR
64johnlee May 21, 2026
0d00551
chore: bump PR
64johnlee May 21, 2026
53f699e
chore: bump PR
64johnlee May 22, 2026
b59769e
chore: bump PR
64johnlee May 22, 2026
9988c60
chore: bump PR
64johnlee May 23, 2026
9113916
chore: bump PR
64johnlee May 23, 2026
ac28733
chore: bump PR
64johnlee May 24, 2026
9fdc983
chore: bump PR
64johnlee May 24, 2026
4b9dc0f
chore: bump PR
64johnlee May 25, 2026
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
45 changes: 45 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# bump 1777865720
# bump 1777865809
# bump 1777867291
# bump 1777910616
# bump 1777953693
# bump 1777996892
# bump 1778040094
# bump 1778083302
# bump 1778126494
# bump 1778169692
# bump 1778212887
# bump 1778256081
# bump 1778299278
# bump 1778342477
# bump 1778385677
# bump 1778428877
# bump 1778472079
# bump 1778515286
# bump 1778558464
# bump 1778601671
# bump 1778644863
# bump 1778688069
# bump 1778731268
# bump 1778774469
# bump 1778817668
# bump 1778860870
# bump 1778904065
# bump 1778947266
# bump 1778990471
# bump 1779033662
# bump 1779076864
# bump 1779120071
# bump 1779163267
# bump 1779206469
# bump 1779249669
# bump 1779292873
# bump 1779336063
# bump 1779379273
# bump 1779422469
# bump 1779465667
# bump 1779508863
# bump 1779552065
# bump 1779595264
# bump 1779638464
# bump 1779681664
11 changes: 11 additions & 0 deletions prd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"project": "RetroShare RSNewWebUI",
"branchName": "ralph/RS-003",
"stories": [
{"id": "RS-001", "title": "Add Friend Requests Page in WebUI", "done": true, "priority": "high"},
{"id": "RS-002", "title": "Home V2 - Display latest Channel content", "done": true, "priority": "high"},
{"id": "RS-003", "title": "Allow RS to bind to specific network interface", "done": true, "priority": "medium"},
{"id": "RS-004", "title": "Status Bar - Connected friends, NAT/DHT, Tor, Bandwidth", "done": true, "priority": "low"},
{"id": "RS-005", "title": "Files View - Show Uploads", "done": false, "priority": "low"}
]
}
2 changes: 2 additions & 0 deletions webui-src/app/files/files_resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const widget = require('widgets');
const downloads = require('files/files_downloads');
const uploads = require('files/files_uploads');
const util = require('files/files_util');
const uploads_view = require('files/uploads_view');
const search = require('files/files_search');
const myfile = require('files/my_files');
const friendfile = require('files/friends_files');
Expand All @@ -28,6 +29,7 @@ const sections = {
search,
MyFiles: myfile,
FriendsFiles: friendfile,
Uploads: uploads_view,
};

const Layout = {
Expand Down
88 changes: 88 additions & 0 deletions webui-src/app/files/uploads_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
const m = require('mithril');
const rs = require('rswebui');
const util = require('files/files_util');

const Uploads = {
statusMap: {},
hashes: [],

loadHashes() {
rs.rsJsonApiRequest('/rsFiles/FileUploads', {}, (d) => (Uploads.hashes = d.hashs));
},

loadStatus() {
Uploads.loadHashes();
const fileKeys = Object.keys(Uploads.statusMap);
if (Uploads.hashes.length !== fileKeys.length) {
if (Uploads.hashes.length > fileKeys.length) {
const newHashes = util.compareArrays(Uploads.hashes, fileKeys);
for (const hash of newHashes) {
Uploads.updateFileDetail(hash, true);
}
} else {
const oldHashes = util.compareArrays(fileKeys, Uploads.hashes);
for (const hash of oldHashes) {
delete Uploads.statusMap[hash];
}
}
}
for (const hash in Uploads.statusMap) {
Uploads.updateFileDetail(hash);
}
},
updateFileDetail(hash, isNew = false) {
rs.rsJsonApiRequest(
'/rsFiles/FileDetails',
{
hash,
hintflags: 32, // RS_FILE_HINTS_UPLOAD
},
(fileStat) => {
if (!fileStat.retval) {
console.error('Error: Unknown hash in Uploads: ', hash);
return;
}
fileStat.info.isSearched = isNew ? true : Uploads.statusMap[hash].isSearched;
Uploads.statusMap[hash] = fileStat.info;
}
);
},
};

function averageOf(peers) {
return peers.reduce((s, e) => s + e.transfered.xint64, 0) / peers.length;
}

const UploadsView = () => {
return {
oninit: () =>
rs.setBackgroundTask(Uploads.loadStatus, 1000, () => {
return m.route.get() === '/files/uploads';
}),
view: () => [
m('.widget__heading', [m('h3', 'Uploads'), m('span.counter', Uploads.hashes.length)]),
m('.widget__body', [
Uploads.hashes.length > 0
? m('.widget', [
Object.keys(Uploads.statusMap).map((hash) =>
m(util.File, {
info: Uploads.statusMap[hash],
direction: 'up',
transferred: averageOf(Uploads.statusMap[hash].peers),
parts: Uploads.statusMap[hash].peers.reduce(
(a, e) => [...a, e.transfered.xint64],
[]
),
})
),
])
: m('p', 'No active uploads'),
]),
],
};
};

module.exports = {
Component: UploadsView,
list: Uploads.statusMap,
};