Skip to content

Commit

Permalink
luci-app-v2raya: sync with upstream source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
  • Loading branch information
1715173329 committed Jan 26, 2024
1 parent bce2d61 commit 9f3c5d0
Show file tree
Hide file tree
Showing 40 changed files with 5,104 additions and 220 deletions.
9 changes: 5 additions & 4 deletions luci-app-v2raya/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2022 ImmortalWrt.org
# Copyright (C) 2024 ImmortalWrt.org

include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI support for v2rayA
LUCI_DEPENDS:=+v2raya
LUCI_PKGARCH:=all

PKG_VERSION:=10
PKG_VERSION:=11
PKG_PO_VERSION:=$(PKG_VERSION)

PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature
44 changes: 6 additions & 38 deletions luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* SPDX-License-Identifier: GPL-3.0-only
*
* Copyright (C) 2022 ImmortalWrt.org
*/

'use strict';
'require form';
'require poll';
Expand Down Expand Up @@ -66,41 +61,32 @@ return view.extend({
});

return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'service_status' }, _('Collecting data...'))
E('p', { id: 'service_status' }, _('Collecting data'))
]);
}

s = m.section(form.NamedSection, 'config', 'v2raya');

o = s.option(form.Flag, 'enabled', _('Enable'));
o.default = o.disabled;
o.rmempty = false;

o = s.option(form.Value, 'address', _('Listening address'));
o.datatype = 'ipaddrport(1)';
o.default = '0.0.0.0:2017';
o.rmempty = false;

o = s.option(form.Value, 'config', _('Configuration directory'));
o.datatype = 'path';
o.default = '/etc/v2raya';
o.rmempty = false;
o.placeholder = '0.0.0.0:2017';

o = s.option(form.ListValue, 'ipv6_support', _('IPv6 support'),
_('Make sure your IPv6 network works fine before you turn it on.'));
_('Requires working IPv6 connectivity.'));
o.value('auto', _('Auto'));
o.value('on', _('On'));
o.value('off', _('Off'));
o.default = 'auto';
o.rmempty = false;

o = s.option(form.ListValue, 'nftables_support', _('Nftables support'),
_('Make sure you have installed nftables before you turn it on.'));
_('Requires nftables.'));
o.value('auto', _('Auto'));
o.value('on', _('On'));
o.value('off', _('Off'));
o.default = 'auto';
o.rmempty = false;

o = s.option(form.ListValue, 'log_level', _('Log level'));
o.value('trace', _('Trace'));
Expand All @@ -109,33 +95,15 @@ return view.extend({
o.value('warn', _('Warn'));
o.value('error', _('Error'));
o.default = 'info';
o.rmempty = false;

o = s.option(form.Value, 'log_file', _('Log file path'));
o.datatype = 'path';
o.default = '/var/log/v2raya/v2raya.log';
o.rmempty = false;
/* Due to ACL rule, this value must retain default otherwise log page will be broken */
o.readonly = true;

o = s.option(form.Value, 'log_max_days', _('Max log retention period'),
_('Maximum number of days to keep log files.'));
_('Unit: days.'));
o.datatype = 'uinteger';
o.default = '3';
o.placeholder = '3';

o = s.option(form.Flag, 'log_disable_color', _('Disable log color output'));
o.default = o.disabled;

o = s.option(form.Flag, 'log_disable_timestamp', _('Disable log timestamp'));
o.default = o.disabled;

o = s.option(form.Value, 'v2ray_bin', _('v2ray binary path'),
_('Executable v2ray binary path. Auto-detect if put it empty (recommended).'));
o.datatype = 'path';

o = s.option(form.Value, 'v2ray_confdir', _('Extra config directory'),
_('Additional v2ray config directory, files in it will be combined with config generated by v2rayA.'));
o.datatype = 'path';

return m.render();
}
Expand Down
13 changes: 4 additions & 9 deletions luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* SPDX-License-Identifier: GPL-3.0-only
*
* Copyright (C) 2022 ImmortalWrt.org
*/

'use strict';
'require dom';
'require fs';
Expand Down Expand Up @@ -30,12 +25,12 @@ return view.extend({
var log_textarea = E('div', { 'id': 'log_textarea' },
E('img', {
'src': L.resource(['icons/loading.gif']),
'alt': _('Loading...'),
'alt': _('Loading'),
'style': 'vertical-align:middle'
}, _('Collecting data...'))
}, _('Collecting data'))
);

var log_path = uci.get('v2raya', 'config', 'log_file') || '/var/log/v2raya/v2raya.log';
var log_path = '/var/log/v2raya/v2raya.log';

poll.add(L.bind(function() {
return fs.read_direct(log_path, 'text')
Expand Down Expand Up @@ -67,7 +62,7 @@ return view.extend({
E('div', {'class': 'cbi-section'}, [
log_textarea,
E('div', {'style': 'text-align:right'},
E('small', {}, _('Refresh every %s seconds.').format(L.env.pollinterval))
E('small', {}, _('Refresh every %d seconds.').format(L.env.pollinterval))
)
])
])
Expand Down
150 changes: 150 additions & 0 deletions luci-app-v2raya/po/ar/v2raya.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: luci-app-v 2raya\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:79
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:86
msgid "Auto"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:64
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:30
msgid "Collecting data…"
msgstr ""

#: applications/luci-app-v2raya/root/usr/share/luci/menu.d/luci-app-v2raya.json:13
msgid "Configuration"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:93
msgid "Debug"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:104
msgid "Disable log color output"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:106
msgid "Disable log timestamp"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:70
msgid "Enable"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:96
msgid "Error"
msgstr ""

#: applications/luci-app-v2raya/root/usr/share/rpcd/acl.d/luci-app-v2raya.json:3
msgid "Grant access to v2rayA configuration"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:77
msgid "IPv6 support"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:94
msgid "Info"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:73
msgid "Listening address"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:28
msgid "Loading…"
msgstr ""

#: applications/luci-app-v2raya/root/usr/share/luci/menu.d/luci-app-v2raya.json:21
msgid "Log"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:48
msgid "Log file does not exist."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:39
msgid "Log is clean."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:91
msgid "Log level"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:99
msgid "Max log retention period"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:33
msgid "NOT RUNNING"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:84
msgid "Nftables support"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:81
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:88
msgid "Off"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:80
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:87
msgid "On"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:30
msgid "Open Web Interface"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:31
msgid "RUNNING"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:65
msgid "Refresh every %d seconds."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:85
msgid "Requires nftables."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:78
msgid "Requires working IPv6 connectivity."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:92
msgid "Trace"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:100
msgid "Unit: days."
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/log.js:52
msgid "Unknown error: %s"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:95
msgid "Warn"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:31
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:33
#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:50
#: applications/luci-app-v2raya/root/usr/share/luci/menu.d/luci-app-v2raya.json:3
msgid "v2rayA"
msgstr ""

#: applications/luci-app-v2raya/htdocs/luci-static/resources/view/v2raya/config.js:51
msgid ""
"v2rayA is a V2Ray Linux client supporting global transparent proxy, "
"compatible with SS, SSR, Trojan(trojan-go), PingTunnel protocols."
msgstr ""
Loading

0 comments on commit 9f3c5d0

Please sign in to comment.