update 2023-07-31 23:36:39
This commit is contained in:
parent
409dc25113
commit
41fd8beabb
|
@ -11,13 +11,13 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua
|
||||||
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17)
|
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17)
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
|
||||||
PKG_VERSION:=0.1.13-3
|
PKG_VERSION:=0.1.14-1
|
||||||
# PKG_RELEASE MUST be empty for luci.mk
|
# PKG_RELEASE MUST be empty for luci.mk
|
||||||
PKG_RELEASE:=
|
PKG_RELEASE:=
|
||||||
|
|
||||||
ISTORE_UI_VERSION:=0.1.13
|
ISTORE_UI_VERSION:=0.1.14
|
||||||
ISTORE_UI_RELEASE:=3
|
ISTORE_UI_RELEASE:=1
|
||||||
PKG_HASH:=edae8745fdc88c954d0be8ee563232410547546280345a61df9d4951658a1f29
|
PKG_HASH:=4ec3c8ecbba6f1cc205bbba1ee9c8b804ded8fe743150a7c32fc966fc254b50c
|
||||||
|
|
||||||
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
|
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
|
||||||
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE)
|
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE)
|
||||||
|
@ -30,6 +30,7 @@ TARGET_CONFIGURE_OPTS+= SED="$(SED)"
|
||||||
|
|
||||||
define Package/luci-app-store/conffiles
|
define Package/luci-app-store/conffiles
|
||||||
/etc/.app_store.id
|
/etc/.app_store.id
|
||||||
|
/etc/config/istore
|
||||||
endef
|
endef
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
|
@ -24,6 +24,7 @@ function index()
|
||||||
entry({"admin", "store", "upload"}, post("store_upload"))
|
entry({"admin", "store", "upload"}, post("store_upload"))
|
||||||
entry({"admin", "store", "check_self_upgrade"}, call("check_self_upgrade"))
|
entry({"admin", "store", "check_self_upgrade"}, call("check_self_upgrade"))
|
||||||
entry({"admin", "store", "do_self_upgrade"}, post("do_self_upgrade"))
|
entry({"admin", "store", "do_self_upgrade"}, post("do_self_upgrade"))
|
||||||
|
entry({"admin", "store", "toggle_docker"}, post("toggle_docker"))
|
||||||
|
|
||||||
for _, action in ipairs({"update", "install", "upgrade", "remove"}) do
|
for _, action in ipairs({"update", "install", "upgrade", "remove"}) do
|
||||||
store_api(action, true)
|
store_api(action, true)
|
||||||
|
@ -67,6 +68,16 @@ local function user_id()
|
||||||
return id
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function user_config()
|
||||||
|
local uci = require "luci.model.uci".cursor()
|
||||||
|
|
||||||
|
local data = {
|
||||||
|
hide_docker = uci:get("istore", "istore", "hide_docker") == "1",
|
||||||
|
channel = uci:get("istore", "istore", "channel")
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
end
|
||||||
|
|
||||||
local function vue_lang()
|
local function vue_lang()
|
||||||
local i18n = require("luci.i18n")
|
local i18n = require("luci.i18n")
|
||||||
local lang = i18n.translate("istore_vue_lang")
|
local lang = i18n.translate("istore_vue_lang")
|
||||||
|
@ -131,11 +142,14 @@ function store_index()
|
||||||
if luci.sys.call("[ -d /ext_overlay ] >/dev/null 2>&1") == 0 then
|
if luci.sys.call("[ -d /ext_overlay ] >/dev/null 2>&1") == 0 then
|
||||||
features[#features+1] = "sandbox"
|
features[#features+1] = "sandbox"
|
||||||
end
|
end
|
||||||
luci.template.render("store/main", {prefix=luci.dispatcher.build_url(unpack(page_index)),id=user_id(),lang=vue_lang(),features=features})
|
if luci.sys.call("[ -f /www/luci-static/resources/luci.js ] >/dev/null 2>&1") == 0 then
|
||||||
|
features[#features+1] = "luci-js"
|
||||||
|
end
|
||||||
|
luci.template.render("store/main", {prefix=luci.dispatcher.build_url(unpack(page_index)),id=user_id(),lang=vue_lang(),user_config=user_config(),features=features})
|
||||||
end
|
end
|
||||||
|
|
||||||
function store_dev()
|
function store_dev()
|
||||||
luci.template.render("store/main_dev", {prefix=luci.dispatcher.build_url(unpack({"admin", "store", "dev"})),id=user_id(),lang=vue_lang()})
|
luci.template.render("store/main_dev", {prefix=luci.dispatcher.build_url(unpack({"admin", "store", "dev"})),id=user_id(),lang=vue_lang(),user_config=user_config()})
|
||||||
end
|
end
|
||||||
|
|
||||||
function store_log()
|
function store_log()
|
||||||
|
@ -259,7 +273,7 @@ function store_action(param)
|
||||||
code, out, err = _action(myopkg, action, unpack(pkgs))
|
code, out, err = _action(myopkg, action, unpack(pkgs))
|
||||||
else -- remove
|
else -- remove
|
||||||
for _, dep in ipairs(meta.depends) do
|
for _, dep in ipairs(meta.depends) do
|
||||||
if dep ~= "docker-deps" then
|
if dep ~= "docker-deps" and dep ~= "luci-js-deps" then
|
||||||
pkgs[#pkgs+1] = dep
|
pkgs[#pkgs+1] = dep
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -437,7 +451,7 @@ local function update_local_backup_path(path)
|
||||||
if path ~= local_backup_path then
|
if path ~= local_backup_path then
|
||||||
-- set uci config
|
-- set uci config
|
||||||
x:set("istore","istore","local_backup_path",path)
|
x:set("istore","istore","local_backup_path",path)
|
||||||
x:commit("istore")
|
x:commit("istore")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -612,7 +626,7 @@ end
|
||||||
-- post set_local_backup_dir_path
|
-- post set_local_backup_dir_path
|
||||||
function set_local_backup_dir_path()
|
function set_local_backup_dir_path()
|
||||||
local path = luci.http.formvalue("path")
|
local path = luci.http.formvalue("path")
|
||||||
local success_ret = {code = 200,msg = "Success"}
|
local success_ret = {code = 200, msg = "Success"}
|
||||||
local error_ret = {code = 500, msg = "Unknown"}
|
local error_ret = {code = 500, msg = "Unknown"}
|
||||||
|
|
||||||
if path ~= "" then
|
if path ~= "" then
|
||||||
|
@ -715,3 +729,12 @@ function get_block_devices()
|
||||||
luci.http.write_json(error_ret)
|
luci.http.write_json(error_ret)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function toggle_docker()
|
||||||
|
local uci = require "luci.model.uci".cursor()
|
||||||
|
local hide = luci.http.formvalue("hide")
|
||||||
|
uci:set("istore", "istore", "hide_docker", hide == "true" and "1" or "0")
|
||||||
|
uci:commit("istore")
|
||||||
|
luci.http.prepare_content("application/json")
|
||||||
|
luci.http.write_json({code = 200, msg = "Success"})
|
||||||
|
end
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
window.token = "<%=token%>";
|
window.token = "<%=token%>";
|
||||||
window.device_id = {arch:"<%=id.arch%>",uid:"<%=id.uid%>",version:"<%=id.version%>"};
|
window.device_id = {arch:"<%=id.arch%>",uid:"<%=id.uid%>",version:"<%=id.version%>"};
|
||||||
window.istore_features = <%=jsonc.stringify(features)%>.filter(f => f !== '_lua_force_array_');
|
window.istore_features = <%=jsonc.stringify(features)%>.filter(f => f !== '_lua_force_array_');
|
||||||
|
window.istore_config = <%=jsonc.stringify(user_config or {})%>;
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<h2 name="content"><%:iStore%>
|
<h2 name="content"><%:iStore%>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
config istore 'istore'
|
||||||
|
option hide_docker '0'
|
||||||
|
# option channel 'istore'
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"luci-app-store": {
|
||||||
|
"description": "Grant UCI access for luci-app-store",
|
||||||
|
"read": {
|
||||||
|
"uci": [ "istore" ]
|
||||||
|
},
|
||||||
|
"write": {
|
||||||
|
"uci": [ "istore" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue