diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-09-17 14:49:53 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-09-17 14:49:53 +0200 |
commit | 19990b36ae3f7ca9135934e7ecc92b6aa172480f (patch) | |
tree | 40a6a77a14d65590dd1892d7486a932ce4493d7c /luci2/htdocs/luci2/view/status.overview.js | |
parent | 259860a1fd126cd8b2f0a6968e77783647fcd4d3 (diff) | |
download | luci2-ui-19990b36ae3f7ca9135934e7ecc92b6aa172480f.tar.gz |
luci2: major changes to RPC implementation
- rework LuCI2.rpc namespace to support batching arbritary requests
- use new LuCI.rpc.declare() generator function to declare RPC proxy functions
- thoroughly use jQuery promises for chaining RPC responses, drop callback model
- drop internal rcall() and retcb() helpers in favor to the new RPC implementation
- adjust existing views for new RPC model
- implement session alive check to automatically prompt for a login if the server session is expired
Diffstat (limited to 'luci2/htdocs/luci2/view/status.overview.js')
-rw-r--r-- | luci2/htdocs/luci2/view/status.overview.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/luci2/htdocs/luci2/view/status.overview.js b/luci2/htdocs/luci2/view/status.overview.js index 5505722..7440f8c 100644 --- a/luci2/htdocs/luci2/view/status.overview.js +++ b/luci2/htdocs/luci2/view/status.overview.js @@ -2,7 +2,7 @@ L.ui.view.extend({ title: L.tr('Status'), execute: function() { return $.when( - L.network.findWanInterfaces(function(wans) { + L.network.findWanInterfaces().then(function(wans) { var wan = wans[0]; var wan6 = wans[1]; @@ -86,7 +86,7 @@ L.ui.view.extend({ networkTable.insertInto('#network_status_table'); }), - L.network.getConntrackCount(function(count) { + L.network.getConntrackCount().then(function(count) { var conntrackTable = new L.ui.table({ caption: L.tr('Connection Tracking'), columns: [ { @@ -105,7 +105,7 @@ L.ui.view.extend({ conntrackTable.row([ L.tr('Active Connections'), count ]); conntrackTable.insertInto('#conntrack_status_table'); }), - L.system.getInfo(function(info) { + L.system.getInfo().then(function(info) { var sysinfoTable = new L.ui.table({ caption: L.tr('System'), columns: [ { width: '300px' }, { } ] @@ -207,7 +207,7 @@ L.ui.view.extend({ diskTable.row([ '' + L.tr('Temporary Usage') + ' (/tmp)', [ info.tmp.used, info.tmp.total ] ]); diskTable.insertInto('#disk_status_table'); }), - L.wireless.getInfo(null, function(radios) { + L.wireless.getWirelessStatus().then(function(radios) { var phys = [ ]; for (var phy in radios) phys.push(phy); @@ -309,7 +309,7 @@ L.ui.view.extend({ $('#wifi_status_table').append(wifiTable.render()); } }), - L.wireless.getAssocList(null, function(assoclist) { + L.wireless.getAssocLists().then(function(assoclist) { var formatRate = function(v) { return (typeof v.mcs != 'undefined') @@ -352,7 +352,7 @@ L.ui.view.extend({ assocTable.rows(assoclist); assocTable.insertInto('#wifi_assoc_table'); }), - L.network.getDHCPLeases(function(leases) { + L.network.getDHCPLeases().then(function(leases) { var leaseTable = new L.ui.table({ caption: L.tr('DHCP Leases'), placeholder: L.tr('There are no active leases.'), @@ -378,7 +378,7 @@ L.ui.view.extend({ leaseTable.rows(leases); leaseTable.insertInto('#lease_status_table'); }), - L.network.getDHCPv6Leases(function(leases) { + L.network.getDHCPv6Leases().then(function(leases) { if (!leases.length) return; |