new & opt.

- new: support suspend and WOL #172
- opt.: `execWithPwd` when cancel
- opt.: extentions
This commit is contained in:
lollipopkit
2023-09-25 18:51:14 +08:00
parent df84aeb8b2
commit 4d06a52e99
45 changed files with 251 additions and 176 deletions

View File

@@ -3,7 +3,6 @@ import 'dart:async';
import 'package:dartssh2/dartssh2.dart';
import 'package:flutter/material.dart';
import 'package:toolbox/core/extension/ssh_client.dart';
import 'package:toolbox/core/extension/stringx.dart';
import 'package:toolbox/data/model/app/shell_func.dart';
import 'package:toolbox/data/model/docker/image.dart';
import 'package:toolbox/data/model/docker/ps.dart';
@@ -175,9 +174,10 @@ class DockerProvider extends ChangeNotifier {
// judge whether to use DOCKER_HOST
String _wrap(String cmd) {
final dockerHost = Stores.docker.fetch(hostId!);
cmd = 'export LANG=en_US.UTF-8 && $cmd';
if (dockerHost == null || dockerHost.isEmpty) {
return cmd.withLangExport;
return cmd;
}
return 'export DOCKER_HOST=$dockerHost && $cmd'.withLangExport;
return 'export DOCKER_HOST=$dockerHost && $cmd';
}
}

View File

@@ -291,7 +291,7 @@ class ServerProvider extends ChangeNotifier {
final localPath = joinPath(await Paths.doc, 'install.sh');
final file = File(localPath);
file.writeAsString(ShellFunc.allScript);
final sftp = Providers.sftp;
final sftp = Pros.sftp;
final completer = Completer();
sftp.add(
SftpReq(spi, installShellPath, localPath, SftpReqType.upload),

View File

@@ -31,12 +31,13 @@ class SnippetProvider extends ChangeNotifier {
}
void _addInternal() {
if (!Stores.setting.fTISBM.fetch() || _snippets.isNotEmpty) {
if (!Stores.first.iSSBM.fetch() ||
_snippets.any((e) => e.name == installSBM.name)) {
return;
}
_snippets.add(installSBM);
Stores.snippet.put(installSBM);
Stores.setting.fTISBM.put(false);
Stores.first.iSSBM.put(false);
}
void _updateTags() {