diff --git a/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js b/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js index 9d277ccd3..4d2da1b00 100644 --- a/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js +++ b/luci-app-wizard/htdocs/luci-static/resources/view/wizard/initsetup.js @@ -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.')); diff --git a/luci-app-wizard/luasrc/controller/wizard.lua b/luci-app-wizard/luasrc/controller/wizard.lua new file mode 100644 index 000000000..76e0378b4 --- /dev/null +++ b/luci-app-wizard/luasrc/controller/wizard.lua @@ -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