<%+cbi/valueheader%> <% local api = require "luci.passwall.api" local appname = 'passwall' local map = self.map local has_ss = api.is_finded("ss-redir") local has_ss_rust = api.is_finded("sslocal") local has_trojan_plus = api.is_finded("trojan-plus") local has_singbox = api.finded_com("sing-box") local has_xray = api.finded_com("xray") local has_hysteria2 = api.finded_com("hysteria") local function get_core(field, candidates) local v = map:get("@global_subscribe[0]", field) if not v or v == "" then for _, c in ipairs(candidates) do if c[1] then return c[2] end end end return v end local ss_type = get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}}) local trojan_type = get_core("trojan_type", {{has_trojan_plus,"trojan-plus"},{has_singbox,"sing-box"},{has_xray,"xray"}}) local vmess_type = get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}}) local vless_type = get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}}) local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{has_singbox,"sing-box"}}) -%>
<%+cbi/valuefooter%>