feat: new ui (#1455)

This commit is contained in:
Levi authored and GitHub committed 2026-09-05 19:53:41 +08:00
1 parent 3be8db664c
commit 177c225f16
742 files changed
+59951 -5934

No files matched your search

+23 -65
View File
@@ -13,16 +13,17 @@ class DownloaderConfig {
ScriptConfig script = ScriptConfig();
AutoTorrentConfig autoTorrent = AutoTorrentConfig();
ArchiveConfig archive = ArchiveConfig();
bool autoStartTasks;
bool autoDeleteMissingFileTasks;
DownloaderConfig({
this.downloadDir = '',
this.maxRunning = 0,
this.autoStartTasks = false,
this.autoDeleteMissingFileTasks = false,
});
factory DownloaderConfig.fromJson(Map<String, dynamic> json) =>
_$DownloaderConfigFromJson(json);
factory DownloaderConfig.fromJson(Map<String, dynamic> json) => _$DownloaderConfigFromJson(json);
Map<String, dynamic> toJson() => _$DownloaderConfigToJson(this);
}
@@ -47,14 +48,9 @@ class HttpConfig {
int connections;
bool useServerCtime;
HttpConfig({
this.userAgent = '',
this.connections = 0,
this.useServerCtime = false,
});
HttpConfig({this.userAgent = '', this.connections = 0, this.useServerCtime = false});
factory HttpConfig.fromJson(Map<String, dynamic> json) =>
_$HttpConfigFromJson(json);
factory HttpConfig.fromJson(Map<String, dynamic> json) => _$HttpConfigFromJson(json);
Map<String, dynamic> toJson() => _$HttpConfigToJson(this);
}
@@ -75,8 +71,7 @@ class BtConfig {
this.seedTime = 0,
});
factory BtConfig.fromJson(Map<String, dynamic> json) =>
_$BtConfigFromJson(json);
factory BtConfig.fromJson(Map<String, dynamic> json) => _$BtConfigFromJson(json);
Map<String, dynamic> toJson() => _$BtConfigToJson(this);
}
@@ -89,16 +84,9 @@ class Ed2kConfig {
String serverMet;
String nodesDat;
Ed2kConfig({
this.listenPort = 0,
this.udpPort = 0,
this.serverAddr = '',
this.serverMet = '',
this.nodesDat = '',
});
Ed2kConfig({this.listenPort = 0, this.udpPort = 0, this.serverAddr = '', this.serverMet = '', this.nodesDat = ''});
factory Ed2kConfig.fromJson(Map<String, dynamic> json) =>
_$Ed2kConfigFromJson(json);
factory Ed2kConfig.fromJson(Map<String, dynamic> json) => _$Ed2kConfigFromJson(json);
Map<String, dynamic> toJson() => _$Ed2kConfigToJson(this);
}
@@ -106,12 +94,12 @@ class Ed2kConfig {
@JsonSerializable(explicitToJson: true)
class ExtraConfig {
String themeMode;
String themeColor;
String locale;
bool lastDeleteTaskKeep;
bool defaultDirectDownload;
bool defaultBtClient;
bool notifyWhenNewVersion;
bool autoStartTasks;
bool desktopNotification;
bool backgroundLocationKeepAlive;
List<DownloadCategory> downloadCategories;
@@ -121,12 +109,12 @@ class ExtraConfig {
ExtraConfig({
this.themeMode = '',
this.themeColor = 'green',
this.locale = '',
this.lastDeleteTaskKeep = false,
this.defaultDirectDownload = false,
this.defaultBtClient = true,
this.notifyWhenNewVersion = true,
this.autoStartTasks = false,
this.desktopNotification = true,
this.backgroundLocationKeepAlive = false,
this.downloadCategories = const [],
@@ -144,8 +132,7 @@ class DownloadCategory {
String path;
bool isBuiltIn;
String? nameKey; // i18n key for built-in categories (e.g., 'categoryMusic')
bool
isDeleted; // Mark built-in categories as deleted instead of removing them
bool isDeleted; // Mark built-in categories as deleted instead of removing them
DownloadCategory({
required this.name,
@@ -155,8 +142,7 @@ class DownloadCategory {
this.isDeleted = false,
});
factory DownloadCategory.fromJson(Map<String, dynamic> json) =>
_$DownloadCategoryFromJson(json);
factory DownloadCategory.fromJson(Map<String, dynamic> json) => _$DownloadCategoryFromJson(json);
Map<String, dynamic> toJson() => _$DownloadCategoryToJson(this);
}
@@ -166,10 +152,7 @@ class WebhookConfig {
bool enable;
List<String> urls;
WebhookConfig({
this.enable = false,
this.urls = const [],
});
WebhookConfig({this.enable = false, this.urls = const []});
factory WebhookConfig.fromJson(Map<String, dynamic>? json) =>
json == null ? WebhookConfig() : _$WebhookConfigFromJson(json);
@@ -182,10 +165,7 @@ class ScriptConfig {
bool enable;
List<String> paths;
ScriptConfig({
this.enable = false,
this.paths = const [],
});
ScriptConfig({this.enable = false, this.paths = const []});
factory ScriptConfig.fromJson(Map<String, dynamic>? json) =>
json == null ? ScriptConfig() : _$ScriptConfigFromJson(json);
@@ -211,8 +191,7 @@ class ProxyConfig {
this.pwd = '',
});
factory ProxyConfig.fromJson(Map<String, dynamic> json) =>
_$ProxyConfigFromJson(json);
factory ProxyConfig.fromJson(Map<String, dynamic> json) => _$ProxyConfigFromJson(json);
Map<String, dynamic> toJson() => _$ProxyConfigToJson(this);
}
@@ -228,16 +207,12 @@ class ExtraConfigBt {
ExtraConfigBt();
factory ExtraConfigBt.fromJson(Map<String, dynamic> json) =>
_$ExtraConfigBtFromJson(json);
factory ExtraConfigBt.fromJson(Map<String, dynamic> json) => _$ExtraConfigBtFromJson(json);
Map<String, dynamic> toJson() => _$ExtraConfigBtToJson(this);
}
enum GithubMirrorType {
jsdelivr,
ghProxy,
}
enum GithubMirrorType { jsdelivr, ghProxy }
@JsonSerializable()
class GithubMirror {
@@ -246,15 +221,9 @@ class GithubMirror {
bool isBuiltIn;
bool isDeleted;
GithubMirror({
required this.type,
required this.url,
this.isBuiltIn = false,
this.isDeleted = false,
});
GithubMirror({required this.type, required this.url, this.isBuiltIn = false, this.isDeleted = false});
factory GithubMirror.fromJson(Map<String, dynamic> json) =>
_$GithubMirrorFromJson(json);
factory GithubMirror.fromJson(Map<String, dynamic> json) => _$GithubMirrorFromJson(json);
Map<String, dynamic> toJson() => _$GithubMirrorToJson(this);
}
@@ -264,15 +233,10 @@ class ExtraConfigGithubMirror {
bool enabled;
List<GithubMirror> mirrors;
ExtraConfigGithubMirror({
this.enabled = true,
this.mirrors = const [],
});
ExtraConfigGithubMirror({this.enabled = true, this.mirrors = const []});
factory ExtraConfigGithubMirror.fromJson(Map<String, dynamic>? json) =>
json == null
? ExtraConfigGithubMirror()
: _$ExtraConfigGithubMirrorFromJson(json);
json == null ? ExtraConfigGithubMirror() : _$ExtraConfigGithubMirrorFromJson(json);
Map<String, dynamic> toJson() => _$ExtraConfigGithubMirrorToJson(this);
}
@@ -282,10 +246,7 @@ class AutoTorrentConfig {
bool enable;
bool deleteAfterDownload;
AutoTorrentConfig({
this.enable = false,
this.deleteAfterDownload = false,
});
AutoTorrentConfig({this.enable = false, this.deleteAfterDownload = false});
factory AutoTorrentConfig.fromJson(Map<String, dynamic>? json) =>
json == null ? AutoTorrentConfig() : _$AutoTorrentConfigFromJson(json);
@@ -298,10 +259,7 @@ class ArchiveConfig {
bool autoExtract;
bool deleteAfterExtract;
ArchiveConfig({
this.autoExtract = true,
this.deleteAfterExtract = true,
});
ArchiveConfig({this.autoExtract = true, this.deleteAfterExtract = true});
factory ArchiveConfig.fromJson(Map<String, dynamic>? json) =>
json == null ? ArchiveConfig() : _$ArchiveConfigFromJson(json);