mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-06 09:11:36 +00:00
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { Component, Input, OnInit } from '@angular/core';
|
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
import { Node } from '../../../cartography/models/node';
|
|
import { Server } from '../../../models/server';
|
|
import { NodeService } from '../../../services/node.service';
|
|
|
|
@Component({
|
|
selector: 'app-change-symbol-dialog',
|
|
templateUrl: './change-symbol-dialog.component.html',
|
|
styleUrls: ['./change-symbol-dialog.component.scss'],
|
|
})
|
|
export class ChangeSymbolDialogComponent implements OnInit {
|
|
@Input() server: Server;
|
|
@Input() node: Node;
|
|
symbol: string;
|
|
|
|
constructor(public dialogRef: MatDialogRef<ChangeSymbolDialogComponent>, private nodeService: NodeService) {}
|
|
|
|
ngOnInit() {
|
|
this.symbol = this.node.symbol;
|
|
}
|
|
|
|
symbolChanged(chosenSymbol: string) {
|
|
this.symbol = chosenSymbol;
|
|
}
|
|
|
|
onCloseClick() {
|
|
this.dialogRef.close();
|
|
}
|
|
|
|
onSelectClick() {
|
|
this.nodeService.updateSymbol(this.server, this.node, this.symbol).subscribe(() => {
|
|
this.onCloseClick();
|
|
});
|
|
}
|
|
}
|