new & opt.
- new: support suspend and WOL #172 - opt.: `execWithPwd` when cancel - opt.: extentions
This commit is contained in:
@@ -9,11 +9,11 @@ import 'package:toolbox/data/model/sftp/req.dart';
|
||||
import 'package:toolbox/data/res/misc.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/omit_start_text.dart';
|
||||
import 'package:toolbox/view/widget/picker.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
|
||||
import '../../../core/extension/numx.dart';
|
||||
import '../../../core/extension/stringx.dart';
|
||||
import '../../../core/route.dart';
|
||||
import '../../../core/utils/misc.dart';
|
||||
import '../../../data/model/app/path_with_prefix.dart';
|
||||
@@ -89,7 +89,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
(_path?.path ?? l10n.loadingFiles).omitStartStr(),
|
||||
OmitStartText(_path?.path ?? l10n.loadingFiles),
|
||||
_buildBtns(),
|
||||
],
|
||||
),
|
||||
@@ -275,7 +275,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
title: Text(l10n.upload),
|
||||
onTap: () async {
|
||||
context.pop();
|
||||
final ids = Providers.server.serverOrder;
|
||||
final ids = Pros.server.serverOrder;
|
||||
var idx = 0;
|
||||
await context.showRoundDialog(
|
||||
title: Text(l10n.server),
|
||||
@@ -289,7 +289,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
],
|
||||
);
|
||||
final id = ids[idx];
|
||||
final spi = Providers.server.pick(id: id)?.spi;
|
||||
final spi = Pros.server.pick(id: id)?.spi;
|
||||
if (spi == null) {
|
||||
return;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
if (remotePath == null) {
|
||||
return;
|
||||
}
|
||||
Providers.sftp.add(SftpReq(
|
||||
Pros.sftp.add(SftpReq(
|
||||
spi,
|
||||
'$remotePath/$fileName',
|
||||
file.absolute.path,
|
||||
|
||||
@@ -13,10 +13,10 @@ import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/misc.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/omit_start_text.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
|
||||
import '../../../core/extension/numx.dart';
|
||||
import '../../../core/extension/stringx.dart';
|
||||
import '../../../core/route.dart';
|
||||
import '../../../core/utils/misc.dart';
|
||||
import '../../../data/model/server/server_private_info.dart';
|
||||
@@ -113,7 +113,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
(_status.path?.path ?? l10n.loadingFiles).omitStartStr(),
|
||||
OmitStartText(_status.path?.path ?? l10n.loadingFiles),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: children,
|
||||
@@ -162,7 +162,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
context.showSnackBar('remote path is null');
|
||||
return;
|
||||
}
|
||||
Providers.sftp.add(
|
||||
Pros.sftp.add(
|
||||
SftpReq(
|
||||
widget.spi,
|
||||
'$remotePath/${path.split('/').last}',
|
||||
@@ -362,14 +362,14 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
localPath,
|
||||
SftpReqType.download,
|
||||
);
|
||||
Providers.sftp.add(req, completer: completer);
|
||||
Pros.sftp.add(req, completer: completer);
|
||||
context.showLoadingDialog();
|
||||
await completer.future;
|
||||
context.pop();
|
||||
|
||||
final result = await AppRoute.editor(path: localPath).go<bool>(context);
|
||||
if (result != null && result) {
|
||||
Providers.sftp
|
||||
Pros.sftp
|
||||
.add(SftpReq(req.spi, remotePath, localPath, SftpReqType.upload));
|
||||
context.showSnackBar(l10n.added2List);
|
||||
}
|
||||
@@ -389,7 +389,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
context.pop();
|
||||
final remotePath = _getRemotePath(name);
|
||||
|
||||
Providers.sftp.add(
|
||||
Pros.sftp.add(
|
||||
SftpReq(
|
||||
widget.spi,
|
||||
remotePath,
|
||||
|
||||
@@ -141,7 +141,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Providers.sftp.cancel(id);
|
||||
Pros.sftp.cancel(id);
|
||||
context.pop();
|
||||
},
|
||||
child: Text(l10n.ok),
|
||||
|
||||
Reference in New Issue
Block a user