import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, ElementRef, ViewChild } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { MinerService } from './miner.service'; import { interval, Subscription } from 'rxjs'; import { switchMap, catchError } from 'rxjs/operators'; import { of } from 'rxjs'; @Component({ selector: 'app-terminal-modal', standalone: true, imports: [CommonModule, FormsModule], template: `
`, styles: [` .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; } .modal-content { background: #1e1e1e; border-radius: 8px; width: 90%; max-width: 900px; height: 70vh; display: flex; flex-direction: column; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); } .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #333; } .modal-header h3 { margin: 0; color: #fff; font-size: 14px; font-weight: 500; } .close-btn { background: none; border: none; color: #888; font-size: 24px; cursor: pointer; padding: 0; line-height: 1; } .close-btn:hover { color: #fff; } .terminal { flex: 1; overflow-y: auto; padding: 12px; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 12px; line-height: 1.5; background: #0d0d0d; color: #00ff00; } .terminal-line { white-space: pre-wrap; word-break: break-all; } .modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border-top: 1px solid #333; color: #888; font-size: 12px; } .auto-scroll-label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #888; } .auto-scroll-label input { cursor: pointer; } `] }) export class TerminalModalComponent implements OnInit, OnDestroy { @Input() minerName: string = ''; @Output() close = new EventEmitter