some pages added.
This commit is contained in:
parent
35f82466a0
commit
d33dafbdd2
|
@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||||
import { MenuItem } from 'primeng/primeng';
|
import { MenuItem } from 'primeng/primeng';
|
||||||
import { AppComponent } from 'app/app.component';
|
import { AppComponent } from 'app/app.component';
|
||||||
import { PagesComponent } from '../../../../pages/pages.component';
|
import { PagesComponent } from 'app/pages/pages.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
/* tslint:disable:component-selector */
|
/* tslint:disable:component-selector */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {Component, trigger, state, transition, style, animate} from '@angular/core';
|
import {Component, trigger, state, transition, style, animate} from '@angular/core';
|
||||||
import {AppComponent} from 'app/app.component';
|
import {AppComponent} from 'app/app.component';
|
||||||
import { PagesComponent } from '../../../../pages/pages.component';
|
import { PagesComponent } from 'app/pages/pages.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-inline-profile',
|
selector: 'of-inline-profile',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Component, ViewChild, AfterViewInit} from '@angular/core';
|
import {Component, ViewChild, AfterViewInit} from '@angular/core';
|
||||||
import {AppComponent} from 'app/app.component';
|
import {AppComponent} from 'app/app.component';
|
||||||
import {ScrollPanel} from 'primeng/primeng';
|
import {ScrollPanel} from 'primeng/primeng';
|
||||||
import { PagesComponent } from '../../../../pages/pages.component';
|
import { PagesComponent } from 'app/pages/pages.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-rightpanel',
|
selector: 'of-rightpanel',
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<p-tabView (onChange)="handleChange($event)">
|
||||||
|
<p-tabPanel [header]="tab.label" *ngFor="let tab of tabs; let i = index" [selected]="i == 0" [leftIcon]="tab.icon">
|
||||||
|
</p-tabPanel>
|
||||||
|
</p-tabView>
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Component, AfterViewInit, Input } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Language } from 'angular-l10n';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-tabbar',
|
||||||
|
templateUrl: './app.tabbar.component.html',
|
||||||
|
})
|
||||||
|
export class TabbarComponent implements AfterViewInit {
|
||||||
|
@Input() tabs: any;
|
||||||
|
|
||||||
|
constructor(public router: Router) { }
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
handleChange(event) {
|
||||||
|
const path: string = this.tabs[event.index].path;
|
||||||
|
if (path.length === 0) { return; }
|
||||||
|
this.router.navigate([path]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,6 @@ import { Component, OnInit } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-pages-auth-reset-password',
|
selector: 'of-pages-auth-reset-password',
|
||||||
templateUrl: './reset-password-page.component.html',
|
templateUrl: './reset-password-page.component.html',
|
||||||
styleUrls: ['./reset-password-page.component.scss']
|
|
||||||
})
|
})
|
||||||
export class ResetPasswordPageComponent implements OnInit {
|
export class ResetPasswordPageComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
.signin-form {
|
|
||||||
min-width: 150px;
|
|
||||||
max-width: 500px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signin-full-width {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
|
@ -6,7 +6,6 @@ import { Form, FormBuilder, FormGroup, FormGroupDirective, FormControl, NgForm,
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-pages-auth-signin',
|
selector: 'of-pages-auth-signin',
|
||||||
templateUrl: './signin-page.component.html',
|
templateUrl: './signin-page.component.html',
|
||||||
styleUrls: ['./signin-page.component.scss'],
|
|
||||||
})
|
})
|
||||||
export class SigninPageComponent implements OnInit {
|
export class SigninPageComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
.signup-form {
|
|
||||||
min-width: 150px;
|
|
||||||
max-width: 500px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-full-width {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
|
@ -5,7 +5,6 @@ import { Form, FormBuilder, FormGroup, FormGroupDirective, FormControl, NgForm,
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-pages-auth-signup',
|
selector: 'of-pages-auth-signup',
|
||||||
templateUrl: './signup-page.component.html',
|
templateUrl: './signup-page.component.html',
|
||||||
styleUrls: ['./signup-page.component.scss']
|
|
||||||
})
|
})
|
||||||
export class SignupPageComponent implements OnInit {
|
export class SignupPageComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Component, OnInit } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-pages-home',
|
selector: 'of-pages-home',
|
||||||
templateUrl: './home-page.component.html',
|
templateUrl: './home-page.component.html',
|
||||||
styleUrls: ['./home-page.component.scss']
|
|
||||||
})
|
})
|
||||||
export class HomePageComponent implements OnInit {
|
export class HomePageComponent implements OnInit {
|
||||||
|
|
||||||
|
|
18
src/app/pages/infra/infra-page-routing.module.ts
Normal file
18
src/app/pages/infra/infra-page-routing.module.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { InfraPageComponent } from './infra-page.component';
|
||||||
|
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: InfraPageComponent,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class InfraPageRoutingModule { }
|
2
src/app/pages/infra/infra-page.component.html
Normal file
2
src/app/pages/infra/infra-page.component.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- <of-infra-map></of-infra-map> -->
|
||||||
|
<div>infra page</div>
|
25
src/app/pages/infra/infra-page.component.spec.ts
Normal file
25
src/app/pages/infra/infra-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { InfraPageComponent } from './infra-page.component';
|
||||||
|
|
||||||
|
describe('InfraPageComponent', () => {
|
||||||
|
let component: InfraPageComponent;
|
||||||
|
let fixture: ComponentFixture<InfraPageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ InfraPageComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(InfraPageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
14
src/app/pages/infra/infra-page.component.ts
Normal file
14
src/app/pages/infra/infra-page.component.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-infra-page',
|
||||||
|
templateUrl: './infra-page.component.html',
|
||||||
|
})
|
||||||
|
export class InfraPageComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
}
|
21
src/app/pages/infra/infra-page.module.ts
Normal file
21
src/app/pages/infra/infra-page.module.ts
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { InfraPageRoutingModule } from './infra-page-routing.module';
|
||||||
|
|
||||||
|
// import { InfraModule } from 'packages/infra/infra.module';
|
||||||
|
import { InfraPageComponent } from './infra-page.component';
|
||||||
|
// import { DiscoveryModule } from 'packages/discovery/discovery.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
InfraPageRoutingModule,
|
||||||
|
// InfraModule,
|
||||||
|
// DiscoveryModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
InfraPageComponent,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class InfraPageModule { }
|
|
@ -9,12 +9,12 @@ const routes: Routes = [
|
||||||
children: [
|
children: [
|
||||||
{ path: '', redirectTo: 'home' },
|
{ path: '', redirectTo: 'home' },
|
||||||
{ path: 'home', loadChildren: './home/home-page.module#HomePageModule' },
|
{ path: 'home', loadChildren: './home/home-page.module#HomePageModule' },
|
||||||
// { path: 'probes', loadChildren: './probes/probes-page.module#ProbesPageModule' },
|
{ path: 'probes', loadChildren: './probes/probes-page.module#ProbesPageModule' },
|
||||||
// { path: 'probe', loadChildren: './probe/probe-page.module#ProbePageModule' },
|
{ path: 'probe', loadChildren: './probe/probe-page.module#ProbePageModule' },
|
||||||
// { path: 'sensors', loadChildren: './sensors/sensors-page.module#SensorsPageModule' },
|
{ path: 'sensors', loadChildren: './sensors/sensors-page.module#SensorsPageModule' },
|
||||||
// { path: 'sensor', loadChildren: './sensor/sensor-page.module#SensorPageModule' },
|
{ path: 'sensor', loadChildren: './sensor/sensor-page.module#SensorPageModule' },
|
||||||
// { path: 'discovery', loadChildren: './discovery/discovery-page.module#DiscoveryPageModule' },
|
// { path: 'discovery', loadChildren: './discovery/discovery-page.module#DiscoveryPageModule' },
|
||||||
// { path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' },
|
{ path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' },
|
||||||
// { path: 'sensor-setting', loadChildren: './sensor-setting/sensor-setting-page.module#SensorSettingPageModule' },
|
// { path: 'sensor-setting', loadChildren: './sensor-setting/sensor-setting-page.module#SensorSettingPageModule' },
|
||||||
// { path: 'target', loadChildren: './target/target-page.module#TargetPageModule' },
|
// { path: 'target', loadChildren: './target/target-page.module#TargetPageModule' },
|
||||||
// { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' },
|
// { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' },
|
||||||
|
|
23
src/app/pages/probe/probe-page-routing.module.ts
Normal file
23
src/app/pages/probe/probe-page-routing.module.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { ProbePageComponent } from './probe-page.component';
|
||||||
|
// import { DetailComponent as ProbeDetailComponent } from 'packages/probe/component/detail/detail.component';
|
||||||
|
// import { ListComponent as TargetListComponent } from 'packages/target/component/list/list.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ProbePageComponent,
|
||||||
|
children: [
|
||||||
|
// { path: ':id', component: ProbeDetailComponent },
|
||||||
|
// { path: ':id/targets', loadChildren: 'app/pages/targets/targets-page.module#TargetsPageModule'},
|
||||||
|
// { path: ':id/history', component: null },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class ProbePageRoutingModule { }
|
7
src/app/pages/probe/probe-page.component.html
Normal file
7
src/app/pages/probe/probe-page.component.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<div>
|
||||||
|
<!-- <of-sub-menubar [tabs]="tabs"></of-sub-menubar> -->
|
||||||
|
<of-tabbar [tabs]="tabs"></of-tabbar>
|
||||||
|
<div style="padding: 15px">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
25
src/app/pages/probe/probe-page.component.spec.ts
Normal file
25
src/app/pages/probe/probe-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ProbePageComponent } from './probe-page.component';
|
||||||
|
|
||||||
|
describe('ProbeComponent', () => {
|
||||||
|
let component: ProbePageComponent;
|
||||||
|
let fixture: ComponentFixture<ProbePageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ProbePageComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ProbePageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
26
src/app/pages/probe/probe-page.component.ts
Normal file
26
src/app/pages/probe/probe-page.component.ts
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-pages-probe',
|
||||||
|
templateUrl: './probe-page.component.html',
|
||||||
|
})
|
||||||
|
export class ProbePageComponent implements OnInit {
|
||||||
|
|
||||||
|
tabs = undefined;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute, private router: Router) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
// const id = this.router.url.split('probe/')[1].split('/')[0];
|
||||||
|
const id = '1';
|
||||||
|
|
||||||
|
this.tabs = [
|
||||||
|
{ label: 'Info', path: '/probe/' + id, icon: 'fa-check' },
|
||||||
|
{ label: 'Targets', path: '/probe/' + id + '/targets', icon: 'fa-check' },
|
||||||
|
{ label: 'History', path: '/probe/' + id + '/history', icon: 'fa-check' },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
22
src/app/pages/probe/probe-page.module.ts
Normal file
22
src/app/pages/probe/probe-page.module.ts
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
// import { ProbeModule } from 'packages/probe/probe.module';
|
||||||
|
import { ProbePageComponent } from './probe-page.component';
|
||||||
|
import { ProbePageRoutingModule } from './probe-page-routing.module';
|
||||||
|
import { TabbarComponent } from 'app/commons/component/layout/tabbar/app.tabbar.component';
|
||||||
|
import { PrimeNGModules } from 'packages/commons/prime-ng/prime-ng.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
ProbePageRoutingModule,
|
||||||
|
PrimeNGModules
|
||||||
|
// ProbeModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
ProbePageComponent,
|
||||||
|
TabbarComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ProbePageModule { }
|
25
src/app/pages/probes/probes-page-routing.module.ts
Normal file
25
src/app/pages/probes/probes-page-routing.module.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { ProbesPageComponent } from './probes-page.component';
|
||||||
|
// import { ListComponent as ProbeListComponent } from 'packages/probe/component/list/list.component';
|
||||||
|
// import { ListComponent as NoauthListComponent } from 'packages/noauth/component/list/list.component';
|
||||||
|
// import { DownloadComponent } from 'packages/probe/component/download/download.component';
|
||||||
|
// import { DetailComponent as ProbeDetailComponent } from 'packages/probe/component/detail/detail.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ProbesPageComponent,
|
||||||
|
children: [
|
||||||
|
// { path: '', component: ProbeListComponent },
|
||||||
|
// { path: 'noauth', component: NoauthListComponent },
|
||||||
|
// { path: 'download', component: DownloadComponent },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class ProbesPageRoutingModule { }
|
9
src/app/pages/probes/probes-page.component.html
Normal file
9
src/app/pages/probes/probes-page.component.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!-- <div>
|
||||||
|
<of-sub-menubar [tabs]="tabs"></of-sub-menubar>
|
||||||
|
<div style="padding: 15px">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
probe detail
|
||||||
|
<router-outlet></router-outlet>
|
25
src/app/pages/probes/probes-page.component.spec.ts
Normal file
25
src/app/pages/probes/probes-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ProbesPageComponent } from './probes-page.component';
|
||||||
|
|
||||||
|
describe('ProbesComponent', () => {
|
||||||
|
let component: ProbesPageComponent;
|
||||||
|
let fixture: ComponentFixture<ProbesPageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ProbesPageComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ProbesPageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
17
src/app/pages/probes/probes-page.component.ts
Normal file
17
src/app/pages/probes/probes-page.component.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-pages-probes',
|
||||||
|
templateUrl: './probes-page.component.html',
|
||||||
|
})
|
||||||
|
export class ProbesPageComponent {
|
||||||
|
|
||||||
|
tabs = [
|
||||||
|
{ label: 'Probe', path: '/probes' },
|
||||||
|
{ label: 'Unauthorized', path: '/probes/noauth' },
|
||||||
|
{ label: 'Download', path: '/probes/download' },
|
||||||
|
];
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
}
|
19
src/app/pages/probes/probes-page.module.ts
Normal file
19
src/app/pages/probes/probes-page.module.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
// import { ProbeModule } from 'packages/probe/probe.module';
|
||||||
|
// import { NoauthModule } from 'packages/noauth/noauth.module';
|
||||||
|
import { ProbesPageComponent } from './probes-page.component';
|
||||||
|
import { ProbesPageRoutingModule } from './probes-page-routing.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
ProbesPageRoutingModule,
|
||||||
|
// ProbeModule,
|
||||||
|
// NoauthModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
ProbesPageComponent,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ProbesPageModule { }
|
21
src/app/pages/sensor/sensor-page-routing.module.ts
Normal file
21
src/app/pages/sensor/sensor-page-routing.module.ts
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { SensorPageComponent } from './sensor-page.component';
|
||||||
|
// import { DetailComponent } from 'packages/sensor/component/detail/detail.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: SensorPageComponent,
|
||||||
|
children: [
|
||||||
|
// { path: ':id', component: DetailComponent },
|
||||||
|
// { path: ':id/history', component: null },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class SensorPageRoutingModule { }
|
6
src/app/pages/sensor/sensor-page.component.html
Normal file
6
src/app/pages/sensor/sensor-page.component.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<div>
|
||||||
|
<of-sub-menubar [tabs]="tabs"></of-sub-menubar>
|
||||||
|
<div style="padding: 15px">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
25
src/app/pages/sensor/sensor-page.component.spec.ts
Normal file
25
src/app/pages/sensor/sensor-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SensorPageComponent } from './sensor-page.component';
|
||||||
|
|
||||||
|
describe('SensorPageComponent', () => {
|
||||||
|
let component: SensorPageComponent;
|
||||||
|
let fixture: ComponentFixture<SensorPageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ SensorPageComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SensorPageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
24
src/app/pages/sensor/sensor-page.component.ts
Normal file
24
src/app/pages/sensor/sensor-page.component.ts
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-pages-sensor',
|
||||||
|
templateUrl: './sensor-page.component.html',
|
||||||
|
})
|
||||||
|
export class SensorPageComponent implements OnInit {
|
||||||
|
|
||||||
|
tabs = undefined;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute, private router: Router) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
const id = this.router.url.split('sensor/')[1].split('/')[0];
|
||||||
|
|
||||||
|
this.tabs = [
|
||||||
|
{ label: 'Info', path: '/sensor/' + id },
|
||||||
|
{ label: 'History', path: '/sensor/' + id + '/history' },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
src/app/pages/sensor/sensor-page.module.ts
Normal file
18
src/app/pages/sensor/sensor-page.module.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
// import { SensorModule } from 'packages/sensor/sensor.module';
|
||||||
|
import { SensorPageRoutingModule } from './sensor-page-routing.module';
|
||||||
|
import { SensorPageComponent } from './sensor-page.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
SensorPageRoutingModule,
|
||||||
|
// SensorModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
SensorPageComponent,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SensorPageModule { }
|
19
src/app/pages/sensors/sensors-page-routing.module.ts
Normal file
19
src/app/pages/sensors/sensors-page-routing.module.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { SensorsPageComponent } from './sensors-page.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: SensorsPageComponent,
|
||||||
|
children: [
|
||||||
|
// { path: '', component: SensorListComponent },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class SensorsPageRoutingModule { }
|
3
src/app/pages/sensors/sensors-page.component.html
Normal file
3
src/app/pages/sensors/sensors-page.component.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<div style="padding: 15px">
|
||||||
|
<of-sensor-list></of-sensor-list>
|
||||||
|
</div>
|
25
src/app/pages/sensors/sensors-page.component.spec.ts
Normal file
25
src/app/pages/sensors/sensors-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SensorsPageComponent } from './sensors-page.component';
|
||||||
|
|
||||||
|
describe('SensorsComponent', () => {
|
||||||
|
let component: SensorsPageComponent;
|
||||||
|
let fixture: ComponentFixture<SensorsPageComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ SensorsPageComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SensorsPageComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
20
src/app/pages/sensors/sensors-page.component.ts
Normal file
20
src/app/pages/sensors/sensors-page.component.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'of-pages-sensors',
|
||||||
|
templateUrl: './sensors-page.component.html',
|
||||||
|
})
|
||||||
|
export class SensorsPageComponent implements OnInit {
|
||||||
|
|
||||||
|
tabs = [
|
||||||
|
{ label: 'Overview', path: '/sensors' },
|
||||||
|
{ label: 'History', path: '/sensors/history' },
|
||||||
|
{ label: 'Settings', path: '/sensors/setting' },
|
||||||
|
];
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
src/app/pages/sensors/sensors-page.module.ts
Normal file
17
src/app/pages/sensors/sensors-page.module.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
// import { SensorModule } from 'packages/sensor/sensor.module';
|
||||||
|
import { SensorsPageComponent } from './sensors-page.component';
|
||||||
|
import { SensorsPageRoutingModule } from './sensors-page-routing.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
SensorsPageRoutingModule,
|
||||||
|
// SensorModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
SensorsPageComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SensorsPageModule { }
|
Loading…
Reference in New Issue
Block a user