diff --git a/ClientTest/ClientTest.csproj b/ClientTest/ClientTest.csproj index c1dfc90e..243cd509 100644 --- a/ClientTest/ClientTest.csproj +++ b/ClientTest/ClientTest.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/Plugins/MySqlAgent/MySqlAgent.csproj b/Plugins/MySqlAgent/MySqlAgent.csproj index 7c97f354..a5210c35 100644 --- a/Plugins/MySqlAgent/MySqlAgent.csproj +++ b/Plugins/MySqlAgent/MySqlAgent.csproj @@ -20,7 +20,7 @@ - + diff --git a/Stardust.Data/Stardust.Data.csproj b/Stardust.Data/Stardust.Data.csproj index 35066bf0..f763747a 100644 --- a/Stardust.Data/Stardust.Data.csproj +++ b/Stardust.Data/Stardust.Data.csproj @@ -41,7 +41,7 @@ - + diff --git a/Stardust.Server/Services/NodeStatService.cs b/Stardust.Server/Services/NodeStatService.cs index 8c0e1c70..d54b3d45 100644 --- a/Stardust.Server/Services/NodeStatService.cs +++ b/Stardust.Server/Services/NodeStatService.cs @@ -499,12 +499,17 @@ private void ProcessorStat(DateTime date, ConcatExpression selects) p = name.IndexOf("Platinum"); if (p > 0) name = name[p..].Trim(); + // AMD Ryzen 7 2700 Eight-Core Processor + p = name.IndexOf("-Core"); + if (p > 0) p = name.LastIndexOf(' ', p); + if (p > 0) name = name[..p].Trim(); + var name2 = name - .TrimStart("AMD ", "Ryzen ", "EPYC", "Genuine ", "Intel(R) ", "Xeon(R) ", "Pentium(R) ", "Celeron(R) ", "CPU") - .TrimEnd(" Processor", "-Core", " v2", " v3", " v4", " 0", " (Device Tree)") + .TrimStart("AMD ", /*"Ryzen ",*/ /*"EPYC",*/ "Genuine ", "Intel(R) ", "Xeon(R) ", "Pentium(R) ", "Celeron(R) ", "CPU") + .TrimEnd(" Processor", /*"-Core",*/ " v2", " v3", " v4", " 0", " (Device Tree)") .Trim(); - if (name2.Contains("Ryzen")) - XTrace.WriteLine("{0} -> {1}", name, name2); + //if (name2.Contains("Ryzen")) + // XTrace.WriteLine("{0} -> {1}", name, name2); node.Processor = name2; } diff --git a/Stardust.Server/Stardust.Server.csproj b/Stardust.Server/Stardust.Server.csproj index 3f7e69ce..d14494d6 100644 --- a/Stardust.Server/Stardust.Server.csproj +++ b/Stardust.Server/Stardust.Server.csproj @@ -42,7 +42,7 @@ - + diff --git a/Stardust.ServerTests/Nodes/NodeStatTests.cs b/Stardust.ServerTests/Nodes/NodeStatTests.cs new file mode 100644 index 00000000..6798172a --- /dev/null +++ b/Stardust.ServerTests/Nodes/NodeStatTests.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using Xunit; + +namespace Stardust.ServerTests.Nodes; + +public class NodeStatTests +{ + [Fact] + public void Test1() + { + var name = "AMD Ryzen 7 2700 Eight-Core Processor"; + + var p = name.IndexOf("-Core"); + if (p > 0) p = name.LastIndexOf(' ', p); + if (p > 0) name = name[..p].Trim(); + + Assert.Equal("AMD Ryzen 7 2700", name); + } +} diff --git a/Stardust.ServerTests/Stardust.ServerTests.csproj b/Stardust.ServerTests/Stardust.ServerTests.csproj index ba26cf58..f1368767 100644 --- a/Stardust.ServerTests/Stardust.ServerTests.csproj +++ b/Stardust.ServerTests/Stardust.ServerTests.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/Stardust.Web/Areas/Nodes/Controllers/NodeStatController.cs b/Stardust.Web/Areas/Nodes/Controllers/NodeStatController.cs index 8c799006..5d24af47 100644 --- a/Stardust.Web/Areas/Nodes/Controllers/NodeStatController.cs +++ b/Stardust.Web/Areas/Nodes/Controllers/NodeStatController.cs @@ -77,7 +77,7 @@ public String Resolve(DataField field, IModel data) "城市" => $"/Nodes/Node?areaid={st.LinkItem}", "芯片架构" => $"/Nodes/Node?arch={st.LinkItem}", "项目" => $"/Nodes/Node?projectId={st.LinkItem}", - _ => df.Url, + _ => $"/Nodes/Node?q={st.LinkItem}", }; } diff --git a/Stardust.Web/Stardust.Web.csproj b/Stardust.Web/Stardust.Web.csproj index a69ec3a1..ef0a3d76 100644 --- a/Stardust.Web/Stardust.Web.csproj +++ b/Stardust.Web/Stardust.Web.csproj @@ -51,7 +51,7 @@ - +