Skip to content

feat(amuleapi): add web frontend for amuleapi - #220

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/local-amuleapi-web
Jul 4, 2026
Merged

feat(amuleapi): add web frontend for amuleapi#220
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/local-amuleapi-web

Conversation

@ngosang

@ngosang ngosang commented Jun 20, 2026

Copy link
Copy Markdown
Member

Add a full static web frontend for amuleapi under src/webapi/static
(HTML, CSS, JS, i18n, images), aligned with the amulegui feature set.

Highlights:

  • Downloads, Search, Shared Files, Networks, Servers, Stats and
    Preferences views, organized on notebook tabs.
  • SSE-first data layer with throttled delta re-renders to keep the UI
    responsive under bursty updates.
  • Internationalized (English + Spanish), responsive nav and status bar
    for mobile, and a light/dark theme.
  • Hand-rolled canvas charts (no external charting dependency).
Screenshot 2026-07-04 at 11-16-37 aMule Web Screenshot 2026-07-04 at 11-16-59 aMule Web Screenshot 2026-07-04 at 11-17-11 aMule Web Screenshot 2026-07-04 at 11-17-22 aMule Web Screenshot 2026-07-04 at 11-17-33 aMule Web Screenshot 2026-07-04 at 11-17-46 aMule Web

@got3nks

got3nks commented Jun 20, 2026

Copy link
Copy Markdown

Hello @ngosang, welcome back.

Let me know if amuleapi need any adjustment so we can merge it first, I tried my best testing it but I might have missed something.

@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch 2 times, most recently from b3aa9ef to 95acef9 Compare June 21, 2026 12:16
@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch 2 times, most recently from 481a50f to 94a6c72 Compare June 22, 2026 16:47
@got3nks

got3nks commented Jun 22, 2026

Copy link
Copy Markdown

@ngosang — quick read of src/webapi/static/js/events.js while drafting the bootstrap docs on the daemon side. The call ordering in data.ensure(key) is right (SSE opened before the snapshot GET), but seed() has a merge bug that re-introduces the race:

async function seed(key) {
  ...
  const m = new Map();
  for (const it of arr) m.set(String(it[spec.id]), it);
  collections.set(key, m);   // wipes anything applyDelta() inserted while the GET was in flight
}

While await spec.list() is in flight, applyDelta may already have written events into collections.get(key). The wholesale set(key, m) overwrites them, dropping any event whose payload isn't reflected in the snapshot. Same overwrite path runs from the resync handler. The bug bites hardest on _removed: a stale snapshot can resurrect an entry that a buffered delete had already removed.

Fix pattern + full rationale (with the _removed timeline + a JS sketch) in the Bootstrap: snapshot + stream section of EVENTS.md.

@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch from 94a6c72 to b806ae1 Compare June 22, 2026 20:29
@got3nks

got3nks commented Jun 22, 2026

Copy link
Copy Markdown

@ngosang — saw the new commit. Three findings from a fresh pass through static/js/:

You haven't rebased onto the latest amuleapi tree. Your PR base predates the four backend changes I landed earlier today:

  • 1dd35a67 — file ECIDs gone from /downloads, /shared, and client.*_file_*
  • 3dc6370fclients[].ecid renamed to client_ecid (also in client_added / _updated / _removed payloads)
  • 898818a5m_files is now unordered_map; wire iteration order of /downloads, /shared, /clients is no longer ECID-sorted, so order client-side
  • 7dc005b4 — EVENTS.md gap-fills (bootstrap notes, ?channels= symmetry, status_changed / log_appended shapes called out)

Quick grep finds one spot that breaks after rebase: views/downloads.js:38 registers the clients resource with id: "ecid", and applyDelta's payload[spec.id] then reads .ecid off each client payload — that needs to be id: "client_ecid" once you rebase. Server / download / shared specs are already keyed on the right identifier (server .ecid, download / shared .hash).

Search lifecycle is polling but the SSE channel exists — needs the rebase too. views/search.js:1-3 says "Search has no SSE channel, so results are polled until the search reports complete" — that's stale. The amuleapi tree has had search_result_added and search_finished events since 9dc4f36a. Rebasing onto current feature/amuleapi-v0 puts those events on the wire, after which the search flow can switch to: subscribe on POST /search, append on search_result_added, finalize on search_finished, fall back to polling only if SSE drops. The "search may already be running" mount-time fetch becomes a bootstrap-style seed (open SSE, then GET /search/results, then drain buffer) for the search-active-on-reload case.

Bootstrap race in events.js is still open — see the earlier comment. Buffer-then-replay rationale (incl. _removed) in Bootstrap: snapshot + stream.

@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch 2 times, most recently from d886655 to e134f06 Compare June 22, 2026 22:17
@got3nks got3nks added this to the 3.1.0 milestone Jun 23, 2026
@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch 4 times, most recently from 9b77835 to 4e7c43b Compare July 4, 2026 08:15
@got3nks

got3nks commented Jul 4, 2026

Copy link
Copy Markdown

Hey @ngosang, I ran a quick pass over the web frontend — great work, this is a huge improvement over the old amuleweb; people will love it. 🎉

A few small things I noticed while clicking around:

  • Peers table
    • It's a panel at the bottom of the Downloads view — with a long (unpaginated) queue above it, the peers list is hard to reach. Moving Peers to its own page/route would help a lot.
    • Columns aren't sortable (can't order by a column).
    • The file name isn't shown per peer.
    • The peer IP isn't displayed — would be good to show it, and we could enrich it with ip2country (country/flag) like the GUI does.
    • Only an Identity filter exists; a filter by DL state / UL state would be handy too.
  • Large lists aren't paginated — the downloads and shared-files tables render the full list, which gets long on a big node. Vertical virtual (windowed) scrolling is probably the cleanest fit.
  • Text search for tables — a free-text filter field on the tables (downloads, shared, peers) would make finding a row much easier.
  • Language switcher — clicking the button cycles to the next locale; a dropdown list of locales would be more discoverable.

Nothing blocking — really nice first cut.

Add a full static web frontend for amuleapi under src/webapi/static
(HTML, CSS, JS, i18n, images), aligned with the amulegui feature set.

Highlights:
- Downloads, Search, Shared Files, Networks, Servers, Stats and
  Preferences views, organized on notebook tabs.
- SSE-first data layer with throttled delta re-renders to keep the UI
  responsive under bursty updates.
- Internationalized (English + Spanish), responsive nav and status bar
  for mobile, and a light/dark theme.
- Hand-rolled canvas charts (no external charting dependency).
@ngosang
ngosang force-pushed the feature/local-amuleapi-web branch from 4e7c43b to a1167f6 Compare July 4, 2026 10:01
@ngosang
ngosang marked this pull request as ready for review July 4, 2026 10:01
@ngosang ngosang changed the title [POC] Frontend for amuleapi feat(amuleapi): add web frontend for amuleapi Jul 4, 2026
@ngosang
ngosang merged commit f36e0ee into amule-org:master Jul 4, 2026
12 checks passed
@ngosang
ngosang deleted the feature/local-amuleapi-web branch July 4, 2026 10:09
@ngosang

ngosang commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

I will work on those issues + responsive design in the next weeks.

Cflsft pushed a commit to Cflsft/amule that referenced this pull request Jul 6, 2026
Add a full static web frontend for amuleapi under src/webapi/static
(HTML, CSS, JS, i18n, images), aligned with the amulegui feature set.

Highlights:
- Downloads, Search, Shared Files, Networks, Servers, Stats and
  Preferences views, organized on notebook tabs.
- SSE-first data layer with throttled delta re-renders to keep the UI
  responsive under bursty updates.
- Internationalized (English + Spanish), responsive nav and status bar
  for mobile, and a light/dark theme.
- Hand-rolled canvas charts (no external charting dependency).
@ngosang

ngosang commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@got3nks

got3nks commented Jul 9, 2026

Copy link
Copy Markdown

@got3nks

* language selector => [feat(webui): replace language toggle with scalable dropdown #304](https://github.com/amule-org/amule/pull/304)

* virtualized tables + table filters + table sorting => [feat(webui): virtualize data tables to handle thousands of rows #360](https://github.com/amule-org/amule/pull/360)

* remaining issues => [New WebUI: Let users show/hide and resize table columns (persisted in localStorage) #361](https://github.com/amule-org/amule/issues/361)

Great job 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants