diff --git a/htdocs/luci-static/resources/homeproxy.js b/htdocs/luci-static/resources/homeproxy.js index f99e1a5b..f61b3568 100644 --- a/htdocs/luci-static/resources/homeproxy.js +++ b/htdocs/luci-static/resources/homeproxy.js @@ -154,9 +154,9 @@ return baseclass.extend({ if (padding) str = str + Array(padding + 1).join('='); - return decodeURIComponent(Array.prototype.map.call(atob(str), (c) => { - return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); - }).join('')); + return decodeURIComponent(Array.prototype.map.call(atob(str), (c) => + '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) + ).join('')); }, getBuiltinFeatures: function() { @@ -171,16 +171,16 @@ return baseclass.extend({ generateUUIDv4: function() { /* Thanks to https://stackoverflow.com/a/2117523 */ - return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => + return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, (c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) ); }, loadDefaultLabel: function(uciconfig, ucisection) { var label = uci.get(uciconfig, ucisection, 'label'); - if (label) + if (label) { return label; - else { + } else { uci.set(uciconfig, ucisection, 'label', ucisection); return ucisection; } @@ -226,9 +226,8 @@ return baseclass.extend({ return L.resolveDefault(callWriteCertificate(filename), {}).then((ret) => { if (ret.result === true) ui.addNotification(null, E('p', _('Your %s was successfully uploaded. Size: %sB.').format(type, res.size))); - else { + else ui.addNotification(null, E('p', _('Failed to upload %s, error: %s.').format(type, ret.error))); - } }); }, this, ev.target)) .catch((e) => { ui.addNotification(null, E('p', e.message)) }); diff --git a/htdocs/luci-static/resources/view/homeproxy/client.js b/htdocs/luci-static/resources/view/homeproxy/client.js index c9f6ae90..a6846054 100644 --- a/htdocs/luci-static/resources/view/homeproxy/client.js +++ b/htdocs/luci-static/resources/view/homeproxy/client.js @@ -51,11 +51,10 @@ function getServiceStatus() { function renderStatus(isRunning) { var spanTemp = '%s %s'; var renderHTML; - if (isRunning) { + if (isRunning) renderHTML = spanTemp.format('green', _('HomeProxy'), _('RUNNING')); - } else { + else renderHTML = spanTemp.format('red', _('HomeProxy'), _('NOT RUNNING')); - } return renderHTML; } diff --git a/htdocs/luci-static/resources/view/homeproxy/node.js b/htdocs/luci-static/resources/view/homeproxy/node.js index 49428efa..c3bbc483 100644 --- a/htdocs/luci-static/resources/view/homeproxy/node.js +++ b/htdocs/luci-static/resources/view/homeproxy/node.js @@ -420,8 +420,9 @@ return view.extend({ .then(L.bind(this.map.reset, this.map)) .then(L.ui.hideModal) .catch(function() {}); - } else + } else { return ui.hideModal(); + } }) }, [ _('Import') ]) ]) @@ -996,8 +997,9 @@ return view.extend({ if (['hysteria', 'shadowtls'].includes(type)) { tls.checked = true; tls.disabled = true; - } else + } else { tls.disabled = null; + } } return true; @@ -1237,9 +1239,9 @@ return view.extend({ o.inputstyle = 'apply'; o.inputtitle = function(section_id) { var sublist = uci.get(data[0], section_id, 'subscription_url') || []; - if (sublist.length > 0) + if (sublist.length > 0) { return _('Update %s subscriptions').format(sublist.length); - else { + } else { this.readonly = true; return _('No subscription available') } diff --git a/htdocs/luci-static/resources/view/homeproxy/server.js b/htdocs/luci-static/resources/view/homeproxy/server.js index 29082ab1..c31354a7 100644 --- a/htdocs/luci-static/resources/view/homeproxy/server.js +++ b/htdocs/luci-static/resources/view/homeproxy/server.js @@ -33,11 +33,10 @@ function getServiceStatus() { function renderStatus(isRunning) { var spanTemp = '%s %s'; var renderHTML; - if (isRunning) { + if (isRunning) renderHTML = spanTemp.format('green', _('HomeProxy Server'), _('RUNNING')); - } else { + else renderHTML = spanTemp.format('red', _('HomeProxy Server'), _('NOT RUNNING')); - } return renderHTML; } @@ -362,8 +361,9 @@ return view.extend({ if (['hysteria'].includes(type)) { tls.checked = true; tls.disabled = true; - } else + } else { tls.disabled = null; + } } return true; diff --git a/po/zh_Hans/homeproxy.po b/po/zh_Hans/homeproxy.po index 7ec165a6..0c77a447 100644 --- a/po/zh_Hans/homeproxy.po +++ b/po/zh_Hans/homeproxy.po @@ -95,7 +95,7 @@ msgstr "允许不安全连接" #: htdocs/luci-static/resources/view/homeproxy/node.js:1018 msgid "Allow insecure connection at TLS client." -msgstr "允许 TLS 客户端侧的不安全连接" +msgstr "允许 TLS 客户端侧的不安全连接。" #: htdocs/luci-static/resources/view/homeproxy/node.js:1215 msgid "Allow insecure connection by default when add nodes from subscriptions." @@ -108,11 +108,11 @@ msgstr "请求中允许的载荷大小。" #: htdocs/luci-static/resources/view/homeproxy/status.js:94 msgid "Already at the latest version." -msgstr "已是最新版本" +msgstr "已是最新版本。" #: htdocs/luci-static/resources/view/homeproxy/status.js:91 msgid "Already in updating." -msgstr "已在更新中" +msgstr "已在更新中。" #: htdocs/luci-static/resources/view/homeproxy/node.js:750 #: htdocs/luci-static/resources/view/homeproxy/server.js:246 @@ -176,7 +176,7 @@ msgstr "自动更新" #: htdocs/luci-static/resources/view/homeproxy/node.js:1169 msgid "Auto update subscriptions, GeoIP and GeoSite." -msgstr "自动更新订阅、GeoIP 和 GeoSite" +msgstr "自动更新订阅、GeoIP 和 GeoSite。" #: htdocs/luci-static/resources/view/homeproxy/status.js:193 msgid "BaiDu" @@ -578,7 +578,7 @@ msgstr "启用 PQ 签名方案。" #: htdocs/luci-static/resources/view/homeproxy/node.js:1145 #: htdocs/luci-static/resources/view/homeproxy/server.js:570 msgid "Enable UDP fragmentation." -msgstr "启用 UDP 分片" +msgstr "启用 UDP 分片。" #: htdocs/luci-static/resources/view/homeproxy/client.js:284 msgid "Enable endpoint-independent NAT" @@ -1010,7 +1010,7 @@ msgstr "匹配进程名。" #: htdocs/luci-static/resources/view/homeproxy/client.js:517 #: htdocs/luci-static/resources/view/homeproxy/client.js:780 msgid "Match process path." -msgstr "匹配进程路径" +msgstr "匹配进程路径。" #: htdocs/luci-static/resources/view/homeproxy/client.js:475 #: htdocs/luci-static/resources/view/homeproxy/client.js:742 @@ -1045,7 +1045,7 @@ msgstr "最大下载速度" #: htdocs/luci-static/resources/view/homeproxy/node.js:591 #: htdocs/luci-static/resources/view/homeproxy/server.js:167 msgid "Max download speed in Mbps." -msgstr "最大下载速度(Mbps)" +msgstr "最大下载速度(Mbps)。" #: htdocs/luci-static/resources/view/homeproxy/server.js:507 msgid "Max time difference" @@ -1059,7 +1059,7 @@ msgstr "最大上传速度" #: htdocs/luci-static/resources/view/homeproxy/node.js:597 #: htdocs/luci-static/resources/view/homeproxy/server.js:173 msgid "Max upload speed in Mbps." -msgstr "最大上传速度(Mbps)" +msgstr "最大上传速度(Mbps)。" #: htdocs/luci-static/resources/view/homeproxy/node.js:1034 #: htdocs/luci-static/resources/view/homeproxy/server.js:392 @@ -1113,7 +1113,7 @@ msgstr "多路复用" #: htdocs/luci-static/resources/view/homeproxy/node.js:949 msgid "Multiplex protocol." -msgstr "多路复用协议" +msgstr "多路复用协议。" #: htdocs/luci-static/resources/view/homeproxy/client.js:57 #: htdocs/luci-static/resources/view/homeproxy/server.js:39 @@ -1798,7 +1798,7 @@ msgid "" msgstr "" "默认规则使用以下匹配逻辑:
(domain || domain_suffix || " "domain_keyword || domain_regex || geosite || geoip || ip_cidr) &&
(source_geoip || source_ip_cidr) &&
其他字段." +">(source_geoip || source_ip_cidr) &&
其他字段。" #: htdocs/luci-static/resources/view/homeproxy/client.js:693 msgid "" @@ -1809,7 +1809,7 @@ msgid "" msgstr "" "默认规则使用以下匹配逻辑:

(domain || domain_suffix || " "domain_keyword || domain_regex || geosite || ip_cidr) &&
(source_geoip || source_ip_cidr) &&
其他字段." +">(source_geoip || source_ip_cidr) &&
其他字段。" #: htdocs/luci-static/resources/view/homeproxy/client.js:639 msgid ""