// API Types for TaskPool

export interface MonitorStats {
  env: {
    os: string
    arch: string
    go_version: string
    num_cpu: number
    goroutines: number
  }
  host: {
    cpu_percent: number
    mem_total: number
    mem_used: number
    mem_percent: number
    disk_total: number
    disk_used: number
    disk_percent: number
    uptime: number
    platform: string
  }
  scheduler: {
    scheduled: number
    running: number
    queue_size: number
    worker_count: number
  }
}

export interface Task {
  id: number
  name: string
  script: string
  cron: string
  status: string
  tags: string[]
  env_ids: number[]
  language: string
  created_at: string
  updated_at: string
  last_run?: string
  next_run?: string
}

export interface Script {
  id: number
  name: string
  filename: string
  content: string
  language: string
  created_at: string
  updated_at: string
}

export interface EnvVar {
  id: number
  key: string
  value: string
  tags: string[]
  remark: string
  created_at: string
  updated_at: string
}

export interface LogEntry {
  id: number
  task_id: number
  task_name: string
  status: string
  output: string
  started_at: string
  finished_at: string
  duration: number
}

export interface InterconnectNode {
  id: string
  name: string
  url: string
  token: string
  remark: string
  status: string
  created_at: string
  updated_at: string
  metrics?: {
    cpu_percent: number
    mem_percent: number
    disk_percent: number
  }
}

export interface Settings {
  site_name: string
  site_url: string
  theme: string
  language: string
}

export interface User {
  id: number
  username: string
  role: string
}