import { apiRequest } from './api.js'

export function fetchSystemLogFiles() {
  return apiRequest('/system-logs/files')
}

export function fetchSystemLogTail(fileName, lines = 300) {
  return apiRequest(`/system-logs/files/${encodeURIComponent(fileName)}?lines=${encodeURIComponent(lines)}`)
}

export function fetchSystemLogEntries(limit = 300) {
  return apiRequest(`/system-logs/entries?limit=${encodeURIComponent(limit)}`)
}

export function fetchSystemLogEntry(entryId) {
  return apiRequest(`/system-logs/entries/${encodeURIComponent(entryId)}`)
}
