luci2: fix interface type detection in LuCI2.ui.devicebadge()
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Oct 2013 22:40:24 +0000 (22:40 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Oct 2013 22:40:24 +0000 (22:40 +0000)
luci2/htdocs/luci2/luci2.js

index df127e175b77a15951416fe44cb8165b40ec4fb7..84ebf847040c5efc09ae6320f1820b3ccf9e42e6 100644 (file)
@@ -2700,7 +2700,9 @@ function LuCI2()
        this.ui.devicebadge = AbstractWidget.extend({
                render: function()
                {
-                       var dev = this.options.l3_device || this.options.device || '?';
+                       var l2dev = this.options.l2_device || this.options.device;
+                       var l3dev = this.options.l3_device;
+                       var dev = l3dev || l2dev || '?';
 
                        var span = document.createElement('span');
                                span.className = 'ifacebadge';
@@ -2741,7 +2743,7 @@ function LuCI2()
                                var type = 'ethernet';
                                var desc = _luci2.tr('Ethernet device');
 
-                               if (this.options.l3_device != this.options.device)
+                               if (l3dev != l2dev)
                                {
                                        type = 'tunnel';
                                        desc = _luci2.tr('Tunnel interface');