feat: клик по модели — лог всех проверок с ошибками
Build and deploy / build-deploy (push) Has been cancelled
Build and deploy / build-deploy (push) Has been cancelled
Кнопка 📋 Лог открывает /api/checks/{model_id} — все проверки модели
за период (по умолчанию 100 последних, limit через CHECKS_LIMIT) с
ok/latency_ms/checked_at/error. Заполняет history для перерисовки.
This commit is contained in:
@@ -363,6 +363,7 @@ function renderRow(m) {
|
||||
<td>${statusCell(m.last_ok)}</td>
|
||||
<td>${uptimeCell(m.uptime_pct, m.history)}</td>
|
||||
<td><button class="check-btn" onclick="checkOne('${m.id}', this)">▶ Тест</button></td>
|
||||
<td><button class="check-btn" onclick="openCheckHistory('${m.id}', this)">📋 Лог</button></td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
@@ -487,6 +488,16 @@ async function checkOne(modelId, btn) {
|
||||
}
|
||||
}
|
||||
|
||||
async function openCheckHistory(modelId, btn) {
|
||||
const res = await fetch(`/api/checks/${encodeURIComponent(modelId)}`);
|
||||
const data = await res.json();
|
||||
const idx = allData.findIndex(m => m.id === modelId);
|
||||
if (idx >= 0) {
|
||||
allData[idx].history = (data.checks || []).map(c => ({ ok: c.ok, latency_ms: c.latency_ms, at: c.checked_at, error: c.error }));
|
||||
}
|
||||
applyFilters();
|
||||
}
|
||||
|
||||
document.getElementById('btn-refresh').addEventListener('click', loadData);
|
||||
document.getElementById('btn-sync').addEventListener('click', async () => {
|
||||
const btn = document.getElementById('btn-sync');
|
||||
|
||||
Reference in New Issue
Block a user