mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-11 05:43:26 +00:00
tabs
This commit is contained in:
@@ -9,7 +9,9 @@ import { LaunchGuardService } from './services/launch-guard.service';
|
|||||||
|
|
||||||
import { LoginComponent } from './accounts/login.component';
|
import { LoginComponent } from './accounts/login.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
import { DashboardComponent } from './tabs/dashboard.component';
|
||||||
|
import { SettingsComponent } from './tabs/settings.component';
|
||||||
|
import { TabsComponent } from './tabs/tabs.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: '/login', pathMatch: 'full' },
|
{ path: '', redirectTo: '/login', pathMatch: 'full' },
|
||||||
@@ -20,9 +22,25 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{ path: '2fa', component: TwoFactorComponent },
|
{ path: '2fa', component: TwoFactorComponent },
|
||||||
{
|
{
|
||||||
path: 'dashboard',
|
path: 'tabs',
|
||||||
component: DashboardComponent,
|
component: TabsComponent,
|
||||||
canActivate: [AuthGuardService],
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirectTo: '/tabs/dashboard',
|
||||||
|
pathMatch: 'full',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dashboard',
|
||||||
|
component: DashboardComponent,
|
||||||
|
canActivate: [AuthGuardService],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'settings',
|
||||||
|
component: SettingsComponent,
|
||||||
|
canActivate: [AuthGuardService],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ import { EnvironmentComponent } from './accounts/environment.component';
|
|||||||
import { LoginComponent } from './accounts/login.component';
|
import { LoginComponent } from './accounts/login.component';
|
||||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
import { DashboardComponent } from './tabs/dashboard.component';
|
||||||
|
import { SettingsComponent } from './tabs/settings.component';
|
||||||
|
import { TabsComponent } from './tabs/tabs.component';
|
||||||
|
|
||||||
import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive';
|
import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive';
|
||||||
import { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive';
|
import { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive';
|
||||||
@@ -63,8 +65,10 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';
|
|||||||
LoginComponent,
|
LoginComponent,
|
||||||
ModalComponent,
|
ModalComponent,
|
||||||
SearchCiphersPipe,
|
SearchCiphersPipe,
|
||||||
|
SettingsComponent,
|
||||||
StopClickDirective,
|
StopClickDirective,
|
||||||
StopPropDirective,
|
StopPropDirective,
|
||||||
|
TabsComponent,
|
||||||
TwoFactorComponent,
|
TwoFactorComponent,
|
||||||
TwoFactorOptionsComponent,
|
TwoFactorOptionsComponent,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class LaunchGuardService implements CanActivate {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.router.navigate(['/dashboard']);
|
this.router.navigate(['/tabs/dashboard']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
src/app/tabs/settings.component.html
Normal file
3
src/app/tabs/settings.component.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<i class="fa fa-rocket"></i>
|
||||||
|
|
||||||
|
The settings!!!
|
||||||
20
src/app/tabs/settings.component.ts
Normal file
20
src/app/tabs/settings.component.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
ViewChild,
|
||||||
|
ViewContainerRef,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-settings',
|
||||||
|
templateUrl: 'settings.component.html',
|
||||||
|
})
|
||||||
|
export class SettingsComponent {
|
||||||
|
constructor(analytics: Angulartics2, toasterService: ToasterService,
|
||||||
|
i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver) {}
|
||||||
|
}
|
||||||
13
src/app/tabs/tabs.component.html
Normal file
13
src/app/tabs/tabs.component.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<div class="tab-page">
|
||||||
|
<nav class="nav flex-column">
|
||||||
|
<a class="nav-link" routerLink="dashboard" routerLinkActive="active">
|
||||||
|
<i class="fa fa-rocket"></i>
|
||||||
|
{{'masterPass' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a class="nav-link" routerLink="settings" routerLinkActive="active">
|
||||||
|
<i class="fa fa-cogs"></i>
|
||||||
|
{{'settings' | i18n}}
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
7
src/app/tabs/tabs.component.ts
Normal file
7
src/app/tabs/tabs.component.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-tabs',
|
||||||
|
templateUrl: 'tabs.component.html',
|
||||||
|
})
|
||||||
|
export class TabsComponent { }
|
||||||
Reference in New Issue
Block a user