/**
 * Types for CI/CD Dashboard
 */

export interface PipelineStatus {
  gitea_connected: boolean
  gitea_url: string
  last_sbom_update: string | null
  total_runs: number
  successful_runs: number
  failed_runs: number
}

export interface PipelineRun {
  id: string
  workflow: string
  branch: string
  commit_sha: string
  status: 'success' | 'failed' | 'running' | 'pending'
  started_at: string
  finished_at: string | null
  duration_seconds: number | null
}

export interface ContainerInfo {
  id: string
  name: string
  image: string
  status: string
  state: string
  created: string
  ports: string[]
  cpu_percent: number
  memory_usage: string
  memory_limit: string
  memory_percent: number
  network_rx: string
  network_tx: string
}

export interface SystemStats {
  hostname: string
  platform: string
  arch: string
  uptime: number
  cpu: {
    model: string
    cores: number
    usage_percent: number
  }
  memory: {
    total: string
    used: string
    free: string
    usage_percent: number
  }
  disk: {
    total: string
    used: string
    free: string
    usage_percent: number
  }
}

export interface DockerStats {
  containers: ContainerInfo[]
  total_containers: number
  running_containers: number
  stopped_containers: number
}

export type TabType = 'overview' | 'pipelines' | 'deployments' | 'setup' | 'scheduler'
