Skip to content

Commit

Permalink
Merge pull request #1 from RainSunMe/fix-get-mem
Browse files Browse the repository at this point in the history
fix: can not get chinese mem
  • Loading branch information
lollipopkit authored Mar 2, 2022
2 parents f07d33a + fa8ffdc commit bb80f09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/data/provider/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,10 @@ class ServerProvider extends BusyProvider {
void _getMem(ServerPrivateInfo spi, String raw) {
final info = _servers.firstWhere((e) => e.info == spi);
for (var item in raw.split('\n')) {
if (item.contains('Mem:')) {
final split = item.replaceFirst('Mem:', '').split(' ');
if (item.contains('Mem:') || item.contains('内存:')) {
var split = item.replaceFirst('Mem:', '');
split = split.replaceFirst('内存:', '');
split = split.split(' ');
split.removeWhere((e) => e == '');
final memList = split.map((e) => int.parse(e)).toList();
info.status.memory = Memory(
Expand Down

0 comments on commit bb80f09

Please sign in to comment.