From c265e4c282c70a905597003a1bc2598ba897d03d Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 31 Jul 2019 13:35:42 +0200 Subject: [PATCH] Windows Agent: Refine setup wizard text and add docs URL Note for others: DO NOT manually fix whitespaces with sed and variants. Ensure that tabs (4 spaces, keep tabs) are set inside Visual Studio. --- .../ServiceStatus.Designer.cs | 178 +++++++++--------- agent/windows-setup-agent/ServiceStatus.cs | 5 - .../SetupWizard.Designer.cs | 72 ++++--- agent/windows-setup-agent/SetupWizard.cs | 17 +- 4 files changed, 140 insertions(+), 132 deletions(-) diff --git a/agent/windows-setup-agent/ServiceStatus.Designer.cs b/agent/windows-setup-agent/ServiceStatus.Designer.cs index 874f29672..cda0fd418 100644 --- a/agent/windows-setup-agent/ServiceStatus.Designer.cs +++ b/agent/windows-setup-agent/ServiceStatus.Designer.cs @@ -28,95 +28,95 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceStatus)); - this.picBanner = new System.Windows.Forms.PictureBox(); - this.lblStatus = new System.Windows.Forms.Label(); - this.txtStatus = new System.Windows.Forms.TextBox(); - this.btnReconfigure = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnOpenConfigDir = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.picBanner)).BeginInit(); - this.SuspendLayout(); - // - // picBanner - // - this.picBanner.Image = global::Icinga.Properties.Resources.icinga_banner; - this.picBanner.Location = new System.Drawing.Point(0, 0); - this.picBanner.Name = "picBanner"; - this.picBanner.Size = new System.Drawing.Size(625, 77); - this.picBanner.TabIndex = 2; - this.picBanner.TabStop = false; - // - // lblStatus - // - this.lblStatus.AutoSize = true; - this.lblStatus.Location = new System.Drawing.Point(12, 105); - this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(79, 13); - this.lblStatus.TabIndex = 3; - this.lblStatus.Text = "Service Status:"; - // - // txtStatus - // - this.txtStatus.Location = new System.Drawing.Point(97, 102); - this.txtStatus.Name = "txtStatus"; - this.txtStatus.ReadOnly = true; - this.txtStatus.Size = new System.Drawing.Size(278, 20); - this.txtStatus.TabIndex = 3; - // - // btnReconfigure - // - this.btnReconfigure.Location = new System.Drawing.Point(195, 143); - this.btnReconfigure.Name = "btnReconfigure"; - this.btnReconfigure.Size = new System.Drawing.Size(89, 23); - this.btnReconfigure.TabIndex = 1; - this.btnReconfigure.Text = "Reconfigure"; - this.btnReconfigure.UseVisualStyleBackColor = true; - this.btnReconfigure.Click += new System.EventHandler(this.btnReconfigure_Click); - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnOK.Location = new System.Drawing.Point(290, 143); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(89, 23); - this.btnOK.TabIndex = 0; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnOpenConfigDir - // - this.btnOpenConfigDir.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnOpenConfigDir.Location = new System.Drawing.Point(100, 143); - this.btnOpenConfigDir.Name = "btnOpenConfigDir"; - this.btnOpenConfigDir.Size = new System.Drawing.Size(89, 23); - this.btnOpenConfigDir.TabIndex = 2; - this.btnOpenConfigDir.Text = "Examine Config"; - this.btnOpenConfigDir.UseVisualStyleBackColor = true; - this.btnOpenConfigDir.Click += new System.EventHandler(this.btnOpenConfigDir_Click); - // - // ServiceStatus - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnOK; - this.ClientSize = new System.Drawing.Size(391, 186); - this.Controls.Add(this.btnOpenConfigDir); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.btnReconfigure); - this.Controls.Add(this.txtStatus); - this.Controls.Add(this.lblStatus); - this.Controls.Add(this.picBanner); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "ServiceStatus"; - this.Text = "Icinga 2 Service Status"; - ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceStatus)); + this.picBanner = new System.Windows.Forms.PictureBox(); + this.lblStatus = new System.Windows.Forms.Label(); + this.txtStatus = new System.Windows.Forms.TextBox(); + this.btnReconfigure = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnOpenConfigDir = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).BeginInit(); + this.SuspendLayout(); + // + // picBanner + // + this.picBanner.Image = global::Icinga.Properties.Resources.icinga_banner; + this.picBanner.Location = new System.Drawing.Point(0, 0); + this.picBanner.Name = "picBanner"; + this.picBanner.Size = new System.Drawing.Size(625, 77); + this.picBanner.TabIndex = 2; + this.picBanner.TabStop = false; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(12, 105); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(79, 13); + this.lblStatus.TabIndex = 3; + this.lblStatus.Text = "Service Status:"; + // + // txtStatus + // + this.txtStatus.Location = new System.Drawing.Point(97, 102); + this.txtStatus.Name = "txtStatus"; + this.txtStatus.ReadOnly = true; + this.txtStatus.Size = new System.Drawing.Size(278, 20); + this.txtStatus.TabIndex = 3; + // + // btnReconfigure + // + this.btnReconfigure.Location = new System.Drawing.Point(195, 143); + this.btnReconfigure.Name = "btnReconfigure"; + this.btnReconfigure.Size = new System.Drawing.Size(89, 23); + this.btnReconfigure.TabIndex = 1; + this.btnReconfigure.Text = "Reconfigure"; + this.btnReconfigure.UseVisualStyleBackColor = true; + this.btnReconfigure.Click += new System.EventHandler(this.btnReconfigure_Click); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnOK.Location = new System.Drawing.Point(290, 143); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(89, 23); + this.btnOK.TabIndex = 0; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnOpenConfigDir + // + this.btnOpenConfigDir.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnOpenConfigDir.Location = new System.Drawing.Point(100, 143); + this.btnOpenConfigDir.Name = "btnOpenConfigDir"; + this.btnOpenConfigDir.Size = new System.Drawing.Size(89, 23); + this.btnOpenConfigDir.TabIndex = 2; + this.btnOpenConfigDir.Text = "Examine Config"; + this.btnOpenConfigDir.UseVisualStyleBackColor = true; + this.btnOpenConfigDir.Click += new System.EventHandler(this.btnOpenConfigDir_Click); + // + // ServiceStatus + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnOK; + this.ClientSize = new System.Drawing.Size(391, 186); + this.Controls.Add(this.btnOpenConfigDir); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnReconfigure); + this.Controls.Add(this.txtStatus); + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.picBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "ServiceStatus"; + this.Text = "Icinga Windows Agent Service Status"; + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/agent/windows-setup-agent/ServiceStatus.cs b/agent/windows-setup-agent/ServiceStatus.cs index e9782fe1d..c1272a98d 100644 --- a/agent/windows-setup-agent/ServiceStatus.cs +++ b/agent/windows-setup-agent/ServiceStatus.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; using System.Windows.Forms; using System.ServiceProcess; using System.Diagnostics; diff --git a/agent/windows-setup-agent/SetupWizard.Designer.cs b/agent/windows-setup-agent/SetupWizard.Designer.cs index 090e34d37..7dc52d1c4 100644 --- a/agent/windows-setup-agent/SetupWizard.Designer.cs +++ b/agent/windows-setup-agent/SetupWizard.Designer.cs @@ -46,6 +46,7 @@ this.colGlobalZoneName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.introduction1 = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.chkDisableConf = new System.Windows.Forms.CheckBox(); this.txtUser = new System.Windows.Forms.TextBox(); this.chkRunServiceAsThisUser = new System.Windows.Forms.CheckBox(); this.chkInstallNSCP = new System.Windows.Forms.CheckBox(); @@ -87,7 +88,7 @@ this.txtError = new System.Windows.Forms.TextBox(); this.lblError = new System.Windows.Forms.Label(); this.picBanner = new System.Windows.Forms.PictureBox(); - this.chkDisableConf = new System.Windows.Forms.CheckBox(); + this.linkLabelDocs = new System.Windows.Forms.LinkLabel(); this.tabFinish.SuspendLayout(); this.tabConfigure.SuspendLayout(); this.tabParameters.SuspendLayout(); @@ -141,7 +142,7 @@ this.tabFinish.Location = new System.Drawing.Point(4, 5); this.tabFinish.Name = "tabFinish"; this.tabFinish.Padding = new System.Windows.Forms.Padding(3); - this.tabFinish.Size = new System.Drawing.Size(617, 471); + this.tabFinish.Size = new System.Drawing.Size(617, 495); this.tabFinish.TabIndex = 5; this.tabFinish.Text = "Finish"; this.tabFinish.UseVisualStyleBackColor = true; @@ -151,7 +152,7 @@ this.lblSetupCompleted.AutoSize = true; this.lblSetupCompleted.Location = new System.Drawing.Point(34, 35); this.lblSetupCompleted.Name = "lblSetupCompleted"; - this.lblSetupCompleted.Size = new System.Drawing.Size(259, 13); + this.lblSetupCompleted.Size = new System.Drawing.Size(252, 13); this.lblSetupCompleted.TabIndex = 0; this.lblSetupCompleted.Text = "The Icinga Windows agent was set up successfully."; // @@ -162,7 +163,7 @@ this.tabConfigure.Location = new System.Drawing.Point(4, 5); this.tabConfigure.Name = "tabConfigure"; this.tabConfigure.Padding = new System.Windows.Forms.Padding(3); - this.tabConfigure.Size = new System.Drawing.Size(617, 471); + this.tabConfigure.Size = new System.Drawing.Size(617, 495); this.tabConfigure.TabIndex = 4; this.tabConfigure.Text = "Configure Icinga 2"; this.tabConfigure.UseVisualStyleBackColor = true; @@ -185,6 +186,7 @@ // // tabParameters // + this.tabParameters.Controls.Add(this.linkLabelDocs); this.tabParameters.Controls.Add(this.groupBox4); this.tabParameters.Controls.Add(this.introduction1); this.tabParameters.Controls.Add(this.groupBox3); @@ -270,7 +272,7 @@ this.introduction1.AutoSize = true; this.introduction1.Location = new System.Drawing.Point(11, 3); this.introduction1.Name = "introduction1"; - this.introduction1.Size = new System.Drawing.Size(269, 13); + this.introduction1.Size = new System.Drawing.Size(262, 13); this.introduction1.TabIndex = 6; this.introduction1.Text = "Welcome to the Icinga Windows Agent Setup Wizard!"; // @@ -289,6 +291,18 @@ this.groupBox3.TabStop = false; this.groupBox3.Text = "Advanced Options"; // + // chkDisableConf + // + this.chkDisableConf.AutoSize = true; + this.chkDisableConf.Checked = true; + this.chkDisableConf.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkDisableConf.Location = new System.Drawing.Point(9, 137); + this.chkDisableConf.Name = "chkDisableConf"; + this.chkDisableConf.Size = new System.Drawing.Size(211, 17); + this.chkDisableConf.TabIndex = 9; + this.chkDisableConf.Text = "Disable including local \'conf.d\' directory"; + this.chkDisableConf.UseVisualStyleBackColor = true; + // // txtUser // this.txtUser.Enabled = false; @@ -341,9 +355,9 @@ // // txtTicket // - this.txtTicket.Location = new System.Drawing.Point(136, 56); + this.txtTicket.Location = new System.Drawing.Point(164, 56); this.txtTicket.Name = "txtTicket"; - this.txtTicket.Size = new System.Drawing.Size(378, 20); + this.txtTicket.Size = new System.Drawing.Size(350, 20); this.txtTicket.TabIndex = 1; // // lblTicket @@ -351,15 +365,15 @@ this.lblTicket.AutoSize = true; this.lblTicket.Location = new System.Drawing.Point(9, 59); this.lblTicket.Name = "lblTicket"; - this.lblTicket.Size = new System.Drawing.Size(117, 13); + this.lblTicket.Size = new System.Drawing.Size(149, 13); this.lblTicket.TabIndex = 4; - this.lblTicket.Text = "Setup Ticket (optional):"; + this.lblTicket.Text = "CSR Signing Ticket (optional):"; // // txtInstanceName // - this.txtInstanceName.Location = new System.Drawing.Point(136, 27); + this.txtInstanceName.Location = new System.Drawing.Point(164, 27); this.txtInstanceName.Name = "txtInstanceName"; - this.txtInstanceName.Size = new System.Drawing.Size(378, 20); + this.txtInstanceName.Size = new System.Drawing.Size(350, 20); this.txtInstanceName.TabIndex = 0; // // lblInstanceName @@ -527,7 +541,7 @@ this.tabRetrieveCertificate.Location = new System.Drawing.Point(4, 5); this.tabRetrieveCertificate.Name = "tabRetrieveCertificate"; this.tabRetrieveCertificate.Padding = new System.Windows.Forms.Padding(3); - this.tabRetrieveCertificate.Size = new System.Drawing.Size(617, 471); + this.tabRetrieveCertificate.Size = new System.Drawing.Size(617, 495); this.tabRetrieveCertificate.TabIndex = 7; this.tabRetrieveCertificate.Text = "Checking Certificate"; this.tabRetrieveCertificate.UseVisualStyleBackColor = true; @@ -559,7 +573,7 @@ this.tabVerifyCertificate.Location = new System.Drawing.Point(4, 5); this.tabVerifyCertificate.Name = "tabVerifyCertificate"; this.tabVerifyCertificate.Padding = new System.Windows.Forms.Padding(3); - this.tabVerifyCertificate.Size = new System.Drawing.Size(617, 471); + this.tabVerifyCertificate.Size = new System.Drawing.Size(617, 495); this.tabVerifyCertificate.TabIndex = 6; this.tabVerifyCertificate.Text = "Verify Certificate"; this.tabVerifyCertificate.UseVisualStyleBackColor = true; @@ -659,7 +673,7 @@ this.tabError.Location = new System.Drawing.Point(4, 5); this.tabError.Name = "tabError"; this.tabError.Padding = new System.Windows.Forms.Padding(3); - this.tabError.Size = new System.Drawing.Size(617, 471); + this.tabError.Size = new System.Drawing.Size(617, 495); this.tabError.TabIndex = 8; this.tabError.Text = "Error"; this.tabError.UseVisualStyleBackColor = true; @@ -686,25 +700,25 @@ // // picBanner // - this.picBanner.Image = global::Icinga.Properties.Resources.icinga_banner; + this.picBanner.Image = ((System.Drawing.Image)(resources.GetObject("picBanner.Image"))); this.picBanner.Location = new System.Drawing.Point(0, 0); this.picBanner.Name = "picBanner"; this.picBanner.Size = new System.Drawing.Size(625, 77); this.picBanner.TabIndex = 1; this.picBanner.TabStop = false; // - // chkDisableConf + // linkLabelDocs // - this.chkDisableConf.AutoSize = true; - this.chkDisableConf.Checked = true; - this.chkDisableConf.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkDisableConf.Location = new System.Drawing.Point(9, 137); - this.chkDisableConf.Name = "chkDisableConf"; - this.chkDisableConf.Size = new System.Drawing.Size(138, 17); - this.chkDisableConf.TabIndex = 9; - this.chkDisableConf.Text = "Disable conf.d inclusion"; - this.chkDisableConf.UseVisualStyleBackColor = true; - this.chkDisableConf.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + this.linkLabelDocs.AutoSize = true; + this.linkLabelDocs.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(149)))), ((int)(((byte)(191))))); + this.linkLabelDocs.Location = new System.Drawing.Point(525, 3); + this.linkLabelDocs.Name = "linkLabelDocs"; + this.linkLabelDocs.Size = new System.Drawing.Size(79, 13); + this.linkLabelDocs.TabIndex = 10; + this.linkLabelDocs.TabStop = true; + this.linkLabelDocs.Text = "Documentation"; + this.linkLabelDocs.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(149)))), ((int)(((byte)(191))))); + this.linkLabelDocs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelDocs_LinkClicked); // // SetupWizard // @@ -722,7 +736,8 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "SetupWizard"; - this.Text = "Icinga 2 Setup Wizard"; + this.Text = "Icinga Windows Agent Setup Wizard"; + this.Load += new System.EventHandler(this.SetupWizard_Load); this.tabFinish.ResumeLayout(false); this.tabFinish.PerformLayout(); this.tabConfigure.ResumeLayout(false); @@ -746,7 +761,7 @@ this.tabError.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit(); this.ResumeLayout(false); - this.Load += new System.EventHandler(this.SetupWizard_Load); + } #endregion @@ -810,6 +825,7 @@ private System.Windows.Forms.ListView lvwGlobalZones; private System.Windows.Forms.ColumnHeader colGlobalZoneName; private System.Windows.Forms.CheckBox chkDisableConf; + private System.Windows.Forms.LinkLabel linkLabelDocs; } } diff --git a/agent/windows-setup-agent/SetupWizard.cs b/agent/windows-setup-agent/SetupWizard.cs index b28fd53c8..84d322704 100644 --- a/agent/windows-setup-agent/SetupWizard.cs +++ b/agent/windows-setup-agent/SetupWizard.cs @@ -1,16 +1,11 @@ using System; using System.IO; using System.Text; -using System.Collections.Generic; -using System.ComponentModel; using System.Windows.Forms; -using System.Runtime.InteropServices; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Net.NetworkInformation; -using System.IO.Compression; using System.Diagnostics; -using System.ServiceProcess; using System.Security.AccessControl; namespace Icinga @@ -572,16 +567,18 @@ namespace Icinga lvwGlobalZones.Items.Add(lvi2); } - private void checkBox1_CheckedChanged(object sender, EventArgs e) - { - - } - private void SetupWizard_Load(object sender, EventArgs e) { this.MinimumSize = this.Size; this.MaximumSize = this.Size; } + + private void linkLabelDocs_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + linkLabelDocs.LinkVisited = true; + + Process.Start("https://icinga.com/docs/icinga2/latest/"); + } } } -- 2.40.0