Base for server-discovery, Ref: #159

This commit is contained in:
ziajka 2018-07-23 21:04:11 +02:00
parent c7d079ed0d
commit e8e951afa7
7 changed files with 56 additions and 7 deletions

View File

@ -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(),

View File

@ -0,0 +1,9 @@
<mat-card class="info">
<mat-card-content align="center">
We've discovered GNS3 server on <b>127.0.0.1:3080</b>, would you like to add it?
</mat-card-content>
<mat-card-actions align="right">
<button mat-button color="accent">NO</button>
<button mat-button>YES</button>
</mat-card-actions>
</mat-card>

View File

@ -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<ServerDiscoveryComponent>;
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();
});
});

View File

@ -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() {
}
}

View File

@ -3,6 +3,9 @@
<h1>Servers</h1>
</div>
<div class="default-content">
<app-server-discovery></app-server-discovery>
<mat-divider></mat-divider>
<div class="example-container mat-elevation-z8">
<mat-table #table [dataSource]="dataSource">

View File

@ -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";