summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-06 13:22:10 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-06 13:22:10 +0100
commita8a76978298ba1cfddadbb48da73fa2abde82692 (patch)
treeec1b25faca67a27ebb2c540efd1316011048930d
parentb27b5cfb51de91af90a05a6f31dba7511dedf8b7 (diff)
luci-base: network.js: prevent duplicate wan interface reporting
Fixes: #3269 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/network.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js
index 7c5d2b974..b29a100e9 100644
--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -1471,10 +1471,14 @@ Network = L.Class.extend(/** @lends LuCI.Network.prototype */ {
*/
getWANNetworks: function() {
return this.getStatusByRoute('0.0.0.0', 0).then(L.bind(function(statuses) {
- var rv = [];
+ var rv = [], seen = {};
- for (var i = 0; i < statuses.length; i++)
- rv.push(this.instantiateNetwork(statuses[i].interface, statuses[i].proto));
+ for (var i = 0; i < statuses.length; i++) {
+ if (!seen.hasOwnProperty(statuses[i].interface)) {
+ rv.push(this.instantiateNetwork(statuses[i].interface, statuses[i].proto));
+ seen[statuses[i].interface] = true;
+ }
+ }
return rv;
}, this));
@@ -1492,10 +1496,14 @@ Network = L.Class.extend(/** @lends LuCI.Network.prototype */ {
*/
getWAN6Networks: function() {
return this.getStatusByRoute('::', 0).then(L.bind(function(statuses) {
- var rv = [];
+ var rv = [], seen = {};
- for (var i = 0; i < statuses.length; i++)
- rv.push(this.instantiateNetwork(statuses[i].interface, statuses[i].proto));
+ for (var i = 0; i < statuses.length; i++) {
+ if (!seen.hasOwnProperty(statuses[i].interface)) {
+ rv.push(this.instantiateNetwork(statuses[i].interface, statuses[i].proto));
+ seen[statuses[i].interface] = true;
+ }
+ }
return rv;
}, this));