global-ai-data-node's picture
Update index.html
845bf25 verified
Raw History Blame Contribute Delete
5.25 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liquid Compute Gateway Multi-Mesh</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-slate-950 text-slate-100 min-h-screen flex flex-col items-center justify-center p-4">
<div class="max-w-xl w-full bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-2xl">
<div class="flex items-center justify-between border-b border-slate-800 pb-4 mb-6">
<div>
<h1 class="text-xl font-bold text-white flex items-center gap-2">
<span>⚡</span> Liquid Compute Gateway
</h1>
<p class="text-xs text-slate-400">Autonomous Edge Arbitrage Mesh v2.0</p>
</div>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-950 text-emerald-400 border border-emerald-800">
Live 🟢
</span>
</div>
<form id="arbitrageForm" class="space-y-4">
<div>
<label for="gpu" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Select Hardware Node</label>
<select id="gpu" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500">
<option value="NVIDIA H200">NVIDIA H200 (Extreme Cluster - $5.30/hr)</option>
<option value="NVIDIA H100" selected>NVIDIA H100 (Enterprise Fine-Tuning - $3.85/hr)</option>
<option value="NVIDIA A100">NVIDIA A100 (Deep Learning Standard - $2.40/hr)</option>
<option value="RTX 4090">RTX 4090 (Mid-tier Inference - $0.85/hr)</option>
<option value="RTX 3090">RTX 3090 (Budget Open-Source - $0.46/hr)</option>
</select>
</div>
<div>
<label for="hours" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Compute Duration (Hours)</label>
<input type="number" id="hours" min="1" max="168" value="1" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500">
</div>
<div>
<label for="txSig" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Solana Settlement Tx Signature (Optional for Quote)</label>
<input type="text" id="txSig" placeholder="Paste SPL-USDC Tx Hash after payment" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500 font-mono">
</div>
<button type="submit" id="submitBtn" class="w-full bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white font-medium py-2.5 rounded-lg text-sm transition-all shadow-lg shadow-indigo-600/30">
Fetch Instant Mesh Route
</button>
</form>
<div id="outputContainer" class="mt-6 hidden">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Gateway Dispatch Response</span>
<span id="badgeStatus" class="text-xs font-mono text-emerald-400"></span>
</div>
<pre id="output" class="bg-slate-950 border border-slate-800 rounded-lg p-3 text-xs font-mono text-slate-300 overflow-x-auto max-h-64"></pre>
</div>
<div class="mt-6 pt-4 border-t border-slate-800 flex items-center justify-between text-xs text-slate-500">
<span>Settlement: Solana SPL-USDC</span>
<a href="https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev/openapi.json" target="_blank" class="text-indigo-400 hover:underline">OpenAPI 3.0.0 Spec</a>
</div>
</div>
<script>
const WORKER_URL = "https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev";
document.getElementById("arbitrageForm").addEventListener("submit", async (e) => {
e.preventDefault();
const btn = document.getElementById("submitBtn");
const outBox = document.getElementById("outputContainer");
const out = document.getElementById("output");
const badge = document.getElementById("badgeStatus");
btn.disabled = true;
btn.innerText = "Routing across Mesh...";
const payload = {
gpu: document.getElementById("gpu").value,
hours: Number(document.getElementById("hours").value) || 1,
tx_signature: document.getElementById("txSig").value.trim() || null
};
try {
const res = await fetch(WORKER_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
});
const data = await res.json();
outBox.classList.remove("hidden");
badge.innerText = data.status || "ROUTED";
out.textContent = JSON.stringify(data, null, 2);
} catch (err) {
outBox.classList.remove("hidden");
badge.innerText = "ERROR";
out.textContent = JSON.stringify({ error: "Failed to connect to Edge Gateway", details: err.message }, null, 2);
} finally {
btn.disabled = false;
btn.innerText = "Fetch Instant Mesh Route";
}
});
</script>
</body>
</html>