types.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. export interface CustomVariable {
  2. name: string
  3. value: string
  4. }
  5. export interface SshConfig {
  6. host: string
  7. port?: number
  8. username: string
  9. password: string
  10. }
  11. export type TerminalType = 'CMD' | 'POWERSHELL' | 'GIT_BASH' | 'SSH'
  12. export type RunStatus = 'STOPPED' | 'RUNNING' | 'STARTING' | 'STOPPING' | 'ERROR'
  13. export interface ServiceConfig {
  14. id?: string
  15. name: string
  16. description?: string
  17. startupCommand: string
  18. workDir?: string
  19. terminalType: TerminalType
  20. sshConfig?: SshConfig
  21. variables?: CustomVariable[]
  22. webUrl?: string
  23. logEncoding?: string
  24. createdAt?: string
  25. updatedAt?: string
  26. status?: RunStatus
  27. pid?: number | null
  28. statusMessage?: string | null
  29. lastStartedAt?: string | null
  30. lastStoppedAt?: string | null
  31. }
  32. /** 占用端口的进程信息 */
  33. export interface OccupiedProcess {
  34. pid: number
  35. processName: string
  36. commandLine: string
  37. }
  38. /** 端口检查结果 */
  39. export interface PortCheckResult {
  40. variableName: string
  41. port: number
  42. occupied: boolean
  43. processes: OccupiedProcess[]
  44. }
  45. /** 杀死进程结果 */
  46. export interface KillResult {
  47. success: boolean
  48. message: string
  49. }