fix: windows bakup (#188)
This commit is contained in:
@@ -80,7 +80,8 @@ Future<SSHClient> genClient(
|
||||
timeout: timeout,
|
||||
);
|
||||
// Use `0.0.0.0` as localhost to use all interfaces.
|
||||
return await jumpClient.forwardLocal(spi.ip, spi.port, localHost: '0.0.0.0');
|
||||
return await jumpClient.forwardLocal(spi.ip, spi.port,
|
||||
localHost: '0.0.0.0');
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
@@ -271,7 +271,8 @@ class ServerProvider extends ChangeNotifier {
|
||||
s.client = await genClient(
|
||||
spi,
|
||||
timeout: Stores.setting.timeoutD,
|
||||
jumpSpi: spi.jumpId == null ? null : Stores.server.box.get(spi.jumpId),
|
||||
jumpSpi:
|
||||
spi.jumpId == null ? null : Stores.server.box.get(spi.jumpId),
|
||||
);
|
||||
} catch (e) {
|
||||
_limiter.inc(sid);
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 606;
|
||||
static const int build = 607;
|
||||
static const String engine = "3.13.7";
|
||||
static const String buildAt = "2023-10-21 19:26:34";
|
||||
static const String buildAt = "2023-10-22 14:20:27";
|
||||
static const int modifications = 4;
|
||||
static const int script = 22;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import 'package:toolbox/view/widget/expand_tile.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/store_switch.dart';
|
||||
import 'package:toolbox/view/widget/value_notifier.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../core/utils/misc.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
@@ -63,10 +64,7 @@ class BackupPage extends StatelessWidget {
|
||||
l10n.backupTip,
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
onTap: () async {
|
||||
await Backup.backup();
|
||||
await shareFiles([await Paths.bak]);
|
||||
},
|
||||
onTap: _onBackup,
|
||||
),
|
||||
ListTile(
|
||||
trailing: const Icon(Icons.restore),
|
||||
@@ -150,6 +148,21 @@ class BackupPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _onBackup() async {
|
||||
await Backup.backup();
|
||||
final path = await Paths.bak;
|
||||
|
||||
/// Issue #188
|
||||
if (isWindows) {
|
||||
await launchUrl(
|
||||
File(path).uri,
|
||||
mode: LaunchMode.externalNonBrowserApplication,
|
||||
);
|
||||
} else {
|
||||
await shareFiles([path]);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onRestore(BuildContext context) async {
|
||||
final path = await pickOneFile();
|
||||
if (path == null) return;
|
||||
|
||||
Reference in New Issue
Block a user