mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-18 14:58:15 +00:00
Extending error information
This commit is contained in:
@ -20,8 +20,8 @@ export class ProgressService {
|
|||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
public setError(error: Error) {
|
public setError(error) {
|
||||||
this.state.next(new State(false, error));
|
this.state.next(new State(false, error.error));
|
||||||
}
|
}
|
||||||
|
|
||||||
public clear() {
|
public clear() {
|
||||||
|
@ -2,6 +2,7 @@ import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
|||||||
import { Server } from '../../../../../models/server';
|
import { Server } from '../../../../../models/server';
|
||||||
import { NodeService } from '../../../../../services/node.service';
|
import { NodeService } from '../../../../../services/node.service';
|
||||||
import { Node } from '../../../../../cartography/models/node';
|
import { Node } from '../../../../../cartography/models/node';
|
||||||
|
import { ToasterService } from '../../../../../services/toaster.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-start-node-action',
|
selector: 'app-start-node-action',
|
||||||
@ -12,7 +13,10 @@ export class StartNodeActionComponent implements OnInit, OnChanges {
|
|||||||
@Input() nodes: Node[];
|
@Input() nodes: Node[];
|
||||||
isNodeWithStoppedStatus: boolean;
|
isNodeWithStoppedStatus: boolean;
|
||||||
|
|
||||||
constructor(private nodeService: NodeService) {}
|
constructor(
|
||||||
|
private nodeService: NodeService,
|
||||||
|
private toasterService: ToasterService
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
@ -30,7 +34,12 @@ export class StartNodeActionComponent implements OnInit, OnChanges {
|
|||||||
|
|
||||||
startNodes() {
|
startNodes() {
|
||||||
this.nodes.forEach((node) => {
|
this.nodes.forEach((node) => {
|
||||||
this.nodeService.start(this.server, node).subscribe((n: Node) => {});
|
this.nodeService.start(this.server, node).subscribe(
|
||||||
|
(n: Node) => {},
|
||||||
|
error => {
|
||||||
|
this.toasterService.error(error.error.message)
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user