mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-10042: Properly show ICMP SecGroup Rules (#2233)
A simple if-statement would fail if either the type or code were 0 as that if-statement failed them. By checking if they are defined and casting them to a String afterwards this makes the if-statement properly resolve and show the rule as it should. Signed-off-by: Wido den Hollander <wido@widodh.nl>
This commit is contained in:
parent
a5778139c2
commit
86b6050c32
|
|
@ -26,11 +26,19 @@
|
|||
tags: elem.tags
|
||||
};
|
||||
|
||||
if (typeof elem.icmptype != 'undefined') {
|
||||
var icmptype = elem.icmptype.toString()
|
||||
}
|
||||
|
||||
if (typeof elem.icmpcode != 'undefined') {
|
||||
var icmpcode = elem.icmpcode.toString()
|
||||
}
|
||||
|
||||
if (elemData.startport == 0 && elemData.endport) {
|
||||
elemData.startport = '0';
|
||||
} else if (elem.icmptype && elem.icmpcode) {
|
||||
elemData.startport = elem.icmptype;
|
||||
elemData.endport = elem.icmpcode;
|
||||
} else if (icmptype && icmpcode) {
|
||||
elemData.startport = icmptype;
|
||||
elemData.endport = icmpcode;
|
||||
}
|
||||
|
||||
return elemData;
|
||||
|
|
|
|||
Loading…
Reference in New Issue