mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: ssh tab
This commit is contained in:
@@ -111,7 +111,16 @@ class _HomePageState extends State<HomePage>
|
||||
|
||||
return Scaffold(
|
||||
drawer: _buildDrawer(),
|
||||
appBar: _buildAppBar(),
|
||||
appBar: CustomAppBar(
|
||||
title: const Text(BuildData.name),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.developer_mode, size: 23),
|
||||
tooltip: l10n.debug,
|
||||
onPressed: () => AppRoute.debug().go(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: PageView.builder(
|
||||
controller: _pageController,
|
||||
itemCount: AppTab.values.length,
|
||||
@@ -129,37 +138,6 @@ class _HomePageState extends State<HomePage>
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _buildAppBar() {
|
||||
final actions = <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.developer_mode, size: 23),
|
||||
tooltip: l10n.debug,
|
||||
onPressed: () => AppRoute.debug().go(context),
|
||||
),
|
||||
];
|
||||
if (isDesktop && _selectIndex.value == AppTab.server.index) {
|
||||
actions.add(
|
||||
ValueBuilder(
|
||||
listenable: _selectIndex,
|
||||
build: () {
|
||||
if (_selectIndex.value != AppTab.server.index) {
|
||||
return const SizedBox();
|
||||
}
|
||||
return IconButton(
|
||||
icon: const Icon(Icons.refresh, size: 23),
|
||||
tooltip: 'Refresh',
|
||||
onPressed: () => Pros.server.refreshData(onlyFailed: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
return CustomAppBar(
|
||||
title: const Text(BuildData.name),
|
||||
actions: actions,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomBar() {
|
||||
return NavigationBar(
|
||||
selectedIndex: _selectIndex.value,
|
||||
@@ -185,16 +163,16 @@ class _HomePageState extends State<HomePage>
|
||||
label: l10n.server,
|
||||
selectedIcon: const Icon(Icons.cloud),
|
||||
),
|
||||
const NavigationDestination(
|
||||
icon: Icon(Icons.terminal_outlined),
|
||||
label: 'SSH',
|
||||
selectedIcon: Icon(Icons.terminal),
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.snippet_folder_outlined),
|
||||
label: l10n.snippet,
|
||||
selectedIcon: const Icon(Icons.snippet_folder),
|
||||
),
|
||||
const NavigationDestination(
|
||||
icon: Icon(Icons.network_check_outlined),
|
||||
label: 'Ping',
|
||||
selectedIcon: Icon(Icons.network_check),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user