Skip to content

Commit 957bd65

Browse files
committed
docs: add thumbnails + thumbnail generator + CI workflow
1 parent 89f17ba commit 957bd65

10 files changed

Lines changed: 191 additions & 0 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Generate Thumbnails
2+
3+
on:
4+
push:
5+
paths:
6+
- 'management-portal/docs/**'
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
generate:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
persist-credentials: true
18+
19+
- name: Setup ImageMagick
20+
run: choco install imagemagick -y
21+
22+
- name: Generate thumbnails
23+
working-directory: management-portal/docs
24+
run: |
25+
pwsh -NoProfile -ExecutionPolicy Bypass -File .\generate-thumbnails.ps1 -Width 300 -Force
26+
27+
- name: Commit thumbnails
28+
run: |
29+
git config user.name "github-actions[bot]"
30+
git config user.email "github-actions[bot]@users.noreply.github.com"
31+
git add management-portal/docs/thumbnails || true
32+
git commit -m "chore(docs): add/update thumbnails" || echo "No changes to commit"
33+
git push origin HEAD:main || echo "Push failed"
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Management Portal Screenshots
2+
3+
This page shows the screenshots located in this folder. Images are displayed as thumbnails and link to the full-size images so they render nicely on GitHub and stay fast to load.
4+
5+
Images live in `management-portal/docs` — you can link to them from other docs using the same relative path.
6+
7+
---
8+
9+
## Gallery (click a thumbnail to open the full-size image)
10+
11+
<table>
12+
<tr>
13+
<td align="center">
14+
<a href="ManagmentPortal-Dashboard-Screenshot.png">
15+
<img src="thumbnails/ManagmentPortal-Dashboard-Screenshot-thumb.png" alt="Dashboard" width="300" />
16+
</a>
17+
<p><strong>Dashboard</strong><br /><em>Main application dashboard and summary widgets.</em></p>
18+
</td>
19+
<td align="center">
20+
<a href="ManagmentPortal-Tenants-Screenshot.png">
21+
<img src="thumbnails/ManagmentPortal-Tenants-Screenshot-thumb.png" alt="Tenants" width="300" />
22+
</a>
23+
<p><strong>Tenants</strong><br /><em>Tenant list and quick actions.</em></p>
24+
</td>
25+
</tr>
26+
<tr>
27+
<td align="center">
28+
<a href="ManagmentPortal-Cell-Screenshot.png">
29+
<img src="thumbnails/ManagmentPortal-Cell-Screenshot-thumb.png" alt="Cell" width="300" />
30+
</a>
31+
<p><strong>Cell</strong><br /><em>Cell overview and status.</em></p>
32+
</td>
33+
<td align="center">
34+
<a href="ManagmentPortal-CellMgmt-Screenshot.png">
35+
<img src="thumbnails/ManagmentPortal-CellMgmt-Screenshot-thumb.png" alt="Cell Management" width="300" />
36+
</a>
37+
<p><strong>Cell Management</strong><br /><em>Cell configuration and management screens.</em></p>
38+
</td>
39+
</tr>
40+
<tr>
41+
<td align="center">
42+
<a href="ManagmentPortal-Infrastructure-Screenshot.png">
43+
<img src="thumbnails/ManagmentPortal-Infrastructure-Screenshot-thumb.png" alt="Infrastructure" width="300" />
44+
</a>
45+
<p><strong>Infrastructure</strong><br /><em>Infrastructure view and resource mapping.</em></p>
46+
</td>
47+
<td align="center">
48+
<a href="ManagmentPortal-Operations-Screenshot.png">
49+
<img src="thumbnails/ManagmentPortal-Operations-Screenshot-thumb.png" alt="Operations" width="300" />
50+
</a>
51+
<p><strong>Operations</strong><br /><em>Operational metrics and logs.</em></p>
52+
</td>
53+
</tr>
54+
<tr>
55+
<td align="center">
56+
<a href="ManagmentPortal-NewTenant-Screenshot.png">
57+
<img src="thumbnails/ManagmentPortal-NewTenant-Screenshot-thumb.png" alt="New Tenant" width="300" />
58+
</a>
59+
<p><strong>New Tenant</strong><br /><em>Create a new tenant flow.</em></p>
60+
</td>
61+
<td></td>
62+
</tr>
63+
</table>
64+
65+
---
66+
67+
## How to regenerate thumbnails locally
68+
69+
I included a PowerShell helper `generate-thumbnails.ps1` in this folder that uses ImageMagick to create thumbnails (300px wide by default). Run it from this folder like:
70+
71+
```powershell
72+
powershell -NoProfile -ExecutionPolicy Bypass -File .\generate-thumbnails.ps1 -Width 300
73+
```
74+
75+
The script writes thumbnails to `management-portal/docs/thumbnails` with the `-thumb` suffix.
76+
77+
## CI / automated generation
78+
79+
A GitHub Actions workflow (.github/workflows/generate-thumbnails.yml) is included. It runs on push and on manual dispatch and will generate thumbnails and push them back to the repository automatically.
80+
81+
## Notes and tips
82+
83+
- If images are large, thumbnails speed up page rendering; clicking a thumbnail opens the full image.
84+
- For accessibility, edit the `alt` text and captions to be more descriptive if needed.
85+
- If you want different thumbnail sizes or a different filename convention, edit `generate-thumbnails.ps1` and the workflow accordingly.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<#
2+
Script: generate-thumbnails.ps1
3+
Purpose: Generate thumbnails for images in this folder and write them to ./thumbnails with a -thumb suffix.
4+
Requirements:
5+
- ImageMagick (magick) recommended
6+
- On Windows, PowerShell can use System.Drawing as a fallback
7+
8+
Usage:
9+
powershell -NoProfile -ExecutionPolicy Bypass -File .\generate-thumbnails.ps1 -Width 300
10+
#>
11+
12+
param(
13+
[int]$Width = 300,
14+
[string]$SourceDir = ".",
15+
[string]$OutDir = "./thumbnails",
16+
[switch]$Force
17+
)
18+
19+
$ErrorActionPreference = 'Stop'
20+
21+
if (-not (Test-Path $OutDir)) {
22+
New-Item -ItemType Directory -Path $OutDir | Out-Null
23+
}
24+
25+
# Collect images using explicit patterns to avoid Get-ChildItem -Include pitfalls
26+
$images = @()
27+
$patterns = @('*.png','*.jpg','*.jpeg','*.gif')
28+
foreach ($p in $patterns) {
29+
$images += Get-ChildItem -Path (Join-Path $SourceDir $p) -File -ErrorAction SilentlyContinue
30+
}
31+
# Remove duplicates and normalize
32+
$images = $images | Sort-Object -Property FullName -Unique
33+
34+
Write-Output "Found $($images.Count) image(s) in $SourceDir"
35+
36+
foreach ($img in $images) {
37+
$thumbName = [System.IO.Path]::Combine($OutDir, "$($img.BaseName)-thumb$($img.Extension)")
38+
if ((Test-Path $thumbName) -and -not $Force) {
39+
Write-Output "Skipping existing: $thumbName"
40+
continue
41+
}
42+
43+
# Prefer ImageMagick if available
44+
$magick = Get-Command magick -ErrorAction SilentlyContinue
45+
if ($magick) {
46+
Write-Output "Creating thumbnail via ImageMagick: $thumbName"
47+
# Use 'magick' in a portable way: magick input -auto-orient -thumbnail {Width}x output
48+
& magick "$($img.FullName)" -auto-orient -thumbnail ${Width}x "$thumbName"
49+
continue
50+
}
51+
52+
# Fallback: use .NET System.Drawing (Windows only)
53+
try {
54+
Add-Type -AssemblyName System.Drawing
55+
$src = [System.Drawing.Image]::FromFile($img.FullName)
56+
$ratio = [double]$Width / $src.Width
57+
$newHeight = [int]([math]::Round($src.Height * $ratio))
58+
$thumb = New-Object System.Drawing.Bitmap $Width, $newHeight
59+
$g = [System.Drawing.Graphics]::FromImage($thumb)
60+
$g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
61+
$g.DrawImage($src, 0, 0, $Width, $newHeight)
62+
$thumb.Save($thumbName, $src.RawFormat)
63+
$g.Dispose()
64+
$thumb.Dispose()
65+
$src.Dispose()
66+
Write-Output "Created thumbnail: $thumbName"
67+
}
68+
catch {
69+
Write-Warning "Failed to create thumbnail for $($img.Name): $_"
70+
}
71+
}
72+
73+
Write-Output "Done. Thumbnails are in: $OutDir"
34.8 KB
Loading
40.9 KB
Loading
46.3 KB
Loading
50.3 KB
Loading
28.5 KB
Loading
36.5 KB
Loading
41.7 KB
Loading

0 commit comments

Comments
 (0)