mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt. proj struct
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import '../../../core/extension/stringx.dart';
|
||||
|
||||
///
|
||||
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
||||
///
|
||||
@@ -39,3 +41,16 @@ class TcpStatus {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
final numReg = RegExp(r'\s{1,}');
|
||||
|
||||
TcpStatus? parseTcp(String raw) {
|
||||
final lines = raw.split('\n');
|
||||
final idx = lines.lastWhere((element) => element.startsWith('Tcp:'),
|
||||
orElse: () => '');
|
||||
if (idx != '') {
|
||||
final vals = idx.split(numReg);
|
||||
return TcpStatus(vals[5].i, vals[6].i, vals[7].i, vals[8].i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user