fix: termux compatibility (#472)

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-07-20 20:35:30 +08:00
committed by GitHub
parent 2907ac74d4
commit b0936c5e6e
7 changed files with 53 additions and 82 deletions

View File

@@ -51,7 +51,8 @@ class _ProcessPageState extends State<ProcessPage> {
Future<void> _refresh() async {
if (mounted) {
final result = await _client?.run(ShellFunc.process.exec).string;
final result =
await _client?.run(ShellFunc.process.exec(widget.spi.id)).string;
if (result == null || result.isEmpty) {
context.showSnackBar(l10n.noResult);
return;

View File

@@ -356,7 +356,7 @@ class _ServerPageState extends State<ServerPage>
Stores.setting.showSuspendTip.put(false);
}
srv.client?.execWithPwd(
ShellFunc.suspend.exec,
ShellFunc.suspend.exec(srv.id),
context: context,
id: srv.id,
);
@@ -370,7 +370,7 @@ class _ServerPageState extends State<ServerPage>
IconTextBtn(
onPressed: () => _askFor(
func: () => srv.client?.execWithPwd(
ShellFunc.shutdown.exec,
ShellFunc.shutdown.exec(srv.id),
context: context,
id: srv.id,
),
@@ -383,7 +383,7 @@ class _ServerPageState extends State<ServerPage>
IconTextBtn(
onPressed: () => _askFor(
func: () => srv.client?.execWithPwd(
ShellFunc.reboot.exec,
ShellFunc.reboot.exec(srv.id),
context: context,
id: srv.id,
),