rdt-client/client/src/app/navbar/add-new-torrent/add-new-torrent.component.html

77 lines
2.7 KiB
HTML

<div class="modal" [class.is-active]="isActive">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Add New Torrent</p>
<button class="delete" aria-label="close" (click)="cancel()"></button>
</header>
<section class="modal-card-body">
<div class="field">
<label class="label">Magnet Link</label>
<div class="control">
<textarea
class="textarea"
placeholder="Paste your magnet link here"
[(ngModel)]="magnetLink"
[disabled]="saving"
></textarea>
</div>
</div>
<hr />
<div class="field">
<label class="label">Torrent file</label>
<div class="file has-name">
<label class="file-label">
<input class="file-input" type="file" name="resume" (change)="pickFile($event)" [disabled]="saving" />
<span class="file-cta">
<span class="file-icon">
<i class="fas fa-upload"></i>
</span>
<span class="file-label"> Pick a torrent file... </span>
</span>
<span class="file-name">
{{ fileName }}
</span>
</label>
</div>
</div>
<hr />
<div class="field">
<label class="checkbox">
<input type="checkbox" [(ngModel)]="autoDelete" />
Remove torrent when finished downloading on host
</label>
</div>
<div class="notification is-danger is-light" *ngIf="error">Cannot add torrent: {{ error | json }}</div>
</section>
<footer class="modal-card-foot">
<button class="button is-success" [disabled]="saving" [ngClass]="{ 'is-loading': saving }" (click)="ok()">
<span>Add Torrent</span>
</button>
<button class="button is-info" [disabled]="saving" [ngClass]="{ 'is-loading': saving }" (click)="checkFiles()">
<span>Check available files</span>
</button>
<button class="button" (click)="cancel()" [disabled]="saving">Cancel</button>
</footer>
</div>
</div>
<div class="modal" [class.is-active]="isFileModalActive">
<div class="modal-background"></div>
<div class="modal-card file-modal">
<header class="modal-card-head">
<p class="modal-card-title">Available Files</p>
<button class="delete" aria-label="close" (click)="isFileModalActive = false"></button>
</header>
<section class="modal-card-body">
<table class="table" style="width: 100%">
<tbody>
<tr *ngFor="let file of fileList">
<td>{{ file }}</td>
</tr>
</tbody>
</table>
</section>
<footer class="modal-card-foot"></footer>
</div>
</div>