mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
#43 new: bsd base support
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 491;
|
||||
static const String engine = "3.10.6";
|
||||
static const String buildAt = "2023-08-20 23:32:07.343451";
|
||||
static const int modifications = 4;
|
||||
static const int build = 493;
|
||||
static const String engine = "3.13.0";
|
||||
static const String buildAt = "2023-08-22 16:14:41.022063";
|
||||
static const int modifications = 8;
|
||||
}
|
||||
|
||||
@@ -1,41 +1 @@
|
||||
import '../model/app/shell_func.dart';
|
||||
import 'build_data.dart';
|
||||
|
||||
const seperator = 'SrvBoxSep';
|
||||
const serverBoxDir = r'$HOME/.config/server_box';
|
||||
const shellPath = '$serverBoxDir/mobile_app.sh';
|
||||
|
||||
const statusCmds = [
|
||||
'date +%s',
|
||||
'cat /proc/net/dev',
|
||||
'cat /etc/os-release | grep PRETTY_NAME',
|
||||
'cat /proc/stat | grep cpu',
|
||||
'uptime',
|
||||
'cat /proc/net/snmp',
|
||||
'df -h',
|
||||
'cat /proc/meminfo',
|
||||
'cat /sys/class/thermal/thermal_zone*/type',
|
||||
'cat /sys/class/thermal/thermal_zone*/temp',
|
||||
'hostname',
|
||||
'cat /etc/redhat-release',
|
||||
];
|
||||
|
||||
const dockerCmds = [
|
||||
'docker version',
|
||||
'docker ps -a',
|
||||
'docker stats --no-stream',
|
||||
'docker image ls',
|
||||
];
|
||||
|
||||
final shellCmd = """
|
||||
# Script for app `${BuildData.name} v1.0.${BuildData.build}`
|
||||
# Delete this file while app is running will cause app crash
|
||||
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
${AppShellFuncType.shellScript}
|
||||
""";
|
||||
|
||||
final installShellCmd = "mkdir -p $serverBoxDir && "
|
||||
"echo '$shellCmd' > $shellPath && "
|
||||
"chmod +x $shellPath";
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../model/server/memory.dart';
|
||||
import '../model/server/net_speed.dart';
|
||||
import '../model/server/server_status.dart';
|
||||
import '../model/server/conn.dart';
|
||||
import '../model/server/system.dart';
|
||||
|
||||
Memory get _initMemory => Memory(
|
||||
total: 1,
|
||||
@@ -38,8 +39,8 @@ NetSpeed get initNetSpeed => NetSpeed(
|
||||
[_initNetSpeedPart],
|
||||
);
|
||||
Swap get _initSwap => Swap(
|
||||
total: 1,
|
||||
free: 1,
|
||||
total: 0,
|
||||
free: 0,
|
||||
cached: 0,
|
||||
);
|
||||
ServerStatus get initStatus => ServerStatus(
|
||||
@@ -60,5 +61,6 @@ ServerStatus get initStatus => ServerStatus(
|
||||
tcp: Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
|
||||
netSpeed: initNetSpeed,
|
||||
swap: _initSwap,
|
||||
system: SystemType.linux,
|
||||
temps: Temperatures(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user