2024-12-20 06:14:48 +00:00
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using ryCommon;
|
|
|
|
|
using ryControls.Controls;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
2024-12-20 07:55:25 +00:00
|
|
|
|
using System.Reflection;
|
2024-12-20 06:14:48 +00:00
|
|
|
|
using System.Text;
|
2025-01-08 08:55:00 +00:00
|
|
|
|
using System.Threading;
|
2024-12-20 06:14:48 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace SuperDesign.Tools.UpLog
|
|
|
|
|
{
|
|
|
|
|
public partial class FrmPublishLogs : Form
|
|
|
|
|
{
|
|
|
|
|
public FrmPublishLogs()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
private string MdLog { get; set; } = "";
|
|
|
|
|
private string HtmlLog { get; set; } = "";
|
|
|
|
|
public void ShowLog(string LogJson)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
JArray jarr = JArray.Parse(LogJson);
|
|
|
|
|
MdLog = SuperDesign.Manager.APIManager.GetMdLogText(jarr, DateTime.Now);
|
2024-12-21 06:16:03 +00:00
|
|
|
|
HtmlLog = SuperDesign.Manager.APIManager.GetHtmlLogText(BFFolderPath, jarr, DateTime.Now);
|
2024-12-20 06:14:48 +00:00
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
2024-12-20 07:55:25 +00:00
|
|
|
|
public string BFFolderPath { get; set; } = "";
|
|
|
|
|
int index = 0;
|
2024-12-20 06:14:48 +00:00
|
|
|
|
private void BtnCopyMD_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
RyFiles.CopyToClip(MdLog);
|
2024-12-20 07:55:25 +00:00
|
|
|
|
var git_path= SuperDesign.Manager.APIManager.GetTortoiseGitProcPath();
|
|
|
|
|
if(git_path.Length>0 && BFFolderPath.Length>0)
|
|
|
|
|
{
|
2025-01-08 08:55:00 +00:00
|
|
|
|
index = 0;
|
2024-12-20 07:55:25 +00:00
|
|
|
|
RyFiles.RunFile(git_path, "/command:commit", BFFolderPath);
|
2025-01-08 08:55:00 +00:00
|
|
|
|
new Thread(Start).Start();
|
|
|
|
|
void Start()
|
2024-12-20 07:55:25 +00:00
|
|
|
|
{
|
2025-01-08 08:55:00 +00:00
|
|
|
|
while (index < 10 && !this.IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
System.Threading.Thread.Sleep(1000);
|
2024-12-20 07:55:25 +00:00
|
|
|
|
var handle = RyForm.GetForegroundWindow();
|
|
|
|
|
var path = ryCommon.ProcessExt.GetPath(RyForm.GetProcessId(handle));
|
2025-01-08 08:55:00 +00:00
|
|
|
|
index++;
|
2024-12-20 07:55:25 +00:00
|
|
|
|
if (path != null && path.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
var filename = System.IO.Path.GetFileName(path);
|
|
|
|
|
if (filename == "TortoiseGitProc.exe")
|
|
|
|
|
{
|
2025-01-08 08:55:00 +00:00
|
|
|
|
this.Invoke(new Action(() =>
|
|
|
|
|
{
|
|
|
|
|
SendKeys.Send("^v");
|
|
|
|
|
}));
|
|
|
|
|
break;
|
2024-12-20 07:55:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-08 08:55:00 +00:00
|
|
|
|
}
|
2024-12-20 07:55:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-20 06:14:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BtnCopyHtml_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
RyFiles.CopyToClip(HtmlLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|