gui FEATURE device autoconnect
Let user to specify certain devices to be automatically connected when
the user login. It is actually not strictly when the user login, but
as soon as he opens Netopeer tab first time after login.
The patch also adds possibility to add own name to the device in the
inventory. Such a name is then used in configuration tab when the device
is connected.
Another change is that Netopeer dashboard now shows the currently connected
device. This is mainly due to the autoconnection feature to see that it
works and to allow simly go to the autoconnected device configuration.
Fixes #7
diff --git a/frontend/dashboard.component.ts b/frontend/dashboard.component.ts
index 636f735..e2759b2 100644
--- a/frontend/dashboard.component.ts
+++ b/frontend/dashboard.component.ts
@@ -1,9 +1,21 @@
import { Component } from '@angular/core';
+import {Router} from '@angular/router';
+
+import {SessionsService} from './config/sessions.service';
@Component({
selector : 'netopeer-dashboard',
templateUrl : './dashboard.component.html',
- styleUrls : ['./netopeer.scss']
+ styleUrls : ['./netopeer.scss', 'inventory/inventory.component.scss']
})
-export class DashboardComponent { }
+export class DashboardComponent {
+
+ constructor(public sessionsService: SessionsService,
+ private router: Router) {}
+
+ gotoConfig(session) {
+ this.sessionsService.changeActiveSession(session.key);
+ this.router.navigateByUrl('/netopeer/config');
+ }
+}