{
const mode = (event.target as HTMLSelectElement).value as 'edit' | 'simulate';
if (mode === 'edit') {
const components = [...this.componets];
const connections = [...this.connections];
const networks = [...this.networks];
this.ipv4Database = new Map(); //(address, nodeId)
this.macDatabase = new Map();
this.ipv6Database = new Map();
console.log(components, connections, networks);
this._graph.elements().remove();
this.componets = components;
this.connections = connections;
this.networks = networks;
load.bind(this)();
} else {
this._graph.$('node').lock();
this.packetSimulator.initSession(this);
}
this.mode = mode;
}}
size="small"
>
${this.mode === 'edit' ? biPencil : biBoxes}
Edit
Simulate
${this.toolboxTemplate()} ${contextMenuTemplate.bind(this)()} ${simulationMenuTemplate.bind(this)()}