mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-13 14:03:23 +00:00
Reload action added
This commit is contained in:
parent
00597accac
commit
cd5edebd98
@ -209,6 +209,7 @@ import { ChangeSymbolActionComponent } from './components/project-map/context-me
|
|||||||
import { EditProjectDialogComponent } from './components/projects/edit-project-dialog/edit-project-dialog.component';
|
import { EditProjectDialogComponent } from './components/projects/edit-project-dialog/edit-project-dialog.component';
|
||||||
import { ProjectsFilter } from './filters/projectsFilter.pipe';
|
import { ProjectsFilter } from './filters/projectsFilter.pipe';
|
||||||
import { ComputeService } from './services/compute.service';
|
import { ComputeService } from './services/compute.service';
|
||||||
|
import { ReloadNodeActionComponent } from './components/project-map/context-menu/actions/reload-node-action/reload-node-action.component';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -345,7 +346,8 @@ if (environment.production) {
|
|||||||
ConsoleDeviceActionBrowserComponent,
|
ConsoleDeviceActionBrowserComponent,
|
||||||
ChangeSymbolDialogComponent,
|
ChangeSymbolDialogComponent,
|
||||||
ChangeSymbolActionComponent,
|
ChangeSymbolActionComponent,
|
||||||
EditProjectDialogComponent
|
EditProjectDialogComponent,
|
||||||
|
ReloadNodeActionComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
<button mat-menu-item *ngIf="filteredNodes.length > 0" (click)="reloadNodes()">
|
||||||
|
<mat-icon>refresh</mat-icon>
|
||||||
|
<span>Reload</span>
|
||||||
|
</button>
|
@ -0,0 +1,31 @@
|
|||||||
|
import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
||||||
|
import { Server } from '../../../../../models/server';
|
||||||
|
import { NodeService } from '../../../../../services/node.service';
|
||||||
|
import { Node } from '../../../../../cartography/models/node';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-reload-node-action',
|
||||||
|
templateUrl: './reload-node-action.component.html'
|
||||||
|
})
|
||||||
|
export class ReloadNodeActionComponent implements OnInit {
|
||||||
|
@Input() server: Server;
|
||||||
|
@Input() nodes: Node[];
|
||||||
|
|
||||||
|
filteredNodes: Node[] = [];
|
||||||
|
|
||||||
|
constructor(private nodeService: NodeService) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.nodes.forEach((node) => {
|
||||||
|
if (node.node_type === 'vpcs' || node.node_type === 'qemu' || node.node_type === 'virtualbox' || node.node_type === 'vmware') {
|
||||||
|
this.filteredNodes.push(node);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadNodes() {
|
||||||
|
this.filteredNodes.forEach((node) => {
|
||||||
|
this.nodeService.reload(this.server, node).subscribe((n: Node) => {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,9 @@
|
|||||||
></app-show-node-action>
|
></app-show-node-action>
|
||||||
<app-start-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-start-node-action>
|
<app-start-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-start-node-action>
|
||||||
<app-stop-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-stop-node-action>
|
<app-stop-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-stop-node-action>
|
||||||
|
<app-reload-node-action
|
||||||
|
*ngIf="nodes.length" [server]="server" [nodes]="nodes"
|
||||||
|
></app-reload-node-action>
|
||||||
<app-console-device-action
|
<app-console-device-action
|
||||||
*ngIf="!projectService.isReadOnly(project) && nodes.length && isElectronApp"
|
*ngIf="!projectService.isReadOnly(project) && nodes.length && isElectronApp"
|
||||||
[server]="server"
|
[server]="server"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user