diff --git a/lib/data/model/server/server.dart b/lib/data/model/server/server.dart index 6eab9fab..7aa2fedf 100644 --- a/lib/data/model/server/server.dart +++ b/lib/data/model/server/server.dart @@ -56,7 +56,7 @@ class ServerStatus { SystemType system; String? err; DiskIO diskIO; - List? nvdia; + List? nvidia; /// Whether is connectting, parsing and etc. bool _isBusy = false; @@ -74,7 +74,7 @@ class ServerStatus { required this.system, required this.diskIO, this.err, - this.nvdia, + this.nvidia, }); } diff --git a/lib/data/model/server/server_status_update_req.dart b/lib/data/model/server/server_status_update_req.dart index 718507a5..eb58a850 100644 --- a/lib/data/model/server/server_status_update_req.dart +++ b/lib/data/model/server/server_status_update_req.dart @@ -113,8 +113,8 @@ Future _getLinuxStatus(ServerStatusUpdateReq req) async { } try { - final nvdia = NvidiaSmi.fromXml(StatusCmdType.nvdia.find(segments)); - req.ss.nvdia = nvdia; + final nvidia = NvidiaSmi.fromXml(StatusCmdType.nvidia.find(segments)); + req.ss.nvidia = nvidia; } catch (e, s) { Loggers.parse.warning(e, s); } diff --git a/lib/data/model/sftp/worker.dart b/lib/data/model/sftp/worker.dart index 2d05b5bd..3171d8e1 100644 --- a/lib/data/model/sftp/worker.dart +++ b/lib/data/model/sftp/worker.dart @@ -154,9 +154,12 @@ Future _upload( mainSendPort.send(SftpWorkerStatus.loading); final localFile = local.openRead().cast(); final sftp = await client.sftp(); + // If remote exists, overwrite it final file = await sftp.open( req.remotePath, - mode: SftpFileOpenMode.write | SftpFileOpenMode.create, + mode: SftpFileOpenMode.truncate | + SftpFileOpenMode.create | + SftpFileOpenMode.write, ); final writer = file.write( localFile, diff --git a/lib/data/res/github_id.dart b/lib/data/res/github_id.dart index ceeae295..10fbb44c 100644 --- a/lib/data/res/github_id.dart +++ b/lib/data/res/github_id.dart @@ -42,5 +42,7 @@ abstract final class GithubIds { 'xingleiwu', 'Cooper098', 'xushuojie', + 'AniberMokie', + 'LucaLin233', }; } diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index cfe63b39..97e6a16a 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -307,8 +307,8 @@ class _ServerDetailPageState extends State } Widget _buildGpuView(ServerStatus ss) { - if (ss.nvdia == null) return UIs.placeholder; - final children = ss.nvdia!.map((e) => _buildGpuItem(e)).toList(); + if (ss.nvidia == null) return UIs.placeholder; + final children = ss.nvidia!.map((e) => _buildGpuItem(e)).toList(); return CardX( child: ExpandTile( title: const Text('GPU'), diff --git a/lib/view/page/storage/sftp.dart b/lib/view/page/storage/sftp.dart index fcbb036c..a786d4e1 100644 --- a/lib/view/page/storage/sftp.dart +++ b/lib/view/page/storage/sftp.dart @@ -144,18 +144,15 @@ class _SftpPageState extends State with AfterLayoutMixin { if (path == null) { return; } - final remotePath = _status.path?.path; - if (remotePath == null) { + final remoteDir = _status.path?.path; + if (remoteDir == null) { context.showSnackBar('remote path is null'); return; } + final remotePath = '$remoteDir/${path.split('/').last}'; + Loggers.app.info('SFTP upload local: $path, remote: $remotePath'); Pros.sftp.add( - SftpReq( - widget.spi, - '$remotePath/${path.split('/').last}', - path, - SftpReqType.upload, - ), + SftpReq(widget.spi, remotePath, path, SftpReqType.upload), ); }, icon: const Icon(Icons.upload_file)); diff --git a/lib/view/widget/tag.dart b/lib/view/widget/tag.dart index 644455c6..d6f7c111 100644 --- a/lib/view/widget/tag.dart +++ b/lib/view/widget/tag.dart @@ -218,7 +218,7 @@ class TagSwitcher extends StatelessWidget implements PreferredSizeWidget { ), ); } - + @override Size get preferredSize => const Size.fromHeight(_kTagBtnHeight); }