From: Tianling Shen Date: Fri, 16 Sep 2022 11:23:39 +0000 (+0800) Subject: luci-app-v2raya: fix bind arguments X-Git-Tag: xray-1.6.0~2 X-Git-Url: http://git.osdn.net/view?p=v2raya%2Fv2raya-openwrt.git;a=commitdiff_plain;h=d21c3e5f15256c2a5c6304f76865c94e1e919e11 luci-app-v2raya: fix bind arguments Signed-off-by: Tianling Shen --- diff --git a/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js b/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js index 0c4b1d0..7ad9906 100644 --- a/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js +++ b/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js @@ -44,7 +44,7 @@ function renderStatus(isRunning, port) { return renderHTML; } -function uploadCertificate(option, type, filename, ev) { +function uploadCertificate(type, filename, ev) { L.resolveDefault(fs.exec('/bin/mkdir', [ '-p', '/etc/v2raya/' ])); return ui.uploadFile('/etc/v2raya/' + filename, ev.target) @@ -57,11 +57,11 @@ function uploadCertificate(option, type, filename, ev) { } ui.addNotification(null, E('p', _('Your %s was successfully uploaded. Size: %sB.').format(type, res.size))); - }, option, ev.target)) + }, this, ev.target)) .catch(function(e) { ui.addNotification(null, E('p', e.message)) }) .finally(L.bind(function(btn, input) { btn.firstChild.data = _('Upload...'); - }, option, ev.target)); + }, this, ev.target)); } return view.extend({ @@ -163,13 +163,13 @@ return view.extend({ o = s.option(form.Button, '_upload_cert', _('Upload certificate')); o.inputstyle = 'action'; o.inputtitle = _('Upload...'); - o.onclick = L.bind(uploadCertificate, this, o, _('certificate'), 'grpc_certificate.crt'); + o.onclick = L.bind(uploadCertificate, this, _('certificate'), 'grpc_certificate.crt'); o.depends('vless_grpc_inbound_cert_key', '/etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key'); o = s.option(form.Button, '_upload_key', _('Upload privateKey')); o.inputstyle = 'action'; o.inputtitle = _('Upload...'); - o.onclick = L.bind(uploadCertificate, this, o, _('private key'), 'grpc_private.key'); + o.onclick = L.bind(uploadCertificate, this, _('private key'), 'grpc_private.key'); o.depends('vless_grpc_inbound_cert_key', '/etc/v2raya/grpc_certificate.crt,/etc/v2raya/grpc_private.key'); return m.render();