mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
refactors (#539)
This commit is contained in:
@@ -58,7 +58,7 @@ class AppRoutes {
|
||||
return Future.value(null);
|
||||
}
|
||||
|
||||
static AppRoutes serverDetail({Key? key, required ServerPrivateInfo spi}) {
|
||||
static AppRoutes serverDetail({Key? key, required Spi spi}) {
|
||||
return AppRoutes(ServerDetailPage(key: key, spi: spi), 'server_detail');
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class AppRoutes {
|
||||
return AppRoutes(ServerPage(key: key), 'server_tab');
|
||||
}
|
||||
|
||||
static AppRoutes serverEdit({Key? key, ServerPrivateInfo? spi}) {
|
||||
static AppRoutes serverEdit({Key? key, Spi? spi}) {
|
||||
return AppRoutes(
|
||||
ServerEditPage(spi: spi),
|
||||
'server_${spi == null ? 'add' : 'edit'}',
|
||||
@@ -97,7 +97,7 @@ class AppRoutes {
|
||||
|
||||
static AppRoutes ssh({
|
||||
Key? key,
|
||||
required ServerPrivateInfo spi,
|
||||
required Spi spi,
|
||||
String? initCmd,
|
||||
Snippet? initSnippet,
|
||||
}) {
|
||||
@@ -133,7 +133,7 @@ class AppRoutes {
|
||||
|
||||
static AppRoutes sftp(
|
||||
{Key? key,
|
||||
required ServerPrivateInfo spi,
|
||||
required Spi spi,
|
||||
String? initPath,
|
||||
bool isSelect = false}) {
|
||||
return AppRoutes(
|
||||
@@ -150,7 +150,7 @@ class AppRoutes {
|
||||
return AppRoutes(BackupPage(key: key), 'backup');
|
||||
}
|
||||
|
||||
static AppRoutes docker({Key? key, required ServerPrivateInfo spi}) {
|
||||
static AppRoutes docker({Key? key, required Spi spi}) {
|
||||
return AppRoutes(ContainerPage(key: key, spi: spi), 'docker');
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ class AppRoutes {
|
||||
return AppRoutes(PingPage(key: key), 'ping');
|
||||
}
|
||||
|
||||
static AppRoutes process({Key? key, required ServerPrivateInfo spi}) {
|
||||
static AppRoutes process({Key? key, required Spi spi}) {
|
||||
return AppRoutes(ProcessPage(key: key, spi: spi), 'process');
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class AppRoutes {
|
||||
'snippet_result');
|
||||
}
|
||||
|
||||
static AppRoutes iperf({Key? key, required ServerPrivateInfo spi}) {
|
||||
static AppRoutes iperf({Key? key, required Spi spi}) {
|
||||
return AppRoutes(IPerfPage(key: key, spi: spi), 'iperf');
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ class AppRoutes {
|
||||
return AppRoutes(ServerFuncBtnsOrderPage(key: key), 'server_func_btns_seq');
|
||||
}
|
||||
|
||||
static AppRoutes pve({Key? key, required ServerPrivateInfo spi}) {
|
||||
static AppRoutes pve({Key? key, required Spi spi}) {
|
||||
return AppRoutes(PvePage(key: key, spi: spi), 'pve');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ String getPrivateKey(String id) {
|
||||
}
|
||||
|
||||
Future<SSHClient> genClient(
|
||||
ServerPrivateInfo spi, {
|
||||
Spi spi, {
|
||||
void Function(GenSSHClientStatus)? onStatus,
|
||||
|
||||
/// Only pass this param if using multi-threading and key login
|
||||
@@ -52,10 +52,10 @@ Future<SSHClient> genClient(
|
||||
String? jumpPrivateKey,
|
||||
Duration timeout = const Duration(seconds: 5),
|
||||
|
||||
/// [ServerPrivateInfo] of the jump server
|
||||
/// [Spi] of the jump server
|
||||
///
|
||||
/// Must pass this param if using multi-threading and key login
|
||||
ServerPrivateInfo? jumpSpi,
|
||||
Spi? jumpSpi,
|
||||
|
||||
/// Handle keyboard-interactive authentication
|
||||
FutureOr<List<String>?> Function(SSHUserInfoRequest)? onKeyboardInteractive,
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:server_box/data/provider/app.dart';
|
||||
|
||||
abstract final class KeybordInteractive {
|
||||
static FutureOr<List<String>?> defaultHandle(
|
||||
ServerPrivateInfo spi, {
|
||||
Spi spi, {
|
||||
BuildContext? ctx,
|
||||
}) async {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user