让用户选择更新源,并同步在线更新历史

设置里可以在 YanJiu Git 和 GitHub 之间选择,默认是 YanJiu Git。选中的源连不上时改用另一个,结果会写明实际用的是哪一个。更新历史从所选源读取已发布版本并在本机缓存。表单里被省略号截断的提示可以点开。

Co-authored-by: yanjiu0721 <yanjiu0721@users.noreply.github.com>
This commit is contained in:
Cursor Agentandyanjiu0721 committed 2026-11-26 23:32:19 +00:00
1 parent b8cc446454
commit 2e77fcc376
14 files changed
+1771 -68

No files matched your search

+40
View File
@@ -11,13 +11,48 @@ class ReleaseEntry {
required this.source,
required this.points,
this.published,
this.tag,
});
final String version;
final String title;
final String source;
final String? published;
/// Release tag, when this entry came from a forge. Bundled entries omit it.
final String? tag;
final List<String> points;
Map<String, Object?> toJson() => {
'version': version,
'title': title,
'source': source,
'published': published,
'tag': tag,
'points': points,
};
factory ReleaseEntry.fromJson(Map<String, dynamic> json) {
final rawPoints = json['points'];
final points = <String>[];
if (rawPoints is List) {
for (final item in rawPoints) {
if (item is String && item.trim().isNotEmpty) {
points.add(item);
}
}
}
return ReleaseEntry(
version: json['version'] is String ? json['version'] as String : '',
title: json['title'] is String ? json['title'] as String : '',
source: json['source'] is String ? json['source'] as String : '',
published: json['published'] is String
? json['published'] as String
: null,
tag: json['tag'] is String ? json['tag'] as String : null,
points: points,
);
}
}
const releaseHistory = <ReleaseEntry>[
@@ -66,3 +101,8 @@ const releaseHistory = <ReleaseEntry>[
const releaseHistoryNote =
'仓库里目前公开的版本标签只有 v1.1.1。1.1.1 的发布说明提到过更早的发包行为,但没有单独的标签或 Release,所以这里不写成另一个版本。';
/// Already shipped installers cannot grow this screen. The sentence stays
/// visible so the app does not imply that 1.1.2 or 1.1.3 already sync notes.
const onlineHistoryLimitNote =
'已经发布的 1.1.2 和 1.1.3 安装包没有在线更新历史。那些版本不会自己同步以后的发布说明,需要先安装包含这个功能的版本。';