% local fs = require "luci.openclash_kejibear" local jsonc = require "luci.jsonc" local plugin_version = fs.oc_version() -- CSRF 令牌必须是 authtoken;authsession 是会话 id,比错了所有请求都会被拒 local token = luci.dispatcher.context.authtoken or luci.dispatcher.context.token or "" -- 脚本里要用的文案经 jsonc 编码后整体注入:翻译里带引号也不会把 JS 打断 local T = { add_title = translate("Add Custom Node"), edit_title = translate("Edit Custom Node"), link = translate("Share Link / Node Config"), replace_link = translate("Replace With New Link"), link_ph = translate("Paste one share link (ss/vmess/vless/trojan/hysteria2/tuic/…), or one node as YAML/JSON"), replace_ph = translate("Leave empty to keep the current node, only change the fields below"), invalid_link = translate("Unrecognized link or config. Only one node can be added at a time"), name = translate("Node Name"), position = translate("Position"), top = translate("Top of list"), bottom = translate("Bottom of list"), dialer = translate("Dialer Proxy"), no_dialer = translate("None (connect directly)"), missing = translate("not found in current config"), groups = translate("Groups"), nodes = translate("Nodes"), no_core = translate("The service is not running, so the node/group list for dialer proxy cannot be loaded"), err_empty = translate("Node name cannot be empty"), err_builtin = translate("This is a name reserved by the core, please choose another"), err_dup = translate("Another custom node already uses this name"), err_sub = translate("A node or group in the subscription already uses this name, please choose another"), cancel = translate("Cancel"), save = translate("Save"), saving = translate("Saving…"), del = translate("Delete"), edit = translate("Edit"), del_title = translate("Delete Custom Node"), del_confirm = translate("Delete custom node"), del_hint = translate("The service will restart to apply the change."), empty = translate("No custom nodes yet"), load_fail = translate("Failed to load, please refresh the page"), req_fail = translate("Request failed, please try again"), fallback_snapshot = translate("Last start: the config with your custom nodes / overwrite settings failed the core check, so they were all skipped. Your custom nodes are NOT in effect right now."), fallback_previous = translate("Last start: the newly generated config failed the core check, so the service is running with the previous runtime config. Your custom nodes are NOT in effect right now."), fallback_reason = translate("Core error:"), not_managed = translate("The active config is not the Kejibear managed config. Custom nodes only take effect when running the Kejibear config; you can still edit them here."), } %> <%+header%>