Files
nandi 4bb81f1b80
check / check (macos-latest) (push) Failing after 26s
check / check (windows-latest) (push) Failing after 26s
check / check (ubuntu-latest) (push) Failing after 29s
feat: add diagnostics report to Firefox torrent extension
- Add a Diagnostics panel to the extension popup and manager page with copy and refresh actions
- Collect extension settings, router API status, torrents, DHT nodes, and a tail of the router log into one report
- Add a native host `diagnostics` command that reports router PID, active ports, log path, and log summary counters
- Export data dir, log file, router PID, and SAM port from the AppImage launcher
- Start the router with `--debug` so the log tail has detailed output
- Bump extension version to 0.1.4 and request clipboardWrite permission
2026-11-28 19:28:39 -08:00

122 lines
4.5 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Moon I2P Torrent &amp; DHT Manager</title>
<link rel="stylesheet" href="ui.css" />
</head>
<body class="manager">
<header>
<div class="brand">
<img src="icon.svg" alt="" />
<span>moon-i2p BitTorrent &amp; I2P DHT Manager</span>
</div>
<div class="row">
<span id="router-pill" class="pill offline">Offline</span>
<button id="header-diag-btn" class="secondary" type="button">Diagnostics</button>
<button id="start-router-btn">Start Router</button>
<button id="stop-router-btn" class="secondary" style="display:none;">Stop Router</button>
</div>
</header>
<div class="grid-2">
<section class="card">
<h2><span>I2P Router &amp; HTTP Proxy</span></h2>
<div class="grid-2">
<div class="stat">
<div class="stat-label">NetDB / Tunnels</div>
<div id="net-summary" class="stat-val">--</div>
</div>
<div class="stat">
<div class="stat-label">I2P Proxy (.i2p)</div>
<label class="row" style="gap:4px;">
<input id="proxy-enabled" type="checkbox" />
<span id="proxy-addr" class="mono">127.0.0.1:4444</span>
</label>
</div>
</div>
<div class="stat" style="margin-top:8px;">
<div class="stat-label">Torrent Session .b32.i2p (share with DHT peers)</div>
<div id="torrent-b32" class="stat-val mono">--</div>
</div>
</section>
<section class="card">
<h2>
<span>I2P Kademlia DHT (Proto 17 / 18)</span>
<span id="dht-summary" class="mono">0 nodes</span>
</h2>
<div class="grid-2">
<div class="stat">
<div class="stat-label">Secure Node ID (20B)</div>
<div id="dht-node-id" class="stat-val mono">--</div>
</div>
<div class="stat">
<div class="stat-label">Sent / Recv / Peers</div>
<div id="dht-stats" class="stat-val">0 / 0 / 0</div>
</div>
</div>
<form id="bootstrap-form" class="row" style="margin-top:8px;">
<input id="bootstrap-b32" type="text" placeholder="Bootstrap node .b32.i2p" />
<input id="bootstrap-port" type="number" value="6881" style="width:84px;" />
<button type="submit" class="secondary">Bootstrap</button>
</form>
<div id="dht-nodes-list" class="node-list mono"></div>
</section>
</div>
<section class="card">
<h2><span>Add Torrent or Magnet URI</span></h2>
<form id="magnet-form" class="row">
<input id="magnet-uri" type="text" placeholder="magnet:?xt=urn:btih:...&amp;dn=..." />
<button type="submit">Add Magnet</button>
</form>
<div id="dropzone" class="dropzone">
Drop a .torrent file here or click to select one from disk
<input id="torrent-file" type="file" accept=".torrent" style="display:none;" />
</div>
<div id="status-msg" class="msg"></div>
</section>
<section class="card">
<h2>
<span>Active &amp; Completed Torrents</span>
<span id="torrent-count" class="mono">0</span>
</h2>
<div id="torrents-list">No torrents added yet.</div>
</section>
<section id="diagnostics-card" class="card">
<h2>
<span>Diagnostics &amp; Verbose Logs</span>
<span class="row">
<button id="copy-diag-btn" type="button">Copy Diagnostics</button>
<button id="refresh-diag-btn" class="secondary" type="button">Refresh</button>
</span>
</h2>
<div id="diag-status" class="msg"></div>
<pre id="diagnostics-log" class="mono diag-log">Loading diagnostics...</pre>
</section>
<section class="card">
<h2><span>Extension &amp; Router Settings</span></h2>
<form id="settings-form">
<div class="grid-2">
<div><div class="stat-label">HTTP Proxy Port</div><input id="cfg-proxy-port" type="number" /></div>
<div><div class="stat-label">Torrent API Port</div><input id="cfg-api-port" type="number" /></div>
</div>
<div style="margin-top:8px;">
<div class="stat-label">Default Download Directory</div>
<input id="cfg-dl-dir" type="text" placeholder="~/Downloads/moon-i2p" />
</div>
<div class="row" style="margin-top:8px;justify-content:space-between;">
<label class="row"><input id="cfg-intercept" type="checkbox" /> <span>Intercept magnet: and .torrent links on .i2p pages</span></label>
<button type="submit">Save Settings</button>
</div>
</form>
</section>
<script src="ui.js"></script>
</body>
</html>