X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci2%2Fui.git;a=blobdiff_plain;f=luci2%2Fhtdocs%2Fluci2%2Fluci2.js;h=ffa58ea0de2d8ceedf9c119a711c57624940caab;hp=279da1716c0c77767793a87c50f6a2f6bfa83722;hb=b7e255f6d02885cb0d093812e32f4632734d4b6f;hpb=a437b0d71daa0cb9231a165083523bdc6463889a diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index 279da17..ffa58ea 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -977,6 +977,42 @@ function LuCI2() method: 'switch_status', params: [ 'switch' ], expect: { ports: [ ] } + }), + + + runPing: _luci2.rpc.declare({ + object: 'luci2.network', + method: 'ping', + params: [ 'data' ], + expect: { '': { code: -1 } } + }), + + runPing6: _luci2.rpc.declare({ + object: 'luci2.network', + method: 'ping6', + params: [ 'data' ], + expect: { '': { code: -1 } } + }), + + runTraceroute: _luci2.rpc.declare({ + object: 'luci2.network', + method: 'traceroute', + params: [ 'data' ], + expect: { '': { code: -1 } } + }), + + runTraceroute6: _luci2.rpc.declare({ + object: 'luci2.network', + method: 'traceroute6', + params: [ 'data' ], + expect: { '': { code: -1 } } + }), + + runNslookup: _luci2.rpc.declare({ + object: 'luci2.network', + method: 'nslookup', + params: [ 'data' ], + expect: { '': { code: -1 } } }) }; @@ -2664,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'; @@ -2705,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'); @@ -2955,6 +2993,7 @@ function LuCI2() } } + validation.i18n('Must be a valid IPv6 address'); return false; }, @@ -5604,33 +5643,6 @@ function LuCI2() }); }, - dialog: function(id) - { - var d = $('
'); - var p = $('

'); - - $('') - .attr('src', _luci2.globals.resource + '/icons/loading.gif') - .css('vertical-align', 'middle') - .css('padding-right', '10px') - .appendTo(p); - - p.append(_luci2.tr('Loading data...')); - - p.appendTo(d); - d.appendTo(id); - - return d.dialog({ - modal: true, - draggable: false, - resizable: false, - height: 90, - open: function() { - $(this).parent().children('.ui-dialog-titlebar').hide(); - } - }); - }, - insertInto: function(id) { var self = this;