parent
cde0a21530
commit
538f061b47
@ -148,6 +148,7 @@ return view.extend({
|
|||||||
o.value('hysteria2', _('Hysteria2'));
|
o.value('hysteria2', _('Hysteria2'));
|
||||||
o.value('naive', _('NaïveProxy'));
|
o.value('naive', _('NaïveProxy'));
|
||||||
}
|
}
|
||||||
|
o.value('mixed', _('Mixed'));
|
||||||
o.value('shadowsocks', _('Shadowsocks'));
|
o.value('shadowsocks', _('Shadowsocks'));
|
||||||
o.value('socks', _('Socks'));
|
o.value('socks', _('Socks'));
|
||||||
o.value('trojan', _('Trojan'));
|
o.value('trojan', _('Trojan'));
|
||||||
@ -169,13 +170,14 @@ return view.extend({
|
|||||||
|
|
||||||
o = s.option(form.Value, 'username', _('Username'));
|
o = s.option(form.Value, 'username', _('Username'));
|
||||||
o.depends('type', 'http');
|
o.depends('type', 'http');
|
||||||
|
o.depends('type', 'mixed');
|
||||||
o.depends('type', 'naive');
|
o.depends('type', 'naive');
|
||||||
o.depends('type', 'socks');
|
o.depends('type', 'socks');
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
o = s.option(form.Value, 'password', _('Password'));
|
o = s.option(form.Value, 'password', _('Password'));
|
||||||
o.password = true;
|
o.password = true;
|
||||||
o.depends({'type': /^(http|naive|socks)$/, 'username': /[\s\S]/});
|
o.depends({'type': /^(http|mixed|naive|socks)$/, 'username': /[\s\S]/});
|
||||||
o.depends('type', 'hysteria2');
|
o.depends('type', 'hysteria2');
|
||||||
o.depends('type', 'shadowsocks');
|
o.depends('type', 'shadowsocks');
|
||||||
o.depends('type', 'trojan');
|
o.depends('type', 'trojan');
|
||||||
@ -194,7 +196,7 @@ return view.extend({
|
|||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
if (section_id) {
|
if (section_id) {
|
||||||
var type = this.map.lookupOption('type', section_id)[0].formvalue(section_id);
|
var type = this.map.lookupOption('type', section_id)[0].formvalue(section_id);
|
||||||
var required_type = [ 'http', 'naive', 'socks', 'shadowsocks' ];
|
var required_type = [ 'http', 'mixed', 'naive', 'socks', 'shadowsocks' ];
|
||||||
|
|
||||||
if (required_type.includes(type)) {
|
if (required_type.includes(type)) {
|
||||||
if (type === 'shadowsocks') {
|
if (type === 'shadowsocks') {
|
||||||
|
@ -79,10 +79,10 @@ uci.foreach(uciconfig, uciserver, (cfg) => {
|
|||||||
zero_rtt_handshake: strToBool(cfg.tuic_enable_zero_rtt),
|
zero_rtt_handshake: strToBool(cfg.tuic_enable_zero_rtt),
|
||||||
heartbeat: cfg.tuic_heartbeat ? (cfg.tuic_heartbeat + 's') : null,
|
heartbeat: cfg.tuic_heartbeat ? (cfg.tuic_heartbeat + 's') : null,
|
||||||
|
|
||||||
/* HTTP / Hysteria (2) / Socks / Trojan / Tuic / VLESS / VMess */
|
/* HTTP / Hysteria (2) / Mixed / Socks / Trojan / Tuic / VLESS / VMess */
|
||||||
users: (cfg.type !== 'shadowsocks') ? [
|
users: (cfg.type !== 'shadowsocks') ? [
|
||||||
{
|
{
|
||||||
name: !(cfg.type in ['http', 'socks']) ? 'cfg-' + cfg['.name'] + '-server' : null,
|
name: !(cfg.type in ['http', 'mixed', 'socks']) ? 'cfg-' + cfg['.name'] + '-server' : null,
|
||||||
username: cfg.username,
|
username: cfg.username,
|
||||||
password: cfg.password,
|
password: cfg.password,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user