luci-base, luci-mod-network: migrate luci/getDHCPLeases to C plugin
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
d21ebcfbbc
commit
5ff35d8be4
3 changed files with 3 additions and 21 deletions
|
@ -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")
|
||||
|
|
|
@ -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" ],
|
||||
|
|
|
@ -18,7 +18,7 @@ callDUIDHints = rpc.declare({
|
|||
});
|
||||
|
||||
callDHCPLeases = rpc.declare({
|
||||
object: 'luci',
|
||||
object: 'luci-rpc',
|
||||
method: 'getDHCPLeases',
|
||||
params: [ 'family' ],
|
||||
expect: { dhcp_leases: [] }
|
||||
|
|
Loading…
Reference in a new issue