Reorganize settings in separate tabs.

This commit is contained in:
Roger Far 2021-07-18 14:38:49 -06:00
parent 3e832cc416
commit 4daa5ba4dc
3 changed files with 232 additions and 191 deletions

View file

@ -6,6 +6,24 @@
<button class="delete" aria-label="close" (click)="cancel()"></button> <button class="delete" aria-label="close" (click)="cancel()"></button>
</header> </header>
<section class="modal-card-body"> <section class="modal-card-body">
<div class="tabs">
<ul>
<li [ngClass]="{ 'is-active': activeTab === 0 }" (click)="activeTab = 0">
<a>General</a>
</li>
<li [ngClass]="{ 'is-active': activeTab === 1 }" (click)="activeTab = 1">
<a>Download Client</a>
</li>
<li [ngClass]="{ 'is-active': activeTab === 2 }" (click)="activeTab = 2">
<a>Radarr/Sonarr</a>
</li>
<li [ngClass]="{ 'is-active': activeTab === 3 }" (click)="activeTab = 3">
<a>Tests</a>
</li>
</ul>
</div>
<div *ngIf="activeTab === 0">
<div class="field"> <div class="field">
<label class="label">Real-Debrid API Key</label> <label class="label">Real-Debrid API Key</label>
<div class="control"> <div class="control">
@ -13,7 +31,8 @@
</div> </div>
<p class="help"> <p class="help">
You can find your API key here: You can find your API key here:
<a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener">https://real-debrid.com/apitoken</a <a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener"
>https://real-debrid.com/apitoken</a
>. >.
</p> </p>
</div> </div>
@ -32,7 +51,6 @@
</div> </div>
<p class="help">Recommended level is Warning, set to Debug to get the most info.</p> <p class="help">Recommended level is Warning, set to Debug to get the most info.</p>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Download path</label> <label class="label">Download path</label>
<div class="control"> <div class="control">
@ -40,7 +58,6 @@
</div> </div>
<p class="help">Path in the docker container to download files to (i.e. /data/downloads).</p> <p class="help">Path in the docker container to download files to (i.e. /data/downloads).</p>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Mapped path</label> <label class="label">Mapped path</label>
<div class="control"> <div class="control">
@ -52,6 +69,16 @@
</p> </p>
</div> </div>
<div class="field">
<label class="label">Maximum unpack processes</label>
<div class="control">
<input class="input" type="number" max="100" min="1" [(ngModel)]="settingUnpackLimit" />
</div>
<p class="help">Maximum amount of downloads that get unpacked on your host at the same time.</p>
</div>
</div>
<div *ngIf="activeTab === 1">
<div class="field"> <div class="field">
<label class="label">Download client</label> <label class="label">Download client</label>
<div class="control select is-fullwidth"> <div class="control select is-fullwidth">
@ -72,8 +99,8 @@
<input class="input" type="text" maxlength="1000" [(ngModel)]="settingTempPath" /> <input class="input" type="text" maxlength="1000" [(ngModel)]="settingTempPath" />
</div> </div>
<p class="help"> <p class="help">
Path in the docker container to temporarily download to (i.e. /data/temp). Make sure the docker container has Path in the docker container to temporarily download to (i.e. /data/temp). Make sure the docker container
enough disk space if using a path inside the container. has enough disk space if using a path inside the container.
</p> </p>
</div> </div>
@ -95,7 +122,6 @@
parallel downloading will be done. parallel downloading will be done.
</p> </p>
</div> </div>
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'"> <div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
<label class="label">Download speed (in MB/s)</label> <label class="label">Download speed (in MB/s)</label>
<div class="control"> <div class="control">
@ -103,7 +129,6 @@
</div> </div>
<p class="help">Maximum download speed in Megabytes per second. When set to 0 unlimited speed is used.</p> <p class="help">Maximum download speed in Megabytes per second. When set to 0 unlimited speed is used.</p>
</div> </div>
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'"> <div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
<label class="label">Proxy Server</label> <label class="label">Proxy Server</label>
<div class="control"> <div class="control">
@ -111,16 +136,14 @@
</div> </div>
<p class="help">Address of a proxy server.</p> <p class="help">Address of a proxy server.</p>
</div> </div>
<div class="field">
<label class="label">Maximum unpack processes</label>
<div class="control">
<input class="input" type="number" max="100" min="1" [(ngModel)]="settingUnpackLimit" />
</div>
<p class="help">Maximum amount of downloads that get unpacked on your host at the same time.</p>
</div> </div>
<div *ngIf="activeTab === 2">
<div class="field"> <div class="field">
<h3 class="subtitle">
The following settings only apply when a torrent gets added through the qbittorrent API, usually Radarr or
Sonarr.
</h3>
<label class="label">Minimum file size to download</label> <label class="label">Minimum file size to download</label>
<div class="control"> <div class="control">
<div class="field has-addons" style="margin-bottom: 0"> <div class="field has-addons" style="margin-bottom: 0">
@ -131,7 +154,11 @@
<a class="button is-static">MB</a> <a class="button is-static">MB</a>
</div> </div>
</div> </div>
<div class="help">When selecting files in the torrent, skip files smaller than this setting.</div> <div class="help">
Files that are smaller than this setting are skipped and not downloaded. When set to 0 all files are
downloaded. When downloading from Radarr or Sonarr it's recommended to keep this setting at atleast a few
MB to avoid RealDebrid having to re-download the torrent.
</div>
</div> </div>
</div> </div>
@ -147,7 +174,9 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div *ngIf="activeTab === 3">
<div class="field"> <div class="field">
<label class="label">Test download path permissions</label> <label class="label">Test download path permissions</label>
<div class="control"> <div class="control">
@ -192,7 +221,8 @@
</div> </div>
</div> </div>
<div class="help"> <div class="help">
This will download a 10GB test file from RealDebrid. Hit cancel when you have seen enough. This will attempt to download a 10GB file from Real Debrid. When 50MB has been downloaded the test will
stop.
</div> </div>
</div> </div>
@ -217,7 +247,10 @@
Write speed {{ testWriteSpeedSuccess | filesize }}/s Write speed {{ testWriteSpeedSuccess | filesize }}/s
</div> </div>
</div> </div>
<div class="help">This will write a small file to your download folder to see how fast it can write to it.</div> <div class="help">
This will write a small file to your download folder to see how fast it can write to it.
</div>
</div>
</div> </div>
<div class="notification is-danger is-light" *ngIf="error?.length > 0">Error saving settings: {{ error }}</div> <div class="notification is-danger is-light" *ngIf="error?.length > 0">Error saving settings: {{ error }}</div>

View file

@ -21,6 +21,8 @@ export class SettingsComponent implements OnInit {
@Output() @Output()
public openChange = new EventEmitter<boolean>(); public openChange = new EventEmitter<boolean>();
public activeTab = 0;
public isActive = false; public isActive = false;
public saving = false; public saving = false;

View file

@ -20,6 +20,12 @@ namespace RdtClient.Data.Models.Data
public DateTimeOffset Added { get; set; } public DateTimeOffset Added { get; set; }
public DateTimeOffset? Completed { get; set; } public DateTimeOffset? Completed { get; set; }
public Boolean DownloadOnlyAvailableFiles { get; set; }
public String DownloadFiles { get; set; }
public Int32 MinimumFileSize { get; set; }
public Boolean AutoDelete { get; set; } public Boolean AutoDelete { get; set; }
public String FileOrMagnet { get; set; } public String FileOrMagnet { get; set; }