mirror of
https://github.com/netchx/netch.git
synced 2026-04-19 21:19:01 +08:00
Fix: SS/SSR password not allow empty and Update Model
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Netch.Forms;
|
||||
using Netch.Utils;
|
||||
|
||||
namespace Netch.Servers.Shadowsocks.Form
|
||||
{
|
||||
@@ -8,7 +9,7 @@ namespace Netch.Servers.Shadowsocks.Form
|
||||
{
|
||||
server ??= new Shadowsocks();
|
||||
Server = server;
|
||||
CreateTextBox("Password", "Password", s => true, s => server.Password = s, server.Password);
|
||||
CreateTextBox("Password", "Password", s => !s.IsNullOrWhiteSpace(), s => server.Password = s, server.Password);
|
||||
CreateComboBox("EncryptMethod", "Encrypt Method", SSGlobal.EncryptMethods, s => server.EncryptMethod = s, server.EncryptMethod);
|
||||
CreateTextBox("Plugin", "Plugin", s => true, s => server.Plugin = s, server.Plugin);
|
||||
CreateTextBox("PluginsOption", "Plugin Options", s => true, s => server.PluginOption = s, server.PluginOption);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Netch.Forms;
|
||||
using Netch.Utils;
|
||||
|
||||
namespace Netch.Servers.ShadowsocksR.Form
|
||||
{
|
||||
@@ -8,7 +9,7 @@ namespace Netch.Servers.ShadowsocksR.Form
|
||||
{
|
||||
server ??= new ShadowsocksR();
|
||||
Server = server;
|
||||
CreateTextBox("Password", "Password", s => true, s => server.Password = s, server.Password);
|
||||
CreateTextBox("Password", "Password", s => !s.IsNullOrWhiteSpace(), s => server.Password = s, server.Password);
|
||||
CreateComboBox("EncryptMethod", "Encrypt Method", SSRGlobal.EncryptMethods, s => server.EncryptMethod = s, server.EncryptMethod);
|
||||
CreateComboBox("Protocol", "Protocol", SSRGlobal.Protocols, s => server.Protocol = s, server.Protocol);
|
||||
CreateTextBox("ProtocolParam", "Protocol Param", s => true, s => server.ProtocolParam = s, server.ProtocolParam);
|
||||
|
||||
@@ -7,26 +7,16 @@ namespace Netch.Servers.ShadowsocksR
|
||||
{
|
||||
public override string Type { get; } = "SSR";
|
||||
|
||||
/// <summary>
|
||||
/// 加密方式
|
||||
/// </summary>
|
||||
public string EncryptMethod { get; set; } = SSRGlobal.EncryptMethods[0];
|
||||
|
||||
/// <summary>
|
||||
/// 混淆
|
||||
/// </summary>
|
||||
public string OBFS { get; set; } = SSRGlobal.OBFSs[0];
|
||||
|
||||
/// <summary>
|
||||
/// 混淆参数
|
||||
/// </summary>
|
||||
public string OBFSParam { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 加密方式
|
||||
/// </summary>
|
||||
public string EncryptMethod { get; set; } = SSRGlobal.EncryptMethods[0];
|
||||
|
||||
/// <summary>
|
||||
/// 协议
|
||||
/// </summary>
|
||||
@@ -35,7 +25,17 @@ namespace Netch.Servers.ShadowsocksR
|
||||
/// <summary>
|
||||
/// 协议参数
|
||||
/// </summary>
|
||||
public string ProtocolParam { get; set; } = string.Empty;
|
||||
public string? ProtocolParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 混淆
|
||||
/// </summary>
|
||||
public string OBFS { get; set; } = SSRGlobal.OBFSs[0];
|
||||
|
||||
/// <summary>
|
||||
/// 混淆参数
|
||||
/// </summary>
|
||||
public string? OBFSParam { get; set; }
|
||||
}
|
||||
|
||||
public class SSRGlobal
|
||||
|
||||
Reference in New Issue
Block a user