mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: use new routes
This commit is contained in:
@@ -110,8 +110,15 @@ class AppRoute {
|
|||||||
return AppRoute(SSHVirtKeySettingPage(key: key), 'ssh_virt_key_setting');
|
return AppRoute(SSHVirtKeySettingPage(key: key), 'ssh_virt_key_setting');
|
||||||
}
|
}
|
||||||
|
|
||||||
static AppRoute localStorage({Key? key}) {
|
static AppRoute localStorage(
|
||||||
return AppRoute(LocalStoragePage(key: key), 'local_storage');
|
{Key? key, bool isPickFile = false, String? initDir}) {
|
||||||
|
return AppRoute(
|
||||||
|
LocalStoragePage(
|
||||||
|
key: key,
|
||||||
|
isPickFile: isPickFile,
|
||||||
|
initDir: initDir,
|
||||||
|
),
|
||||||
|
'local_storage');
|
||||||
}
|
}
|
||||||
|
|
||||||
static AppRoute sftpMission({Key? key}) {
|
static AppRoute sftpMission({Key? key}) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import '../../data/model/server/snippet.dart';
|
|||||||
import '../../data/provider/snippet.dart';
|
import '../../data/provider/snippet.dart';
|
||||||
import '../../data/res/ui.dart';
|
import '../../data/res/ui.dart';
|
||||||
import '../../locator.dart';
|
import '../../locator.dart';
|
||||||
import '../../view/page/snippet/edit.dart';
|
|
||||||
import '../../view/widget/picker.dart';
|
import '../../view/widget/picker.dart';
|
||||||
import '../persistant_store.dart';
|
import '../persistant_store.dart';
|
||||||
import '../route.dart';
|
import '../route.dart';
|
||||||
@@ -146,7 +145,7 @@ void showSnippetDialog(
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
AppRoute(const SnippetEditPage(), 'edit snippet').go(context);
|
AppRoute.snippetEdit().go(context);
|
||||||
},
|
},
|
||||||
child: Text(s.add),
|
child: Text(s.add),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:toolbox/core/extension/navigator.dart';
|
import 'package:toolbox/core/extension/navigator.dart';
|
||||||
import 'package:toolbox/core/route.dart';
|
import 'package:toolbox/core/route.dart';
|
||||||
import 'package:toolbox/data/model/docker/image.dart';
|
import 'package:toolbox/data/model/docker/image.dart';
|
||||||
import 'package:toolbox/view/page/ssh_term.dart';
|
|
||||||
import 'package:toolbox/view/widget/input_field.dart';
|
import 'package:toolbox/view/widget/input_field.dart';
|
||||||
|
|
||||||
import '../../core/utils/ui.dart';
|
import '../../core/utils/ui.dart';
|
||||||
@@ -457,21 +456,15 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
context.pop();
|
context.pop();
|
||||||
break;
|
break;
|
||||||
case DockerMenuType.logs:
|
case DockerMenuType.logs:
|
||||||
AppRoute(
|
AppRoute.ssh(
|
||||||
SSHPage(
|
|
||||||
spi: widget.spi,
|
spi: widget.spi,
|
||||||
initCmd: 'docker logs -f --tail 100 ${dItem.containerId}',
|
initCmd: 'docker logs -f --tail 100 ${dItem.containerId}',
|
||||||
),
|
|
||||||
'Docker logs',
|
|
||||||
).go(context);
|
).go(context);
|
||||||
break;
|
break;
|
||||||
case DockerMenuType.terminal:
|
case DockerMenuType.terminal:
|
||||||
AppRoute(
|
AppRoute.ssh(
|
||||||
SSHPage(
|
|
||||||
spi: widget.spi,
|
spi: widget.spi,
|
||||||
initCmd: 'docker exec -it ${dItem.containerId} sh',
|
initCmd: 'docker exec -it ${dItem.containerId} sh',
|
||||||
),
|
|
||||||
'Docker terminal',
|
|
||||||
).go(context);
|
).go(context);
|
||||||
break;
|
break;
|
||||||
// case DockerMenuType.stats:
|
// case DockerMenuType.stats:
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import '../../data/model/server/server.dart';
|
|||||||
import '../../data/model/server/server_private_info.dart';
|
import '../../data/model/server/server_private_info.dart';
|
||||||
import '../../data/model/server/server_status.dart';
|
import '../../data/model/server/server_status.dart';
|
||||||
import '../../data/res/color.dart';
|
import '../../data/res/color.dart';
|
||||||
import 'server/edit.dart';
|
|
||||||
import 'setting/entry.dart';
|
|
||||||
|
|
||||||
class FullScreenPage extends StatefulWidget {
|
class FullScreenPage extends StatefulWidget {
|
||||||
const FullScreenPage({Key? key}) : super(key: key);
|
const FullScreenPage({Key? key}) : super(key: key);
|
||||||
@@ -117,10 +115,7 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
|||||||
|
|
||||||
Widget _buildSettingBtn() {
|
Widget _buildSettingBtn() {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.setting().go(context),
|
||||||
const SettingPage(),
|
|
||||||
'Setting',
|
|
||||||
).go(context),
|
|
||||||
icon: const Icon(Icons.settings, color: Colors.grey));
|
icon: const Icon(Icons.settings, color: Colors.grey));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,10 +124,7 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
|||||||
if (pro.serverOrder.isEmpty) {
|
if (pro.serverOrder.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.serverEdit().go(context),
|
||||||
const ServerEditPage(),
|
|
||||||
'Add server info page',
|
|
||||||
).go(context),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
_s.addAServer,
|
_s.addAServer,
|
||||||
style: const TextStyle(fontSize: 27),
|
style: const TextStyle(fontSize: 27),
|
||||||
|
|||||||
@@ -22,12 +22,6 @@ import '../../data/store/setting.dart';
|
|||||||
import '../../locator.dart';
|
import '../../locator.dart';
|
||||||
import '../widget/custom_appbar.dart';
|
import '../widget/custom_appbar.dart';
|
||||||
import '../widget/url_text.dart';
|
import '../widget/url_text.dart';
|
||||||
import 'backup.dart';
|
|
||||||
import 'convert.dart';
|
|
||||||
import 'debug.dart';
|
|
||||||
import 'private_key/list.dart';
|
|
||||||
import 'setting/entry.dart';
|
|
||||||
import 'storage/local.dart';
|
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
const HomePage({Key? key}) : super(key: key);
|
const HomePage({Key? key}) : super(key: key);
|
||||||
@@ -136,10 +130,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.developer_mode, size: 23),
|
icon: const Icon(Icons.developer_mode, size: 23),
|
||||||
tooltip: _s.debug,
|
tooltip: _s.debug,
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.debug().go(context),
|
||||||
const DebugPage(),
|
|
||||||
'Debug Page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
if (isDesktop && _selectIndex.value == AppTab.server.index) {
|
if (isDesktop && _selectIndex.value == AppTab.server.index) {
|
||||||
@@ -238,42 +229,27 @@ class _HomePageState extends State<HomePage>
|
|||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.settings),
|
leading: const Icon(Icons.settings),
|
||||||
title: Text(_s.setting),
|
title: Text(_s.setting),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.setting().go(context),
|
||||||
const SettingPage(),
|
|
||||||
'Setting',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.vpn_key),
|
leading: const Icon(Icons.vpn_key),
|
||||||
title: Text(_s.privateKey),
|
title: Text(_s.privateKey),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.keyList().go(context),
|
||||||
const PrivateKeysListPage(),
|
|
||||||
'private key list',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.download),
|
leading: const Icon(Icons.download),
|
||||||
title: Text(_s.download),
|
title: Text(_s.download),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.localStorage().go(context),
|
||||||
const LocalStoragePage(),
|
|
||||||
'sftp local page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.import_export),
|
leading: const Icon(Icons.import_export),
|
||||||
title: Text(_s.backup),
|
title: Text(_s.backup),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.backup().go(context),
|
||||||
BackupPage(),
|
|
||||||
'backup page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.code),
|
leading: const Icon(Icons.code),
|
||||||
title: Text(_s.convert),
|
title: Text(_s.convert),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.convert().go(context),
|
||||||
const ConvertPage(),
|
|
||||||
'convert page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.text_snippet),
|
leading: const Icon(Icons.text_snippet),
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import '../../../data/model/server/private_key_info.dart';
|
|||||||
import '../../../data/provider/private_key.dart';
|
import '../../../data/provider/private_key.dart';
|
||||||
import '../../../data/res/ui.dart';
|
import '../../../data/res/ui.dart';
|
||||||
import '../../widget/custom_appbar.dart';
|
import '../../widget/custom_appbar.dart';
|
||||||
import 'edit.dart';
|
|
||||||
import '../../../view/widget/round_rect_card.dart';
|
import '../../../view/widget/round_rect_card.dart';
|
||||||
|
|
||||||
class PrivateKeysListPage extends StatefulWidget {
|
class PrivateKeysListPage extends StatefulWidget {
|
||||||
@@ -44,10 +43,7 @@ class _PrivateKeyListState extends State<PrivateKeysListPage>
|
|||||||
body: _buildBody(),
|
body: _buildBody(),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.keyEdit().go(context),
|
||||||
const PrivateKeyEditPage(),
|
|
||||||
'private key edit page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -68,10 +64,8 @@ class _PrivateKeyListState extends State<PrivateKeysListPage>
|
|||||||
ListTile(
|
ListTile(
|
||||||
title: Text(key.pkis[idx].id),
|
title: Text(key.pkis[idx].id),
|
||||||
trailing: TextButton(
|
trailing: TextButton(
|
||||||
onPressed: () => AppRoute(
|
onPressed: () =>
|
||||||
PrivateKeyEditPage(pki: key.pkis[idx]),
|
AppRoute.keyEdit(pki: key.pkis[idx]).go(context),
|
||||||
'private key edit page',
|
|
||||||
).go(context),
|
|
||||||
child: Text(_s.edit),
|
child: Text(_s.edit),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -102,10 +96,7 @@ class _PrivateKeyListState extends State<PrivateKeysListPage>
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
AppRoute(
|
AppRoute.keyEdit(pki: sysPk).go(context);
|
||||||
PrivateKeyEditPage(pki: sysPk),
|
|
||||||
'private key edit page',
|
|
||||||
).go(context);
|
|
||||||
},
|
},
|
||||||
child: Text(_s.ok),
|
child: Text(_s.ok),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import '../../../data/store/private_key.dart';
|
|||||||
import '../../../locator.dart';
|
import '../../../locator.dart';
|
||||||
import '../../widget/custom_appbar.dart';
|
import '../../widget/custom_appbar.dart';
|
||||||
import '../../widget/tag.dart';
|
import '../../widget/tag.dart';
|
||||||
import '../private_key/edit.dart';
|
|
||||||
|
|
||||||
class ServerEditPage extends StatefulWidget {
|
class ServerEditPage extends StatefulWidget {
|
||||||
const ServerEditPage({Key? key, this.spi}) : super(key: key);
|
const ServerEditPage({Key? key, this.spi}) : super(key: key);
|
||||||
@@ -231,10 +230,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
icon: const Icon(Icons.add),
|
icon: const Icon(Icons.add),
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.keyEdit().go(context),
|
||||||
const PrivateKeyEditPage(),
|
|
||||||
'private key edit page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import '../../../locator.dart';
|
|||||||
import '../../widget/round_rect_card.dart';
|
import '../../widget/round_rect_card.dart';
|
||||||
import '../../widget/server_func_btns.dart';
|
import '../../widget/server_func_btns.dart';
|
||||||
import '../../widget/tag.dart';
|
import '../../widget/tag.dart';
|
||||||
import 'edit.dart';
|
|
||||||
|
|
||||||
class ServerPage extends StatefulWidget {
|
class ServerPage extends StatefulWidget {
|
||||||
const ServerPage({Key? key}) : super(key: key);
|
const ServerPage({Key? key}) : super(key: key);
|
||||||
@@ -63,10 +62,7 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: _buildBody(),
|
body: _buildBody(),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.serverEdit().go(context),
|
||||||
const ServerEditPage(),
|
|
||||||
'Add server info page',
|
|
||||||
).go(context),
|
|
||||||
tooltip: _s.addAServer,
|
tooltip: _s.addAServer,
|
||||||
heroTag: 'server',
|
heroTag: 'server',
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import 'package:toolbox/core/extension/stringx.dart';
|
|||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
import 'package:toolbox/core/route.dart';
|
import 'package:toolbox/core/route.dart';
|
||||||
import 'package:toolbox/data/model/app/net_view.dart';
|
import 'package:toolbox/data/model/app/net_view.dart';
|
||||||
import 'package:toolbox/view/page/setting/virt_key.dart';
|
|
||||||
import 'package:toolbox/view/widget/input_field.dart';
|
import 'package:toolbox/view/widget/input_field.dart';
|
||||||
import 'package:toolbox/view/widget/value_notifier.dart';
|
import 'package:toolbox/view/widget/value_notifier.dart';
|
||||||
|
|
||||||
@@ -814,10 +813,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(_s.editVirtKeys),
|
title: Text(_s.editVirtKeys),
|
||||||
trailing: const Icon(Icons.keyboard_arrow_right),
|
trailing: const Icon(Icons.keyboard_arrow_right),
|
||||||
onTap: () => AppRoute(
|
onTap: () => AppRoute.sshVirtKeySetting().go(context),
|
||||||
const SSHVirtKeySettingPage(),
|
|
||||||
'ssh virt key edit',
|
|
||||||
).go(context),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import '../../../locator.dart';
|
|||||||
import '../../widget/tag.dart';
|
import '../../widget/tag.dart';
|
||||||
import '/core/route.dart';
|
import '/core/route.dart';
|
||||||
import '/data/provider/snippet.dart';
|
import '/data/provider/snippet.dart';
|
||||||
import 'edit.dart';
|
|
||||||
import '/view/widget/round_rect_card.dart';
|
import '/view/widget/round_rect_card.dart';
|
||||||
|
|
||||||
class SnippetListPage extends StatefulWidget {
|
class SnippetListPage extends StatefulWidget {
|
||||||
@@ -46,10 +45,7 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
|||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
heroTag: 'snippet',
|
heroTag: 'snippet',
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.snippetEdit().go(context),
|
||||||
const SnippetEditPage(),
|
|
||||||
'snippet edit page',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -121,10 +117,8 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => AppRoute(
|
onPressed: () =>
|
||||||
SnippetEditPage(snippet: snippet),
|
AppRoute.snippetEdit(snippet: snippet).go(context),
|
||||||
'snippet edit page',
|
|
||||||
).go(context),
|
|
||||||
icon: const Icon(Icons.edit),
|
icon: const Icon(Icons.edit),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import 'package:toolbox/data/provider/server.dart';
|
|||||||
import 'package:toolbox/data/provider/sftp.dart';
|
import 'package:toolbox/data/provider/sftp.dart';
|
||||||
import 'package:toolbox/data/res/misc.dart';
|
import 'package:toolbox/data/res/misc.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
import 'package:toolbox/view/page/editor.dart';
|
|
||||||
import 'package:toolbox/view/widget/input_field.dart';
|
import 'package:toolbox/view/widget/input_field.dart';
|
||||||
import 'package:toolbox/view/widget/picker.dart';
|
import 'package:toolbox/view/widget/picker.dart';
|
||||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||||
@@ -23,13 +22,15 @@ import '../../../data/res/path.dart';
|
|||||||
import '../../../data/res/ui.dart';
|
import '../../../data/res/ui.dart';
|
||||||
import '../../widget/custom_appbar.dart';
|
import '../../widget/custom_appbar.dart';
|
||||||
import '../../widget/fade_in.dart';
|
import '../../widget/fade_in.dart';
|
||||||
import 'sftp_mission.dart';
|
|
||||||
|
|
||||||
class LocalStoragePage extends StatefulWidget {
|
class LocalStoragePage extends StatefulWidget {
|
||||||
final bool isPickFile;
|
final bool isPickFile;
|
||||||
final String? initDir;
|
final String? initDir;
|
||||||
const LocalStoragePage({Key? key, this.isPickFile = false, this.initDir})
|
const LocalStoragePage({
|
||||||
: super(key: key);
|
Key? key,
|
||||||
|
required this.isPickFile,
|
||||||
|
this.initDir,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LocalStoragePage> createState() => _LocalStoragePageState();
|
State<LocalStoragePage> createState() => _LocalStoragePageState();
|
||||||
@@ -78,10 +79,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
|||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.downloading),
|
icon: const Icon(Icons.downloading),
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.sftpMission().go(context),
|
||||||
const SftpMissionPage(),
|
|
||||||
'sftp downloading',
|
|
||||||
).go(context),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -256,11 +254,8 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final result = await AppRoute(
|
final result = await AppRoute.editor(
|
||||||
EditorPage(
|
|
||||||
path: file.absolute.path,
|
path: file.absolute.path,
|
||||||
),
|
|
||||||
'sftp dled editor',
|
|
||||||
).go<String>(context);
|
).go<String>(context);
|
||||||
final f = File(file.absolute.path);
|
final f = File(file.absolute.path);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import 'package:toolbox/core/extension/navigator.dart';
|
|||||||
import 'package:toolbox/core/extension/sftpfile.dart';
|
import 'package:toolbox/core/extension/sftpfile.dart';
|
||||||
import 'package:toolbox/data/res/misc.dart';
|
import 'package:toolbox/data/res/misc.dart';
|
||||||
import 'package:toolbox/data/store/history.dart';
|
import 'package:toolbox/data/store/history.dart';
|
||||||
import 'package:toolbox/view/page/editor.dart';
|
|
||||||
import 'package:toolbox/view/page/storage/local.dart';
|
|
||||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||||
|
|
||||||
import '../../../core/extension/numx.dart';
|
import '../../../core/extension/numx.dart';
|
||||||
@@ -31,7 +29,6 @@ import '../../widget/custom_appbar.dart';
|
|||||||
import '../../widget/fade_in.dart';
|
import '../../widget/fade_in.dart';
|
||||||
import '../../widget/input_field.dart';
|
import '../../widget/input_field.dart';
|
||||||
import '../../widget/two_line_text.dart';
|
import '../../widget/two_line_text.dart';
|
||||||
import 'sftp_mission.dart';
|
|
||||||
|
|
||||||
class SftpPage extends StatefulWidget {
|
class SftpPage extends StatefulWidget {
|
||||||
final ServerPrivateInfo spi;
|
final ServerPrivateInfo spi;
|
||||||
@@ -92,10 +89,7 @@ class _SftpPageState extends State<SftpPage> {
|
|||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.downloading),
|
icon: const Icon(Icons.downloading),
|
||||||
onPressed: () => AppRoute(
|
onPressed: () => AppRoute.sftpMission().go(context),
|
||||||
const SftpMissionPage(),
|
|
||||||
'sftp downloading',
|
|
||||||
).go(context),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -176,11 +170,7 @@ class _SftpPageState extends State<SftpPage> {
|
|||||||
final path = await () async {
|
final path = await () async {
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case 0:
|
case 0:
|
||||||
return await AppRoute(
|
return await AppRoute.localStorage(isPickFile: true)
|
||||||
const LocalStoragePage(
|
|
||||||
isPickFile: true,
|
|
||||||
),
|
|
||||||
'sftp dled pick')
|
|
||||||
.go<String>(context);
|
.go<String>(context);
|
||||||
case 1:
|
case 1:
|
||||||
return await pickOneFile();
|
return await pickOneFile();
|
||||||
@@ -390,10 +380,7 @@ class _SftpPageState extends State<SftpPage> {
|
|||||||
await completer.future;
|
await completer.future;
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|
||||||
final result = await AppRoute(
|
final result = await AppRoute.editor(path: localPath).go<String>(context);
|
||||||
EditorPage(path: localPath),
|
|
||||||
'SFTP edit',
|
|
||||||
).go<String>(context);
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
_sftp.add(SftpReq(req.spi, remotePath, localPath, SftpReqType.upload));
|
_sftp.add(SftpReq(req.spi, remotePath, localPath, SftpReqType.upload));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:toolbox/core/extension/datetime.dart';
|
|||||||
import 'package:toolbox/core/extension/navigator.dart';
|
import 'package:toolbox/core/extension/navigator.dart';
|
||||||
import 'package:toolbox/core/route.dart';
|
import 'package:toolbox/core/route.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
import 'package:toolbox/view/page/storage/local.dart';
|
|
||||||
|
|
||||||
import '../../../core/extension/numx.dart';
|
import '../../../core/extension/numx.dart';
|
||||||
import '../../../core/utils/misc.dart';
|
import '../../../core/utils/misc.dart';
|
||||||
@@ -77,10 +76,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
final idx = status.req.localPath.lastIndexOf('/');
|
final idx = status.req.localPath.lastIndexOf('/');
|
||||||
final dir = status.req.localPath.substring(0, idx);
|
final dir = status.req.localPath.substring(0, idx);
|
||||||
AppRoute(
|
AppRoute.localStorage(initDir: dir).go(context);
|
||||||
LocalStoragePage(initDir: dir),
|
|
||||||
'sftp local',
|
|
||||||
).go(context);
|
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.file_open)),
|
icon: const Icon(Icons.file_open)),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import '../../data/model/server/server_private_info.dart';
|
|||||||
import '../../data/model/server/snippet.dart';
|
import '../../data/model/server/snippet.dart';
|
||||||
import '../../data/provider/snippet.dart';
|
import '../../data/provider/snippet.dart';
|
||||||
import '../../locator.dart';
|
import '../../locator.dart';
|
||||||
import '../page/process.dart';
|
|
||||||
import 'tag.dart';
|
import 'tag.dart';
|
||||||
|
|
||||||
class ServerFuncBtns extends StatelessWidget {
|
class ServerFuncBtns extends StatelessWidget {
|
||||||
@@ -84,7 +83,7 @@ class ServerFuncBtns extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case ServerTabMenuType.process:
|
case ServerTabMenuType.process:
|
||||||
AppRoute(ProcessPage(spi: spi), 'process page').checkGo(
|
AppRoute.process(spi: spi).checkGo(
|
||||||
context: context,
|
context: context,
|
||||||
check: () => _checkClient(context, spi.id),
|
check: () => _checkClient(context, spi.id),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user