luci-base: migrate luci/getBoardJSON to C plugin
authorJo-Philipp Wich <jo@mein.io>
Thu, 31 Oct 2019 13:15:40 +0000 (14:15 +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/htdocs/luci-static/resources/network.js
modules/luci-base/root/usr/libexec/rpcd/luci
modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json

index 5fa6167b27484522f282aa4853545228568b2895..665024fd7eff12639ce5cd4c6b8bc5580613e29e 100644 (file)
@@ -63,7 +63,7 @@ var callLuciIfaddrs = rpc.declare({
 });
 
 var callLuciBoardJSON = rpc.declare({
-       object: 'luci',
+       object: 'luci-rpc',
        method: 'getBoardJSON'
 });
 
index ace0957f3e1ac36198592e524c34acbc017acf21..1e95ff5c683708eff9055845efbedeaeba707cfa 100755 (executable)
@@ -334,13 +334,6 @@ local methods = {
                end
        },
 
-       getBoardJSON = {
-               call = function(args)
-                       local jsc = require "luci.jsonc"
-                       return jsc.parse(fs.readfile("/etc/board.json") or "")
-               end
-       },
-
        getConntrackHelpers = {
                call = function()
                        local ok, fd = pcall(io.open, "/usr/share/fw3/helpers.conf", "r")
index b3c40137828ad7d700b451bfa5bad868a6c9d261..158e72cf76347d09b528357515439c1de113c22c 100644 (file)
@@ -41,7 +41,8 @@
                        "ubus": {
                                "file": [ "list", "read", "stat" ],
                                "iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ],
-                               "luci": [ "getBoardJSON", "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getDHCPLeases", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ],
+                               "luci": [ "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getDHCPLeases", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ],
+                               "luci-rpc": [ "getBoardJSON" ],
                                "network.device": [ "status" ],
                                "network.interface": [ "dump" ],
                                "network": [ "get_proto_handlers" ],