]> git.proxmox.com Git - flutter/pve_flutter_frontend.git/commitdiff
enable multi session usage
authorTim Marx <t.marx@proxmox.com>
Fri, 18 Sep 2020 10:56:00 +0000 (12:56 +0200)
committerTim Marx <t.marx@proxmox.com>
Fri, 18 Sep 2020 10:56:00 +0000 (12:56 +0200)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
lib/main.dart
lib/pages/main_layout_slim.dart

index e643371c6a67c0e867e0d5be031a2e8f6c6f5eca..d7202253c954d8a8dc0eba3c882270c2116e081b 100644 (file)
@@ -144,9 +144,6 @@ class MyApp extends StatelessWidget {
 
           if (authbloc.state.value is Unauthenticated ||
               context.name == '/login') {
-            ProxmoxLoginStorage.fromLocalStorage()
-                .then((storage) => storage?.invalidateAllSessions());
-
             return MaterialPageRoute(
               builder: (context) {
                 return StreamListener<PveAuthenticationState>(
index 0bc90eb64e759d089d6e75043608cb863347689b..623939bfa322b379a24dc7969528d466ee13c0f9 100644 (file)
@@ -114,14 +114,15 @@ class PveMobileBottomNavigationbar extends StatelessWidget {
   Widget build(BuildContext context) {
     final pageSelector = Provider.of<BehaviorSubject<int>>(context);
     return BottomNavigationBar(
+        type: BottomNavigationBarType.fixed,
         backgroundColor: Colors.white,
         items: [
           BottomNavigationBarItem(
-            icon: Icon(
-              Icons.dashboard,
-            ),
-            label: "Dashboard",
-          ),
+              icon: Icon(
+                Icons.dashboard,
+              ),
+              label: "Dashboard",
+              backgroundColor: Theme.of(context).primaryColor),
           BottomNavigationBarItem(
             icon: Icon(
               Icons.developer_board,
@@ -134,9 +135,22 @@ class PveMobileBottomNavigationbar extends StatelessWidget {
             ),
             label: "Access",
           ),
+          BottomNavigationBarItem(
+            icon: Icon(
+              Icons.logout,
+            ),
+            label: "Sites",
+          ),
         ],
         currentIndex: pageSelector.value,
-        onTap: (index) => pageSelector.add(index));
+        onTap: (index) {
+          if (index == 3) {
+            Provider.of<PveAuthenticationBloc>(context).events.add(LoggedOut());
+            Navigator.of(context).pushReplacementNamed('/login');
+          } else {
+            pageSelector.add(index);
+          }
+        });
   }
 }
 
@@ -977,17 +991,6 @@ class MobileAccessManagement extends StatelessWidget {
           //backgroundColor: Colors.transparent,
           elevation: 0.0,
           automaticallyImplyLeading: false,
-          actions: [
-            IconButton(
-                icon: Icon(Icons.input),
-                tooltip: "Logout",
-                onPressed: () {
-                  Provider.of<PveAuthenticationBloc>(context)
-                      .events
-                      .add(LoggedOut());
-                  Navigator.of(context).pushReplacementNamed('/login');
-                })
-          ],
           bottom: TabBar(isScrollable: true, tabs: [
             Tab(
               text: 'Users',