import { api } from './client'

export async function fetchServerInfo() {
  const { data } = await api.get('/server/info')
  return data
}

export async function fetchDockerStats() {
  const { data } = await api.get('/docker_stats')
  return data
}

export async function fetchTaskStats() {
  const { data } = await api.get('/task/stats')
  return data
}

export async function fetchRunningTasks() {
  const { data } = await api.get('/task/running')
  return data
}

export async function fetchTaskLogs(params) {
  const { data } = await api.get('/task/logs', { params })
  return data
}

export async function clearOldTaskLogs(days) {
  const { data } = await api.post('/task/logs/clear', { days })
  return data
}

