From 6b4f7c7e4d38e8f2270243463e3006aa69568660 Mon Sep 17 00:00:00 2001 From: Rephl3x Date: Thu, 29 Jan 2026 14:35:44 +1300 Subject: [PATCH] Make How-to dialog a styled page --- certy.ps1 | 123 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 96 insertions(+), 27 deletions(-) diff --git a/certy.ps1 b/certy.ps1 index 8edf89e..c50bc84 100644 --- a/certy.ps1 +++ b/certy.ps1 @@ -816,8 +816,8 @@ function Update-OutputTypeUI { function Show-HelpDialog { $helpForm = New-Object System.Windows.Forms.Form - $helpForm.Text = "How to use me" - $helpForm.Size = [System.Drawing.Size]::new(720, 520) + $helpForm.Text = "How it works" + $helpForm.Size = [System.Drawing.Size]::new(760, 560) $helpForm.StartPosition = "CenterParent" $helpForm.BackColor = $colorBg @@ -827,40 +827,109 @@ function Show-HelpDialog { $panelHelp.Padding = New-Object System.Windows.Forms.Padding(16) $helpForm.Controls.Add($panelHelp) + $headerPanel = New-Object System.Windows.Forms.Panel + $headerPanel.BackColor = $colorPanel + $headerPanel.BorderStyle = "FixedSingle" + $headerPanel.Size = [System.Drawing.Size]::new(700, 70) + $headerPanel.Location = [System.Drawing.Point]::new(0, 0) + $panelHelp.Controls.Add($headerPanel) + $title = New-Object System.Windows.Forms.Label - $title.Text = "How Certy Works" + $title.Text = "Certy - How it works" $title.Font = New-Object System.Drawing.Font("Segoe UI Semibold", 14) $title.ForeColor = $colorText - $title.AutoSize = $true - $panelHelp.Controls.Add($title) + $title.Location = [System.Drawing.Point]::new(12, 12) + $title.Size = [System.Drawing.Size]::new(500, 24) + $headerPanel.Controls.Add($title) - $body = New-Object System.Windows.Forms.TextBox - $body.Multiline = $true - $body.ReadOnly = $true - $body.ScrollBars = "Vertical" - $body.BorderStyle = "FixedSingle" - $body.Font = $font - $body.BackColor = $colorInput - $body.ForeColor = $colorText - $body.Location = [System.Drawing.Point]::new(0, 40) - $body.Size = [System.Drawing.Size]::new(660, 380) - $body.Text = @" -1. Add your hostnames via one-per-line, CSV or CSR folder then click 1) Preview. -2. Click 2) Scan and select the DNS server in question (Primary is 10.106.60.1). Replication runs from there. -3. Update the replication wait for as long as you want. Usually 15 minutes. -4. Choose the output type (PEM/PFX). If PFX, supply a password. -5. Click 5) Run. + $subtitle = New-Object System.Windows.Forms.Label + $subtitle.Text = "Follow these steps to create DNS records and issue certificates." + $subtitle.Font = New-Object System.Drawing.Font("Segoe UI", 9) + $subtitle.ForeColor = $colorMuted + $subtitle.Location = [System.Drawing.Point]::new(12, 38) + $subtitle.Size = [System.Drawing.Size]::new(640, 18) + $headerPanel.Controls.Add($subtitle) -Other options: -- Turn off cert generation (DNS-only mode) to just add DNS records now and generate certs later. -- Disable DNS replication if records already point correctly and you only need a renewal certificate. -"@ - $panelHelp.Controls.Add($body) + $contentPanel = New-Object System.Windows.Forms.Panel + $contentPanel.Location = [System.Drawing.Point]::new(0, 86) + $contentPanel.Size = [System.Drawing.Size]::new(700, 380) + $contentPanel.BackColor = $colorBg + $panelHelp.Controls.Add($contentPanel) + + $stepTitle = New-Object System.Windows.Forms.Label + $stepTitle.Text = "Basic steps" + $stepTitle.Font = New-Object System.Drawing.Font("Segoe UI Semibold", 10) + $stepTitle.ForeColor = $colorText + $stepTitle.Location = [System.Drawing.Point]::new(0, 0) + $stepTitle.Size = [System.Drawing.Size]::new(200, 20) + $contentPanel.Controls.Add($stepTitle) + + $stepY = 28 + $steps = @( + "Add hostnames (one per line, CSV, or CSR folder) then click 1) Preview.", + "Click 2) Scan and select the DNS server (Primary is 10.106.60.1). Replication runs from there.", + "Set the replication wait time. Typical value: 15 minutes.", + "Choose output type (PEM or PFX). If PFX, supply a password.", + "Click 5) Run." + ) + $index = 1 + foreach ($step in $steps) { + $num = New-Object System.Windows.Forms.Label + $num.Text = "$index." + $num.Font = New-Object System.Drawing.Font("Segoe UI Semibold", 9) + $num.ForeColor = $colorText + $num.Location = [System.Drawing.Point]::new(0, $stepY) + $num.Size = [System.Drawing.Size]::new(24, 20) + $contentPanel.Controls.Add($num) + + $text = New-Object System.Windows.Forms.Label + $text.Text = $step + $text.Font = $font + $text.ForeColor = $colorText + $text.Location = [System.Drawing.Point]::new(28, $stepY) + $text.Size = [System.Drawing.Size]::new(660, 32) + $contentPanel.Controls.Add($text) + + $stepY += 34 + $index++ + } + + $optionsTitle = New-Object System.Windows.Forms.Label + $optionsTitle.Text = "Options" + $optionsTitle.Font = New-Object System.Drawing.Font("Segoe UI Semibold", 10) + $optionsTitle.ForeColor = $colorText + $optionsTitle.Location = [System.Drawing.Point]::new(0, ($stepY + 10)) + $optionsTitle.Size = [System.Drawing.Size]::new(200, 20) + $contentPanel.Controls.Add($optionsTitle) + + $optY = $stepY + 36 + $options = @( + "Turn off cert generation (DNS-only mode) to add DNS now and generate certs later.", + "Disable DNS replication if records already point correctly and you only need a renewal." + ) + foreach ($opt in $options) { + $bullet = New-Object System.Windows.Forms.Label + $bullet.Text = "•" + $bullet.Font = $font + $bullet.ForeColor = $colorText + $bullet.Location = [System.Drawing.Point]::new(0, $optY) + $bullet.Size = [System.Drawing.Size]::new(12, 20) + $contentPanel.Controls.Add($bullet) + + $optLabel = New-Object System.Windows.Forms.Label + $optLabel.Text = $opt + $optLabel.Font = $font + $optLabel.ForeColor = $colorText + $optLabel.Location = [System.Drawing.Point]::new(16, $optY) + $optLabel.Size = [System.Drawing.Size]::new(660, 32) + $contentPanel.Controls.Add($optLabel) + $optY += 30 + } $closeBtn = New-Object System.Windows.Forms.Button $closeBtn.Text = "Close" $closeBtn.Size = [System.Drawing.Size]::new(100, 30) - $closeBtn.Location = [System.Drawing.Point]::new(($body.Width - 100), ($body.Bottom + 12)) + $closeBtn.Location = [System.Drawing.Point]::new(600, 470) $panelHelp.Controls.Add($closeBtn) Style-ButtonSecondary $closeBtn $closeBtn.Add_Click({ $helpForm.Close() })