Mining/ui/src/app/profile-list.component.html

60 lines
2.1 KiB
HTML

<div class="profile-list">
<h5>Existing Profiles</h5>
@for(profile of state().profiles; track profile.id) {
<div class="profile-item">
@if(editingProfile && editingProfile.id === profile.id) {
<div class="profile-form">
<wa-input
label="Profile Name"
[value]="editingProfile.name"
(input)="onNameInput($event)">
</wa-input>
<wa-select
label="Miner Type"
[value]="editingProfile.minerType"
(change)="onMinerTypeChange($event)">
@for(miner of state().manageableMiners; track miner.name) {
<wa-option [value]="miner.name" [selected]="miner.name === editingProfile.minerType">
{{ miner.name }}
</wa-option>
}
</wa-select>
<wa-input
label="Pool Address"
[value]="editingProfile.config.pool"
(input)="onPoolInput($event)">
</wa-input>
<wa-input
label="Wallet Address"
[value]="editingProfile.config.wallet"
(input)="onWalletInput($event)">
</wa-input>
<div class="checkbox-group">
<wa-checkbox
[checked]="editingProfile.config.tls"
(change)="onTlsChange($event)">
TLS
</wa-checkbox>
<wa-checkbox
[checked]="editingProfile.config.hugePages"
(change)="onHugePagesChange($event)">
Huge Pages
</wa-checkbox>
</div>
<div class="button-group">
<wa-button (click)="updateProfile()">Save</wa-button>
<wa-button variant="neutral" (click)="cancelEdit()">Cancel</wa-button>
</div>
</div>
} @else {
<span>{{ profile.name }} ({{ profile.minerType }})</span>
<div class="button-group">
<wa-button size="small" (click)="editProfile(profile)">Edit</wa-button>
<wa-button size="small" variant="danger" (click)="deleteProfile(profile.id)">Delete</wa-button>
</div>
}
</div>
} @empty {
<p>No profiles created yet.</p>
}
</div>