mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix glorytun interface
This commit is contained in:
parent
a727c6cace
commit
86588f0792
1 changed files with 15 additions and 6 deletions
|
@ -58,20 +58,29 @@ function s.create(self, name)
|
||||||
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
|
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
|
||||||
self.sectiontype .. ".text"
|
self.sectiontype .. ".text"
|
||||||
)
|
)
|
||||||
if string.len(name)>3 and not name:match("[^a-zA-Z0-9_]") then
|
if #name > 3 and not name:match("[^a-zA-Z0-9_]") then
|
||||||
uci:section(
|
--uci:section(
|
||||||
"glorytun", "glorytun", name,
|
-- "glorytun", "glorytun", name,
|
||||||
uci:get_all( "glorytun_recipes", recipe )
|
-- uci:get_all( "glorytun_recipes", recipe )
|
||||||
)
|
--)
|
||||||
|
local recipe_data = uci:get_all( "glorytun_recipes", recipe )
|
||||||
|
uci:set("glorytun", name,"glorytun")
|
||||||
|
local k, v
|
||||||
|
for k, v in pairs(recipe_data) do
|
||||||
|
uci:set("glorytun", name, k,v)
|
||||||
|
end
|
||||||
|
|
||||||
uci:delete("glorytun", name, "_role")
|
uci:delete("glorytun", name, "_role")
|
||||||
uci:delete("glorytun", name, "_description")
|
uci:delete("glorytun", name, "_description")
|
||||||
|
uci:commit("glorytun")
|
||||||
uci:save("glorytun")
|
uci:save("glorytun")
|
||||||
|
|
||||||
luci.http.redirect( self.extedit:format(name) )
|
luci.http.redirect( self.extedit:format(name) )
|
||||||
else
|
elseif #name > 0 then
|
||||||
self.invalid_cts = true
|
self.invalid_cts = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue