mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Fix Disable edit server if the server is in a group
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Netch.Models
|
||||
/// <summary>
|
||||
/// 组
|
||||
/// </summary>
|
||||
public string Group { get; set; } = "None";
|
||||
public string Group { get; set; } = Constants.DefaultGroup;
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
@@ -62,18 +62,7 @@ namespace Netch.Models
|
||||
{
|
||||
var remark = string.IsNullOrWhiteSpace(Remark) ? $"{Hostname}:{Port}" : Remark;
|
||||
|
||||
if (Group.Equals("None") || Group.Equals(""))
|
||||
Group = "NONE";
|
||||
|
||||
string shortName;
|
||||
if (Type == string.Empty)
|
||||
{
|
||||
shortName = "WTF";
|
||||
}
|
||||
else
|
||||
{
|
||||
shortName = ServerHelper.GetUtilByTypeName(Type).ShortName;
|
||||
}
|
||||
var shortName = Type.IsNullOrEmpty() ? "WTF" : ServerHelper.GetUtilByTypeName(Type).ShortName;
|
||||
|
||||
return $"[{shortName}][{Group}] {remark}";
|
||||
}
|
||||
@@ -139,5 +128,10 @@ namespace Netch.Models
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInGroup(this Server server)
|
||||
{
|
||||
return server.Group is not Constants.DefaultGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user