Merge pull request #28 from lollipopkit/fix/synology

Fix & opt.
This commit is contained in:
lollipopkit
2023-04-27 16:24:31 +08:00
committed by GitHub
17 changed files with 17 additions and 2 deletions

BIN
assets/linux/alpine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
assets/linux/linux.psd Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -33,11 +33,20 @@ List<DiskInfo> parseDisk(String raw) {
final list = <DiskInfo>[];
final items = raw.split('\n');
items.removeAt(0);
var pathCache = '';
for (var item in items) {
if (item.isEmpty) {
continue;
}
final vals = item.split(numReg);
if (vals.length == 1) {
pathCache = vals[0];
continue;
}
if (pathCache != '') {
vals[0] = pathCache;
pathCache = '';
}
list.add(DiskInfo(
vals[0],
vals[5],

View File

@@ -8,6 +8,7 @@ enum Dist {
wrt,
armbian,
arch,
alpine,
rocky;
String? get iconPath {

View File

@@ -15,7 +15,7 @@ class ServerStatusUpdateReq {
Future<ServerStatus> getStatus(ServerStatusUpdateReq req) async {
final net = parseNetSpeed(req.segments[0]);
req.ss.netSpeed.update(net);
final sys = _parseSysVer(req.segments[1]);
final sys = _parseSysVer(req.segments[1], req.segments[9]);
if (sys != null) {
req.ss.sysVer = sys;
}
@@ -49,10 +49,11 @@ String? _parseUpTime(String raw) {
return null;
}
String? _parseSysVer(String raw) {
String? _parseSysVer(String raw, String hostname) {
final s = raw.split('=');
if (s.length == 2) {
return s[1].replaceAll('"', '').replaceFirst('\n', '');
}
if (hostname.isNotEmpty) return hostname;
return null;
}

View File

@@ -29,4 +29,6 @@ echo $seperator
cat /sys/class/thermal/thermal_zone*/type
echo $seperator
cat /sys/class/thermal/thermal_zone*/temp
echo $seperator
hostname
""";

View File

@@ -100,6 +100,8 @@ flutter:
- assets/linux/opensuse.png
- assets/linux/wrt.png
- assets/linux/armbian.png
- assets/linux/alpine.png
- assets/linux/rocky.png
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see