From da66377a9640e529c07f159b63f47cf97c72f9e8 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 6 Apr 2018 17:11:24 +0900 Subject: [PATCH] pages/auth layout --- src/app/app-routing.module.ts | 30 +++------ src/app/app.component.html | 51 +++++++------- src/app/app.component.spec.ts | 39 ----------- src/app/app.component.ts | 11 +++- .../pages/home/home-page-routing.module.ts | 16 +++++ src/app/pages/home/home-page.component.html | 3 + src/app/pages/home/home-page.component.scss | 0 src/app/pages/home/home-page.component.ts | 15 +++++ src/app/pages/home/home-page.module.ts | 14 ++++ src/app/pages/pages-routing.module.ts | 4 +- src/app/pages/pages.component.html | 2 +- .../{pages => layout/css}/primeng.min.css | 0 src/assets/translations/of-en.json | 19 ++++++ src/assets/translations/of-kr.json | 19 ++++++ .../component/signin/signin.component.html | 66 ++++++++++++++++++- 15 files changed, 201 insertions(+), 88 deletions(-) delete mode 100644 src/app/app.component.spec.ts create mode 100644 src/app/pages/home/home-page-routing.module.ts create mode 100644 src/app/pages/home/home-page.component.html create mode 100644 src/app/pages/home/home-page.component.scss create mode 100644 src/app/pages/home/home-page.component.ts create mode 100644 src/app/pages/home/home-page.module.ts rename src/assets/{pages => layout/css}/primeng.min.css (100%) create mode 100644 src/assets/translations/of-en.json create mode 100644 src/assets/translations/of-kr.json diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1d0192d..f771974 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,25 +1,15 @@ -// import { NgModule } from '@angular/core'; -// import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; -// import { AuthGuard } from './commons/guard/auth.guard'; +import { NgModule } from '@angular/core'; +import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; +import { AuthGuard } from './commons/guard/auth.guard'; -// const routes: Routes = [ -// { path: '', loadChildren: './pages/pages.module#PagesModule' }, -// { path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' }, -// { path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' }, -// ]; - -// @NgModule({ -// imports: [RouterModule.forRoot(routes, {useHash: true, preloadingStrategy: PreloadAllModules})], -// exports: [RouterModule], -// }) -// export class AppRoutingModule { } - -import { Routes, RouterModule } from '@angular/router'; -import { ModuleWithProviders } from '@angular/core'; - -export const routes: Routes = [ +const routes: Routes = [ { path: '', loadChildren: './pages/pages.module#PagesModule' }, { path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' }, + // { path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' }, ]; -export const AppRoutingModule: ModuleWithProviders = RouterModule.forRoot(routes); +@NgModule({ + imports: [RouterModule.forRoot(routes, {useHash: true, preloadingStrategy: PreloadAllModules})], + exports: [RouterModule], +}) +export class AppRoutingModule { } diff --git a/src/app/app.component.html b/src/app/app.component.html index 56e8223..b9662e5 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,7 +1,10 @@ -
+
+ +
+ +
-
- + -
- - - - -
- -
- - -
- - - +
+ + + +
+ +
+ + +
+ + + +
+
+ + + +
- - - -
- -
+ \ No newline at end of file diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts deleted file mode 100644 index 9d4d212..0000000 --- a/src/app/app.component.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* tslint:disable:no-unused-variable */ - -import { TestBed, async } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; -import { AppTopbarComponent } from './app.topbar.component'; -import { AppRightpanelComponent} from './app.rightpanel.component'; -import { AppInlineProfileComponent } from './app.profile.component'; -import { AppFooterComponent } from './app.footer.component'; -import { AppBreadcrumbComponent } from './app.breadcrumb.component'; -import { AppMenuComponent, AppSubMenuComponent } from './app.menu.component'; -import { BreadcrumbService } from './breadcrumb.service'; -import {ScrollPanel} from 'primeng/primeng'; - -describe('AppComponent', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ RouterTestingModule ], - declarations: [ AppComponent, - AppTopbarComponent, - AppMenuComponent, - AppSubMenuComponent, - AppFooterComponent, - AppBreadcrumbComponent, - AppInlineProfileComponent, - AppRightpanelComponent, - ScrollPanel - ], - providers: [BreadcrumbService] - }); - TestBed.compileComponents(); - }); - - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); -}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 052ac35..7f9cd09 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,6 @@ import { Component, AfterViewInit, ElementRef, Renderer, ViewChild, OnDestroy, OnInit, NgZone } from '@angular/core'; import { ScrollPanel } from 'primeng/primeng'; +import { Router } from '@angular/router'; enum MenuOrientation { STATIC, @@ -59,9 +60,13 @@ export class AppComponent implements AfterViewInit, OnDestroy, OnInit { rippleMouseDownListener: any; - constructor(public renderer: Renderer, public zone: NgZone) { } + constructor(public renderer: Renderer, public zone: NgZone, private router: Router) { } ngOnInit() { + if (this.isAuthRouteActivated()) { + console.log('auth?'); + return; + } this.zone.runOutsideAngular(() => { this.bindRipple(); }); } @@ -310,4 +315,8 @@ export class AppComponent implements AfterViewInit, OnDestroy, OnInit { this.unbindRipple(); } + isAuthRouteActivated() { + return this.router.url.indexOf('/auth') > -1; + } + } diff --git a/src/app/pages/home/home-page-routing.module.ts b/src/app/pages/home/home-page-routing.module.ts new file mode 100644 index 0000000..126218e --- /dev/null +++ b/src/app/pages/home/home-page-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { HomePageComponent } from './home-page.component'; + +const routes: Routes = [ + { + path: '', + component: HomePageComponent, + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class HomePageRoutingModule { } diff --git a/src/app/pages/home/home-page.component.html b/src/app/pages/home/home-page.component.html new file mode 100644 index 0000000..4f86c00 --- /dev/null +++ b/src/app/pages/home/home-page.component.html @@ -0,0 +1,3 @@ +

+ Home works! +

diff --git a/src/app/pages/home/home-page.component.scss b/src/app/pages/home/home-page.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts new file mode 100644 index 0000000..e9f6e3f --- /dev/null +++ b/src/app/pages/home/home-page.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'of-pages-home', + templateUrl: './home-page.component.html', + styleUrls: ['./home-page.component.scss'] +}) +export class HomePageComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/pages/home/home-page.module.ts b/src/app/pages/home/home-page.module.ts new file mode 100644 index 0000000..f6a9eeb --- /dev/null +++ b/src/app/pages/home/home-page.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { HomePageComponent } from './home-page.component'; +import { HomePageRoutingModule } from './home-page-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + HomePageRoutingModule, + ], + declarations: [HomePageComponent] +}) +export class HomePageModule { } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index c268df5..428a539 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -8,8 +8,8 @@ const routes: Routes = [ path: '', component: PagesComponent, children: [ - // { path: '', redirectTo: 'home' }, - // { path: 'home', loadChildren: './home/home-page.module#HomePageModule' }, + { path: '', redirectTo: 'home' }, + { path: 'home', loadChildren: './home/home-page.module#HomePageModule' }, // { path: 'probes', loadChildren: './probes/probes-page.module#ProbesPageModule' }, // { path: 'probe', loadChildren: './probe/probe-page.module#ProbePageModule' }, // { path: 'sensors', loadChildren: './sensors/sensors-page.module#SensorsPageModule' }, diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html index 4340d37..90c6b64 100644 --- a/src/app/pages/pages.component.html +++ b/src/app/pages/pages.component.html @@ -1 +1 @@ -
pages-component
\ No newline at end of file + \ No newline at end of file diff --git a/src/assets/pages/primeng.min.css b/src/assets/layout/css/primeng.min.css similarity index 100% rename from src/assets/pages/primeng.min.css rename to src/assets/layout/css/primeng.min.css diff --git a/src/assets/translations/of-en.json b/src/assets/translations/of-en.json new file mode 100644 index 0000000..929b0f6 --- /dev/null +++ b/src/assets/translations/of-en.json @@ -0,0 +1,19 @@ +{ + "App": { + "Title": "overFlow", + "Subtitle": "It's a small world", + "Home": "Home", + "Infra": "Infra", + "Map": "Map", + "Sensors": "Sensors", + "SensorSetting": "SensorSetting", + "Probes": "Probes", + "Monitor": "Monitor", + "Overview": "Overview", + "Dashboards": "Dashboards", + "Alert": "Alert", + "Report": "Report", + "Log": "Log", + "Setting":"Setting" + } +} diff --git a/src/assets/translations/of-kr.json b/src/assets/translations/of-kr.json new file mode 100644 index 0000000..bfd4ec3 --- /dev/null +++ b/src/assets/translations/of-kr.json @@ -0,0 +1,19 @@ +{ + "App": { + "Title": "오버플로우", + "Subtitle": "It's a small world", + "Home": "홈", + "Infra": "인프라", + "Map": "맵", + "Sensors": "센서", + "SensorSetting": "센서설정", + "Probes": "프로브", + "Monitor": "모니터", + "Overview": "오버뷰", + "Dashboards": "대시보드", + "Alert": "알림", + "Report": "리포트", + "Log": "기록", + "Setting":"설정" + } +} diff --git a/src/packages/member/component/signin/signin.component.html b/src/packages/member/component/signin/signin.component.html index a8e7b3c..6b97055 100644 --- a/src/packages/member/component/signin/signin.component.html +++ b/src/packages/member/component/signin/signin.component.html @@ -1 +1,65 @@ -
signin
\ No newline at end of file + + + + + + + + + + overFlow + + + + + + + + + + + + + + + +