fix: wrong hostname display (#336)

This commit is contained in:
lollipopkit
2024-04-16 00:19:00 +08:00
parent b80bf51a61
commit ff8bc49074
2 changed files with 12 additions and 6 deletions

View File

@@ -60,8 +60,8 @@ Future<ServerStatus> _getLinuxStatus(ServerStatusUpdateReq req) async {
}
try {
final host = StatusCmdType.host.find(segments);
if (host.isNotEmpty) {
final host = _parseHostName(StatusCmdType.host.find(segments));
if (host != null) {
req.ss.more[StatusCmdType.host] = host;
}
} catch (e, s) {
@@ -237,3 +237,9 @@ String? _parseSysVer(String raw) {
}
return null;
}
String? _parseHostName(String raw) {
if (raw.isEmpty) return null;
if (raw.contains(ShellFunc.scriptFile)) return null;
return raw;
}