diff --git a/ui/k-info-panel/show_circuit.kytos b/ui/k-info-panel/show_circuit.kytos index 798f53bc..29b5509f 100644 --- a/ui/k-info-panel/show_circuit.kytos +++ b/ui/k-info-panel/show_circuit.kytos @@ -288,6 +288,13 @@ module.exports = { } }, methods: { + parse_check: function (val) { + try { return JSON.parse(val) } + catch (e) { + if (e instanceof SyntaxError) { return val } + else { throw e } + } + }, queue_options: function(queue) { let _result = [ {value: -1, description:"default", selected: (queue.value == -1)}, @@ -775,13 +782,13 @@ module.exports = { if(this.endpoints_data["VLAN"][0]["value"]) { payload["uni_a"]["tag"] = { tag_type: this.TAG_TYPE_VLAN, - value: JSON.parse(this.endpoints_data["VLAN"][0]["value"]) + value: this.parse_check(this.endpoints_data["VLAN"][0]["value"]) }; } if(this.endpoints_data["VLAN"][1]["value"]) { payload["uni_z"]["tag"] = { tag_type: this.TAG_TYPE_VLAN, - value: JSON.parse(this.endpoints_data["VLAN"][1]["value"]) + value: this.parse_check(this.endpoints_data["VLAN"][1]["value"]) }; }