50 lines
2.0 KiB
HTML
50 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>BridgeSwarm – HRPC Demo</title>
|
||
<link rel="stylesheet" href="style.css">
|
||
</head>
|
||
<body>
|
||
<h1>BridgeSwarm – HRPC Demo</h1>
|
||
<p>HRPC is <strong>auto-enabled</strong> on every connection. Open this page in two tabs, join the same topic in both; once connected, you can "Ping peer" in either tab (no manual enable step).</p>
|
||
|
||
<div class="section">
|
||
<h2>1. Swarm <span class="badge">join / leave</span></h2>
|
||
<p id="status" class="status">Waiting for extension…</p>
|
||
<div class="row">
|
||
<input type="text" id="topic" placeholder="Topic" value="bridge-swarm-hrpc-demo">
|
||
<button class="primary" id="btnJoin">Join topic</button>
|
||
<button class="danger" id="btnLeave" disabled>Leave & destroy</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="section">
|
||
<h2>2. Connection & HRPC <span class="badge">attachHrpc, hrpcInvoke</span></h2>
|
||
<p id="peers">Peers: 0</p>
|
||
<p id="publicKey">Your public key: (join to generate)</p>
|
||
<div class="row" id="connSelectRow" style="display:none;">
|
||
<label for="connSelect" style="font-size:0.85rem; color:#a9b1d6;">Use connection:</label>
|
||
<select id="connSelect" style="min-width:180px; padding:0.35rem 0.5rem; border-radius:6px; border:1px solid #3b4261; background:#24283b; color:#c0caf5; font-size:0.85rem;"></select>
|
||
</div>
|
||
<div class="row">
|
||
<button class="secondary" id="btnEnableHrpc" disabled>Retry HRPC on selected connection</button>
|
||
</div>
|
||
<p id="hrpcStatus" class="status" style="display:none;"></p>
|
||
<div class="row" id="pingRow" style="display:none;">
|
||
<input type="text" id="pingValue" placeholder="Ping value (optional)">
|
||
<button class="primary" id="btnPing">Ping peer</button>
|
||
</div>
|
||
<p id="pongResult" class="status" style="display:none;"></p>
|
||
</div>
|
||
|
||
<div class="section">
|
||
<h2>Log</h2>
|
||
<div class="log" id="log"></div>
|
||
</div>
|
||
|
||
<script src="app.js"></script>
|
||
</body>
|
||
</html>
|