update 2024-05-22 20:10:35

This commit is contained in:
actions-user 2024-05-22 20:10:35 +08:00
parent 025affd3f4
commit 964b071be2
5 changed files with 60 additions and 7 deletions

View File

@ -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_PKGARCH:=all
PKG_VERSION:=0.1.16-1
PKG_VERSION:=0.1.17-1
# PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:=
ISTORE_UI_VERSION:=0.1.14
ISTORE_UI_RELEASE:=2
PKG_HASH:=4d20ffeabfe6572b01e0bedd860043ec0dbd6f2f63aaf0ee58caeb851df18e73
ISTORE_UI_VERSION:=0.1.16
ISTORE_UI_RELEASE:=1
PKG_HASH:=993c6c1fd59bf48f9583be4c91898b355a5fe79dc7274bd3d795a8828d59ec1d
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE)

View File

@ -25,6 +25,7 @@ function index()
entry({"admin", "store", "check_self_upgrade"}, call("check_self_upgrade"))
entry({"admin", "store", "do_self_upgrade"}, post("do_self_upgrade"))
entry({"admin", "store", "toggle_docker"}, post("toggle_docker"))
entry({"admin", "store", "toggle_arch"}, post("toggle_arch"))
for _, action in ipairs({"update", "install", "upgrade", "remove"}) do
store_api(action, true)
@ -73,6 +74,8 @@ local function user_config()
local data = {
hide_docker = uci:get("istore", "istore", "hide_docker") == "1",
ignore_arch = uci:get("istore", "istore", "ignore_arch") == "1",
super_arch = uci:get("istore", "istore", "super_arch"),
channel = uci:get("istore", "istore", "channel")
}
return data
@ -757,3 +760,12 @@ function toggle_docker()
luci.http.prepare_content("application/json")
luci.http.write_json({code = 200, msg = "Success"})
end
function toggle_arch()
local uci = require "luci.model.uci".cursor()
local ignore = luci.http.formvalue("ignore")
uci:set("istore", "istore", "ignore_arch", ignore == "true" and "1" or "0")
uci:commit("istore")
luci.http.prepare_content("application/json")
luci.http.write_json({code = 200, msg = "Success"})
end

View File

@ -1,3 +1,6 @@
config istore 'istore'
option hide_docker '0'
# option hide_docker '0'
# option ignore_arch '0'
# option channel 'istore'
# option super_arch 'x86_64'
# option super_arch 'aarch64'

View File

@ -4,9 +4,15 @@
START=45
boot() {
[ -s /etc/.app_store.id ] && return 0
local ARCH=`/bin/is-opkg arch`
generate_store_id $ARCH
generate_super_arch $ARCH
}
ARCH=`/bin/is-opkg arch`
generate_store_id() {
[ -s /etc/.app_store.id ] && return 0
local ARCH=$1
local iface HASH
for iface in eth0 br-lan; do
if [ -e /sys/class/net/$iface/address ]; then
@ -21,3 +27,28 @@ boot() {
echo "{\"arch\":\"${ARCH}\", \"uid\":\"${HASH}\"}" > /etc/.app_store.id
}
generate_super_arch() {
local ARCH=$1
local super_arch
case "$ARCH" in
arm*)
super_arch="arm"
;;
i386)
super_arch="x86"
;;
x86_64)
super_arch="x86_64"
;;
*)
super_arch="${ARCH%%_*}"
;;
esac
local old=`uci -q get istore.istore.super_arch`
[ "$old" = "$super_arch" ] && return 0
uci -q batch <<-EOF >/dev/null
set istore.istore.super_arch=$super_arch
commit istore
EOF
}

View File

@ -2,4 +2,11 @@
/etc/init.d/istore boot
if [ -z "`uci -q get istore.istore.hide_docker`" ] && ! which docker >/dev/null; then
uci -q batch <<-EOF >/dev/null
set istore.istore.hide_docker=1
commit istore
EOF
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache