mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 01:25:13 +08:00
🍉 Sync 2026-09-21 06:25:47
This commit is contained in:
1 parent
d769ef6662
commit
027d4d40d0
2 files changed
+31
-6
No files matched your search
@@ -4,7 +4,26 @@ local uci = luci.model.uci.cursor()
|
|||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
|
|
||||||
function index()
|
function index()
|
||||||
entry({"admin", "index"}, call("landing_page"), _("Home") , 1).dependent = false
|
-- 1. 注册 admin/index 为纯路由跳板(无 title,不占菜单)
|
||||||
|
entry({"admin", "index"}, call("landing_page")).dependent = false
|
||||||
|
|
||||||
|
-- 2. 核心:直接改写 admin 根节点的调度目标
|
||||||
|
-- 这样当用户访问 /admin、登录后跳转或访问根目录时,无需经过 firstchild(),直接执行 landing_page()
|
||||||
|
local admin = node("admin")
|
||||||
|
if admin then
|
||||||
|
admin.target = call("landing_page")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function check_wifi()
|
||||||
|
local has_wifi = false
|
||||||
|
pcall(function()
|
||||||
|
uci:foreach("wireless", "wifi-device", function(s)
|
||||||
|
has_wifi = true
|
||||||
|
return false -- 检测到任意 wifi-device 即终止遍历
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
return has_wifi
|
||||||
end
|
end
|
||||||
|
|
||||||
function landing_page()
|
function landing_page()
|
||||||
@@ -22,7 +41,13 @@ function landing_page()
|
|||||||
http.redirect(luci.dispatcher.build_url("admin","quickstart"));
|
http.redirect(luci.dispatcher.build_url("admin","quickstart"));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
http.redirect(luci.dispatcher.build_url("admin","status", "overview"))
|
if check_wifi() then
|
||||||
end
|
-- 具备无线功能,跳转至常用无线仪表盘界面
|
||||||
|
http.redirect(luci.dispatcher.build_url("admin", "dashboard"))
|
||||||
|
else
|
||||||
|
-- 无无线设备(纯有线环境),跳转至原生状态概览
|
||||||
|
http.redirect(luci.dispatcher.build_url("admin", "status", "overview"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
+3
-3
@@ -50,12 +50,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=wwand
|
PKG_NAME:=wwand
|
||||||
PKG_VERSION:=1.6.7_p56
|
PKG_VERSION:=1.6.7_p58
|
||||||
PKG_RELEASE:=49
|
PKG_RELEASE:=50
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://github.com/ddimension/wwand.git
|
PKG_SOURCE_URL:=https://github.com/ddimension/wwand.git
|
||||||
PKG_SOURCE_VERSION:=6c94f21ffc8750a6ac793f0e30d2f3b9220573aa
|
PKG_SOURCE_VERSION:=1b575d41dd35684e035541afe1f129da072275dd
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_MIRROR_HASH:=skip
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0-only
|
PKG_LICENSE:=GPL-2.0-only
|
||||||
|
|||||||
Reference in new issue
Block a user