diff --git a/README.md b/README.md
index 4e99ad52..99dbcd32 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,9 @@ A material-themed interface to the original [qBittorrent Web UI](https://github.
## Demo!
A live demo is available here: https://qbit-material-webui-demo.herokuapp.com/.
-## Installation -- Replacing your existing qBittorrent Web UI
+-----
+
+## Installation
This app is tested with **v4.1.5** and higher of qBittorrent, any lower version are not guaranteed to work.
1. Take a production-ready build from [releases](https://github.com/bill-ahmed/qbit-material-WebUI/releases), or [build it yourself](#build)
diff --git a/mock_backend/sample_data.js b/mock_backend/sample_data.js
index b2cb0203..1c2fe336 100644
--- a/mock_backend/sample_data.js
+++ b/mock_backend/sample_data.js
@@ -38,10 +38,10 @@ function GetMainData(){
"alltime_ul": 169885275053,
"average_time_queue": 3787,
"connection_status": "connected",
- "dht_nodes": 393,
+ "dht_nodes": GetRandomInt(0, 400),
"dl_info_data": GetRandomInt(MIN_FILE_SIZE, MAX_FILE_SIZE),
"dl_info_speed": GetRandomInt(MIN_SPEED, MAX_SPEED),
- "dl_rate_limit": 0,
+ "dl_rate_limit": GetRandomInt(MIN_SPEED, 10000),
"free_space_on_disk": GetRandomInt(MIN_FILE_SIZE, MAX_FILE_SIZE * 100),
"global_ratio": "1.25",
"queued_io_jobs": 0,
@@ -55,8 +55,8 @@ function GetMainData(){
"total_wasted_session": 0,
"up_info_data": GetRandomInt(MIN_FILE_SIZE, MAX_FILE_SIZE),
"up_info_speed": GetRandomInt(MIN_SPEED, MAX_SPEED),
- "up_rate_limit": 0,
- "use_alt_speed_limits": false,
+ "up_rate_limit": GetRandomInt(MIN_SPEED, 10000),
+ "use_alt_speed_limits": GetRandomInt(1, 4) % 2 === 0,
"write_cache_overload": "0"
},
"torrents_removed": ["0daea5cece5"],
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index ad20ed30..4f44a718 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -31,7 +31,7 @@ import { DeleteTorrentDialogComponent } from './modals/delete-torrent-dialog/del
import { MatCheckboxModule } from '@angular/material/checkbox';
import { SearchTorrentsComponent } from './home/search-torrents/search-torrents.component';
import { MatCardModule } from '@angular/material/card';
-import { GlobalTransferInfoComponent } from './torrents-table/global-transfer-info/global-transfer-info.component';
+import { GlobalTransferInfoComponent } from './global-transfer-info/global-transfer-info.component';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatDividerModule } from '@angular/material/divider';
import { MatTabsModule } from '@angular/material/tabs';
@@ -64,6 +64,7 @@ import { WarnSnackbarComponent } from './services/notifications/snackbar/warn-sn
import { ErrorSnackbarComponent } from './services/notifications/snackbar/error-snackbar/error-snackbar.component';
import { InfoSnackbarComponent } from './services/notifications/snackbar/info-snackbar/info-snackbar.component';
import { DragAndDropFilesDirective } from './drag-and-drop-files.directive';
+import { RateLimitsDialogComponent } from './modals/rate-limits-dialog/rate-limits-dialog.component';
var appRoutes: Routes;
@@ -104,7 +105,8 @@ if(!environment.production){
WarnSnackbarComponent,
ErrorSnackbarComponent,
InfoSnackbarComponent,
- DragAndDropFilesDirective
+ DragAndDropFilesDirective,
+ RateLimitsDialogComponent
],
imports: [
CdkTableModule,
diff --git a/src/app/global-transfer-info/global-transfer-info.component.html b/src/app/global-transfer-info/global-transfer-info.component.html
new file mode 100644
index 00000000..d4c8a730
--- /dev/null
+++ b/src/app/global-transfer-info/global-transfer-info.component.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+ refresh
+ Refresh Interval: {{refreshInterval / 1000}}s
+
+
+
+ storage
+ Free space: {{getFreeSpaceOnDisk()}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ arrow_downward
+ {{getDownloadSpeedString()}} {{getDownLimitString()}}
+
+
+
+ vertical_align_bottom
+ Downloaded: {{getDownloadedString()}}
+
+
+
+
+ arrow_upward
+ {{getUploadSpeedString()}} {{getUpLimitString()}}
+
+
+
+ vertical_align_top
+ Uploaded: {{getUploadedString()}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/global-transfer-info/global-transfer-info.component.scss b/src/app/global-transfer-info/global-transfer-info.component.scss
new file mode 100644
index 00000000..327b00fb
--- /dev/null
+++ b/src/app/global-transfer-info/global-transfer-info.component.scss
@@ -0,0 +1,69 @@
+.global-transfer-info-container {
+ height: 100%;
+ padding-top: 56px;
+
+ .data-container {
+ height: 100%;
+
+ display: flex;
+ flex-direction: column;
+
+ section h2 {
+ font-weight: 400;
+ }
+
+ #disk_summary, #global_transfer {
+ display: flex;
+ flex-direction: column;
+
+ width: 100%;
+ }
+
+ #global_transfer {
+ flex-grow: 1;
+ }
+
+ #bottom_actions {
+ width: 100%;
+
+ #useAltLimits > label > span {
+ display: flex;
+ align-items: center;
+ }
+ }
+ }
+}
+
+.row {
+ display: flex;
+ flex-direction: row;
+
+ margin: 5px 0;
+}
+
+h3 {
+ font-size: 11pt;
+ margin: 0;
+}
+
+#summaryContent h4 {
+ font-size: 10pt;
+ margin: 0 5px 0 5px;
+}
+
+mat-chip {
+ border-radius: 0;
+ width: 100%;
+ cursor: pointer;
+}
+
+/** For small screens */
+@media only screen and (max-width: 1550px) {
+ .global-transfer-info-container {
+ padding-top: 0;
+
+ .hide-small {
+ display: none;
+ }
+ }
+}
diff --git a/src/app/global-transfer-info/global-transfer-info.component.ts b/src/app/global-transfer-info/global-transfer-info.component.ts
new file mode 100644
index 00000000..ce848e46
--- /dev/null
+++ b/src/app/global-transfer-info/global-transfer-info.component.ts
@@ -0,0 +1,112 @@
+import { Component, OnInit } from '@angular/core';
+import { MatDialogRef, MatDialog } from '@angular/material/dialog';
+import { TorrentDataStoreService } from 'src/app/services/torrent-management/torrent-data-store.service';
+import { GlobalTransferInfo, MainData } from 'src/utils/Interfaces';
+import { UnitsHelperService } from 'src/app/services/units-helper.service';
+import { ThemeService } from 'src/app/services/theme.service';
+import { Observable } from 'rxjs';
+import { NetworkConnectionInformationService } from 'src/app/services/network/network-connection-information.service';
+import { RateLimitsDialogComponent } from '../modals/rate-limits-dialog/rate-limits-dialog.component';
+
+@Component({
+ selector: 'app-global-transfer-info',
+ templateUrl: './global-transfer-info.component.html',
+ styleUrls: ['./global-transfer-info.component.scss']
+})
+export class GlobalTransferInfoComponent implements OnInit {
+
+ public data: GlobalTransferInfo = null;
+ public isAltSpeedEnabled: boolean;
+
+ public refreshInterval = -1;
+
+ public isDarkTheme: Observable;
+
+ private rateLimitDiaglogRef: MatDialogRef;
+
+ constructor(private data_store: TorrentDataStoreService, private networkInfo: NetworkConnectionInformationService, private units_helper:
+ UnitsHelperService, private rateLimitDialog: MatDialog, private theme: ThemeService) { }
+
+ ngOnInit(): void {
+ this.isDarkTheme = this.theme.getThemeSubscription();
+ // Subscribe to any changes with data store
+ this.data_store.GetTorrentDataSubscription().subscribe((res: MainData) => {
+ if(res) {
+ this.handleDataChange(res.server_state);
+ }
+ });
+
+ // Store refresh interval & subscribe to any changes
+ this.refreshInterval = this.networkInfo.getRefreshInterval();
+ this.networkInfo.get_network_change_subscription()
+ .subscribe(newInterval => {
+ this.refreshInterval = this.networkInfo.getRefreshInterval();
+ })
+ }
+
+ handleDataChange(newData: GlobalTransferInfo): void {
+ this.data = newData;
+ this.isAltSpeedEnabled = this.data.use_alt_speed_limits;
+ }
+
+ handleDownloadLimitSelect() {
+ this.rateLimitDiaglogRef = this.rateLimitDialog.open(RateLimitsDialogComponent, {
+ autoFocus: false,
+ data: {
+ for: 'Download',
+ currentLimit: this.data.dl_rate_limit
+ },
+ panelClass: "generic-dialog"
+ });
+ }
+
+ handleUploadLimitSelect() {
+ this.rateLimitDiaglogRef = this.rateLimitDialog.open(RateLimitsDialogComponent, {
+ autoFocus: false,
+ data: {
+ for: 'Upload',
+ currentLimit: this.data.dl_rate_limit
+ },
+ panelClass: "generic-dialog"
+ });
+ }
+
+ async toggleAltSpeedLimits() {
+ console.log('toggled alt limits')
+ this.isAltSpeedEnabled = !this.isAltSpeedEnabled
+ await this.data_store.ToggleAltSpeedLimits();
+ }
+
+ getDownloadSpeedString() {
+ return `${this.units_helper.GetFileSizeString(this.data.dl_info_speed)}/s`;
+ }
+
+ getDownloadedString() {
+ return `${this.units_helper.GetFileSizeString(this.data.dl_info_data)}`;
+ }
+
+ getUploadSpeedString() {
+ return `${this.units_helper.GetFileSizeString(this.data.up_info_speed)}/s`;
+ }
+
+ getUploadedString() {
+ return `${this.units_helper.GetFileSizeString(this.data.up_info_data)}`;
+ }
+
+ getDownLimitString() {
+ return (this.isAltSpeedEnabled || this.data.dl_rate_limit > 0) ? `[${this.units_helper.GetFileSizeString(this.data.dl_rate_limit)}/s]` : '';
+ }
+
+ getUpLimitString() {
+ return (this.isAltSpeedEnabled || this.data.up_rate_limit > 0) ? `[${this.units_helper.GetFileSizeString(this.data.up_rate_limit)}/s]` : '';
+ }
+
+ getFreeSpaceOnDisk() {
+ return `${this.units_helper.GetFileSizeString(this.data.free_space_on_disk)}`;
+ }
+
+ isLoading(): boolean {
+ return !this.data;
+ }
+
+}
diff --git a/src/app/home/home.component.css b/src/app/home/home.component.css
index 971f579c..b9c224dd 100644
--- a/src/app/home/home.component.css
+++ b/src/app/home/home.component.css
@@ -84,11 +84,37 @@ app-search-torrents:focus-within {
min-height: 100%;
width: 100%;
- flex-grow: 1;
- flex-direction: column;
+ flex-direction: row;
+ justify-content: space-evenly;
+
+ padding-left: 2px;
+ padding-right: 2px;
+}
+
+.content app-torrents-table {
+ width: 83%;
+}
+
+.content app-global-transfer-info {
+ width: 15%;
+ margin-top: 30px;
+}
+
+/** For small screens */
+@media only screen and (max-width: 1550px) {
+ .content {
+ flex-direction: column;
+ padding: 0 5%;
+ }
- padding-left: 8%;
- padding-right: 8%;
+ .content app-torrents-table {
+ width: 100%;
+ }
+
+ .content app-global-transfer-info {
+ width: 100%;
+ margin-top: 10px;
+ }
}
/** For phone screens */
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index feb464ca..ca82e9e1 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -4,12 +4,11 @@
diff --git a/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.css b/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.css
new file mode 100644
index 00000000..e69de29b
diff --git a/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.html b/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.html
new file mode 100644
index 00000000..1b47895c
--- /dev/null
+++ b/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.html
@@ -0,0 +1,23 @@
+
+
+
Global {{inputData.for}} Limit
+
+
+
+
New Limit:
+
+
+ (0 or -1 implies ∞)
+
+
KiB/s
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.ts b/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.ts
new file mode 100644
index 00000000..4d906d43
--- /dev/null
+++ b/src/app/modals/rate-limits-dialog/rate-limits-dialog.component.ts
@@ -0,0 +1,53 @@
+import { Component, Inject, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
+import { ThemeService } from '../../services/theme.service';
+import { Observable } from 'rxjs';
+import { TorrentDataStoreService } from 'src/app/services/torrent-management/torrent-data-store.service';
+import { SnackbarService } from 'src/app/services/notifications/snackbar.service';
+import { UnitsHelperService } from 'src/app/services/units-helper.service';
+
+@Component({
+ selector: 'app-rate-limits-dialog',
+ templateUrl: './rate-limits-dialog.component.html',
+ styleUrls: ['./rate-limits-dialog.component.css']
+})
+export class RateLimitsDialogComponent implements OnInit {
+ public newLimit: number;
+
+ public isDarkTheme: Observable;
+ public isLoading = false;
+
+ public inputData: any; // Data passed in to this component
+
+ constructor(private data_store: TorrentDataStoreService, private snackbar: SnackbarService, private units: UnitsHelperService,
+ private dialogRef: MatDialogRef, private theme: ThemeService, @Inject(MAT_DIALOG_DATA) inputData)
+ {
+ this.inputData = inputData
+ }
+
+ ngOnInit(): void {
+ this.isDarkTheme = this.theme.getThemeSubscription();
+ this.newLimit = this.inputData.currentLimit / 1024 // Want KB!
+ }
+
+ async updateLimit() {
+ this.isLoading = true;
+
+ switch (this.inputData.for) {
+ case 'Download':
+ await this.data_store.SetGlobalDownloadLimit(this.units.Kibibits_to_bits(this.newLimit));
+ break;
+
+ case 'Upload':
+ await this.data_store.SetGlobalUploadLimit(this.units.Kibibits_to_bits(this.newLimit));
+ break;
+
+ default:
+ this.snackbar.enqueueSnackBar(`Unknown limit update type ${this.inputData.for}!`, { type: 'error' });
+ break;
+ }
+
+ this.dialogRef.close();
+ }
+
+}
diff --git a/src/app/modals/settings/speed-settings/speed-settings.component.ts b/src/app/modals/settings/speed-settings/speed-settings.component.ts
index a2fcda1d..60eee352 100644
--- a/src/app/modals/settings/speed-settings/speed-settings.component.ts
+++ b/src/app/modals/settings/speed-settings/speed-settings.component.ts
@@ -59,11 +59,11 @@ export class SpeedSettingsComponent implements OnInit {
let { up_limit, dl_limit, alt_dl_limit, alt_up_limit, scheduler_enabled, schedule_from_hour, schedule_from_min, schedule_to_hour, schedule_to_min, scheduler_days } = pref;
this.speed_settings = {
- up_limit,
- dl_limit,
+ up_limit: up_limit / 1024,
+ dl_limit: dl_limit / 1024,
- alt_dl_limit,
- alt_up_limit,
+ alt_dl_limit: alt_dl_limit / 1024,
+ alt_up_limit: alt_up_limit / 1024,
scheduler_enabled,
schedule_from_hour,
@@ -93,6 +93,9 @@ export class SpeedSettingsComponent implements OnInit {
up_limit: this.units.Kibibits_to_bits(this.speed_settings.up_limit),
dl_limit: this.units.Kibibits_to_bits(this.speed_settings.dl_limit),
+ alt_up_limit: this.units.Kibibits_to_bits(this.speed_settings.alt_up_limit),
+ alt_dl_limit: this.units.Kibibits_to_bits(this.speed_settings.alt_dl_limit),
+
scheduler_days: this.scheduler_days_ordering.indexOf(this.scheduler_day_chosen)
};
}
diff --git a/src/app/services/torrent-management/torrent-data-http.service.ts b/src/app/services/torrent-management/torrent-data-http.service.ts
index 9fdb0b13..edfad7f9 100644
--- a/src/app/services/torrent-management/torrent-data-http.service.ts
+++ b/src/app/services/torrent-management/torrent-data-http.service.ts
@@ -214,6 +214,45 @@ export class TorrentDataHTTPService {
return this.sendTorrentHashesPOST(url, [hash], null, body);
}
+ async ToggleAltSpeedLimits(): Promise {
+ let root = this.http_endpoints.root;
+ let endpoint = this.http_endpoints.toggleSpeedLimitsMode;
+ let url = root + endpoint;
+
+ // Do not send cookies in dev mode
+ let options = IsDevEnv() ? { } : { withCredentials: true }
+
+ await this.http.post(url, null, options).toPromise();
+ }
+
+ async SetDownloadLimit(limit: number) {
+ let root = this.http_endpoints.root;
+ let endpoint = this.http_endpoints.setDownloadLimit;
+ let url = root + endpoint;
+
+ let body = new FormData();
+ body.append("limit", limit.toString());
+
+ // Do not send cookies in dev mode
+ let options = IsDevEnv() ? { } : { withCredentials: true }
+
+ return this.http.post(url, body, options).toPromise();
+ }
+
+ async SetUploadLimit(limit: number) {
+ let root = this.http_endpoints.root;
+ let endpoint = this.http_endpoints.setUploadLimit;
+ let url = root + endpoint;
+
+ let body = new FormData();
+ body.append("limit", limit.toString());
+
+ // Do not send cookies in dev mode
+ let options = IsDevEnv() ? { } : { withCredentials: true }
+
+ return this.http.post(url, body, options).toPromise();
+ }
+
/** Send a list of torrent hashes joined by "|" to a given endpoint
* This functionality is used across many common actions
* @param endpoint The endpoint to send a POST request to
diff --git a/src/app/services/torrent-management/torrent-data-store.service.ts b/src/app/services/torrent-management/torrent-data-store.service.ts
index 82f52fd4..cc161e51 100644
--- a/src/app/services/torrent-management/torrent-data-store.service.ts
+++ b/src/app/services/torrent-management/torrent-data-store.service.ts
@@ -146,6 +146,18 @@ export class TorrentDataStoreService {
return this.torrent_http_service.GetTorrentContents(tor.hash);
}
+ public async ToggleAltSpeedLimits() {
+ await this.torrent_http_service.ToggleAltSpeedLimits();
+ }
+
+ public async SetGlobalUploadLimit(limit: number) {
+ await this.torrent_http_service.SetUploadLimit(limit);
+ }
+
+ public async SetGlobalDownloadLimit(limit: number) {
+ await this.torrent_http_service.SetDownloadLimit(limit);
+ }
+
/** Update observable with new data */
private _updateDataSource(source: MainData): void {
this._torrentMainDataSource.next(source);
diff --git a/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.html b/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.html
index 3428f4f8..b6178b41 100644
--- a/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.html
+++ b/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.html
@@ -56,10 +56,4 @@
-
-
-
- Refresh Interval: {{refreshInterval / 1000}}s
-
-
diff --git a/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.ts b/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.ts
index 18b9983a..1f757251 100644
--- a/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.ts
+++ b/src/app/torrents-table/bulk-update-torrents/bulk-update-torrents.component.ts
@@ -1,5 +1,4 @@
import { Component, OnInit, Inject, Output, EventEmitter } from '@angular/core';
-import { NetworkConnectionInformationService } from 'src/app/services/network/network-connection-information.service';
import { RowSelectionService } from 'src/app/services/torrent-management/row-selection.service';
@Component({
@@ -13,7 +12,6 @@ export class BulkUpdateTorrentsComponent implements OnInit {
public torrentsSelected: string[] = [];
public canUserEdit: boolean = false;
- public refreshInterval = -1;
private loading: boolean = false;
private actions: {
@@ -29,7 +27,7 @@ export class BulkUpdateTorrentsComponent implements OnInit {
"moveTor": () => void,
};
- constructor(private torrentsSelectedService: RowSelectionService, private networkInfo: NetworkConnectionInformationService) {
+ constructor(private torrentsSelectedService: RowSelectionService) {
// Assign all possible actions
this.actions = {
@@ -44,13 +42,6 @@ export class BulkUpdateTorrentsComponent implements OnInit {
"minPrio": () => this.onChange.emit("minPrio"),
"moveTor": () => this.onChange.emit("moveTorrent")
};
-
- // Store refresh interval & subscribe to any changes
- this.refreshInterval = this.networkInfo.getRefreshInterval();
- this.networkInfo.get_network_change_subscription()
- .subscribe(newInterval => {
- this.refreshInterval = this.networkInfo.getRefreshInterval();
- })
}
ngOnInit(): void {
diff --git a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.html b/src/app/torrents-table/global-transfer-info/global-transfer-info.component.html
deleted file mode 100644
index 28b4547f..00000000
--- a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- Disk Summary
-
-
-
-
-
-
- storage
-
Free Space: {{getFreeSpaceOnDisk()}}
-
-
-
-
-
-
- Global Transfer
-
-
-
-
-
-
-
- arrow_downward
-
{{getDownloadSpeedString()}} ({{getDownloadedString()}})
-
-
-
- arrow_upward
- {{getUploadSpeedString()}} ({{getUploadedString()}})
-
-
-
-
-
-
diff --git a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.scss b/src/app/torrents-table/global-transfer-info/global-transfer-info.component.scss
deleted file mode 100644
index 48ff8106..00000000
--- a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.scss
+++ /dev/null
@@ -1,78 +0,0 @@
-.global-transfer-info-container {
- margin-top: 10px;
-
- .data-container {
- display: flex;
- flex-direction: row;
- align-items: baseline;
- justify-content: space-between;
- max-height: 45px;
-
- padding: 4px 20px;
-
- #disk_summary, #global_transfer {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
-
- width: 50%;
- max-width: 680px;
- min-width: 410px;
- }
-
- #disk_summary {
- flex-grow: 0.5;
- margin-right: 10px;
- }
-
- #global_transfer {
- flex-grow: 0.2;
- margin-left: 10px;
- }
- }
-}
-
-#summaryContent {
- flex-grow: 1;
- justify-self: flex-end;
-
- display: flex;
- flex-direction: row;
-}
-
-h3 {
- font-size: 11pt;
- margin: 0;
-}
-
-#summaryContent h4 {
- font-size: 10pt;
- margin: 0 5px 0 5px;
-}
-
-#summaryContentDivider {
- margin: 0 10px 0 10px;
-}
-
-/** For small screens */
-@media only screen and (max-width: 1200px) {
- .global-transfer-info-container {
- .data-container {
- flex-direction: column;
- justify-content: center;
-
- max-height: 90px;
-
- #disk_summary, #global_transfer {
- flex-grow: 1;
-
- max-width: unset;
- width: 100%;
-
- margin: 0;
- }
-
- }
- }
-}
-
diff --git a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.ts b/src/app/torrents-table/global-transfer-info/global-transfer-info.component.ts
deleted file mode 100644
index d9685058..00000000
--- a/src/app/torrents-table/global-transfer-info/global-transfer-info.component.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { TorrentDataStoreService } from 'src/app/services/torrent-management/torrent-data-store.service';
-import { GlobalTransferInfo, MainData } from 'src/utils/Interfaces';
-import { UnitsHelperService } from 'src/app/services/units-helper.service';
-import { ThemeService } from 'src/app/services/theme.service';
-import { Observable } from 'rxjs';
-
-@Component({
- selector: 'app-global-transfer-info',
- templateUrl: './global-transfer-info.component.html',
- styleUrls: ['./global-transfer-info.component.scss']
-})
-export class GlobalTransferInfoComponent implements OnInit {
-
- public data: GlobalTransferInfo = null;
- public isDarkTheme: Observable;
-
- constructor(private data_store: TorrentDataStoreService, private units_helper: UnitsHelperService, private theme: ThemeService) { }
-
- ngOnInit(): void {
- this.isDarkTheme = this.theme.getThemeSubscription();
- // Subscribe to any changes with data store
- this.data_store.GetTorrentDataSubscription().subscribe((res: MainData) => {
- if(res) {
- this.handleDataChange(res.server_state);
- }
- })
- }
-
- handleDataChange(newData: GlobalTransferInfo): void {
- this.data = newData;
- }
-
- getDownloadSpeedString() {
- return `${this.units_helper.GetFileSizeString(this.data.dl_info_speed)}/s`;
- }
-
- getDownloadedString() {
- return `${this.units_helper.GetFileSizeString(this.data.dl_info_data)}`;
- }
-
- getUploadSpeedString() {
- return `${this.units_helper.GetFileSizeString(this.data.up_info_speed)}/s`;
- }
-
- getUploadedString() {
- return `${this.units_helper.GetFileSizeString(this.data.up_info_data)}`;
- }
-
- getFreeSpaceOnDisk() {
- return `${this.units_helper.GetFileSizeString(this.data.free_space_on_disk)}`;
- }
-
- isLoading(): boolean {
- return !this.data;
- }
-
-}
diff --git a/src/app/torrents-table/torrents-table.component.html b/src/app/torrents-table/torrents-table.component.html
index bcb5b070..bfed3cd2 100644
--- a/src/app/torrents-table/torrents-table.component.html
+++ b/src/app/torrents-table/torrents-table.component.html
@@ -118,7 +118,5 @@
No torrents found. Try adding one by clicking Upload at the top-right.
-
-
diff --git a/src/assets/http_config.json b/src/assets/http_config.json
index 80235af0..aae7fa7a 100644
--- a/src/assets/http_config.json
+++ b/src/assets/http_config.json
@@ -17,6 +17,9 @@
"torrentContents": "/torrents/files",
"userPreferences": "/app/preferences",
"setPreferences": "/app/setPreferences",
+ "toggleSpeedLimitsMode": "/transfer/toggleSpeedLimitsMode",
+ "setDownloadLimit": "/transfer/setDownloadLimit",
+ "setUploadLimit": "/transfer/setUploadLimit",
"applicationVersion": "/app/version",
"apiVersion": "/app/webapiVersion"
},
diff --git a/src/assets/http_config.prod.json b/src/assets/http_config.prod.json
index 99393769..5829f383 100644
--- a/src/assets/http_config.prod.json
+++ b/src/assets/http_config.prod.json
@@ -17,6 +17,9 @@
"torrentContents": "/torrents/files",
"userPreferences": "/app/preferences",
"setPreferences": "/app/setPreferences",
+ "toggleSpeedLimitsMode": "/transfer/toggleSpeedLimitsMode",
+ "setDownloadLimit": "/transfer/setDownloadLimit",
+ "setUploadLimit": "/transfer/setUploadLimit",
"applicationVersion": "/app/version",
"apiVersion": "/app/webapiVersion"
}
diff --git a/src/utils/Interfaces.ts b/src/utils/Interfaces.ts
index 9b39763e..a7651934 100644
--- a/src/utils/Interfaces.ts
+++ b/src/utils/Interfaces.ts
@@ -73,6 +73,8 @@ export interface GlobalTransferInfo {
free_space_on_disk: number,
total_peer_connections: number,
+ /** True if alternative speed limits are enabled */
+ use_alt_speed_limits: boolean
}
/** Response when requesting torrent data from server */