Merge branch 'master' of http://www.scserverddns.top:13000/sc/ForwardingServerUI
This commit is contained in:
commit
c3f574d5cf
1 file changed
+29
-24
+29
-24
@@ -124,32 +124,37 @@ namespace ForwardingServerUI.Class
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Personm deserializedPerson = JsonSerializer.Deserialize<Personm>(DAT)!;
|
string trimmedDat = DAT.Trim();
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
if (!string.IsNullOrEmpty(trimmedDat) &&
|
||||||
|
(trimmedDat[0] == '{' || trimmedDat[0] == '['))
|
||||||
{
|
{
|
||||||
var mach = MainWindowViewModel._machineTable.Select("Enterprise='" + deserializedPerson.SERVEREnterprise +
|
Personm deserializedPerson = JsonSerializer.Deserialize<Personm>(trimmedDat)!;
|
||||||
"'and MachineName='" + deserializedPerson.SERVERMachineName + "'");
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
if (mach.Length > 0)
|
|
||||||
{
|
{
|
||||||
//刷新设备信息表
|
var mach = MainWindowViewModel._machineTable.Select("Enterprise='" + deserializedPerson.SERVEREnterprise +
|
||||||
DataRow dataRow = mach.First();
|
"'and MachineName='" + deserializedPerson.SERVERMachineName + "'");
|
||||||
dataRow.BeginEdit();
|
if (mach.Length > 0)
|
||||||
dataRow["ID"] = client.Id;
|
{
|
||||||
dataRow["IP"] = client.IP;
|
//刷新设备信息表
|
||||||
dataRow["Start"] = 30;
|
DataRow dataRow = mach.First();
|
||||||
dataRow["Enterprise"] = "/" + deserializedPerson.SERVEREnterprise;
|
dataRow.BeginEdit();
|
||||||
dataRow["MachineName"] = deserializedPerson.SERVERMachineName;
|
dataRow["ID"] = client.Id;
|
||||||
dataRow["MachineVer"] = deserializedPerson.MachineVer;
|
dataRow["IP"] = client.IP;
|
||||||
dataRow.EndEdit();
|
dataRow["Start"] = 30;
|
||||||
dataRow.AcceptChanges();
|
dataRow["Enterprise"] = "/" + deserializedPerson.SERVEREnterprise;
|
||||||
}
|
dataRow["MachineName"] = deserializedPerson.SERVERMachineName;
|
||||||
else
|
dataRow["MachineVer"] = deserializedPerson.MachineVer;
|
||||||
{
|
dataRow.EndEdit();
|
||||||
//添加设备信息表
|
dataRow.AcceptChanges();
|
||||||
MainWindowViewModel._machineTable.Rows.Add(client.Id, client.IP, 30, "/" + deserializedPerson.SERVEREnterprise,
|
}
|
||||||
deserializedPerson.SERVERMachineName, DateTime.Now.ToString(), deserializedPerson.MachineVer);
|
else
|
||||||
}
|
{
|
||||||
});
|
//添加设备信息表
|
||||||
|
MainWindowViewModel._machineTable.Rows.Add(client.Id, client.IP, 30, "/" + deserializedPerson.SERVEREnterprise,
|
||||||
|
deserializedPerson.SERVERMachineName, DateTime.Now.ToString(), deserializedPerson.MachineVer);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " LINK ID " + client.Id + " IP " + client.IP + "]\nDATA =" + DAT);
|
Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " LINK ID " + client.Id + " IP " + client.IP + "]\nDATA =" + DAT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user