Revision fe416714
Added by Phil Davis over 10 years ago
usr/local/www/javascript/index/ajax.js | ||
---|---|---|
150 | 150 |
interfaces_split = x.split("~"); |
151 | 151 |
interfaces_split.each(function(iface){ |
152 | 152 |
details = iface.split(","); |
153 |
if (details[2] == '') |
|
154 |
ipv4_details = ''; |
|
155 |
else |
|
156 |
ipv4_details = details[2] + '<br />'; |
|
153 | 157 |
switch(details[1]) { |
154 | 158 |
case "up": |
155 | 159 |
jQuery('#' + details[0] + '-up').css("display","inline"); |
156 | 160 |
jQuery('#' + details[0] + '-down').css("display","none"); |
157 | 161 |
jQuery('#' + details[0] + '-block').css("display","none"); |
158 |
jQuery('#' + details[0] + '-ip').html(details[2]);
|
|
162 |
jQuery('#' + details[0] + '-ip').html(ipv4_details);
|
|
159 | 163 |
jQuery('#' + details[0] + '-ipv6').html(details[3]); |
160 | 164 |
jQuery('#' + details[0] + '-media').html(details[4]); |
161 | 165 |
break; |
... | ... | |
163 | 167 |
jQuery('#' + details[0] + '-down').css("display","inline"); |
164 | 168 |
jQuery('#' + details[0] + '-up').css("display","none"); |
165 | 169 |
jQuery('#' + details[0] + '-block').css("display","none"); |
166 |
jQuery('#' + details[0] + '-ip').html(details[2]);
|
|
170 |
jQuery('#' + details[0] + '-ip').html(ipv4_details);
|
|
167 | 171 |
jQuery('#' + details[0] + '-ipv6').html(details[3]); |
168 | 172 |
jQuery('#' + details[0] + '-media').html(details[4]); |
169 | 173 |
break; |
170 | 174 |
case "block": |
171 |
jQuery('#' + details[0] + '-block').css("display","inline");
|
|
172 |
jQuery('#' + details[0] + '-down').css("display","none");
|
|
173 |
jQuery('#' + details[0] + '-up').css("display","none");
|
|
175 |
jQuery('#' + details[0] + '-block').css("display","inline"); |
|
176 |
jQuery('#' + details[0] + '-down').css("display","none"); |
|
177 |
jQuery('#' + details[0] + '-up').css("display","none"); |
|
174 | 178 |
break; |
175 | 179 |
} |
176 | 180 |
}); |
Also available in: Unified diff
Put line break only if IPv4 address exists
This makes a line for the IPv4 address if it is there. If the IPv4 address goes away, the whole line will disappear, leaving just the IPv6 address without an empty line above it.