From e8e951afa7e30c3cfa87fb69f0370c8f2c815cc2 Mon Sep 17 00:00:00 2001 From: ziajka Date: Mon, 23 Jul 2018 21:04:11 +0200 Subject: [PATCH] Base for server-discovery, Ref: #159 --- src/app/app.module.ts | 2 ++ .../server-discovery.component.html | 9 +++++++ .../server-discovery.component.scss | 0 .../server-discovery.component.spec.ts | 27 +++++++++++++++++++ .../server-discovery.component.ts | 15 +++++++++++ .../components/servers/servers.component.html | 3 +++ .../components/servers/servers.component.ts | 7 ----- 7 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 src/app/components/servers/server-discovery/server-discovery.component.html create mode 100644 src/app/components/servers/server-discovery/server-discovery.component.scss create mode 100644 src/app/components/servers/server-discovery/server-discovery.component.spec.ts create mode 100644 src/app/components/servers/server-discovery/server-discovery.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2d08e232..58c51f15 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -82,6 +82,7 @@ import { version } from "./version"; import { ToasterErrorHandler } from "./common/error-handlers/toaster-error-handler"; import { environment } from "../environments/environment"; import { RavenState } from "./common/error-handlers/raven-state-communicator"; +import { ServerDiscoveryComponent } from "./components/servers/server-discovery/server-discovery.component"; if (environment.production) { @@ -118,6 +119,7 @@ if (environment.production) { SettingsComponent, LocalServerComponent, ProgressComponent, + ServerDiscoveryComponent, ], imports: [ NgbModule.forRoot(), diff --git a/src/app/components/servers/server-discovery/server-discovery.component.html b/src/app/components/servers/server-discovery/server-discovery.component.html new file mode 100644 index 00000000..af4c0a46 --- /dev/null +++ b/src/app/components/servers/server-discovery/server-discovery.component.html @@ -0,0 +1,9 @@ + + + We've discovered GNS3 server on 127.0.0.1:3080, would you like to add it? + + + + + + diff --git a/src/app/components/servers/server-discovery/server-discovery.component.scss b/src/app/components/servers/server-discovery/server-discovery.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/components/servers/server-discovery/server-discovery.component.spec.ts b/src/app/components/servers/server-discovery/server-discovery.component.spec.ts new file mode 100644 index 00000000..8ffbc81e --- /dev/null +++ b/src/app/components/servers/server-discovery/server-discovery.component.spec.ts @@ -0,0 +1,27 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ServerDiscoveryComponent } from './server-discovery.component'; +import { MatCardModule } from "@angular/material"; + +describe('ServerDiscoveryComponent', () => { + let component: ServerDiscoveryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ MatCardModule ], + declarations: [ ServerDiscoveryComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ServerDiscoveryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/servers/server-discovery/server-discovery.component.ts b/src/app/components/servers/server-discovery/server-discovery.component.ts new file mode 100644 index 00000000..16b23936 --- /dev/null +++ b/src/app/components/servers/server-discovery/server-discovery.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-server-discovery', + templateUrl: './server-discovery.component.html', + styleUrls: ['./server-discovery.component.scss'] +}) +export class ServerDiscoveryComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/servers/servers.component.html b/src/app/components/servers/servers.component.html index 33bd41fc..b8319d50 100644 --- a/src/app/components/servers/servers.component.html +++ b/src/app/components/servers/servers.component.html @@ -3,6 +3,9 @@

Servers

+ + +
diff --git a/src/app/components/servers/servers.component.ts b/src/app/components/servers/servers.component.ts index 7c8a50d8..b90c8e77 100644 --- a/src/app/components/servers/servers.component.ts +++ b/src/app/components/servers/servers.component.ts @@ -5,13 +5,6 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { Observable, BehaviorSubject, merge } from "rxjs"; import { map } from "rxjs/operators"; -// import 'rxjs/add/operator/startWith'; -// import 'rxjs/add/observable/merge'; -// import 'rxjs/add/operator/map'; -// import 'rxjs/add/operator/debounceTime'; -// import 'rxjs/add/operator/distinctUntilChanged'; -// import 'rxjs/add/observable/fromEvent'; - import { Server } from "../../models/server"; import { ServerService } from "../../services/server.service";