<%+header%> <% require("luci.phtunnel") --输出二 local function display_qrimage(sn, pwd) local qrcode, qrcodeimg, ttl = luci.phtunnel.get_qrimage(sn, pwd) if qrcode and qrcodeimg then print("
") end print("
") end local function main() local base_info_code, device_sn, device_pwd, device_status, public_ip = luci.phtunnel.get_base_info() if not base_info_code then print("phtunnel is not running") return end if base_info_code ~= 0 then print("get sn failed and code = " .. base_info_code) return end --输出基本信息 print("sn:" .. (device_sn and device_sn or "no sn") .. "
") print("device status:" .. (device_status and luci.phtunnel.convert_status(device_status) or "no status") .. "
") print("public ip:" .. (public_ip and public_ip or "no public ip") .. "
") --登录信息查看 local login_info_code, url, bind_account = luci.phtunnel.get_login_info() if not login_info_code then print("get manager url failed") return end if login_info_code ~= 0 then print("get manger url failed and code = " .. login_info_code) return end if not url or url == "" then display_qrimage(device_sn, device_pwd) print("") return end print("bind account:" .. (bind_account and bind_account or "*") .. "") print("(log off)
"); print("manager link
"); end main() %> <%+footer%>