Fix generated capture file is not valid

This commit is contained in:
grossmj 2022-04-21 13:53:27 +07:00
parent 8728056b8d
commit 04936cfc8d

View File

@ -56,7 +56,7 @@ export class StartCaptureDialogComponent implements OnInit {
const sourcePort = sourceNode.ports[this.link.nodes[0].port_number];
const targetPort = targetNode.ports[this.link.nodes[1].port_number];
this.inputForm.controls['fileName'].setValue(
`${sourceNode.name}_${sourcePort.name}_to_${targetNode.name}_${targetPort.name}`
`${sourceNode.name}_${sourcePort.name}_to_${targetNode.name}_${targetPort.name}`.replace(new RegExp('[^0-9A-Za-z_-]', 'g'), '')
);
}