mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-29 15:43:58 +00:00
Different layouts per project map and other pages
This commit is contained in:
parent
2a671be4e9
commit
2039c5ed83
@ -4,11 +4,16 @@ import { RouterModule, Routes } from '@angular/router';
|
||||
import { ProjectMapComponent } from './project-map/project-map.component';
|
||||
import { ServersComponent } from "./servers/servers.component";
|
||||
import { ProjectsComponent } from "./projects/projects.component";
|
||||
import { DefaultLayoutComponent } from "./default-layout/default-layout.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: '/servers', pathMatch: 'full' },
|
||||
{ path: 'servers', component: ServersComponent },
|
||||
{ path: 'server/:server_id/projects', component: ProjectsComponent },
|
||||
{ path: '', component: DefaultLayoutComponent,
|
||||
children: [
|
||||
{ path: '', redirectTo: 'servers', pathMatch: 'full'},
|
||||
{ path: 'servers', component: ServersComponent },
|
||||
{ path: 'server/:server_id/projects', component: ProjectsComponent }
|
||||
]
|
||||
},
|
||||
{ path: 'server/:server_id/project/:project_id', component: ProjectMapComponent },
|
||||
];
|
||||
|
||||
|
@ -1,19 +1 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||
<a class="navbar-brand" href="/"><img src="assets/logo-header.png"></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" [routerLink]="['/servers']" >Servers <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
<footer class="footer">
|
||||
<span class="text-muted">GNS3 Web UI demo</span>
|
||||
</footer>
|
||||
|
@ -20,6 +20,7 @@ import { SymbolService } from "./services/symbol.service";
|
||||
import { ServerService } from "./services/server.service";
|
||||
import { IndexedDbService } from "./services/indexed-db.service";
|
||||
import { HttpServer } from "./services/http-server.service";
|
||||
import { DefaultLayoutComponent } from './default-layout/default-layout.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
@ -30,6 +31,7 @@ import { HttpServer } from "./services/http-server.service";
|
||||
ServersComponent,
|
||||
ServerCreateModalComponent,
|
||||
ProjectsComponent,
|
||||
DefaultLayoutComponent,
|
||||
],
|
||||
imports: [
|
||||
NgbModule.forRoot(),
|
||||
|
0
src/app/default-layout/default-layout.component.css
Normal file
0
src/app/default-layout/default-layout.component.css
Normal file
19
src/app/default-layout/default-layout.component.html
Normal file
19
src/app/default-layout/default-layout.component.html
Normal file
@ -0,0 +1,19 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||
<a class="navbar-brand" href="/"><img src="assets/logo-header.png"></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" [routerLink]="['/servers']" >Servers <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
<footer class="footer">
|
||||
<span class="text-muted">GNS3 Web UI demo</span>
|
||||
</footer>
|
25
src/app/default-layout/default-layout.component.spec.ts
Normal file
25
src/app/default-layout/default-layout.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DefaultLayoutComponent } from './default-layout.component';
|
||||
|
||||
describe('DefaultLayoutComponent', () => {
|
||||
let component: DefaultLayoutComponent;
|
||||
let fixture: ComponentFixture<DefaultLayoutComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DefaultLayoutComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DefaultLayoutComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
15
src/app/default-layout/default-layout.component.ts
Normal file
15
src/app/default-layout/default-layout.component.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-default-layout',
|
||||
templateUrl: './default-layout.component.html',
|
||||
styleUrls: ['./default-layout.component.css']
|
||||
})
|
||||
export class DefaultLayoutComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user