feat: add app version ui

This commit is contained in:
Simon Ding
2024-07-27 15:44:49 +08:00
parent 741a4024fd
commit cd4d600f5e
3 changed files with 12 additions and 4 deletions

View File

@@ -48,6 +48,6 @@ func (s *Server) About(c *gin.Context) (interface{}, error) {
"uptime": uptime.Uptime(),
"chat_group": "https://t.me/+8R2nzrlSs2JhMDgx",
"go_version": runtime.Version(),
"version": db.Version,
"version": db.Version,
}, nil
}

View File

@@ -336,6 +336,7 @@ class About {
required this.homepage,
required this.intro,
required this.uptime,
required this.version,
});
final String? chatGroup;
@@ -343,6 +344,7 @@ class About {
final String? homepage;
final String? intro;
final Duration? uptime;
final String? version;
factory About.fromJson(Map<String, dynamic> json) {
return About(
@@ -350,7 +352,9 @@ class About {
goVersion: json["go_version"],
homepage: json["homepage"],
intro: json["intro"],
uptime: Duration(microseconds: (json["uptime"]/1000.0 as double).round()),
version: json["version"],
uptime:
Duration(microseconds: (json["uptime"] / 1000.0 as double).round()),
);
}
}

View File

@@ -46,9 +46,9 @@ class _SystemPageState extends ConsumerState<SystemPage> {
return DataRow(cells: [
DataCell(Text(item.name ?? "")),
DataCell(Text((item.size??0).readableFileSize())),
DataCell(Text((item.size ?? 0).readableFileSize())),
DataCell(InkWell(
child: Icon(Icons.download),
child: const Icon(Icons.download),
onTap: () => launchUrl(uri,
webViewConfiguration: WebViewConfiguration(
headers: APIs.authHeaders)),
@@ -82,6 +82,7 @@ class _SystemPageState extends ConsumerState<SystemPage> {
"#",
style: TextStyle(height: 2.5),
),
Text("版本", style: TextStyle(height: 2.5)),
Text("主页", style: TextStyle(height: 2.5)),
Text("讨论组", style: TextStyle(height: 2.5)),
Text("go version", style: TextStyle(height: 2.5)),
@@ -104,8 +105,11 @@ class _SystemPageState extends ConsumerState<SystemPage> {
),
Text(v.intro ?? "",
style: const TextStyle(height: 2.5)),
Text(v.version ?? "",
style: const TextStyle(height: 2.5)),
InkWell(
child: Text(v.homepage ?? "",
softWrap: false,
style: const TextStyle(height: 2.5)),
onTap: () => launchUrl(homepage),
),