ソースを参照

jar包发布工具添加版本控制,添加工程配置,优化布局结构,调整按钮协同工作,整合流程,基本可用

yuzhengyang 7 年 前
コミット
34885fc389
20 ファイル変更675 行追加209 行削除
  1. BIN
      Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide
  2. BIN
      Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide
  3. BIN
      Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-shm
  4. BIN
      Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-wal
  5. 9 2
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.cs
  6. 16 0
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Commons/R.Files.cs
  7. 10 1
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Commons/R.Paths.cs
  8. 5 5
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Models/ProjectModel.cs
  9. 1 5
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Models/VersionModel.cs
  10. 2 0
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Oreo.BigBirdDeployer.csproj
  11. 56 68
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Parts/ProjectItemPart.Designer.cs
  12. 228 51
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Parts/ProjectItemPart.cs
  13. 26 3
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Program.cs
  14. 33 0
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Utils/JarFileTool.cs
  15. 167 32
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/MainForm.Designer.cs
  16. 4 14
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/MainForm.cs
  17. 2 2
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/ProjectConfigForm.Designer.cs
  18. 2 0
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/ProjectConfigForm.cs
  19. 62 23
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/SettingsForm.Designer.cs
  20. 52 3
      Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/SettingsForm.cs

BIN
Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-shm


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-wal


+ 9 - 2
Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.cs

@@ -15,6 +15,13 @@ namespace Azylee.WinformSkin.FormUI.Toast
     public partial class ToastForm : NoTitleForm
     {
         private static ToastForm form = new ToastForm();
+        /// <summary>
+        /// 弹出提示框
+        /// </summary>
+        /// <param name="title">标题</param>
+        /// <param name="text">内容</param>
+        /// <param name="type">类型:w,e,i</param>
+        /// <param name="time">显示时间:ms</param>
         public static void Display(string title, string text, char type, int time)
         {
             if (form == null || form.IsDisposed)
@@ -51,8 +58,8 @@ namespace Azylee.WinformSkin.FormUI.Toast
         /// </summary>
         /// <param name="title">标题</param>
         /// <param name="text">内容</param>
-        /// <param name="type">类型</param>
-        /// <param name="time">显示时间</param>
+        /// <param name="type">类型:w,e,i</param>
+        /// <param name="time">显示时间:ms</param>
         private void SetContent(string title, string text, char type, int time)
         {
             TimeSpend = 0;//初始化运行时间,每次执行动画++

+ 16 - 0
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Commons/R.Files.cs

@@ -0,0 +1,16 @@
+using Azylee.Core.IOUtils.DirUtils;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Oreo.BigBirdDeployer.Commons
+{
+    public static partial class R
+    {
+        public static class Files
+        {
+            public static string Settings = DirTool.Combine(Paths.Settings, "Settings.ini");
+        }
+    }
+}

+ 10 - 1
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Commons/R.Paths.cs

@@ -11,8 +11,17 @@ namespace Oreo.BigBirdDeployer.Commons
         public static class Paths
         {
             public static string App = AppDomain.CurrentDomain.BaseDirectory;
-            public static string Storage = DirTool.Combine(App, "Storage");
+            public static string DefaultStorage = DirTool.Combine(App, "Storage");
+            public static string DefaultPublishStorage = DirTool.Combine(DefaultStorage, "Publish");
+            public static string DefaultNewStorage = DirTool.Combine(DefaultStorage, "New");
             public static string Temp = DirTool.Combine(App, "Temp");
+
+            public static string Settings = DirTool.Combine(App, "Settings");
+            public static string Projects = DirTool.Combine(App, "Projects");
+
+            public static string Storage = DefaultStorage;
+            public static string PublishStorage = DefaultPublishStorage;
+            public static string NewStorage = DefaultNewStorage;
         }
     }
 }

+ 5 - 5
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Models/ProjectModel.cs

@@ -8,10 +8,6 @@ namespace Oreo.BigBirdDeployer.Models
     public class ProjectModel
     {
         /// <summary>
-        /// Id
-        /// </summary>
-        public Guid Id { get; set; }
-        /// <summary>
         /// 工程名称
         /// </summary>
         public string Name { get; set; }
@@ -30,7 +26,11 @@ namespace Oreo.BigBirdDeployer.Models
         /// <summary>
         /// 最新版本号
         /// </summary>
-        public int LastVersionNumber { get; set; }
+        public int LastVersion { get; set; }
+        /// <summary>
+        /// 当前运行版本号
+        /// </summary>
+        public int CurrentVersion { get; set; }
         /// <summary>
         /// 版本缓存个数(超出删除)
         /// </summary>

+ 1 - 5
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Models/VersionModel.cs

@@ -12,12 +12,8 @@ namespace Oreo.BigBirdDeployer.Models
         /// </summary>
         public int Number { get; set; }
         /// <summary>
-        /// 相对路径
-        /// </summary>
-        public string Path { get; set; }
-        /// <summary>
         /// 创建时间
         /// </summary>
-        public string CreateTime { get; set; }
+        public DateTime CreateTime { get; set; }
     }
 }

+ 2 - 0
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Oreo.BigBirdDeployer.csproj

@@ -49,6 +49,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Commons\R.Files.cs" />
     <Compile Include="Commons\R.Paths.cs" />
     <Compile Include="Commons\R.cs" />
     <Compile Include="Models\WorkStatus.cs" />
@@ -63,6 +64,7 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Utils\ConsoleCodeTool.cs" />
+    <Compile Include="Utils\JarFileTool.cs" />
     <Compile Include="Views\MainForm.cs">
       <SubType>Form</SubType>
     </Compile>

+ 56 - 68
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Parts/ProjectItemPart.Designer.cs

@@ -33,31 +33,29 @@
             this.LBProjectName = new System.Windows.Forms.Label();
             this.LBStatus = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
-            this.PBLoading = new System.Windows.Forms.PictureBox();
-            this.LBDesc = new System.Windows.Forms.Label();
             this.LBCpu = new System.Windows.Forms.Label();
             this.LBRam = new System.Windows.Forms.Label();
-            this.TBConsole = new System.Windows.Forms.TextBox();
-            this.LBProcessName = new System.Windows.Forms.Label();
+            this.LBPort = new System.Windows.Forms.Label();
+            this.BTAddNew = new System.Windows.Forms.Button();
+            this.CBVersion = new System.Windows.Forms.ComboBox();
             this.panel1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.PBLoading)).BeginInit();
             this.SuspendLayout();
             // 
             // BTStartOrStop
             // 
-            this.BTStartOrStop.Location = new System.Drawing.Point(341, 14);
+            this.BTStartOrStop.Location = new System.Drawing.Point(266, 85);
             this.BTStartOrStop.Name = "BTStartOrStop";
-            this.BTStartOrStop.Size = new System.Drawing.Size(75, 44);
+            this.BTStartOrStop.Size = new System.Drawing.Size(47, 23);
             this.BTStartOrStop.TabIndex = 0;
-            this.BTStartOrStop.Text = "启动/停止";
+            this.BTStartOrStop.Text = "启动";
             this.BTStartOrStop.UseVisualStyleBackColor = true;
             this.BTStartOrStop.Click += new System.EventHandler(this.BTStartOrStop_Click);
             // 
             // BTConfig
             // 
-            this.BTConfig.Location = new System.Drawing.Point(427, 14);
+            this.BTConfig.Location = new System.Drawing.Point(266, 48);
             this.BTConfig.Name = "BTConfig";
-            this.BTConfig.Size = new System.Drawing.Size(75, 44);
+            this.BTConfig.Size = new System.Drawing.Size(47, 23);
             this.BTConfig.TabIndex = 1;
             this.BTConfig.Text = "配置";
             this.BTConfig.UseVisualStyleBackColor = true;
@@ -70,7 +68,7 @@
             this.LBProjectName.ForeColor = System.Drawing.Color.White;
             this.LBProjectName.Location = new System.Drawing.Point(0, 0);
             this.LBProjectName.Name = "LBProjectName";
-            this.LBProjectName.Size = new System.Drawing.Size(195, 44);
+            this.LBProjectName.Size = new System.Drawing.Size(234, 28);
             this.LBProjectName.TabIndex = 2;
             this.LBProjectName.Text = "工程名称";
             this.LBProjectName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -80,9 +78,9 @@
             this.LBStatus.BackColor = System.Drawing.Color.MediumTurquoise;
             this.LBStatus.Dock = System.Windows.Forms.DockStyle.Right;
             this.LBStatus.ForeColor = System.Drawing.Color.White;
-            this.LBStatus.Location = new System.Drawing.Point(195, 0);
+            this.LBStatus.Location = new System.Drawing.Point(234, 0);
             this.LBStatus.Name = "LBStatus";
-            this.LBStatus.Size = new System.Drawing.Size(73, 44);
+            this.LBStatus.Size = new System.Drawing.Size(67, 28);
             this.LBStatus.TabIndex = 3;
             this.LBStatus.Text = "状态显示";
             this.LBStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -91,87 +89,78 @@
             // 
             this.panel1.Controls.Add(this.LBProjectName);
             this.panel1.Controls.Add(this.LBStatus);
-            this.panel1.Location = new System.Drawing.Point(13, 14);
+            this.panel1.Location = new System.Drawing.Point(12, 8);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(268, 44);
+            this.panel1.Size = new System.Drawing.Size(301, 28);
             this.panel1.TabIndex = 4;
             // 
-            // PBLoading
-            // 
-            this.PBLoading.Location = new System.Drawing.Point(288, 14);
-            this.PBLoading.Name = "PBLoading";
-            this.PBLoading.Size = new System.Drawing.Size(47, 44);
-            this.PBLoading.TabIndex = 5;
-            this.PBLoading.TabStop = false;
-            // 
-            // LBDesc
-            // 
-            this.LBDesc.AutoSize = true;
-            this.LBDesc.ForeColor = System.Drawing.Color.White;
-            this.LBDesc.Location = new System.Drawing.Point(11, 73);
-            this.LBDesc.Name = "LBDesc";
-            this.LBDesc.Size = new System.Drawing.Size(29, 12);
-            this.LBDesc.TabIndex = 7;
-            this.LBDesc.Text = "描述";
-            // 
             // LBCpu
             // 
             this.LBCpu.AutoSize = true;
             this.LBCpu.ForeColor = System.Drawing.Color.White;
-            this.LBCpu.Location = new System.Drawing.Point(305, 73);
+            this.LBCpu.Location = new System.Drawing.Point(99, 53);
             this.LBCpu.Name = "LBCpu";
-            this.LBCpu.Size = new System.Drawing.Size(53, 12);
+            this.LBCpu.Size = new System.Drawing.Size(65, 12);
             this.LBCpu.TabIndex = 8;
-            this.LBCpu.Text = "CPU:0 %";
+            this.LBCpu.Text = "CPU:100 %";
             // 
             // LBRam
             // 
             this.LBRam.AutoSize = true;
             this.LBRam.ForeColor = System.Drawing.Color.White;
-            this.LBRam.Location = new System.Drawing.Point(387, 73);
+            this.LBRam.Location = new System.Drawing.Point(173, 53);
             this.LBRam.Name = "LBRam";
-            this.LBRam.Size = new System.Drawing.Size(65, 12);
+            this.LBRam.Size = new System.Drawing.Size(83, 12);
             this.LBRam.TabIndex = 9;
-            this.LBRam.Text = "内存:0 MB";
-            // 
-            // TBConsole
-            // 
-            this.TBConsole.Location = new System.Drawing.Point(13, 100);
-            this.TBConsole.Multiline = true;
-            this.TBConsole.Name = "TBConsole";
-            this.TBConsole.ScrollBars = System.Windows.Forms.ScrollBars.Both;
-            this.TBConsole.Size = new System.Drawing.Size(487, 240);
-            this.TBConsole.TabIndex = 6;
-            // 
-            // LBProcessName
-            // 
-            this.LBProcessName.AutoSize = true;
-            this.LBProcessName.ForeColor = System.Drawing.Color.White;
-            this.LBProcessName.Location = new System.Drawing.Point(111, 73);
-            this.LBProcessName.Name = "LBProcessName";
-            this.LBProcessName.Size = new System.Drawing.Size(41, 12);
-            this.LBProcessName.TabIndex = 10;
-            this.LBProcessName.Text = "进程名";
+            this.LBRam.Text = "内存:9999 MB";
+            // 
+            // LBPort
+            // 
+            this.LBPort.AutoSize = true;
+            this.LBPort.ForeColor = System.Drawing.Color.White;
+            this.LBPort.Location = new System.Drawing.Point(12, 53);
+            this.LBPort.Name = "LBPort";
+            this.LBPort.Size = new System.Drawing.Size(71, 12);
+            this.LBPort.TabIndex = 11;
+            this.LBPort.Text = "端口:10000";
+            // 
+            // BTAddNew
+            // 
+            this.BTAddNew.Location = new System.Drawing.Point(213, 85);
+            this.BTAddNew.Name = "BTAddNew";
+            this.BTAddNew.Size = new System.Drawing.Size(47, 23);
+            this.BTAddNew.TabIndex = 12;
+            this.BTAddNew.Text = "装载";
+            this.BTAddNew.UseVisualStyleBackColor = true;
+            this.BTAddNew.Click += new System.EventHandler(this.BTAddNew_Click);
+            // 
+            // CBVersion
+            // 
+            this.CBVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.CBVersion.FormattingEnabled = true;
+            this.CBVersion.Location = new System.Drawing.Point(14, 87);
+            this.CBVersion.Name = "CBVersion";
+            this.CBVersion.Size = new System.Drawing.Size(189, 20);
+            this.CBVersion.TabIndex = 14;
+            this.CBVersion.SelectedIndexChanged += new System.EventHandler(this.CBVersion_SelectedIndexChanged);
             // 
             // ProjectItemPart
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.DimGray;
-            this.Controls.Add(this.LBProcessName);
+            this.Controls.Add(this.CBVersion);
+            this.Controls.Add(this.BTAddNew);
+            this.Controls.Add(this.LBPort);
             this.Controls.Add(this.LBRam);
             this.Controls.Add(this.LBCpu);
-            this.Controls.Add(this.LBDesc);
-            this.Controls.Add(this.TBConsole);
-            this.Controls.Add(this.PBLoading);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.BTConfig);
             this.Controls.Add(this.BTStartOrStop);
             this.Name = "ProjectItemPart";
-            this.Size = new System.Drawing.Size(513, 95);
+            this.Size = new System.Drawing.Size(325, 123);
             this.Load += new System.EventHandler(this.ProjectItemPart_Load);
             this.panel1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.PBLoading)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -184,11 +173,10 @@
         private System.Windows.Forms.Label LBProjectName;
         private System.Windows.Forms.Label LBStatus;
         private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.PictureBox PBLoading;
-        private System.Windows.Forms.Label LBDesc;
         private System.Windows.Forms.Label LBCpu;
         private System.Windows.Forms.Label LBRam;
-        private System.Windows.Forms.TextBox TBConsole;
-        private System.Windows.Forms.Label LBProcessName;
+        private System.Windows.Forms.Label LBPort;
+        private System.Windows.Forms.Button BTAddNew;
+        private System.Windows.Forms.ComboBox CBVersion;
     }
 }

+ 228 - 51
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Parts/ProjectItemPart.cs

@@ -16,6 +16,15 @@ using Oreo.BigBirdDeployer.Views;
 using Azylee.Core.AppUtils;
 using Azylee.Core.IOUtils.DirUtils;
 using Azylee.Core.ProcessUtils;
+using Oreo.BigBirdDeployer.Utils;
+using Oreo.BigBirdDeployer.Commons;
+using System.IO;
+using Azylee.Core.IOUtils.FileUtils;
+using Azylee.WinformSkin.FormUI.Toast;
+using System.Collections;
+using Azylee.Core.DataUtils.DateTimeUtils;
+using Azylee.Core.Plus.DataUtils.JsonUtils;
+using Azylee.Core.IOUtils.TxtUtils;
 
 namespace Oreo.BigBirdDeployer.Parts
 {
@@ -32,9 +41,29 @@ namespace Oreo.BigBirdDeployer.Parts
         }
         private void ProjectItemPart_Load(object sender, EventArgs e)
         {
-            //加载启动按钮默认不可用(Init初始化后变为可用)
-            BTStartOrStop.Enabled = false;
+            //启动按钮默认不可用(Init初始化后变为可用)
+            BTStartOrStop.Enabled = false;//禁止启动/关闭
+            BTAddNew.Enabled = false;//禁止装载新版本
+            CBVersion.Enabled = false;//禁止选择启动版本
+
+            //持续监控端口及端口进程状态
+            ProcessStatus();
+
+            //加载项目资料(加载前检查是否存在)
+            if (File.Exists(DirTool.Combine(R.Paths.Projects, Name)))
+            {
+                string txt = TxtTool.Read(DirTool.Combine(R.Paths.Projects, Name));
+                var p = JsonTool.ToObjFromStr<ProjectModel>(txt);
+                if (p != null) SetProject(p);
+            }
         }
+
+
+        #region 功能方法
+        /// <summary>
+        /// 设置/重置工程信息
+        /// </summary>
+        /// <param name="model"></param>
         public void SetProject(ProjectModel model)
         {
             //初始化设置项目
@@ -51,31 +80,51 @@ namespace Oreo.BigBirdDeployer.Parts
                 StatusUI(WorkStatus.准备就绪);
             }
             //为控件更新显示
-            LBProjectName.Text = Project.Name;
-            BTStartOrStop.Enabled = true;
+            LBProjectName.Text = Project.Name;//更新项目名称
+            LBPort.Text = $"端口:{Project.Port}";//更新端口号信息
 
-            //持续监控端口及端口进程状态
-            ProcessStatus();
-        }
-        private void BTStartOrStop_Click(object sender, EventArgs e)
-        {
-            //没有端口占用则正常启动
-            if (!GetProcess())
+            //设置下拉框选择版本信息
+            if (ListTool.HasElements(Project.Versions))
             {
-                Start();
+                try
+                {
+                    DataTable dt = new DataTable();
+                    dt.TableName = "dt";
+                    dt.Columns.Add("Code");
+                    dt.Columns.Add("Name");
+                    Project.Versions.OrderByDescending(x => x.Number).ToList().ForEach(x =>
+                    {
+                        DataRow row = dt.NewRow();
+                        row["Code"] = x.Number.ToString();
+                        row["Name"] = $"{x.Number}({x.CreateTime.ToString("yyyy年MM月dd日 HH:mm")})";
+                        dt.Rows.Add(row);
+                        if (x.Number > Project.CurrentVersion) Project.CurrentVersion = x.Number;
+                    });
+                    CBVersion.DataSource = dt;
+                    CBVersion.DisplayMember = "Name";
+                    CBVersion.ValueMember = "Code";
+                }
+                catch { }
             }
             else
             {
-                Stop();
+                DataTable dt = new DataTable();
+                dt.TableName = "dt";
+                dt.Columns.Add("Code");
+                dt.Columns.Add("Name");
+                DataRow row = dt.NewRow();
+                row["Code"] = 0;
+                row["Name"] = $"新建工程需要先加载工程";
+                dt.Rows.Add(row);
+                CBVersion.DataSource = dt;
+                CBVersion.DisplayMember = "Name";
+                CBVersion.ValueMember = "Code";
             }
-        }
 
-        private void BTConfig_Click(object sender, EventArgs e)
-        {
-            new ProjectConfigForm(this, Project).Show();
+            //保存工程信息到文件
+            string str = JsonTool.ToStr(Project);
+            TxtTool.Create(DirTool.Combine(R.Paths.Projects, Name), str);
         }
-
-        #region 功能方法
         /// <summary>
         /// 通过设置的工程端口号获取进程
         /// </summary>
@@ -104,30 +153,44 @@ namespace Oreo.BigBirdDeployer.Parts
         /// <returns></returns>
         private void Start()
         {
-            Task.Factory.StartNew(() =>
+            if (ListTool.HasElements(Project.Versions) && Project.CurrentVersion != 0 && Project.LastVersion != 0)
             {
-                StatusUI(WorkStatus.正在启动);
-                CMDProcessTool.StartExecute($"java -jar {DirTool.Combine(Project.Folder, Project.JarFile)}",
-                    new Action<string>((s) =>
-                    {
-                        //ConsoleUI(s);
-                        if (s.Contains("*****************************"))
+                //存在版本
+                Task.Factory.StartNew(() =>
+                {
+                    StatusUI(WorkStatus.正在启动);
+                    string cmd = $"java -jar {JarFileTool.PathGenerate(Project)}";
+                    CMDProcessTool.StartExecute(cmd,
+                        new Action<string>((s) =>
                         {
-                            StatusUI(WorkStatus.启动成功);
-                            GetProcess();
-                        }
-                    }));
+                            if (ConsoleCodeTool.IsLunchSuccess(s))
+                            {
+                                R.Log.i(s);
+                                StatusUI(WorkStatus.启动成功);
+                                ToastForm.Display("启动成功", $"启动 {Project.Name} 工程成功", 'i', 5000);
+                                GetProcess();
+                            }
 
-                if (Status == WorkStatus.启动成功 || Status == WorkStatus.端口占用)
-                {
-                    StatusUI(WorkStatus.正在关闭);
-                    Stop();
-                }
-                else
-                {
-                    StatusUI(WorkStatus.启动失败);
-                }
-            });
+                            string log = ConsoleCodeTool.GetLogInfo(s);
+                            if (!string.IsNullOrWhiteSpace(log)) R.Log.v(log);
+                        }));
+
+                    if (Status == WorkStatus.启动成功 || Status == WorkStatus.端口占用)
+                    {
+                        StatusUI(WorkStatus.正在关闭);
+                        Stop();
+                    }
+                    else
+                    {
+                        StatusUI(WorkStatus.启动失败);
+                    }
+                });
+            }
+            else
+            {
+                //不存在版本或错误的版本(版本为0),不启动工程
+                ToastForm.Display("启动失败", $"没有发现 {Project.Name} 工程的相关文件", 'e', 5000);
+            }
         }
         /// <summary>
         /// 关闭工程服务
@@ -167,7 +230,6 @@ namespace Oreo.BigBirdDeployer.Parts
                                 double cpu = AppInfoTool.CalcCpuRate(Process, pin, STATUS_INTERVAL);
                                 pin = Process.TotalProcessorTime;
 
-                                LBProcessName.Text = Process.ProcessName;
                                 LBCpu.Text = $"CPU:{Math.Round(cpu, 1)} %";
                                 LBRam.Text = $"内存:{AppInfoTool.RAM(Process.Id) / 1024} MB";
 
@@ -190,6 +252,101 @@ namespace Oreo.BigBirdDeployer.Parts
             });
         }
         #endregion
+
+        #region 事件方法
+        /// <summary>
+        /// 启动工程
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BTStartOrStop_Click(object sender, EventArgs e)
+        {
+            //没有端口占用则正常启动
+            if (!GetProcess())
+            {
+                Start();
+            }
+            else
+            {
+                Stop();
+            }
+        }
+        /// <summary>
+        /// 设置工程信息
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BTConfig_Click(object sender, EventArgs e)
+        {
+            new ProjectConfigForm(this, Project).ShowDialog();
+        }
+        /// <summary>
+        /// 装载新版本工程
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BTAddNew_Click(object sender, EventArgs e)
+        {
+            if (!string.IsNullOrWhiteSpace(Project.Folder) && !string.IsNullOrWhiteSpace(Project.JarFile))
+            {
+                //查询New仓库中,该工程的新版本
+                string newPath = JarFileTool.GetNewPath(Project);
+                if (Directory.Exists(newPath) && File.Exists(DirTool.Combine(newPath, Project.JarFile)))
+                {
+                    try
+                    {
+                        ToastForm.Display("装载中", $"正在装载 {Project.Name} 的新版本...", 'i', 5000);
+                        //移动文件到发布仓库中
+                        string aimPath = DirTool.Combine(R.Paths.PublishStorage, Project.Folder);//组合目标路径
+                        DirTool.Create(aimPath);//创建目标路径
+                        if (Directory.Exists(DirTool.Combine(aimPath, (Project.LastVersion + 1).ToString())))//如果存在目标文件夹
+                            Directory.Delete(DirTool.Combine(aimPath, (Project.LastVersion + 1).ToString()), true);//删除目标文件夹(防止重复)
+                        Directory.Move(newPath, DirTool.Combine(aimPath, (Project.LastVersion + 1).ToString()));//开始移动
+                                                                                                                //添加新版本信息
+                        Project.LastVersion++;
+                        Project.CurrentVersion = Project.LastVersion;
+                        VersionModel version = new VersionModel()
+                        {
+                            CreateTime = DateTime.Now,
+                            Number = Project.LastVersion,
+                        };
+                        if (Project.Versions == null) Project.Versions = new List<VersionModel>();
+                        Project.Versions.Add(version);
+                        //重置项目信息
+                        SetProject(Project);
+                        ToastForm.Display("装载成功", $"成功装载 {Project.Name} 的新版本", 'i', 5000);
+                    }
+                    catch
+                    {
+                        ToastForm.Display("装载失败", $"装载 {Project.Name} 的新版本失败", 'e', 5000);
+                    }
+                }
+                else
+                {
+                    //没有发现新版本,不做处理
+                    ToastForm.Display("装载失败", $"没有发现 {Project.Name} 的新版本", 'w', 5000);
+                }
+            }
+            else
+            {
+                //没有工程配置信息,不做处理
+                ToastForm.Display("装载失败", $"没有发现工程的配置信息", 'e', 5000);
+            }
+        }
+        /// <summary>
+        /// 选择要启动的版本
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void CBVersion_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (int.TryParse(CBVersion.SelectedValue.ToString(), out int v))
+            {
+                Project.CurrentVersion = v;
+            }
+        }
+        #endregion
+
         #region UI操作
         private void StatusUI(WorkStatus status)
         {
@@ -202,30 +359,54 @@ namespace Oreo.BigBirdDeployer.Parts
                     switch (status)
                     {
                         case WorkStatus.准备就绪:
+                            LBStatus.BackColor = Color.Green;
                             BTStartOrStop.Text = "启动";
-                            BTStartOrStop.Enabled = true;
+                            BTStartOrStop.Enabled = true;//允许启动/关闭
+                            BTAddNew.Enabled = true;//允许装载新版本
+                            BTConfig.Enabled = true;//允许配置工程
+                            CBVersion.Enabled = true;//允许选择启动版本
                             break;
                         case WorkStatus.启动成功:
+                            LBStatus.BackColor = Color.MediumTurquoise;
                             BTStartOrStop.Text = "停止";
-                            BTStartOrStop.Enabled = true;
+                            BTStartOrStop.Enabled = true;//允许启动/关闭
+                            BTAddNew.Enabled = false;//禁止装载新版本
+                            BTConfig.Enabled = false;//禁止配置工程
+                            CBVersion.Enabled = false;//禁止选择启动版本
                             break;
 
                         case WorkStatus.正在启动:
+                            LBStatus.BackColor = Color.Yellow;
                             BTStartOrStop.Text = "启动中.";
-                            BTStartOrStop.Enabled = false;
+                            BTStartOrStop.Enabled = false;//禁止启动/关闭
+                            BTAddNew.Enabled = false;//禁止装载新版本
+                            BTConfig.Enabled = false;//禁止配置工程
+                            CBVersion.Enabled = false;//禁止选择启动版本
                             break;
                         case WorkStatus.正在关闭:
+                            LBStatus.BackColor = Color.Yellow;
                             BTStartOrStop.Text = "关闭中.";
-                            BTStartOrStop.Enabled = false;
+                            BTStartOrStop.Enabled = false;//禁止启动/关闭
+                            BTAddNew.Enabled = false;//禁止装载新版本
+                            BTConfig.Enabled = false;//禁止配置工程
+                            CBVersion.Enabled = false;//禁止选择启动版本
                             break;
 
                         case WorkStatus.端口占用:
+                            LBStatus.BackColor = Color.Red;
                             BTStartOrStop.Text = "停止";
-                            BTStartOrStop.Enabled = true;
+                            BTStartOrStop.Enabled = true;//允许启动/关闭
+                            BTAddNew.Enabled = false;//禁止装载新版本
+                            BTConfig.Enabled = false;//禁止配置工程
+                            CBVersion.Enabled = false;//禁止选择启动版本
                             break;
                         case WorkStatus.启动失败:
+                            LBStatus.BackColor = Color.Red;
                             BTStartOrStop.Text = "启动";
-                            BTStartOrStop.Enabled = true;
+                            BTStartOrStop.Enabled = true;//允许启动/关闭
+                            BTAddNew.Enabled = true;//允许装载新版本
+                            BTConfig.Enabled = true;//允许配置工程
+                            CBVersion.Enabled = true;//允许选择启动版本
                             break;
                     }
                 }));
@@ -238,14 +419,10 @@ namespace Oreo.BigBirdDeployer.Parts
             {
                 BeginInvoke(new Action(() =>
                 {
-                    TBConsole.AppendText(s);
                 }));
             }
             catch { }
         }
-
         #endregion
-
-
     }
 }

+ 26 - 3
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Program.cs

@@ -1,5 +1,9 @@
 using Azylee.Core.AppUtils;
+using Azylee.Core.IOUtils.DirUtils;
+using Azylee.Core.IOUtils.TxtUtils;
+using Azylee.Core.LogUtils.SimpleLogUtils;
 using Azylee.Core.ProcessUtils;
+using Oreo.BigBirdDeployer.Commons;
 using Oreo.BigBirdDeployer.Utils;
 using Oreo.BigBirdDeployer.Views;
 using System;
@@ -12,15 +16,34 @@ namespace Oreo.BigBirdDeployer
 {
     static class Program
     {
+        static AppUnique appUnique = new AppUnique();
         /// <summary>
         /// 应用程序的主入口点。
         /// </summary>
         [STAThread]
         static void Main()
         {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new MainForm());
+            if (appUnique.IsUnique("Oreo.BigBirdDeployer"))
+            {
+                R.Log = new Log(true);
+                InitIni();
+                Application.EnableVisualStyles();
+                Application.SetCompatibleTextRenderingDefault(false);
+                Application.Run(new MainForm());
+            }
+        }
+        /// <summary>
+        /// 初始化Ini配置信息
+        /// </summary>
+        static void InitIni()
+        {
+            DirTool.Create(R.Paths.Settings);
+
+            R.Paths.PublishStorage = IniTool.GetStringValue(R.Files.Settings, "Paths", "PublishStorage", R.Paths.DefaultPublishStorage);
+            if (string.IsNullOrWhiteSpace(R.Paths.PublishStorage)) R.Paths.PublishStorage = R.Paths.DefaultPublishStorage;
+
+            R.Paths.NewStorage = IniTool.GetStringValue(R.Files.Settings, "Paths", "NewStorage", R.Paths.DefaultNewStorage);
+            if (string.IsNullOrWhiteSpace(R.Paths.NewStorage)) R.Paths.NewStorage = R.Paths.DefaultNewStorage;
         }
     }
 }

+ 33 - 0
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Utils/JarFileTool.cs

@@ -0,0 +1,33 @@
+using Azylee.Core.IOUtils.DirUtils;
+using Oreo.BigBirdDeployer.Commons;
+using Oreo.BigBirdDeployer.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Oreo.BigBirdDeployer.Utils
+{
+    public static class JarFileTool
+    {
+        /// <summary>
+        /// 执行Jar文件路径生成
+        /// </summary>
+        /// <returns></returns>
+        public static string PathGenerate(ProjectModel project)
+        {
+            string file = DirTool.Combine(R.Paths.PublishStorage, project.Folder, project.CurrentVersion.ToString(), project.JarFile);
+            return file;
+        }
+        /// <summary>
+        /// 获取新添加的Jar文件
+        /// </summary>
+        /// <returns></returns>
+        public static string GetNewPath(ProjectModel project)
+        {
+            string path = DirTool.Combine(R.Paths.NewStorage, project.Folder);
+            return path;
+        }
+
+    }
+}

+ 167 - 32
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/MainForm.Designer.cs

@@ -28,28 +28,43 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.projectItemPart1 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
-            this.projectItemPart2 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
-            this.projectItemPart3 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
+            this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.BTSettings = new System.Windows.Forms.Button();
+            this.project1 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project4 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project2 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project3 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project6 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project5 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project7 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
+            this.project8 = new Oreo.BigBirdDeployer.Parts.ProjectItemPart();
             ((System.ComponentModel.ISupportInitialize)(this.BigIconFormPBHeadIcon)).BeginInit();
             this.BigIconFormPNContainer.SuspendLayout();
             this.BigIconFormPNHead.SuspendLayout();
             this.BigIconFormPNHeadButton.SuspendLayout();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
+            this.tabPage3.SuspendLayout();
             this.SuspendLayout();
             // 
             // BigIconFormLBHeadTitle
             // 
             this.BigIconFormLBHeadTitle.Size = new System.Drawing.Size(508, 68);
+            this.BigIconFormLBHeadTitle.Text = "Big Bird Deployer Java 服务启动管理工具";
             // 
             // BigIconFormPNContainer
             // 
-            this.BigIconFormPNContainer.Controls.Add(this.projectItemPart3);
-            this.BigIconFormPNContainer.Controls.Add(this.projectItemPart2);
-            this.BigIconFormPNContainer.Controls.Add(this.projectItemPart1);
+            this.BigIconFormPNContainer.BackColor = System.Drawing.Color.White;
+            this.BigIconFormPNContainer.Controls.Add(this.tabControl1);
             this.BigIconFormPNContainer.Size = new System.Drawing.Size(775, 445);
             // 
             // BigIconFormPNHead
             // 
+            this.BigIconFormPNHead.BackColor = System.Drawing.Color.DeepSkyBlue;
             this.BigIconFormPNHead.Size = new System.Drawing.Size(775, 68);
             // 
             // BigIconFormPNHeadButton
@@ -59,45 +74,151 @@
             // BigIconFormBTFormMinBox
             // 
             this.BigIconFormBTFormMinBox.FlatAppearance.BorderSize = 0;
+            this.BigIconFormBTFormMinBox.Location = new System.Drawing.Point(44, 7);
             // 
             // BigIconFormBTFormMaxBox
             // 
             this.BigIconFormBTFormMaxBox.FlatAppearance.BorderSize = 0;
+            this.BigIconFormBTFormMaxBox.Location = new System.Drawing.Point(82, 36);
+            this.BigIconFormBTFormMaxBox.Visible = false;
             // 
             // BigIconFormBTFormCloseBox
             // 
             this.BigIconFormBTFormCloseBox.FlatAppearance.BorderSize = 0;
             // 
-            // projectItemPart1
-            // 
-            this.projectItemPart1.BackColor = System.Drawing.Color.DimGray;
-            this.projectItemPart1.Location = new System.Drawing.Point(12, 22);
-            this.projectItemPart1.Name = "projectItemPart1";
-            this.projectItemPart1.Size = new System.Drawing.Size(513, 95);
-            this.projectItemPart1.TabIndex = 0;
-            // 
-            // projectItemPart2
-            // 
-            this.projectItemPart2.BackColor = System.Drawing.Color.DimGray;
-            this.projectItemPart2.Location = new System.Drawing.Point(12, 134);
-            this.projectItemPart2.Name = "projectItemPart2";
-            this.projectItemPart2.Size = new System.Drawing.Size(513, 95);
-            this.projectItemPart2.TabIndex = 1;
-            // 
-            // projectItemPart3
-            // 
-            this.projectItemPart3.BackColor = System.Drawing.Color.DimGray;
-            this.projectItemPart3.Location = new System.Drawing.Point(154, 295);
-            this.projectItemPart3.Name = "projectItemPart3";
-            this.projectItemPart3.Size = new System.Drawing.Size(513, 95);
-            this.projectItemPart3.TabIndex = 2;
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Controls.Add(this.tabPage3);
+            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tabControl1.Location = new System.Drawing.Point(0, 0);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(775, 445);
+            this.tabControl1.TabIndex = 5;
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.Controls.Add(this.project1);
+            this.tabPage1.Controls.Add(this.project4);
+            this.tabPage1.Controls.Add(this.project2);
+            this.tabPage1.Controls.Add(this.project3);
+            this.tabPage1.Location = new System.Drawing.Point(4, 22);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(767, 419);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = " 【第一页】 ";
+            this.tabPage1.UseVisualStyleBackColor = true;
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.Controls.Add(this.project6);
+            this.tabPage2.Controls.Add(this.project5);
+            this.tabPage2.Controls.Add(this.project7);
+            this.tabPage2.Controls.Add(this.project8);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(767, 419);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Text = " 【不够再来一页】 ";
+            this.tabPage2.UseVisualStyleBackColor = true;
+            // 
+            // tabPage3
+            // 
+            this.tabPage3.Controls.Add(this.BTSettings);
+            this.tabPage3.Location = new System.Drawing.Point(4, 22);
+            this.tabPage3.Name = "tabPage3";
+            this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage3.Size = new System.Drawing.Size(767, 419);
+            this.tabPage3.TabIndex = 2;
+            this.tabPage3.Text = " 【设置】 ";
+            this.tabPage3.UseVisualStyleBackColor = true;
+            // 
+            // BTSettings
+            // 
+            this.BTSettings.Location = new System.Drawing.Point(248, 134);
+            this.BTSettings.Name = "BTSettings";
+            this.BTSettings.Size = new System.Drawing.Size(288, 95);
+            this.BTSettings.TabIndex = 4;
+            this.BTSettings.Text = "惊不惊喜,意不意外";
+            this.BTSettings.UseVisualStyleBackColor = true;
+            this.BTSettings.Click += new System.EventHandler(this.BTSettings_Click);
+            // 
+            // project1
+            // 
+            this.project1.BackColor = System.Drawing.Color.DimGray;
+            this.project1.Location = new System.Drawing.Point(35, 55);
+            this.project1.Name = "project1";
+            this.project1.Size = new System.Drawing.Size(324, 116);
+            this.project1.TabIndex = 0;
+            // 
+            // project4
+            // 
+            this.project4.BackColor = System.Drawing.Color.DimGray;
+            this.project4.Location = new System.Drawing.Point(403, 204);
+            this.project4.Name = "project4";
+            this.project4.Size = new System.Drawing.Size(324, 116);
+            this.project4.TabIndex = 4;
+            // 
+            // project2
+            // 
+            this.project2.BackColor = System.Drawing.Color.DimGray;
+            this.project2.Location = new System.Drawing.Point(403, 55);
+            this.project2.Name = "project2";
+            this.project2.Size = new System.Drawing.Size(324, 116);
+            this.project2.TabIndex = 1;
+            // 
+            // project3
+            // 
+            this.project3.BackColor = System.Drawing.Color.DimGray;
+            this.project3.Location = new System.Drawing.Point(35, 204);
+            this.project3.Name = "project3";
+            this.project3.Size = new System.Drawing.Size(324, 116);
+            this.project3.TabIndex = 2;
+            // 
+            // project6
+            // 
+            this.project6.BackColor = System.Drawing.Color.DimGray;
+            this.project6.Location = new System.Drawing.Point(403, 55);
+            this.project6.Name = "project6";
+            this.project6.Size = new System.Drawing.Size(324, 116);
+            this.project6.TabIndex = 14;
+            // 
+            // project5
+            // 
+            this.project5.BackColor = System.Drawing.Color.DimGray;
+            this.project5.Location = new System.Drawing.Point(35, 55);
+            this.project5.Name = "project5";
+            this.project5.Size = new System.Drawing.Size(324, 116);
+            this.project5.TabIndex = 13;
+            // 
+            // project7
+            // 
+            this.project7.BackColor = System.Drawing.Color.DimGray;
+            this.project7.Location = new System.Drawing.Point(35, 204);
+            this.project7.Name = "project7";
+            this.project7.Size = new System.Drawing.Size(324, 116);
+            this.project7.TabIndex = 12;
+            // 
+            // project8
+            // 
+            this.project8.BackColor = System.Drawing.Color.DimGray;
+            this.project8.Location = new System.Drawing.Point(403, 204);
+            this.project8.Name = "project8";
+            this.project8.Size = new System.Drawing.Size(324, 116);
+            this.project8.TabIndex = 11;
             // 
             // MainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(775, 513);
+            this.DoubleClickMax = false;
             this.Name = "MainForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "MainForm";
             this.Load += new System.EventHandler(this.MainForm_Load);
             this.Controls.SetChildIndex(this.BigIconFormPNHead, 0);
@@ -106,13 +227,27 @@
             this.BigIconFormPNContainer.ResumeLayout(false);
             this.BigIconFormPNHead.ResumeLayout(false);
             this.BigIconFormPNHeadButton.ResumeLayout(false);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage3.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
-        private Parts.ProjectItemPart projectItemPart1;
-        private Parts.ProjectItemPart projectItemPart2;
-        private Parts.ProjectItemPart projectItemPart3;
+        private Parts.ProjectItemPart project1;
+        private Parts.ProjectItemPart project2;
+        private Parts.ProjectItemPart project3;
+        private Parts.ProjectItemPart project4;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.TabPage tabPage2;
+        private Parts.ProjectItemPart project7;
+        private Parts.ProjectItemPart project8;
+        private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.Button BTSettings;
+        private Parts.ProjectItemPart project6;
+        private Parts.ProjectItemPart project5;
     }
 }

+ 4 - 14
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/MainForm.cs

@@ -21,21 +21,11 @@ namespace Oreo.BigBirdDeployer.Views
 
         private void MainForm_Load(object sender, EventArgs e)
         {
-            projectItemPart1.SetProject(new ProjectModel()
-            {
-                Name = "server",
-                Folder = @"F:\2018_5_2\temp\noah_cloud_supply_platform_jar",
-                JarFile = "noah-cloud-supply-platform.jar",
-                Port = 9090,
-            });
+        }
 
-            projectItemPart2.SetProject(new ProjectModel()
-            {
-                Name = "web",
-                Folder = @"F:\2018_5_2\temp\noah_cloud_supply_platform_web_jar",
-                JarFile = "noah-cloud-supply-platform-web.jar",
-                Port = 9091,
-            });
+        private void BTSettings_Click(object sender, EventArgs e)
+        {
+            new SettingsForm().ShowDialog();
         }
     }
 }

+ 2 - 2
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/ProjectConfigForm.Designer.cs

@@ -139,9 +139,9 @@
             this.label5.AutoSize = true;
             this.label5.Location = new System.Drawing.Point(27, 214);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(83, 12);
+            this.label5.Size = new System.Drawing.Size(77, 12);
             this.label5.TabIndex = 12;
-            this.label5.Text = " 版本缓存个数";
+            this.label5.Text = "版本缓存个数";
             // 
             // LBDesc
             // 

+ 2 - 0
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/ProjectConfigForm.cs

@@ -51,6 +51,8 @@ namespace Oreo.BigBirdDeployer.Views
                 Project.Port = int.Parse(TBPort.Text);
                 Project.VersionCache = int.Parse(TBVersionCache.Text);
                 ProjectItem.SetProject(Project);
+                Project.LastVersion = 0;
+                Project.CurrentVersion = 0;
                 LBDesc.Text = "保存成功并更新到管理面板";
                 return true;
             }

+ 62 - 23
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/SettingsForm.Designer.cs

@@ -30,15 +30,18 @@
         {
             this.BTSave = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
-            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.TBPublishStorage = new System.Windows.Forms.TextBox();
             this.label2 = new System.Windows.Forms.Label();
-            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.TBNewStorage = new System.Windows.Forms.TextBox();
             this.BTCancel = new System.Windows.Forms.Button();
+            this.LBDesc = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // BTSave
             // 
-            this.BTSave.Location = new System.Drawing.Point(182, 242);
+            this.BTSave.Location = new System.Drawing.Point(393, 254);
             this.BTSave.Name = "BTSave";
             this.BTSave.Size = new System.Drawing.Size(75, 23);
             this.BTSave.TabIndex = 0;
@@ -51,36 +54,36 @@
             this.label1.AutoSize = true;
             this.label1.Location = new System.Drawing.Point(35, 42);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(65, 12);
+            this.label1.Size = new System.Drawing.Size(89, 12);
             this.label1.TabIndex = 1;
-            this.label1.Text = "资料库路径";
+            this.label1.Text = "发布资料库路径";
             // 
-            // textBox1
+            // TBPublish
             // 
-            this.textBox1.Location = new System.Drawing.Point(154, 39);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(235, 21);
-            this.textBox1.TabIndex = 2;
+            this.TBPublishStorage.Location = new System.Drawing.Point(154, 39);
+            this.TBPublishStorage.Name = "TBPublish";
+            this.TBPublishStorage.Size = new System.Drawing.Size(235, 21);
+            this.TBPublishStorage.TabIndex = 2;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Location = new System.Drawing.Point(35, 97);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.Size = new System.Drawing.Size(89, 12);
             this.label2.TabIndex = 3;
-            this.label2.Text = "临时文件路径";
+            this.label2.Text = "新增资料库路径";
             // 
-            // textBox2
+            // TBNew
             // 
-            this.textBox2.Location = new System.Drawing.Point(154, 94);
-            this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(235, 21);
-            this.textBox2.TabIndex = 4;
+            this.TBNewStorage.Location = new System.Drawing.Point(154, 94);
+            this.TBNewStorage.Name = "TBNew";
+            this.TBNewStorage.Size = new System.Drawing.Size(235, 21);
+            this.TBNewStorage.TabIndex = 4;
             // 
             // BTCancel
             // 
-            this.BTCancel.Location = new System.Drawing.Point(314, 242);
+            this.BTCancel.Location = new System.Drawing.Point(525, 254);
             this.BTCancel.Name = "BTCancel";
             this.BTCancel.Size = new System.Drawing.Size(75, 23);
             this.BTCancel.TabIndex = 5;
@@ -88,15 +91,47 @@
             this.BTCancel.UseVisualStyleBackColor = true;
             this.BTCancel.Click += new System.EventHandler(this.BTCancel_Click);
             // 
+            // LBDesc
+            // 
+            this.LBDesc.AutoSize = true;
+            this.LBDesc.Location = new System.Drawing.Point(35, 180);
+            this.LBDesc.Name = "LBDesc";
+            this.LBDesc.Size = new System.Drawing.Size(77, 12);
+            this.LBDesc.TabIndex = 14;
+            this.LBDesc.Text = "执行结果描述";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.ForeColor = System.Drawing.Color.Gray;
+            this.label3.Location = new System.Drawing.Point(403, 42);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(197, 12);
+            this.label3.TabIndex = 15;
+            this.label3.Text = "默认为程序目录下 Storage\\Publish";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.ForeColor = System.Drawing.Color.Gray;
+            this.label4.Location = new System.Drawing.Point(403, 97);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(173, 12);
+            this.label4.TabIndex = 16;
+            this.label4.Text = "默认为程序目录下 Storage\\New";
+            // 
             // SettingsForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(435, 293);
+            this.ClientSize = new System.Drawing.Size(651, 305);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.LBDesc);
             this.Controls.Add(this.BTCancel);
-            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.TBNewStorage);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.TBPublishStorage);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.BTSave);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
@@ -105,6 +140,7 @@
             this.Name = "SettingsForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "设置";
+            this.Load += new System.EventHandler(this.SettingsForm_Load);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -114,9 +150,12 @@
 
         private System.Windows.Forms.Button BTSave;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox TBPublishStorage;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.TextBox TBNewStorage;
         private System.Windows.Forms.Button BTCancel;
+        private System.Windows.Forms.Label LBDesc;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
     }
 }

+ 52 - 3
Fork.Net/Oreo.Plugins/Oreo.BigBirdDeployer/Views/SettingsForm.cs

@@ -1,8 +1,11 @@
-using System;
+using Azylee.Core.IOUtils.TxtUtils;
+using Oreo.BigBirdDeployer.Commons;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
@@ -15,7 +18,11 @@ namespace Oreo.BigBirdDeployer.Views
         {
             InitializeComponent();
         }
-
+        private void SettingsForm_Load(object sender, EventArgs e)
+        {
+            TBPublishStorage.Text = R.Paths.PublishStorage;
+            TBNewStorage.Text = R.Paths.NewStorage;
+        }
         private void BTSave_Click(object sender, EventArgs e)
         {
             if (Save())
@@ -28,7 +35,49 @@ namespace Oreo.BigBirdDeployer.Views
         }
         private bool Save()
         {
-            return false;
+            bool flag = false;
+            if (!string.IsNullOrWhiteSpace(TBPublishStorage.Text))
+            {
+                if (Directory.Exists(TBPublishStorage.Text))
+                {
+                    R.Paths.PublishStorage = TBPublishStorage.Text;
+                    IniTool.WriteValue(R.Files.Settings, "Paths", "PublishStorage", R.Paths.PublishStorage);
+                    flag = true;
+                }
+                else
+                {
+                    LBDesc.Text = "发布资料库目录不存在";
+                }
+            }
+            else
+            {
+                R.Paths.PublishStorage = R.Paths.DefaultPublishStorage;
+                IniTool.WriteValue(R.Files.Settings, "Paths", "PublishStorage", R.Paths.PublishStorage);
+                flag = true;
+            }
+
+            if (!string.IsNullOrWhiteSpace(TBNewStorage.Text))
+            {
+                if (Directory.Exists(TBNewStorage.Text))
+                {
+                    R.Paths.NewStorage = TBNewStorage.Text;
+                    IniTool.WriteValue(R.Files.Settings, "Paths", "NewStorage", R.Paths.NewStorage);
+                    flag = true;
+                }
+                else
+                {
+                    LBDesc.Text = "新增资料库目录不存在";
+                }
+            }
+            else
+            {
+                R.Paths.NewStorage = R.Paths.DefaultNewStorage;
+                IniTool.WriteValue(R.Files.Settings, "Paths", "NewStorage", R.Paths.NewStorage);
+                flag = true;
+            }
+            return flag;
         }
+
+
     }
 }