Files
BridgeSwarm/examples/data-demo/index.html
T
2026-02-21 02:52:00 -05:00

80 lines
2.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BridgeSwarm Data API Demo</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>BridgeSwarm Data API Demo</h1>
<p>Uses <code>BridgeSwarm.request(type, payload)</code> to call Hypercore, Hyperbee, Hyperdrive, Autobase, and Hyperdb in the native host.</p>
<div class="section">
<div class="row">
<span id="publicKey">Your public key: (loading...)</span>
</div>
</div>
<div class="section">
<h2>Hypercore</h2>
<div class="row">
<button class="primary" id="coreInfo">Core info</button>
<input type="text" id="coreAppend" placeholder="Data to append (text)">
<button class="secondary" id="coreAppendBtn">Append</button>
</div>
</div>
<div class="section">
<h2>Hyperbee (key/value)</h2>
<div class="row">
<input type="text" id="beeKey" placeholder="Key">
<input type="text" id="beeValue" placeholder="Value">
<button class="primary" id="beePut">Put</button>
<button class="secondary" id="beeGet">Get</button>
<button class="secondary" id="beeDel">Del</button>
</div>
</div>
<div class="section">
<h2>Hyperdrive (files)</h2>
<div class="row">
<input type="text" id="drivePath" placeholder="Path (e.g. /foo.txt)" value="/readme.txt">
<input type="text" id="driveContent" placeholder="Content to write">
<button class="primary" id="drivePut">Put</button>
<button class="secondary" id="driveGet">Get</button>
<button class="secondary" id="driveList">List /</button>
</div>
</div>
<div class="section">
<h2>Autobase (log)</h2>
<div class="row">
<input type="text" id="autobaseValue" placeholder="Value to append">
<button class="primary" id="autobaseAppend">Append</button>
<button class="secondary" id="autobaseInfo">Info</button>
<button class="secondary" id="autobaseView">Read view (0..4)</button>
</div>
</div>
<div class="section">
<h2>Hyperdb (records)</h2>
<div class="row">
<input type="text" id="hyperdbId" placeholder="Id">
<input type="text" id="hyperdbValue" placeholder="Value">
<button class="primary" id="hyperdbPut">Put</button>
<button class="secondary" id="hyperdbGet">Get</button>
<button class="secondary" id="hyperdbDel">Del</button>
<button class="secondary" id="hyperdbFind">Find all</button>
<button class="secondary" id="hyperdbFlush">Flush</button>
</div>
</div>
<div class="section">
<h2>Log</h2>
<div class="log" id="log"></div>
</div>
<script src="app.js"></script>
</body>
</html>