1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/src/dashboard/templates/ledger.html

146 lines
5.0 KiB
HTML
Raw Normal View History

feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed This commit implements six major features: 1. Event Log System (src/swarm/event_log.py) - SQLite-based audit trail for all swarm events - Task lifecycle tracking (created, assigned, completed, failed) - Agent lifecycle tracking (joined, left, status changes) - Integrated with coordinator for automatic logging - Dashboard page at /swarm/events 2. Lightning Ledger (src/lightning/ledger.py) - Transaction tracking for Lightning Network payments - Balance calculations (incoming, outgoing, net, available) - Integrated with payment_handler for automatic logging - Dashboard page at /lightning/ledger 3. Semantic Memory / Vector Store (src/memory/vector_store.py) - Embedding-based similarity search for Echo agent - Fallback to keyword matching if sentence-transformers unavailable - Personal facts storage and retrieval - Dashboard page at /memory 4. Cascade Router Integration (src/timmy/cascade_adapter.py) - Automatic LLM failover between providers (Ollama → AirLLM → API) - Circuit breaker pattern for failing providers - Metrics tracking per provider (latency, error rates) - Dashboard status page at /router/status 5. Self-Upgrade Approval Queue (src/upgrades/) - State machine for self-modifications: proposed → approved/rejected → applied/failed - Human approval required before applying changes - Git integration for branch management - Dashboard queue at /self-modify/queue 6. Real-Time Activity Feed (src/events/broadcaster.py) - WebSocket-based live activity streaming - Bridges event_log to dashboard clients - Activity panel on /swarm/live Tests: - 101 unit tests passing - 4 new E2E test files for Selenium testing - Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed Documentation: - 6 ADRs (017-022) documenting architecture decisions - Implementation summary in docs/IMPLEMENTATION_SUMMARY.md - Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
{% extends "base.html" %}
{% block title %}Lightning Ledger - Timmy Time{% endblock %}
{% block content %}
<div class="mc-panel">
<div class="mc-panel-header">
<h1 class="page-title">Lightning Ledger</h1>
<p class="mc-text-secondary">Bitcoin Lightning Network transaction history</p>
</div>
<!-- Balance Cards -->
<div class="mc-stats-row balance-row">
<div class="mc-stat-card sats-balance">
<div class="mc-stat-label">Available Balance</div>
<div class="mc-stat-value">{{ balance.available_sats }} <small>sats</small></div>
</div>
<div class="mc-stat-card">
<div class="mc-stat-label">Total Received</div>
<div class="mc-stat-value">{{ balance.incoming_total_sats }} <small>sats</small></div>
</div>
<div class="mc-stat-card">
<div class="mc-stat-label">Total Sent</div>
<div class="mc-stat-value">{{ balance.outgoing_total_sats }} <small>sats</small></div>
</div>
<div class="mc-stat-card">
<div class="mc-stat-label">Fees Paid</div>
<div class="mc-stat-value">{{ balance.fees_paid_sats }} <small>sats</small></div>
</div>
<div class="mc-stat-card net-balance">
<div class="mc-stat-label">Net</div>
<div class="mc-stat-value {% if balance.net_sats >= 0 %}positive{% else %}negative{% endif %}">
{{ balance.net_sats }} <small>sats</small>
</div>
</div>
</div>
<!-- Pending Summary -->
{% if balance.pending_incoming_sats > 0 or balance.pending_outgoing_sats > 0 %}
<div class="mc-pending-row">
{% if balance.pending_incoming_sats > 0 %}
<span class="mc-pending-badge incoming">
Pending incoming: {{ balance.pending_incoming_sats }} sats
</span>
{% endif %}
{% if balance.pending_outgoing_sats > 0 %}
<span class="mc-pending-badge outgoing">
Pending outgoing: {{ balance.pending_outgoing_sats }} sats
</span>
{% endif %}
</div>
{% endif %}
<!-- Filters -->
<div class="mc-filters">
<form id="ledger-filter-form" class="mc-filter-form">
<select name="tx_type" class="mc-select" onchange="submitLedgerFilter()">
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed This commit implements six major features: 1. Event Log System (src/swarm/event_log.py) - SQLite-based audit trail for all swarm events - Task lifecycle tracking (created, assigned, completed, failed) - Agent lifecycle tracking (joined, left, status changes) - Integrated with coordinator for automatic logging - Dashboard page at /swarm/events 2. Lightning Ledger (src/lightning/ledger.py) - Transaction tracking for Lightning Network payments - Balance calculations (incoming, outgoing, net, available) - Integrated with payment_handler for automatic logging - Dashboard page at /lightning/ledger 3. Semantic Memory / Vector Store (src/memory/vector_store.py) - Embedding-based similarity search for Echo agent - Fallback to keyword matching if sentence-transformers unavailable - Personal facts storage and retrieval - Dashboard page at /memory 4. Cascade Router Integration (src/timmy/cascade_adapter.py) - Automatic LLM failover between providers (Ollama → AirLLM → API) - Circuit breaker pattern for failing providers - Metrics tracking per provider (latency, error rates) - Dashboard status page at /router/status 5. Self-Upgrade Approval Queue (src/upgrades/) - State machine for self-modifications: proposed → approved/rejected → applied/failed - Human approval required before applying changes - Git integration for branch management - Dashboard queue at /self-modify/queue 6. Real-Time Activity Feed (src/events/broadcaster.py) - WebSocket-based live activity streaming - Bridges event_log to dashboard clients - Activity panel on /swarm/live Tests: - 101 unit tests passing - 4 new E2E test files for Selenium testing - Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed Documentation: - 6 ADRs (017-022) documenting architecture decisions - Implementation summary in docs/IMPLEMENTATION_SUMMARY.md - Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
<option value="">All Types</option>
{% for t in tx_types %}
<option value="{{ t }}" {% if filter_type == t %}selected{% endif %}>{{ t }}</option>
{% endfor %}
</select>
<select name="status" class="mc-select" onchange="submitLedgerFilter()">
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed This commit implements six major features: 1. Event Log System (src/swarm/event_log.py) - SQLite-based audit trail for all swarm events - Task lifecycle tracking (created, assigned, completed, failed) - Agent lifecycle tracking (joined, left, status changes) - Integrated with coordinator for automatic logging - Dashboard page at /swarm/events 2. Lightning Ledger (src/lightning/ledger.py) - Transaction tracking for Lightning Network payments - Balance calculations (incoming, outgoing, net, available) - Integrated with payment_handler for automatic logging - Dashboard page at /lightning/ledger 3. Semantic Memory / Vector Store (src/memory/vector_store.py) - Embedding-based similarity search for Echo agent - Fallback to keyword matching if sentence-transformers unavailable - Personal facts storage and retrieval - Dashboard page at /memory 4. Cascade Router Integration (src/timmy/cascade_adapter.py) - Automatic LLM failover between providers (Ollama → AirLLM → API) - Circuit breaker pattern for failing providers - Metrics tracking per provider (latency, error rates) - Dashboard status page at /router/status 5. Self-Upgrade Approval Queue (src/upgrades/) - State machine for self-modifications: proposed → approved/rejected → applied/failed - Human approval required before applying changes - Git integration for branch management - Dashboard queue at /self-modify/queue 6. Real-Time Activity Feed (src/events/broadcaster.py) - WebSocket-based live activity streaming - Bridges event_log to dashboard clients - Activity panel on /swarm/live Tests: - 101 unit tests passing - 4 new E2E test files for Selenium testing - Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed Documentation: - 6 ADRs (017-022) documenting architecture decisions - Implementation summary in docs/IMPLEMENTATION_SUMMARY.md - Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
<option value="">All Statuses</option>
{% for s in tx_statuses %}
<option value="{{ s }}" {% if filter_status == s %}selected{% endif %}>{{ s }}</option>
{% endfor %}
</select>
</form>
</div>
<script>
function submitLedgerFilter() {
var form = document.getElementById('ledger-filter-form');
var params = new URLSearchParams();
var txType = form.querySelector('[name="tx_type"]').value;
var status = form.querySelector('[name="status"]').value;
if (txType) params.append('tx_type', txType);
if (status) params.append('status', status);
var qs = params.toString();
window.location.href = '/lightning/ledger' + (qs ? '?' + qs : '');
}
</script>
feat: complete Event Log, Ledger, Memory, Cascade Router, Upgrade Queue, Activity Feed This commit implements six major features: 1. Event Log System (src/swarm/event_log.py) - SQLite-based audit trail for all swarm events - Task lifecycle tracking (created, assigned, completed, failed) - Agent lifecycle tracking (joined, left, status changes) - Integrated with coordinator for automatic logging - Dashboard page at /swarm/events 2. Lightning Ledger (src/lightning/ledger.py) - Transaction tracking for Lightning Network payments - Balance calculations (incoming, outgoing, net, available) - Integrated with payment_handler for automatic logging - Dashboard page at /lightning/ledger 3. Semantic Memory / Vector Store (src/memory/vector_store.py) - Embedding-based similarity search for Echo agent - Fallback to keyword matching if sentence-transformers unavailable - Personal facts storage and retrieval - Dashboard page at /memory 4. Cascade Router Integration (src/timmy/cascade_adapter.py) - Automatic LLM failover between providers (Ollama → AirLLM → API) - Circuit breaker pattern for failing providers - Metrics tracking per provider (latency, error rates) - Dashboard status page at /router/status 5. Self-Upgrade Approval Queue (src/upgrades/) - State machine for self-modifications: proposed → approved/rejected → applied/failed - Human approval required before applying changes - Git integration for branch management - Dashboard queue at /self-modify/queue 6. Real-Time Activity Feed (src/events/broadcaster.py) - WebSocket-based live activity streaming - Bridges event_log to dashboard clients - Activity panel on /swarm/live Tests: - 101 unit tests passing - 4 new E2E test files for Selenium testing - Run with: SELENIUM_UI=1 pytest tests/functional/ -v --headed Documentation: - 6 ADRs (017-022) documenting architecture decisions - Implementation summary in docs/IMPLEMENTATION_SUMMARY.md - Architecture diagram in docs/architecture-v2.md
2026-02-26 08:01:01 -05:00
<!-- Transactions Table -->
<div class="mc-table-container">
{% if transactions %}
<table class="mc-table transactions-table">
<thead>
<tr>
<th>Time</th>
<th>Type</th>
<th>Status</th>
<th>Amount</th>
<th>Hash</th>
<th>Memo</th>
</tr>
</thead>
<tbody>
{% for tx in transactions %}
<tr class="transaction-row" data-type="{{ tx.tx_type.value }}" data-status="{{ tx.status.value }}">
<td>{{ tx.created_at[11:19] }}</td>
<td>
<span class="mc-badge mc-badge-{{ tx.tx_type.value }}">
{{ tx.tx_type.value }}
</span>
</td>
<td>
<span class="mc-status mc-status-{{ tx.status.value }}">
{{ tx.status.value }}
</span>
</td>
<td class="amount {% if tx.tx_type.value == 'incoming' %}positive{% else %}negative{% endif %}">
{% if tx.tx_type.value == 'incoming' %}+{% endif %}{{ tx.amount_sats }} sats
</td>
<td class="mono">{{ tx.payment_hash[:16] }}...</td>
<td>{{ tx.memo }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="mc-empty-state">
<p>No transactions yet.</p>
<p class="mc-text-secondary">Invoices and payments will appear here.</p>
</div>
{% endif %}
</div>
<!-- Weekly Stats -->
{% if stats %}
<div class="mc-stats-section">
<h3>Activity (Last 7 Days)</h3>
<div class="mc-mini-chart">
{% for date, day_stats in stats.items() %}
<div class="mc-chart-bar" title="{{ date }}">
<div class="bar incoming" style="height: {{ day_stats.incoming.count * 10 }}px"></div>
<div class="bar outgoing" style="height: {{ day_stats.outgoing.count * 10 }}px"></div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endblock %}