feat(ui): add nat traversal option

This commit is contained in:
Simon Ding
2025-05-08 16:30:06 +08:00
parent 992fa7ddd0
commit bb0d5d1b58
3 changed files with 46 additions and 26 deletions

View File

@@ -251,6 +251,7 @@ class DownloadClient {
bool? removeCompletedDownloads;
bool? removeFailedDownloads;
int? priority;
bool useNatTraversal = false;
DownloadClient(
{this.id,
this.enable,
@@ -261,7 +262,7 @@ class DownloadClient {
this.password,
this.removeCompletedDownloads = true,
this.priority = 1,
this.removeFailedDownloads = true});
this.removeFailedDownloads = true, this.useNatTraversal = false});
DownloadClient.fromJson(Map<String, dynamic> json) {
id = json['id'];
@@ -274,6 +275,7 @@ class DownloadClient {
priority = json["priority1"];
removeCompletedDownloads = json["remove_completed_downloads"] ?? false;
removeFailedDownloads = json["remove_failed_downloads"] ?? false;
useNatTraversal = json["use_nat_traversal"]?? false;
}
Map<String, dynamic> toJson() {
@@ -288,6 +290,7 @@ class DownloadClient {
data["priority"] = priority;
data["remove_completed_downloads"] = removeCompletedDownloads;
data["remove_failed_downloads"] = removeFailedDownloads;
data["use_nat_traversal"] = useNatTraversal;
return data;
}