Replace luci-lib-jsonc with our own lua-jsonc
This commit is contained in:
parent
4d7740ae97
commit
6cf88c3b03
@ -16,7 +16,7 @@ define Package/gluon-core
|
|||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
TITLE:=Base files of Gluon
|
TITLE:=Base files of Gluon
|
||||||
DEPENDS:= \
|
DEPENDS:= \
|
||||||
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +luci-lib-jsonc +luci-lib-nixio \
|
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +lua-jsonc +luci-lib-nixio \
|
||||||
+vxlan +odhcp6c +firewall +pretty-hostname
|
+vxlan +odhcp6c +firewall +pretty-hostname
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1,22 +1,5 @@
|
|||||||
local site = (function()
|
local json = require 'jsonc'
|
||||||
local config = '/lib/gluon/site.json'
|
local site = assert(json.load('/lib/gluon/site.json'))
|
||||||
|
|
||||||
local json = require 'luci.jsonc'
|
|
||||||
local decoder = json.new()
|
|
||||||
local sink = decoder:sink()
|
|
||||||
|
|
||||||
local file = assert(io.open(config))
|
|
||||||
|
|
||||||
while true do
|
|
||||||
local chunk = file:read(2048)
|
|
||||||
if not chunk or chunk:len() == 0 then break end
|
|
||||||
sink(chunk)
|
|
||||||
end
|
|
||||||
|
|
||||||
file:close()
|
|
||||||
|
|
||||||
return assert(decoder:get())
|
|
||||||
end)()
|
|
||||||
|
|
||||||
|
|
||||||
local wrap
|
local wrap
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/lua
|
#!/usr/bin/lua
|
||||||
util = require 'gluon.util'
|
util = require 'gluon.util'
|
||||||
fs = require 'nixio.fs'
|
fs = require 'nixio.fs'
|
||||||
json = require 'luci.jsonc'
|
json = require 'jsonc'
|
||||||
ubus = require 'ubus'
|
ubus = require 'ubus'
|
||||||
|
|
||||||
io.write("Access-Control-Allow-Origin: *\n")
|
io.write("Access-Control-Allow-Origin: *\n")
|
||||||
|
@ -16,7 +16,7 @@ define Package/gluon-web
|
|||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
TITLE:=Minimal Lua web framework derived from LuCI
|
TITLE:=Minimal Lua web framework derived from LuCI
|
||||||
DEPENDS:=+luci-lib-jsonc +luci-lib-nixio
|
DEPENDS:=+lua-jsonc +luci-lib-nixio
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define lang-config
|
define lang-config
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
-- Licensed to the public under the Apache License 2.0.
|
-- Licensed to the public under the Apache License 2.0.
|
||||||
|
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local json = require "luci.jsonc"
|
local json = require "jsonc"
|
||||||
local tpl = require "gluon.web.template"
|
local tpl = require "gluon.web.template"
|
||||||
local util = require "gluon.web.util"
|
local util = require "gluon.web.util"
|
||||||
local proto = require "gluon.web.http.protocol"
|
local proto = require "gluon.web.http.protocol"
|
||||||
|
Loading…
Reference in New Issue
Block a user