export type LogLevel = 'info' | 'warn' | 'error';

export interface LogEntry {
  timestamp: string;
  level: LogLevel;
  message: string;
}

export interface TestLink {
  url: string;
  name: string;
}

export interface Machine {
  id: string;
  name: string;
  status: 'running' | 'stopped' | 'error' | 'unknown' | 'checking';
  os: string;
  ip: string;  // ✅ Исправлено: было ipAddress, стало ip (соответствует реальным данным)
  cpu: string;
  memory: number;
  storage: number;
  testLinks?: TestLink[];
  logs?: LogEntry[];
  guacamole?: {
    connection?: GuacamoleConnection;
    lastConnectionTime?: string;
    autoReconnect?: boolean;
  };
}

export interface GuacamoleAuthToken {
  authToken: string;
}

export interface GuacamoleConnection {
  connectionId: string;
  name: string;
  protocol: string;
  parameters: Record<string, string>;
}

export interface GuacamoleError {
  statusCode: number;
  message: string;
  type: 'INVALID_CREDENTIALS' | 'PERMISSION_DENIED' | 'NOT_FOUND' | 'UNKNOWN';
}

export interface GuacamoleConnectionResponse {
  success: boolean;
  connection?: GuacamoleConnection;
  error?: GuacamoleError;
} 