Skip to content

Commit

Permalink
Fixed bug with parsed data in show_circuits.kytos
Browse files Browse the repository at this point in the history
  • Loading branch information
HeriLFIU committed Nov 4, 2024
1 parent 64dbb96 commit 091915a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ui/k-info-panel/show_circuit.kytos
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
Expand Down Expand Up @@ -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"])
};
}

Expand Down

0 comments on commit 091915a

Please sign in to comment.