diff options
Diffstat (limited to 'libs/web')
-rw-r--r-- | libs/web/luasrc/config.lua | 24 | ||||
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 1 |
2 files changed, 5 insertions, 20 deletions
diff --git a/libs/web/luasrc/config.lua b/libs/web/luasrc/config.lua index 4eb8e46e4..557303f88 100644 --- a/libs/web/luasrc/config.lua +++ b/libs/web/luasrc/config.lua @@ -25,23 +25,7 @@ limitations under the License. ]]-- -local uci = require("luci.model.uci") -local util = require("luci.util") -module("luci.config") - --- Warning! This is only for fallback and compatibility purporses! -- -main = {} - --- This is where stylesheets and images go -main.mediaurlbase = "/luci/media" - --- Does anybody think about browser autodetect here? --- Too bad busybox doesn't populate HTTP_ACCEPT_LANGUAGE -main.lang = "de" - - --- Now overwrite with UCI values -local ucidata = uci.sections("luci") -if ucidata then - util.update(_M, ucidata) -end
\ No newline at end of file +module("luci.config", + function(m) + setmetatable(m, {__index = require("luci.model.uci").get_all("luci")}) + end)
\ No newline at end of file diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index ef6c6881b..7ff4031a6 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -162,6 +162,7 @@ function dispatch() tpl.viewns.uploadctrl = luci.http.dispatcher_upload() tpl.viewns.media = luci.config.main.mediaurlbase tpl.viewns.resource = luci.config.main.resourcebase + tpl.viewns.uci = require("luci.model.uci").config tpl.viewns.REQUEST_URI = luci.http.env.SCRIPT_NAME .. luci.http.env.PATH_INFO |