chore: README

This commit is contained in:
lollipopkit
2024-12-03 00:13:58 +08:00
parent 3a3c29764a
commit 029b4e0dba
4 changed files with 73 additions and 60 deletions

View File

@@ -9,7 +9,7 @@ English | [简体中文](README_zh.md)
</div> </div>
<p align="center"> <p align="center">
A Flutter project which provide charts to display <a href="../../issues/43">Linux</a> server status and tools to manage server. A Flutter project which provide charts to display <a href="https://github.com/lollipopkit/flutter_server_box/issues/43">Linux</a> server status and tools to manage server.
<br> <br>
Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a>. Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a>.
</p> </p>
@@ -28,11 +28,11 @@ Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartss
## 📥 Install ## 📥 Install
Platform | From Platform | From
--- | --- ----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703)
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid)
Please only download pkgs from the source that **you trust**! Please only download pkgs from the source that **you trust**!

View File

@@ -9,7 +9,7 @@
</div> </div>
<p align="center"> <p align="center">
使用 Flutter 开发的 <a href="../../issues/43">Linux</a> 服务器工具箱,提供服务器状态图表和管理工具。 使用 Flutter 开发的 <a href="https://github.com/lollipopkit/flutter_server_box/issues/43">Linux</a> 服务器工具箱,提供服务器状态图表和管理工具。
<br> <br>
特别感谢 <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a> 特别感谢 <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a>
</p> </p>
@@ -28,11 +28,11 @@
## 📥 安装 ## 📥 安装
平台 | 下载 平台 | 下载
--- | --- ----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703)
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid)
请从 **信任** 的来源下载! 请从 **信任** 的来源下载!
@@ -72,7 +72,7 @@ Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/rel
3. 运行 `dart run fl_build -p PLATFORM` 构建应用 3. 运行 `dart run fl_build -p PLATFORM` 构建应用
### 翻译 ### 翻译
[指南](https://blog.lolli.tech/faq/) 可在我的博客中找到。 [指南](https://blog.lpkt.cn/faq/) 可在我的博客中找到。
## 💡 我的其它 Apps ## 💡 我的其它 Apps
- [GPT Box](https://github.com/lollipopkit/flutter_gpt_box) - 支持 OpenAI API 的 第三方全平台客户端。 - [GPT Box](https://github.com/lollipopkit/flutter_gpt_box) - 支持 OpenAI API 的 第三方全平台客户端。

View File

@@ -124,7 +124,17 @@ class _ServerDetailPageState extends State<ServerDetailPage>
return CustomAppBar( return CustomAppBar(
title: Hero( title: Hero(
tag: 'home_card_title_${si.spi.id}', tag: 'home_card_title_${si.spi.id}',
child: Text(si.spi.name), transitionOnUserGestures: true,
child: Material(
color: Colors.transparent,
child: Text(
si.spi.name,
style: TextStyle(
fontSize: 20,
color: context.isDark ? Colors.white : Colors.black,
),
),
),
), ),
actions: [ actions: [
QrShareBtn( QrShareBtn(

View File

@@ -316,44 +316,41 @@ class _ServerPageState extends State<ServerPage>
final cardStatus = _getCardNoti(id); final cardStatus = _getCardNoti(id);
final title = _buildServerCardTitle(srv); final title = _buildServerCardTitle(srv);
return ListenableBuilder( return cardStatus.listenVal((_) {
listenable: cardStatus, final List<Widget> children = [title];
builder: (_, __) { if (srv.conn == ServerConn.finished) {
final List<Widget> children = [title]; if (cardStatus.value.flip) {
if (srv.conn == ServerConn.finished) { children.add(_buildFlippedCard(srv));
if (cardStatus.value.flip) { } else {
children.addAll(_buildFlippedCard(srv)); children.addAll(_buildNormalCard(srv.status, srv.spi));
} else {
children.addAll(_buildNormalCard(srv.status, srv.spi));
}
} }
}
final height = _calcCardHeight(srv.conn, cardStatus.value.flip); final height = _calcCardHeight(srv.conn, cardStatus.value.flip);
return AnimatedContainer( return AnimatedContainer(
duration: const Duration(milliseconds: 377), duration: const Duration(milliseconds: 377),
curve: Curves.fastEaseInToSlowEaseOut, curve: Curves.fastEaseInToSlowEaseOut,
height: height, height: height,
// Use [OverflowBox] to dismiss the warning of [Column] overflow. // Use [OverflowBox] to dismiss the warning of [Column] overflow.
child: OverflowBox( child: OverflowBox(
// If `height == _kCardHeightMin`, the `maxHeight` will be ignored. // If `height == _kCardHeightMin`, the `maxHeight` will be ignored.
// //
// You can comment the `maxHeight` then connect&disconnect the server // You can comment the `maxHeight` then connect&disconnect the server
// to see the difference. // to see the difference.
maxHeight: height != _kCardHeightMin ? height : null, maxHeight: height != _kCardHeightMin ? height : null,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: children,
children: children,
),
), ),
); ),
}, );
); });
} }
List<Widget> _buildFlippedCard(Server srv) { Widget _buildFlippedCard(Server srv) {
const textStyle = TextStyle(color: Colors.grey); const color = Colors.grey;
const textStyle = TextStyle(fontSize: 13, color: color);
final children = [ final children = [
Btn.column( Btn.column(
onTap: () => _askFor( onTap: () => _askFor(
@@ -374,7 +371,7 @@ class _ServerPageState extends State<ServerPage>
typ: l10n.suspend, typ: l10n.suspend,
name: srv.spi.name, name: srv.spi.name,
), ),
icon: const Icon(Icons.stop, color: Colors.grey), icon: const Icon(Icons.stop, color: color),
text: l10n.suspend, text: l10n.suspend,
textStyle: textStyle, textStyle: textStyle,
), ),
@@ -388,7 +385,7 @@ class _ServerPageState extends State<ServerPage>
typ: l10n.shutdown, typ: l10n.shutdown,
name: srv.spi.name, name: srv.spi.name,
), ),
icon: const Icon(Icons.power_off, color: Colors.grey), icon: const Icon(Icons.power_off, color: color),
text: l10n.shutdown, text: l10n.shutdown,
textStyle: textStyle, textStyle: textStyle,
), ),
@@ -402,29 +399,29 @@ class _ServerPageState extends State<ServerPage>
typ: l10n.reboot, typ: l10n.reboot,
name: srv.spi.name, name: srv.spi.name,
), ),
icon: const Icon(Icons.restart_alt, color: Colors.grey), icon: const Icon(Icons.restart_alt, color: color),
text: l10n.reboot, text: l10n.reboot,
textStyle: textStyle, textStyle: textStyle,
), ),
Btn.column( Btn.column(
onTap: () => ServerEditPage.route.go(context, args: srv.spi), onTap: () => ServerEditPage.route.go(context, args: srv.spi),
icon: const Icon(Icons.edit, color: Colors.grey), icon: const Icon(Icons.edit, color: color),
text: libL10n.edit, text: libL10n.edit,
textStyle: textStyle, textStyle: textStyle,
) )
]; ];
final width = (_media.size.width - _cardPad) / children.length; final width = (_media.size.width - _cardPad) / children.length;
return [ return Padding(
UIs.height13, padding: const EdgeInsets.only(top: 9),
Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: children.map((e) { children: children.map((e) {
if (width == 0) return e; if (width == 0) return e;
return SizedBox(width: width, child: e); return SizedBox(width: width, child: e);
}).toList(), }).toList(),
), ),
]; );
} }
List<Widget> _buildNormalCard(ServerStatus ss, Spi spi) { List<Widget> _buildNormalCard(ServerStatus ss, Spi spi) {
@@ -463,11 +460,17 @@ class _ServerPageState extends State<ServerPage>
constraints: BoxConstraints(maxWidth: _media.size.width / 2.3), constraints: BoxConstraints(maxWidth: _media.size.width / 2.3),
child: Hero( child: Hero(
tag: 'home_card_title_${s.spi.id}', tag: 'home_card_title_${s.spi.id}',
child: Text( transitionOnUserGestures: true,
s.spi.name, child: Material(
style: UIs.text13Bold, color: Colors.transparent,
maxLines: 1, child: Text(
overflow: TextOverflow.ellipsis, s.spi.name,
style: UIs.text13Bold.copyWith(
color: context.isDark ? Colors.white : Colors.black,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
), ),
), ),
), ),