import { Component, inject, computed, signal, effect, OnDestroy } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { MinerService } from '../../miner.service'; import { TerminalModalComponent } from '../../terminal-modal.component'; export interface WorkerStats { name: string; hashrate: number; shares: number; rejected: number; uptime: number; pool: string; algorithm: string; cpu?: string; threads?: number; } @Component({ selector: 'app-workers', standalone: true, imports: [CommonModule, FormsModule, TerminalModalComponent], template: `
| Worker | Hashrate | Shares | Efficiency | Uptime | Pool | Actions |
|---|---|---|---|---|---|---|
|
{{ worker.name }}
@if (worker.algorithm) {
{{ worker.algorithm }}
}
|
{{ formatHashrate(worker.hashrate) }} {{ getHashrateUnit(worker.hashrate) }} | @if (worker.rejected > 0) { } | = 99" [class.text-warning-500]="getEfficiency(worker) >= 95 && getEfficiency(worker) < 99" [class.text-danger-500]="getEfficiency(worker) < 95"> {{ getEfficiency(worker).toFixed(1) }}% | {{ formatUptime(worker.uptime) }} | {{ worker.pool }} |
Select a profile and start mining to see workers here.