mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-20 17:33:11 +00:00
Updating list when project removed
This commit is contained in:
parent
c996c1fe51
commit
52880ddc3e
@ -73,6 +73,8 @@ export class ProjectsComponent implements OnInit {
|
||||
|
||||
this.settings = this.settingsService.getAll();
|
||||
|
||||
this.projectService.projectListSubject.subscribe(() => this.refresh());
|
||||
|
||||
let gns3vmConfig = localStorage.getItem('gns3vmConfig');
|
||||
if (this.electronService.isElectronApp && gns3vmConfig!=='configured') {
|
||||
const dialogRef = this.dialog.open(ConfigureGns3VMDialogComponent, {
|
||||
|
@ -25,7 +25,9 @@ export class ProjectMapGuard implements CanActivate {
|
||||
map(response => {
|
||||
let projectToOpen = response.find(n => n.project_id === project_id);
|
||||
if (projectToOpen) return true;
|
||||
|
||||
this.toasterService.error('Project could not be opened');
|
||||
this.projectService.projectListUpdated();
|
||||
return false;
|
||||
})
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Project } from '../models/project';
|
||||
import { Node } from '../cartography/models/node';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Link } from '../models/link';
|
||||
import { Server } from '../models/server';
|
||||
import { HttpServer } from './http-server.service';
|
||||
@ -10,8 +10,14 @@ import { SettingsService } from './settings.service';
|
||||
|
||||
@Injectable()
|
||||
export class ProjectService {
|
||||
public projectListSubject = new Subject<boolean>();
|
||||
|
||||
constructor(private httpServer: HttpServer, private settingsService: SettingsService) {}
|
||||
|
||||
projectListUpdated() {
|
||||
this.projectListSubject.next(true);
|
||||
}
|
||||
|
||||
get(server: Server, project_id: string) {
|
||||
return this.httpServer.get<Project>(server, `/projects/${project_id}`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user