luci-base, luci-mod-network: migrate luci/getDHCPLeases to C plugin
authorJo-Philipp Wich <jo@mein.io>
Thu, 31 Oct 2019 13:25:53 +0000 (14:25 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 1 Nov 2019 11:03:33 +0000 (12:03 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/root/usr/libexec/rpcd/luci
modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index 1e95ff5c683708eff9055845efbedeaeba707cfa..13a83dfd146544c11dc92e12a566195c3cea2af7 100755 (executable)
@@ -193,24 +193,6 @@ local methods = {
                end
        },
 
-       getDHCPLeases = {
-               args = { family = 0 },
-               call = function(args)
-                       local s = require "luci.tools.status"
-
-                       if args.family == 4 then
-                               return { dhcp_leases = s.dhcp_leases() }
-                       elseif args.family == 6 then
-                               return { dhcp6_leases = s.dhcp6_leases() }
-                       else
-                               return {
-                                       dhcp_leases = s.dhcp_leases(),
-                                       dhcp6_leases = s.dhcp6_leases()
-                               }
-                       end
-               end
-       },
-
        getNetworkDevices = {
                call = function(args)
                        local dir = fs.dir("/sys/class/net")
index 158e72cf76347d09b528357515439c1de113c22c..5256c8bb2c1af6587128e4281b9ab1ea56a83234 100644 (file)
@@ -41,8 +41,8 @@
                        "ubus": {
                                "file": [ "list", "read", "stat" ],
                                "iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ],
-                               "luci": [ "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getDHCPLeases", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ],
-                               "luci-rpc": [ "getBoardJSON" ],
+                               "luci": [ "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ],
+                               "luci-rpc": [ "getBoardJSON", "getDHCPLeases" ],
                                "network.device": [ "status" ],
                                "network.interface": [ "dump" ],
                                "network": [ "get_proto_handlers" ],
index 3acb6d1a16864b73aeac1078569dbd4b9bf2bc95..e299a3ad10232863fc72b6115e403771d82e2897 100644 (file)
@@ -18,7 +18,7 @@ callDUIDHints = rpc.declare({
 });
 
 callDHCPLeases = rpc.declare({
-       object: 'luci',
+       object: 'luci-rpc',
        method: 'getDHCPLeases',
        params: [ 'family' ],
        expect: { dhcp_leases: [] }