luci-base, luci-mod-network, luci-app-firewall: migrate luci/getHostHints

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-10-31 14:37:07 +01:00
parent 5ff35d8be4
commit 37b6092aef
7 changed files with 7 additions and 16 deletions

View file

@ -74,7 +74,7 @@ function forward_via_txt(s) {
return L.view.extend({ return L.view.extend({
callHostHints: rpc.declare({ callHostHints: rpc.declare({
object: 'luci', object: 'luci-rpc',
method: 'getHostHints', method: 'getHostHints',
expect: { '': {} } expect: { '': {} }
}), }),

View file

@ -111,7 +111,7 @@ function rule_target_txt(s) {
return L.view.extend({ return L.view.extend({
callHostHints: rpc.declare({ callHostHints: rpc.declare({
object: 'luci', object: 'luci-rpc',
method: 'getHostHints', method: 'getHostHints',
expect: { '': {} } expect: { '': {} }
}), }),

View file

@ -68,7 +68,7 @@ var callLuciBoardJSON = rpc.declare({
}); });
var callLuciHostHints = rpc.declare({ var callLuciHostHints = rpc.declare({
object: 'luci', object: 'luci-rpc',
method: 'getHostHints', method: 'getHostHints',
expect: { '': {} } expect: { '': {} }
}); });

View file

@ -166,13 +166,6 @@ local methods = {
end end
}, },
getHostHints = {
call = function()
local sys = require "luci.sys"
return sys.net.host_hints()
end
},
getDUIDHints = { getDUIDHints = {
call = function() call = function()
local fp = io.open('/var/hosts/odhcpd') local fp = io.open('/var/hosts/odhcpd')

View file

@ -41,8 +41,8 @@
"ubus": { "ubus": {
"file": [ "list", "read", "stat" ], "file": [ "list", "read", "stat" ],
"iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ], "iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ],
"luci": [ "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ], "luci": [ "getDUIDHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints" ],
"luci-rpc": [ "getBoardJSON", "getDHCPLeases" ], "luci-rpc": [ "getBoardJSON", "getDHCPLeases", "getHostHints" ],
"network.device": [ "status" ], "network.device": [ "status" ],
"network.interface": [ "dump" ], "network.interface": [ "dump" ],
"network": [ "get_proto_handlers" ], "network": [ "get_proto_handlers" ],

View file

@ -6,7 +6,7 @@
var callHostHints, callDUIDHints, callDHCPLeases, CBILeaseStatus; var callHostHints, callDUIDHints, callDHCPLeases, CBILeaseStatus;
callHostHints = rpc.declare({ callHostHints = rpc.declare({
object: 'luci', object: 'luci-rpc',
method: 'getHostHints', method: 'getHostHints',
expect: { '': {} } expect: { '': {} }
}); });
@ -44,8 +44,6 @@ CBILeaseStatus = form.DummyValue.extend({
}); });
return L.view.extend({ return L.view.extend({
load: function() { load: function() {
return Promise.all([ return Promise.all([
callHostHints(), callHostHints(),

View file

@ -4,7 +4,7 @@
return L.view.extend({ return L.view.extend({
callHostHints: rpc.declare({ callHostHints: rpc.declare({
object: 'luci', object: 'luci-rpc',
method: 'getHostHints', method: 'getHostHints',
expect: { '': {} } expect: { '': {} }
}), }),