|
|
@ -24,6 +24,7 @@ using System.Text.Json.Serialization;
|
|
|
|
using System.Text.Json;
|
|
|
|
using System.Text.Json;
|
|
|
|
using System.Text.Encodings.Web;
|
|
|
|
using System.Text.Encodings.Web;
|
|
|
|
using System.Text.Unicode;
|
|
|
|
using System.Text.Unicode;
|
|
|
|
|
|
|
|
using System.Security.Principal;
|
|
|
|
|
|
|
|
|
|
|
|
namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -54,6 +55,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
this._websocket = websocket;
|
|
|
|
this._websocket = websocket;
|
|
|
|
_websocket.WebSocketInit(sc.remoteDb.WebsocketUrl);
|
|
|
|
_websocket.WebSocketInit(sc.remoteDb.WebsocketUrl);
|
|
|
|
CurrentItemsList = ApmsProcessSliceList;
|
|
|
|
CurrentItemsList = ApmsProcessSliceList;
|
|
|
|
|
|
|
|
_websocket.SiginServer(sc.remoteDb.Account,sc.remoteDb.Pwd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -252,7 +254,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
//WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
//WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
OneKeyStop();
|
|
|
|
OneKeyStop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ConnectVPN()
|
|
|
|
private void ConnectVPN()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vpn.CreateOrUpdateVPN(sc.vpnInfo.VpnName, sc.vpnInfo.VpnIP);
|
|
|
|
vpn.CreateOrUpdateVPN(sc.vpnInfo.VpnName, sc.vpnInfo.VpnIP);
|
|
|
@ -336,7 +338,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
// btnSetParams.Enabled = false;
|
|
|
|
// btnSetParams.Enabled = false;
|
|
|
|
timer1.Interval = TimeSpan.FromSeconds(ProMonInterval);
|
|
|
|
timer1.Interval = TimeSpan.FromSeconds(ProMonInterval);
|
|
|
|
timer1.Start();
|
|
|
|
timer1.Start();
|
|
|
|
timer1.Tick += timer1_Tick;
|
|
|
|
|
|
|
|
ReciveDataSource.Clear();
|
|
|
|
ReciveDataSource.Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -453,6 +455,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
public void InitializeParams()
|
|
|
|
public void InitializeParams()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
timer1.Interval = TimeSpan.FromSeconds(ProMonInterval);
|
|
|
|
timer1.Interval = TimeSpan.FromSeconds(ProMonInterval);
|
|
|
|
|
|
|
|
timer1.Tick += timer1_Tick;
|
|
|
|
this.Message = "服务器版本:" + JsonParser.serverVision;
|
|
|
|
this.Message = "服务器版本:" + JsonParser.serverVision;
|
|
|
|
IntervalTimesSource.Add(5);
|
|
|
|
IntervalTimesSource.Add(5);
|
|
|
|
IntervalTimesSource.Add(10);
|
|
|
|
IntervalTimesSource.Add(10);
|
|
|
@ -674,11 +677,10 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
string logStr = DateTime.Now.ToString("s") + "\t服务器程序" + pro.ProName + "重启";
|
|
|
|
string logStr = DateTime.Now.ToString("s") + "\t服务器程序" + pro.ProName + "重启";
|
|
|
|
WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
|
|
|
|
|
|
|
|
string jsonStr= JsonSerializer.Serialize<CSDeviceWebhook>(new CSDeviceWebhook
|
|
|
|
string jsonStr= JsonSerializer.Serialize(new CSDeviceWebhook
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type= CSMessage.webhook,
|
|
|
|
type= CSMessage.webhook,
|
|
|
|
message=logStr,
|
|
|
|
message=logStr,
|
|
|
|
|
|
|
|
|
|
|
|
}, new JsonSerializerOptions
|
|
|
|
}, new JsonSerializerOptions
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 整齐打印
|
|
|
|
// 整齐打印
|
|
|
@ -761,7 +763,7 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
string logStr = DateTime.Now.ToString("s") + "\tVPN断开,重连";
|
|
|
|
string logStr = DateTime.Now.ToString("s") + "\tVPN断开,重连";
|
|
|
|
WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
WriteSerLog(sc.vpnInfo.SystemLogPath + JsonParser.systemLogFileName, logStr);
|
|
|
|
|
|
|
|
|
|
|
|
string jsonStr = JsonSerializer.Serialize<CSDeviceWebhook>(new CSDeviceWebhook
|
|
|
|
string jsonStr = JsonSerializer.Serialize(new CSDeviceWebhook
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type = CSMessage.webhook,
|
|
|
|
type = CSMessage.webhook,
|
|
|
|
message = logStr,
|
|
|
|
message = logStr,
|
|
|
|