Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
809a9f85
Commit
809a9f85
authored
Apr 06, 2011
by
hitz
Browse files
First version of qmp-luci
parent
4875fcf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
packages/qmp-luci/usr/lib/lua/luci/controller/qmp.lua
0 → 100644
View file @
809a9f85
module
(
"luci.controller.qmp.qmp"
,
package
.
seeall
)
function
index
()
entry
({
"qmp"
,
"status"
},
call
(
"action:stauts"
),
"Click here"
,
10
).
dependent
=
false
end
function
action_status
()
luci
.
http
.
prepare_content
(
"text/plain"
)
luci
.
http
.
write
(
"Quick Mesh Project [qMp]"
)
end
packages/qmp-luci/usr/lib/lua/luci/model/cbi/qmp/config.lua
0 → 100644
View file @
809a9f85
require
(
"luci.sys"
)
m
=
Map
(
"qmp"
,
"Quick Mesh Project"
)
real_interfaces
=
{
'eth'
,
'ath'
,
'wlan'
,
'wl'
}
int
=
m
:
section
(
NamedSection
,
"interfaces"
,
"qmp"
,
"Interfaces"
,
"Devices to include into Quick Mesh deployment"
)
int
.
addremove
=
False
-- Getting the physical (real) interfaces
-- interfaces matching with real_interfaces and without dot
phy_int
=
{}
for
i
,
d
in
ipairs
(
luci
.
sys
.
net
.
devices
())
do
for
i
,
r
in
ipairs
(
real_interfaces
)
do
if
string.find
(
d
,
r
)
~=
nil
then
if
string.find
(
d
,
"%."
)
==
nil
then
table.insert
(
phy_int
,
d
)
end
end
end
end
-- Option: lan_devices
lan
=
int
:
option
(
MultiValue
,
"lan_devices"
,
"LAN devices"
)
for
i
,
l
in
ipairs
(
phy_int
)
do
lan
:
value
(
l
,
l
)
end
-- Option wan_device
wan
=
int
:
option
(
ListValue
,
"wan_device"
,
"WAN device"
)
for
i
,
w
in
ipairs
(
phy_int
)
do
wan
:
value
(
w
,
w
)
end
wan
:
value
(
" "
,
" "
)
-- Option mesh_devices
mesh
=
int
:
option
(
MultiValue
,
"mesh_devices"
,
"MESH devices"
)
for
i
,
l
in
ipairs
(
phy_int
)
do
mesh
:
value
(
l
,
l
)
end
--int:option(Value, "lan_devices", "LAN devices", "LAN devices")
--int:option(Value, "wan_device", "WAN device", "WAN devices")
--int:option(Value, "mesh_devices", "Mesh devices", "MESH devices")
return
m
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment