mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-28 15:02:49 +00:00
Dialog added to projects page
This commit is contained in:
parent
8f4b2c502f
commit
bbe19e0513
@ -256,6 +256,7 @@ import { ConfigDialogComponent } from './components/project-map/context-menu/dia
|
|||||||
import { Gns3vmComponent } from './components/preferences/gns3vm/gns3vm.component';
|
import { Gns3vmComponent } from './components/preferences/gns3vm/gns3vm.component';
|
||||||
import { Gns3vmService } from './services/gns3vm.service';
|
import { Gns3vmService } from './services/gns3vm.service';
|
||||||
import { ThemeService } from './services/theme.service';
|
import { ThemeService } from './services/theme.service';
|
||||||
|
import { ConfigureGns3VMDialogComponent } from './components/servers/configure-gns3vm-dialog/configure-gns3vm-dialog.component';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -430,7 +431,8 @@ if (environment.production) {
|
|||||||
AlignVerticallyActionComponent,
|
AlignVerticallyActionComponent,
|
||||||
ConfirmationBottomSheetComponent,
|
ConfirmationBottomSheetComponent,
|
||||||
ConfigDialogComponent,
|
ConfigDialogComponent,
|
||||||
Gns3vmComponent
|
Gns3vmComponent,
|
||||||
|
ConfigureGns3VMDialogComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
@ -540,6 +542,7 @@ if (environment.production) {
|
|||||||
InfoDialogComponent,
|
InfoDialogComponent,
|
||||||
ChangeSymbolDialogComponent,
|
ChangeSymbolDialogComponent,
|
||||||
EditProjectDialogComponent,
|
EditProjectDialogComponent,
|
||||||
|
ConfigureGns3VMDialogComponent,
|
||||||
ConfiguratorDialogVpcsComponent,
|
ConfiguratorDialogVpcsComponent,
|
||||||
ConfiguratorDialogEthernetHubComponent,
|
ConfiguratorDialogEthernetHubComponent,
|
||||||
ConfiguratorDialogEthernetSwitchComponent,
|
ConfiguratorDialogEthernetSwitchComponent,
|
||||||
|
@ -20,6 +20,8 @@ import { ChooseNameDialogComponent } from './choose-name-dialog/choose-name-dial
|
|||||||
import { NavigationDialogComponent } from './navigation-dialog/navigation-dialog.component';
|
import { NavigationDialogComponent } from './navigation-dialog/navigation-dialog.component';
|
||||||
import { ConfirmationBottomSheetComponent } from './confirmation-bottomsheet/confirmation-bottomsheet.component';
|
import { ConfirmationBottomSheetComponent } from './confirmation-bottomsheet/confirmation-bottomsheet.component';
|
||||||
import { ToasterService } from '../../services/toaster.service';
|
import { ToasterService } from '../../services/toaster.service';
|
||||||
|
import { ConfigureGns3VMDialogComponent } from '../servers/configure-gns3vm-dialog/configure-gns3vm-dialog.component';
|
||||||
|
import { ElectronService } from 'ngx-electron';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-projects',
|
selector: 'app-projects',
|
||||||
@ -46,7 +48,8 @@ export class ProjectsComponent implements OnInit {
|
|||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private bottomSheet: MatBottomSheet,
|
private bottomSheet: MatBottomSheet,
|
||||||
private toasterService: ToasterService
|
private toasterService: ToasterService,
|
||||||
|
private electronService: ElectronService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -69,6 +72,22 @@ export class ProjectsComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.settings = this.settingsService.getAll();
|
this.settings = this.settingsService.getAll();
|
||||||
|
|
||||||
|
let gns3vmConfig = localStorage.getItem('gns3vmConfig');
|
||||||
|
if (this.electronService.isElectronApp && gns3vmConfig!=='configured') {
|
||||||
|
const dialogRef = this.dialog.open(ConfigureGns3VMDialogComponent, {
|
||||||
|
width: '350px',
|
||||||
|
height: '120px',
|
||||||
|
autoFocus: false
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe((answer: boolean) => {
|
||||||
|
if (answer) {
|
||||||
|
localStorage.setItem('gns3vmConfig', 'configured');
|
||||||
|
this.router.navigate(['/server', this.server.id, 'preferences', 'gns3vm']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<span class="message">{{message}}</span>
|
||||||
|
<div mat-dialog-actions>
|
||||||
|
<button mat-button class="cancelButton" (click)="onNoClick()" color="accent">No</button>
|
||||||
|
<button mat-button class="confirmButton" (click)="onYesClick()" tabindex="2" mat-raised-button color="primary">
|
||||||
|
Yes
|
||||||
|
</button>
|
||||||
|
</div>
|
@ -0,0 +1,22 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { MatDialogRef} from '@angular/material';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-configure-gns3-vm-dialog',
|
||||||
|
templateUrl: 'configure-gns3vm-dialog.component.html',
|
||||||
|
styleUrls: ['configure-gns3vm-dialog.component.scss']
|
||||||
|
})
|
||||||
|
export class ConfigureGns3VMDialogComponent implements OnInit {
|
||||||
|
public message: string = 'Do you want to configure GNS3 VM?';
|
||||||
|
constructor(public dialogRef: MatDialogRef<ConfigureGns3VMDialogComponent>) {}
|
||||||
|
|
||||||
|
ngOnInit() {}
|
||||||
|
|
||||||
|
onNoClick(): void {
|
||||||
|
this.dialogRef.close(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
onYesClick(): void {
|
||||||
|
this.dialogRef.close(true);
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,16 @@
|
|||||||
import { Component, Inject, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
import { Component, Inject, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
||||||
import { DataSource } from '@angular/cdk/collections';
|
import { DataSource } from '@angular/cdk/collections';
|
||||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||||
|
|
||||||
import { Observable, merge, Subscription } from 'rxjs';
|
import { Observable, merge, Subscription } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { Server } from '../../models/server';
|
import { Server } from '../../models/server';
|
||||||
import { ServerService } from '../../services/server.service';
|
import { ServerService } from '../../services/server.service';
|
||||||
import { ServerDatabase } from '../../services/server.database';
|
import { ServerDatabase } from '../../services/server.database';
|
||||||
import { AddServerDialogComponent } from './add-server-dialog/add-server-dialog.component';
|
import { AddServerDialogComponent } from './add-server-dialog/add-server-dialog.component';
|
||||||
import { ServerManagementService } from '../../services/server-management.service';
|
import { ServerManagementService } from '../../services/server-management.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-server-list',
|
selector: 'app-server-list',
|
||||||
templateUrl: './servers.component.html',
|
templateUrl: './servers.component.html',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user