update 2024-06-16 09:18:36

This commit is contained in:
kenzok8 2024-06-16 09:18:36 +08:00
parent c80dcaf3d7
commit 8c112e10d1
2 changed files with 43 additions and 3 deletions

View File

@ -8,13 +8,18 @@
'require fs';
return view.extend({
load: function() {
return Promise.all([
load: async function () {
const promises = await Promise.all([
fs.exec('/etc/init.d/wizard', ['reconfig']),
uci.changes(),
uci.load('wireless'),
uci.load('wizard')
uci.load('wizard'),
L.resolveDefault(fs.stat('/www/luci-static/istorex/style.css'), null)
]);
const data = {
istorex: promises[4]
};
return data;
},
render: function(data) {
@ -90,6 +95,15 @@ return view.extend({
o = s.taboption('firmware', form.Flag, 'cookie_p', _('Persistent cookies'),
_('Keep the background login state to avoid the need to log in again every time the browser is closed'));
o.default = o.enabled;
if (data.istorex){
o = s.taboption('firmware', form.ListValue, 'landing_page', _('主题模式'));
o.value('default', _('默认'));
o.value('nas', _('NAS模式'));
o.value('next-nas', _('NEXT-NAS模式'));
o.value('router', _('路由模式'));
o.default = 'default';
}
if (has_wifi) {
s.tab('wifisetup', _('Wireless Settings'), _('Set the router\'s wireless name and password. For more advanced settings, please go to the Network-Wireless page.'));

View File

@ -0,0 +1,26 @@
module("luci.controller.wizard", package.seeall)
local uci = luci.model.uci.cursor()
local http = require "luci.http"
function index()
entry({"admin", "index"}, call("landing_page"), _("Home") , 1).dependent = false
end
function landing_page()
local landing_page = uci:get("wizard", "default", "landing_page")
if luci.sys.call("pgrep quickstart >/dev/null") == 0 then
if landing_page == "nas" then
http.redirect(luci.dispatcher.build_url("admin","istorex","nas"));
elseif landing_page == "next-nas" then
http.redirect(luci.dispatcher.build_url("admin","istorex","next-nas"));
elseif landing_page == "router" then
http.redirect(luci.dispatcher.build_url("admin","istorex","router"));
else
http.redirect(luci.dispatcher.build_url("admin","quickstart"));
end
else
http.redirect(luci.dispatcher.build_url("admin","status"))
end
end