update 2024-11-30 20:37:09

This commit is contained in:
kenzok8 2024-11-30 20:37:09 +08:00
parent dac101d274
commit e4eb270d93
5 changed files with 43 additions and 17 deletions

View File

@ -495,6 +495,10 @@ o = s:option(Value, option_name("ws_path"), translate("WebSocket Path"))
o.placeholder = "/"
o:depends({ [option_name("transport")] = "ws" })
o = s:option(Value, option_name("ws_heartbeatPeriod"), translate("HeartbeatPeriod(second)"))
o.datatype = "integer"
o:depends({ [option_name("transport")] = "ws" })
-- [[ HTTP/2部分 ]]--
o = s:option(Value, option_name("h2_host"), translate("HTTP/2 Host"))
o:depends({ [option_name("transport")] = "h2" })
@ -575,6 +579,7 @@ o.default = "auto"
o:value("auto")
o:value("packet-up")
o:value("stream-up")
o:value("stream-one")
o = s:option(Value, option_name("xhttp_host"), translate("XHTTP Host"))
o:depends({ [option_name("transport")] = "xhttp" })
@ -588,12 +593,18 @@ o:depends({ [option_name("transport")] = "xhttp" })
o.rows = 15
o.wrap = "off"
o.custom_write = function(self, section, value)
m:set(section, self.option:sub(1 + #option_prefix), value)
local data = value and value ~= "" and jsonc.parse(value)
local address = (data and data.extra and data.extra.downloadSettings and data.extra.downloadSettings.address)
or (data and data.downloadSettings and data.downloadSettings.address)
if address and address ~= "" then
m:set(section, "download_address", address)
local success, data = pcall(jsonc.parse, value)
if success and data then
local address = (data.extra and data.extra.downloadSettings and data.extra.downloadSettings.address)
or (data.downloadSettings and data.downloadSettings.address)
if address and address ~= "" then
m:set(section, "download_address", address)
else
m:del(section, "download_address")
end
else
m:del(section, "download_address")
end

View File

@ -189,7 +189,8 @@ function gen_outbound(flag, node, tag, proxy_table)
headers = (node.ws_host ~= nil) and
{Host = node.ws_host} or nil,
maxEarlyData = tonumber(node.ws_maxEarlyData) or nil,
earlyDataHeaderName = (node.ws_earlyDataHeaderName) and node.ws_earlyDataHeaderName or nil
earlyDataHeaderName = (node.ws_earlyDataHeaderName) and node.ws_earlyDataHeaderName or nil,
heartbeatPeriod = tonumber(node.ws_heartbeatPeriod) or nil
} or nil,
httpSettings = (node.transport == "h2") and {
path = node.h2_path or "/",
@ -221,7 +222,14 @@ function gen_outbound(flag, node, tag, proxy_table)
path = node.xhttp_path or node.splithttp_path or "/",
host = node.xhttp_host or node.splithttp_host,
-- 如果包含 "extra" 节,取 "extra" 内的内容,否则直接赋值给 extra
extra = node.xhttp_extra and (jsonc.parse(node.xhttp_extra).extra or jsonc.parse(node.xhttp_extra)) or nil
extra = node.xhttp_extra and (function()
local success, parsed = pcall(jsonc.parse, node.xhttp_extra)
if success then
return parsed.extra or parsed
else
return nil
end
end)() or nil
} or nil,
} or nil,
settings = {

View File

@ -1609,6 +1609,9 @@ msgstr "端口跳跃时间 "
msgid "Additional ports for hysteria hop"
msgstr "端口跳跃额外端口"
msgid "HeartbeatPeriod(second)"
msgstr "心跳周期(单位:秒)"
msgid "Custom geoip Path"
msgstr "自定义 geoip 文件路径"

View File

@ -1000,10 +1000,14 @@ local function processData(szType, content, add_mode, add_from)
result.xhttp_path = params.path
result.xhttp_mode = params.mode or "auto"
result.xhttp_extra = params.extra
local Data = params.extra and params.extra ~= "" and jsonParse(params.extra)
local address = (Data and Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
or (Data and Data.downloadSettings and Data.downloadSettings.address)
result.download_address = address and address ~= "" and address or nil
local success, Data = pcall(jsonParse, params.extra)
if success and Data then
local address = (Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
or (Data.downloadSettings and Data.downloadSettings.address)
result.download_address = address and address ~= "" and address or nil
else
result.download_address = nil
end
end
if params.type == 'httpupgrade' then
result.httpupgrade_host = params.host

View File

@ -6,16 +6,16 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-08 14:06+0200\n"
"PO-Revision-Date: 2024-05-25 19:30+0000\n"
"Last-Translator: Hulen <shift0106@gmail.com>\n"
"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationstransmission/zh_Hant/>\n"
"PO-Revision-Date: 2024-11-22 21:39+0000\n"
"Last-Translator: Yuan Lau <traverslombard@outlook.com>\n"
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
"projects/openwrt/luciapplicationstransmission/zh_Hant/>\n"
"Language: zh_Hant\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.6-dev\n"
"X-Generator: Weblate 5.9-dev\n"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:65
msgid "Alternative download speed"
@ -407,7 +407,7 @@ msgstr "傳送"
msgid ""
"Transmission daemon is a simple bittorrent client, here you can configure "
"the settings."
msgstr "Transmission 是一個簡單的 BitTorrent 客戶端,您可以在這裡設定組態。"
msgstr "Transmission 是一個簡單的 BitTorrent 客戶端,您可以在這裡設定。"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:116
msgid "Trash original torrent files"