Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
d09351c9
Commit
d09351c9
authored
8 years ago
by
Christof Schulze
Committed by
Andreas Ziegler
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gluon-luci-portconfig: portconfig.lua: change spaces to tabs (#998)
parent
2ddf77fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua
+72
-73
72 additions, 73 deletions
...ig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua
with
72 additions
and
73 deletions
package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua
+
72
−
73
View file @
d09351c9
...
@@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
...
@@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
$Id$
$Id$
]]
--
]]
--
...
@@ -75,11 +75,11 @@ o.rmempty = false
...
@@ -75,11 +75,11 @@ o.rmempty = false
if
dns
then
if
dns
then
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
o
=
s
:
option
(
DynamicList
,
"dns"
,
translate
(
"Static DNS servers"
))
o
=
s
:
option
(
DynamicList
,
"dns"
,
translate
(
"Static DNS servers"
))
o
:
write
(
nil
,
uci
:
get
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
))
o
:
write
(
nil
,
uci
:
get
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
))
o
.
datatype
=
"ipaddr"
o
.
datatype
=
"ipaddr"
end
end
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
...
@@ -89,80 +89,79 @@ o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disab
...
@@ -89,80 +89,79 @@ o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disab
o
.
rmempty
=
false
o
.
rmempty
=
false
if
sysconfig
.
lan_ifname
then
if
sysconfig
.
lan_ifname
then
o
=
s
:
option
(
Flag
,
"mesh_lan"
,
translate
(
"Enable meshing on the LAN interface"
))
o
=
s
:
option
(
Flag
,
"mesh_lan"
,
translate
(
"Enable meshing on the LAN interface"
))
o
.
default
=
uci
:
get_bool
(
"network"
,
"mesh_lan"
,
"auto"
)
and
o
.
enabled
or
o
.
disabled
o
.
default
=
uci
:
get_bool
(
"network"
,
"mesh_lan"
,
"auto"
)
and
o
.
enabled
or
o
.
disabled
o
.
rmempty
=
false
o
.
rmempty
=
false
end
end
if
uci
:
get
(
'system'
,
'gpio_switch_poe_passthrough'
)
then
if
uci
:
get
(
'system'
,
'gpio_switch_poe_passthrough'
)
then
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
s
=
f
:
section
(
SimpleSection
,
nil
,
nil
)
o
=
s
:
option
(
Flag
,
"poe_passthrough"
,
translate
(
"Enable PoE passthrough"
))
o
=
s
:
option
(
Flag
,
"poe_passthrough"
,
translate
(
"Enable PoE passthrough"
))
o
.
default
=
uci
:
get_bool
(
"system"
,
"gpio_switch_poe_passthrough"
,
"value"
)
and
o
.
enabled
or
o
.
disabled
o
.
default
=
uci
:
get_bool
(
"system"
,
"gpio_switch_poe_passthrough"
,
"value"
)
and
o
.
enabled
or
o
.
disabled
o
.
rmempty
=
false
o
.
rmempty
=
false
end
end
function
f
.
handle
(
self
,
state
,
data
)
function
f
.
handle
(
self
,
state
,
data
)
if
state
==
FORM_VALID
then
if
state
==
FORM_VALID
then
uci
:
set
(
"network"
,
"wan"
,
"proto"
,
data
.
ipv4
)
uci
:
set
(
"network"
,
"wan"
,
"proto"
,
data
.
ipv4
)
if
data
.
ipv4
==
"static"
then
if
data
.
ipv4
==
"static"
then
uci
:
set
(
"network"
,
"wan"
,
"ipaddr"
,
data
.
ipv4_addr
:
trim
())
uci
:
set
(
"network"
,
"wan"
,
"ipaddr"
,
data
.
ipv4_addr
:
trim
())
uci
:
set
(
"network"
,
"wan"
,
"netmask"
,
data
.
ipv4_netmask
:
trim
())
uci
:
set
(
"network"
,
"wan"
,
"netmask"
,
data
.
ipv4_netmask
:
trim
())
uci
:
set
(
"network"
,
"wan"
,
"gateway"
,
data
.
ipv4_gateway
:
trim
())
uci
:
set
(
"network"
,
"wan"
,
"gateway"
,
data
.
ipv4_gateway
:
trim
())
else
else
uci
:
delete
(
"network"
,
"wan"
,
"ipaddr"
)
uci
:
delete
(
"network"
,
"wan"
,
"ipaddr"
)
uci
:
delete
(
"network"
,
"wan"
,
"netmask"
)
uci
:
delete
(
"network"
,
"wan"
,
"netmask"
)
uci
:
delete
(
"network"
,
"wan"
,
"gateway"
)
uci
:
delete
(
"network"
,
"wan"
,
"gateway"
)
end
end
uci
:
set
(
"network"
,
"wan6"
,
"proto"
,
data
.
ipv6
)
uci
:
set
(
"network"
,
"wan6"
,
"proto"
,
data
.
ipv6
)
if
data
.
ipv6
==
"static"
then
if
data
.
ipv6
==
"static"
then
uci
:
set
(
"network"
,
"wan6"
,
"ip6addr"
,
data
.
ipv6_addr
:
trim
())
uci
:
set
(
"network"
,
"wan6"
,
"ip6addr"
,
data
.
ipv6_addr
:
trim
())
uci
:
set
(
"network"
,
"wan6"
,
"ip6gw"
,
data
.
ipv6_gateway
:
trim
())
uci
:
set
(
"network"
,
"wan6"
,
"ip6gw"
,
data
.
ipv6_gateway
:
trim
())
else
else
uci
:
delete
(
"network"
,
"wan6"
,
"ip6addr"
)
uci
:
delete
(
"network"
,
"wan6"
,
"ip6addr"
)
uci
:
delete
(
"network"
,
"wan6"
,
"ip6gw"
)
uci
:
delete
(
"network"
,
"wan6"
,
"ip6gw"
)
end
end
uci
:
set
(
"network"
,
"mesh_wan"
,
"auto"
,
data
.
mesh_wan
)
uci
:
set
(
"network"
,
"mesh_wan"
,
"auto"
,
data
.
mesh_wan
)
if
sysconfig
.
lan_ifname
then
if
sysconfig
.
lan_ifname
then
uci
:
set
(
"network"
,
"mesh_lan"
,
"auto"
,
data
.
mesh_lan
)
uci
:
set
(
"network"
,
"mesh_lan"
,
"auto"
,
data
.
mesh_lan
)
local
doit
local
doit
if
data
.
mesh_lan
==
'1'
then
if
data
.
mesh_lan
==
'1'
then
doit
=
uci
.
remove_from_set
doit
=
uci
.
remove_from_set
else
else
doit
=
uci
.
add_to_set
doit
=
uci
.
add_to_set
end
end
for
_
,
lanif
in
ipairs
(
lutil
.
split
(
sysconfig
.
lan_ifname
,
' '
))
do
for
_
,
lanif
in
ipairs
(
lutil
.
split
(
sysconfig
.
lan_ifname
,
' '
))
do
doit
(
uci
,
"network"
,
"client"
,
"ifname"
,
lanif
)
doit
(
uci
,
"network"
,
"client"
,
"ifname"
,
lanif
)
end
end
end
end
uci
:
save
(
"network"
)
uci
:
save
(
"network"
)
uci
:
commit
(
"network"
)
uci
:
commit
(
"network"
)
if
uci
:
get
(
'system'
,
'gpio_switch_poe_passthrough'
)
then
if
uci
:
get
(
'system'
,
'gpio_switch_poe_passthrough'
)
then
uci
:
set
(
'system'
,
'gpio_switch_poe_passthrough'
,
'value'
,
data
.
poe_passthrough
)
uci
:
set
(
'system'
,
'gpio_switch_poe_passthrough'
,
'value'
,
data
.
poe_passthrough
)
uci
:
save
(
'system'
)
uci
:
save
(
'system'
)
uci
:
commit
(
'system'
)
uci
:
commit
(
'system'
)
end
end
if
dns
then
if
dns
then
if
#
data
.
dns
>
0
then
if
#
data
.
dns
>
0
then
uci
:
set
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
,
data
.
dns
)
uci
:
set
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
,
data
.
dns
)
else
else
uci
:
delete
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
)
uci
:
delete
(
"gluon-wan-dnsmasq"
,
dns
,
"server"
)
end
end
uci
:
save
(
"gluon-wan-dnsmasq"
)
uci
:
save
(
"gluon-wan-dnsmasq"
)
uci
:
commit
(
"gluon-wan-dnsmasq"
)
uci
:
commit
(
"gluon-wan-dnsmasq"
)
end
end
end
end
return
true
return
true
end
end
return
f
return
f
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment