Developing lightweight computation at the DSG edge

Commit 4a64602c authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

sed -i -e 's/\s\+$//g' packages/qmp-small-node/files/usr/lib/lua/luci/controller/qmp.lua

parent 295dea35
...@@ -23,7 +23,7 @@ module("luci.controller.qmp", package.seeall) ...@@ -23,7 +23,7 @@ module("luci.controller.qmp", package.seeall)
function index() function index()
-- Making qmp as default -- Making qmp as default
local root = node() local root = node()
root.target = alias("qmp") root.target = alias("qmp")
root.index = true root.index = true
...@@ -33,7 +33,7 @@ function index() ...@@ -33,7 +33,7 @@ function index()
overview.dependent = false overview.dependent = false
overview.sysauth = "root" overview.sysauth = "root"
overview.sysauth_authenticator = "htmlauth" overview.sysauth_authenticator = "htmlauth"
-- Rest of entries -- Rest of entries
entry({"qmp","info"}, call("action_status"), "Info", 1).dependent=false entry({"qmp","info"}, call("action_status"), "Info", 1).dependent=false
entry({"qmp","status"}, template("admin_status/index"), "Status", 2).dependent=false entry({"qmp","status"}, template("admin_status/index"), "Status", 2).dependent=false
...@@ -46,14 +46,14 @@ function index() ...@@ -46,14 +46,14 @@ function index()
entry({"qmp","tools"}, call("action_tools"), "Tools", 8).dependent=false entry({"qmp","tools"}, call("action_tools"), "Tools", 8).dependent=false
entry({"qmp","map"}, call("action_map"), "Map", 8).dependent=false entry({"qmp","map"}, call("action_map"), "Map", 8).dependent=false
end end
function action_status() function action_status()
package.path = package.path .. ";/etc/qmp/?.lua" package.path = package.path .. ";/etc/qmp/?.lua"
local qmp = require "qmpinfo" local qmp = require "qmpinfo"
local ipv4 = qmp.get_ipv4() local ipv4 = qmp.get_ipv4()
local hostname = qmp.get_hostname() local hostname = qmp.get_hostname()
local uname = qmp.get_uname() local uname = qmp.get_uname()
luci.template.render("qmp/overview",{ipv4=ipv4,hostname=hostname,uname=uname}) luci.template.render("qmp/overview",{ipv4=ipv4,hostname=hostname,uname=uname})
end end
...@@ -62,7 +62,7 @@ function action_tools() ...@@ -62,7 +62,7 @@ function action_tools()
local qmp = require "qmpinfo" local qmp = require "qmpinfo"
local nodes = qmp.nodes() local nodes = qmp.nodes()
local key = qmp.get_key() local key = qmp.get_key()
luci.template.render("qmp/tools",{nodes=nodes,key=key}) luci.template.render("qmp/tools",{nodes=nodes,key=key})
end end
function action_splash() function action_splash()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment