probe menu

This commit is contained in:
insanity 2018-01-30 18:12:56 +09:00
parent abd35226bd
commit ef3e6a2e27
23 changed files with 241 additions and 8 deletions

View File

@ -4,12 +4,15 @@ import { SidebarComponent } from './sidebar/sidebar.component';
import { HeaderComponent } from './header/header.component'; import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component'; import { FooterComponent } from './footer/footer.component';
import { MenuItemComponent } from './menu-item/menu-item.component'; import { MenuItemComponent } from './menu-item/menu-item.component';
import { SubMenubarComponent } from './sub-menubar/sub-menubar.component';
import { FlexLayoutModule } from '@angular/flex-layout';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule CommonModule,
FlexLayoutModule,
], ],
declarations: [SidebarComponent, HeaderComponent, FooterComponent, MenuItemComponent] declarations: [SidebarComponent, HeaderComponent, FooterComponent, MenuItemComponent, SubMenubarComponent]
}) })
export class LayoutsModule { } export class LayoutsModule { }

View File

@ -51,7 +51,7 @@ export const menus = [
'name': 'Dashboards', 'name': 'Dashboards',
'link': '', 'link': '',
'icon': 'indeterminate_check_box', 'icon': 'indeterminate_check_box',
'chip': false, 'chip': { 'value': 3, 'color': 'accent'},
'open': false, 'open': false,
}, },
] ]

View File

@ -0,0 +1,6 @@
<nav mat-tab-nav-bar>
<a mat-tab-link *ngFor="let tab of tabs" [routerLink]="tab.path" routerLinkActive #rla="routerLinkActive" [routerLinkActiveOptions]="{exact: true}"
[active]="rla.isActive">
{{ tab.label }}
</a>
</nav>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SubMenubarComponent } from './sub-menubar.component';
describe('SubMenubarComponent', () => {
let component: SubMenubarComponent;
let fixture: ComponentFixture<SubMenubarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SubMenubarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SubMenubarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,23 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'of-sub-menubar',
templateUrl: './sub-menubar.component.html',
styleUrls: ['./sub-menubar.component.scss']
})
export class SubMenubarComponent implements OnInit {
tabs = [
{label: 'Probe', path: '/probes'},
{label: 'Unauthorized', path: '/probes/noauth'},
{label: 'Download', path: '/probes/download'},
];
constructor(public router: Router) { }
ngOnInit() {
}
}

View File

@ -0,0 +1,3 @@
<p>
list works!
</p>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ListComponent } from './list.component';
describe('ListComponent', () => {
let component: ListComponent;
let fixture: ComponentFixture<ListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'of-noauth-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.scss']
})
export class ListComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ListComponent } from 'app/packages/noauth/components/list/list.component';
@NgModule({
imports: [
CommonModule
],
declarations: [
ListComponent
]
})
export class NoauthModule { }

View File

@ -0,0 +1,3 @@
<p>
download works!
</p>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DownloadComponent } from './download.component';
describe('DownloadComponent', () => {
let component: DownloadComponent;
let fixture: ComponentFixture<DownloadComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DownloadComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DownloadComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'of-download',
templateUrl: './download.component.html',
styleUrls: ['./download.component.scss']
})
export class DownloadComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,3 @@
<p>
list works!
</p>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ListComponent } from './list.component';
describe('ListComponent', () => {
let component: ListComponent;
let fixture: ComponentFixture<ListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'of-probe-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.scss']
})
export class ListComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ListComponent } from 'app/packages/probe/components/list/list.component';
import { DownloadComponent } from 'app/packages/probe/components/download/download.component';
@NgModule({
imports: [
CommonModule
],
declarations: [
ListComponent,
DownloadComponent
],
})
export class ProbeModule { }

View File

@ -1,11 +1,19 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { ProbesPageComponent } from './probes-page.component'; import { ProbesPageComponent } from './probes-page.component';
import { ListComponent as ProbeListComponent } from 'app/packages/probe/components/list/list.component';
import { ListComponent as NoauthListComponent } from 'app/packages/noauth/components/list/list.component';
import { DownloadComponent } from 'app/packages/probe/components/download/download.component';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: ProbesPageComponent, component: ProbesPageComponent,
children: [
{ path: '', component: ProbeListComponent },
{ path: 'noauth', component: NoauthListComponent },
{ path: 'download', component: DownloadComponent },
]
} }
]; ];

View File

@ -1,3 +1,4 @@
<p> <div>
probes works! <of-sub-menubar></of-sub-menubar>
</p> <router-outlet></router-outlet>
</div>

View File

@ -2,12 +2,22 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ProbesPageComponent } from './probes-page.component'; import { ProbesPageComponent } from './probes-page.component';
import { ProbesPageRoutingModule } from './probes-page-routing.module'; import { ProbesPageRoutingModule } from './probes-page-routing.module';
import { SubMenubarComponent } from 'app/commons/layouts/sub-menubar/sub-menubar.component';
import { MaterialModule } from 'app/commons/ui/material/material.module';
import { ProbeModule } from 'app/packages/probe/probe.module';
import { NoauthModule } from 'app/packages/noauth/noauth.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
ProbesPageRoutingModule, ProbesPageRoutingModule,
MaterialModule,
ProbeModule,
NoauthModule,
], ],
declarations: [ProbesPageComponent] declarations: [
ProbesPageComponent,
SubMenubarComponent
]
}) })
export class ProbesPageModule { } export class ProbesPageModule { }