target/realtek: set default theme

This commit is contained in:
jjm2473 2022-03-01 16:28:18 +08:00
parent 2fbd99d158
commit cefb099bc1
2 changed files with 16 additions and 11 deletions

View File

@ -29,6 +29,7 @@ HOST_LN="$(subst ${STAGING_DIR_HOST},$${STAGING_DIR_HOST},$(LN))"
$${HOST_LN} /usr/sbin/jffs2reset "$${IPKG_INSTROOT}/sbin/jffs2reset"
$${HOST_SED} '/<link rel="shortcut icon" href="<%=media%>\/favicon.ico">/a <link rel="stylesheet" href="<%=resource%>/easepi/easeicon.css?t=1642756089463">' \
$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon/header.htm \
$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_dark/header.htm \
$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_light/header.htm \
$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_dark_purple/header.htm \

View File

@ -1,18 +1,22 @@
#!/bin/sh
mediaurlbase=
theme=
if [ -d /www/luci-static/argon_light_green -a -e /proc/device-tree/chosen/default-password ]; then
mediaurlbase=/luci-static/argon_light_green
else
for theme in argon argon_dark material ; do
if [ -d /www/luci-static/$theme ]; then
mediaurlbase=/luci-static/$theme
break
fi
done
fi
if [ -n "$mediaurlbase" ]; then
uci -q batch <<-EOF >/dev/null
set luci.main.mediaurlbase=/luci-static/argon_light_green
commit luci
EOF
elif [ -d /www/luci-static/argon_dark ]; then
uci -q batch <<-EOF >/dev/null
set luci.main.mediaurlbase=/luci-static/argon_dark
commit luci
EOF
elif [ -d /www/luci-static/material ]; then
uci -q batch <<-EOF >/dev/null
set luci.main.mediaurlbase=/luci-static/material
set luci.main.mediaurlbase=$mediaurlbase
commit luci
EOF
fi