Compare commits

..

No commits in common. "a87e9d2db4b5392e3ee2209f2e8976d4c09d7af8" and "1e17771840a990885818a7d4e1480032a4ad5ea2" have entirely different histories.

2 changed files with 0 additions and 15 deletions

View File

@ -102,7 +102,6 @@ textarea { resize: vertical; min-height: 120px; }
<details class="panel" data-panel-key="gitea-events" open>
<summary><h2>Gitea event stream</h2></summary>
<div id="gitea-events" class="muted" aria-live="polite">Loading…</div>
<div id="gitea-events-status" class="small" aria-live="polite">Waiting for activity…</div>
</details>
<details class="panel" data-panel-key="widgets" open>
<summary><h2>Live Widgets</h2></summary>
@ -246,17 +245,11 @@ textarea { resize: vertical; min-height: 120px; }
).join('') : '<div class="muted">No recent Gitea activity.</div>';
}
function setEventStreamStatus(message) {
qs('#gitea-events-status').textContent = message;
}
async function loadEventStream() {
setEventStreamStatus('Updating…');
try {
const res = await fetch('/api/v1/events', { headers: { Accept: 'application/json' } });
if (!res.ok) throw new Error('HTTP ' + res.status);
paintEventStream(await res.json());
setEventStreamStatus('Updated ' + fmt(new Date()));
} catch (e) {
qs('#gitea-events').innerHTML = '<div class="muted">Event stream unavailable.</div>';
}

View File

@ -20,14 +20,6 @@ def test_dashboard_has_realtime_gitea_event_stream_widget():
assert "event.repo?.full_name" in html
def test_event_stream_reports_when_activity_was_refreshed():
html = DASHBOARD.read_text()
assert 'id="gitea-events-status"' in html
assert "setEventStreamStatus('Updating…')" in html
assert "setEventStreamStatus('Updated ' + fmt(new Date()))" in html
@pytest.mark.anyio
async def test_event_stream_returns_recent_authenticated_gitea_activity(monkeypatch):
expected = [{"type": "create", "actor": {"login": "timmy"}}]