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 | ||||
|   TITLE:=Base files of Gluon | ||||
|   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 | ||||
| endef | ||||
| 
 | ||||
|  | ||||
| @ -1,22 +1,5 @@ | ||||
| local site = (function() | ||||
| 	local config = '/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 json = require 'jsonc' | ||||
| local site = assert(json.load('/lib/gluon/site.json')) | ||||
| 
 | ||||
| 
 | ||||
| local wrap | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| #!/usr/bin/lua | ||||
| util = require 'gluon.util' | ||||
| fs = require 'nixio.fs' | ||||
| json = require 'luci.jsonc' | ||||
| json = require 'jsonc' | ||||
| ubus = require 'ubus' | ||||
| 
 | ||||
| io.write("Access-Control-Allow-Origin: *\n") | ||||
|  | ||||
| @ -16,7 +16,7 @@ define Package/gluon-web | ||||
|   SECTION:=gluon | ||||
|   CATEGORY:=Gluon | ||||
|   TITLE:=Minimal Lua web framework derived from LuCI | ||||
|   DEPENDS:=+luci-lib-jsonc +luci-lib-nixio | ||||
|   DEPENDS:=+lua-jsonc +luci-lib-nixio | ||||
| endef | ||||
| 
 | ||||
| define lang-config | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
| -- Licensed to the public under the Apache License 2.0. | ||||
| 
 | ||||
| local fs = require "nixio.fs" | ||||
| local json = require "luci.jsonc" | ||||
| local json = require "jsonc" | ||||
| local tpl = require "gluon.web.template" | ||||
| local util = require "gluon.web.util" | ||||
| local proto = require "gluon.web.http.protocol" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user