Skip to content

Commit 4964d6a

Browse files
authored
Update index.html
1 parent 1cbd323 commit 4964d6a

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

AION.AI/index.html

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
transition: all 0.1s;
201201
}
202202
.badge.ada { background: #1e3a5f; border: 1px solid #c9a028; }
203+
.badge.ada-vela { background: #1e3a5f; border: 1px solid #c9a028; }
203204
.badge.vela.pass { background: #1e4620; color: #4ade80; }
204205
.badge.vela.flag { background: #5f3a1a; color: #ffaa33; }
205206
.badge.vela.block { background: #5f1a1a; color: #ff8a8a; }
@@ -741,6 +742,57 @@ <h4>📈 Market Atlas</h4>
741742
modal.addEventListener('click', (e) => { if (e.target === modal) modal.remove(); });
742743
}
743744

745+
// Ada‑VELA: fetch execution details and show modal
746+
async function fetchAdaVelaExecution(executionId) {
747+
try {
748+
const res = await fetch(`${API_BASE}/api/ada-vela/execution/${executionId}`);
749+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
750+
return await res.json();
751+
} catch (err) {
752+
console.warn('Ada‑VELA execution fetch failed:', err);
753+
return null;
754+
}
755+
}
756+
757+
async function showAdaVelaModal(executionId) {
758+
const loadingMsg = 'Loading Ada‑VELA execution details...';
759+
const modal = document.createElement('div'); modal.className = 'modal-overlay';
760+
modal.innerHTML = `
761+
<div class="modal">
762+
<div class="modal-header"><h3>📋 Ada‑VELA Execution</h3><button id="closeAdaVelaModal">✕</button></div>
763+
<div class="modal-body" id="adaVelaModalBody">
764+
<div class="skeleton" style="height: 200px;"></div>
765+
</div>
766+
</div>`;
767+
document.body.appendChild(modal);
768+
const bodyDiv = modal.querySelector('#adaVelaModalBody');
769+
modal.querySelector('#closeAdaVelaModal').onclick = () => modal.remove();
770+
modal.addEventListener('click', (e) => { if (e.target === modal) modal.remove(); });
771+
772+
const data = await fetchAdaVelaExecution(executionId);
773+
if (data) {
774+
bodyDiv.innerHTML = `
775+
<div style="font-family:monospace;">
776+
<p><strong>Execution ID:</strong> ${escapeHtml(data.id || executionId)}</p>
777+
<p><strong>Operation:</strong> ${escapeHtml(data.name || '?')}</p>
778+
<p><strong>Description:</strong> ${escapeHtml(data.description || '')}</p>
779+
<p><strong>Start:</strong> ${data.startTime?.gregorian || '?'}</p>
780+
<p><strong>End:</strong> ${data.endTime?.gregorian || '?'}</p>
781+
<p><strong>Duration:</strong> ${data.duration ?? '?'}s</p>
782+
<p><strong>Risk Tier:</strong> ${escapeHtml(data.riskTier || '?')}</p>
783+
<p><strong>Domain:</strong> ${escapeHtml(data.domain || '?')}</p>
784+
<p><strong>Inputs:</strong> <pre style="background:#0a0a0f; padding:8px; border-radius:8px;">${escapeHtml(JSON.stringify(data.input, null, 2))}</pre></p>
785+
<p><strong>Outputs:</strong> <pre style="background:#0a0a0f; padding:8px; border-radius:8px;">${escapeHtml(JSON.stringify(data.output, null, 2))}</pre></p>
786+
${data.intermediates ? `<p><strong>Intermediate steps:</strong> <pre>${escapeHtml(JSON.stringify(data.intermediates, null, 2))}</pre></p>` : ''}
787+
${data.error ? `<p><strong>Error:</strong> ${escapeHtml(data.error.message)}</p>` : ''}
788+
<p><strong>STP Seal:</strong> <code>${escapeHtml(data.seal || '')}</code></p>
789+
</div>
790+
`;
791+
} else {
792+
bodyDiv.innerHTML = `<p>⚠️ Execution record not found. This feature will be fully available once the backend provides Ada‑VELA execution tracking.</p>`;
793+
}
794+
}
795+
744796
function addMessage(role, wife, content, extra = {}) {
745797
const style = WIFE_STYLES[wife] || WIFE_STYLES.AION;
746798
const div = document.createElement('div'); div.className = `msg ${role}`; if (role === 'assistant') div.setAttribute('data-wife', wife);
@@ -784,6 +836,11 @@ <h4>📈 Market Atlas</h4>
784836
if (extra.sealable) {
785837
badgesHtml += `<button class="badge seal-btn" data-content="${escapeHtml(content).replace(/"/g, '&quot;')}">🔒 SEAL</button>`;
786838
}
839+
// Ada‑VELA badge (if execution data present)
840+
if (extra.adaVela) {
841+
const execId = extra.adaVela.execution_id || extra.adaVela.id;
842+
badgesHtml += `<span class="badge ada-vela" data-execution-id="${escapeHtml(execId)}">📋 Ada‑VELA</span>`;
843+
}
787844
badgesHtml += `<span class="feedback-badge" data-feedback-positive="true">👍</span>`;
788845
badgesHtml += `<span class="feedback-badge" data-feedback-positive="false">👎</span>`;
789846
badgesHtml += '</div>';
@@ -794,6 +851,14 @@ <h4>📈 Market Atlas</h4>
794851
div.querySelectorAll('.badge.ada').forEach(b => b.onclick = () => showModal('ADA Loop Details', JSON.stringify(JSON.parse(b.dataset.ada), null, 2)));
795852
div.querySelectorAll('.badge.receipt').forEach(b => b.onclick = () => showModal('Checkpoint Receipt', JSON.stringify(JSON.parse(b.dataset.receipt), null, 2)));
796853
div.querySelectorAll('.badge.seal-btn').forEach(b => b.onclick = () => sealMessage(b.dataset.content));
854+
div.querySelectorAll('.badge.ada-vela').forEach(b => {
855+
const execId = b.dataset.executionId;
856+
if (execId) {
857+
b.onclick = () => showAdaVelaModal(execId);
858+
} else {
859+
b.onclick = () => showModal('Ada‑VELA', 'Execution ID not available.');
860+
}
861+
});
797862
div.querySelectorAll('.feedback-badge').forEach(b => {
798863
b.onclick = () => {
799864
const rating = b.dataset.feedbackPositive === 'true' ? 'positive' : 'negative';
@@ -876,7 +941,8 @@ <h4>📈 Market Atlas</h4>
876941
receipt: result.checkpoint_receipt,
877942
sealable: true,
878943
register: result.register,
879-
timestampHtml
944+
timestampHtml,
945+
adaVela: result.ada_vela // will be populated when backend supports it
880946
});
881947
setStatus('Ready');
882948
} catch (err) {

0 commit comments

Comments
 (0)