Actions for all nodes added

This commit is contained in:
Piotr Pekala
2019-03-11 04:35:27 -07:00
parent f3ef8dc273
commit 8cda33c0d9
12 changed files with 265 additions and 10 deletions

View File

@ -0,0 +1,44 @@
import { Component, Input } from "@angular/core";
import { Project } from '../../../models/project';
import { Server } from '../../../models/server';
import { NodeService } from '../../../services/node.service';
import { ToasterService } from '../../../services/toaster.service';
@Component({
selector: 'app-nodes-menu',
templateUrl: './nodes-menu.component.html',
styleUrls: ['./nodes-menu.component.scss']
})
export class NodesMenuComponent {
@Input('project') project: Project;
@Input('server') server: Server;
constructor(
private nodeService: NodeService,
private toasterService: ToasterService
) {}
startNodes() {
this.nodeService.startAll(this.server, this.project).subscribe(() => {
this.toasterService.success('All nodes successfully started');
});
}
stopNodes() {
this.nodeService.stopAll(this.server, this.project).subscribe(() => {
this.toasterService.success('All nodes successfully stopped');
});
}
suspendNodes() {
this.nodeService.suspendAll(this.server, this.project).subscribe(() => {
this.toasterService.success('All nodes successfully suspended');
});
}
reloadNodes() {
this.nodeService.reloadAll(this.server, this.project).subscribe(() => {
this.toasterService.success('All nodes successfully reloaded');
});
}
}