add real info for dashboard-last-check

This commit is contained in:
smanylov
2026-04-20 16:48:15 +07:00
parent 3a8a1f9c08
commit 045eef24c0
5 changed files with 85 additions and 12 deletions
+32
View File
@@ -87,4 +87,36 @@ export async function fetchMonitoringStats(): Promise<MonitoringStats | null> {
} catch (error) {
return null
}
}
export async function fetchLastMonitoringCheck() {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 30011,
message_body: {
token: token,
limit: 1
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (response.ok) {
const parsed = await response.json();
if (parsed?.message_body?.searches_by_status) {
return parsed.message_body;
}
}
} catch (error) {
return null
}
}