Rewrote the urls
This commit is contained in:
parent
9ccab35558
commit
302765b5fe
@ -3,19 +3,17 @@ import {Routes, RouterModule} from '@angular/router';
|
||||
import {DashboardComponent} from './dashboard/dashboard.component';
|
||||
import {WeatherComponent} from './weather/weather.component';
|
||||
import {SecurityComponent} from './security/security.component';
|
||||
import {SettingsComponent} from './settings/settings.component';
|
||||
import {BatteryComponent} from './battery/battery.component';
|
||||
import {LoginComponent} from './login/login.component';
|
||||
import {LoginGuard} from './login/login.guard';
|
||||
|
||||
const routes: Routes = [
|
||||
{path: 'battery', component: BatteryComponent, canActivate: [LoginGuard]},
|
||||
{path: 'dashboard', component: DashboardComponent, canActivate: [LoginGuard]},
|
||||
{path: 'login', component: LoginComponent, data: {hide: true, noAnimation: true}},
|
||||
{path: 'security', component: SecurityComponent, canActivate: [LoginGuard]},
|
||||
{path: 'settings', component: SettingsComponent, canActivate: [LoginGuard]},
|
||||
{path: 'weather', component: WeatherComponent, canActivate: [LoginGuard]},
|
||||
{path: '**', redirectTo: '/dashboard'}
|
||||
{path: '', component: DashboardComponent, canActivate: [LoginGuard]},
|
||||
{path: '**', redirectTo: '/'}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -10,7 +10,7 @@
|
||||
<mat-drawer class="bg-primary" [mode]="mobile ? 'push' : 'side'" [opened]="open" [disableClose]="!mobile" [autoFocus]="false">
|
||||
<mat-nav-list class="p-0">
|
||||
<mat-divider></mat-divider>
|
||||
<a mat-list-item routerLink="dashboard" routerLinkActive="active"><span class="p-3 pl-0 mr-5"><mat-icon class="mr-2">insert_chart</mat-icon> Dashboard</span></a>
|
||||
<a mat-list-item routerLink="" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"><span class="p-3 pl-0 mr-5"><mat-icon class="mr-2">insert_chart</mat-icon> Dashboard</span></a>
|
||||
<mat-divider></mat-divider>
|
||||
<a mat-list-item routerLink="battery" routerLinkActive="active"><span class="p-3 pl-0 mr-5"><mat-icon class="mr-2">{{batteryService.icon}}</mat-icon> Powerwall</span></a>
|
||||
<mat-divider></mat-divider>
|
||||
@ -18,8 +18,6 @@
|
||||
<mat-divider></mat-divider>
|
||||
<a mat-list-item routerLink="security" routerLinkActive="active"><span class="p-3 pl-0 mr-5"><mat-icon class="mr-2">security</mat-icon> Security</span></a>
|
||||
<mat-divider></mat-divider>
|
||||
<a mat-list-item routerLink="settings" routerLinkActive="active"><span class="p-3 pl-0 mr-5"><mat-icon class="mr-2">settings</mat-icon> Settings</span></a>
|
||||
<mat-divider></mat-divider>
|
||||
<a mat-list-item (click)="logout()"><span class="p-3 pl-0 mr-5" style="color: darkred"><mat-icon class="mr-2">logout</mat-icon> Logout</span></a>
|
||||
<mat-divider></mat-divider>
|
||||
</mat-nav-list>
|
||||
|
@ -18,7 +18,6 @@ import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
import {BatteryComponent} from './battery/battery.component';
|
||||
import {WeatherComponent} from './weather/weather.component';
|
||||
import {SecurityComponent} from './security/security.component';
|
||||
import { SettingsComponent } from './settings/settings.component';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {LoginComponent} from './login/login.component';
|
||||
import {environment} from '../environments/environment';
|
||||
@ -36,7 +35,6 @@ export const firebaseApp = firebase.initializeApp(environment.firebase);
|
||||
BatteryComponent,
|
||||
WeatherComponent,
|
||||
SecurityComponent,
|
||||
SettingsComponent,
|
||||
LoginComponent,
|
||||
RoundPipe
|
||||
],
|
||||
|
@ -1 +0,0 @@
|
||||
<h3 class="mt-3 text-center">Coming Soon</h3>
|
@ -1,14 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
templateUrl: './settings.component.html'
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user