mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: SystemType(#184) & opt.: ios home widget
This commit is contained in:
@@ -9,15 +9,16 @@ enum SystemType {
|
||||
|
||||
const SystemType._(this.value);
|
||||
|
||||
static SystemType? parse(String? value) {
|
||||
if (value == null) return null;
|
||||
switch (value) {
|
||||
static SystemType parse(String value) {
|
||||
switch (value.trim()) {
|
||||
case linuxSign:
|
||||
return SystemType.linux;
|
||||
case bsdSign:
|
||||
return SystemType.bsd;
|
||||
default:
|
||||
// Fallback to linux
|
||||
return SystemType.linux;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool isSegmentsLenMatch(int len) => len == segmentsLen;
|
||||
|
||||
@@ -329,10 +329,10 @@ class ServerProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
final systemType = SystemType.parse(segments[0]);
|
||||
if (systemType == null || !systemType.isSegmentsLenMatch(segments.length)) {
|
||||
if (!systemType.isSegmentsLenMatch(segments.length)) {
|
||||
_limiter.inc(sid);
|
||||
s.status.failedInfo =
|
||||
'Segments not match: expect ${systemType?.segmentsLen}, got ${segments.length}';
|
||||
'Segments not match: expect ${systemType.segmentsLen}, got ${segments.length}';
|
||||
_setServerState(s, ServerState.failed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 588;
|
||||
static const int build = 589;
|
||||
static const String engine = "3.13.6";
|
||||
static const String buildAt = "2023-10-13 14:38:17";
|
||||
static const int modifications = 5;
|
||||
static const String buildAt = "2023-10-14 12:09:35";
|
||||
static const int modifications = 6;
|
||||
static const int script = 21;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user