Skip to content

Commit

Permalink
Initial Diagram footer signature support
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Jan 5, 2024
1 parent 1ebe399 commit 1c734ce
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 95 deletions.
16 changes: 9 additions & 7 deletions Src/Private/Get-DiagBackupToHvProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToHvProxy {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.3
Version: 0.5.6
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -37,14 +37,16 @@ function Get-DiagBackupToHvProxy {
color=$SubGraphDebug.color
style='dashed,rounded'
}
SubGraph MainHyperVProxies -Attributes $ProxiesAttr -ScriptBlock {
SubGraph MainSubGraph -Attributes $ProxiesAttr -ScriptBlock {
# Dummy Node used for subgraph centering
node DummyHyperVProxy @{Label=$DiagramDummyLabel; fontsize=18; fontname="Segoe Ui Black"; fontcolor='#005f4b'; shape='plain'}
node HvLeft @{Label='HvLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node HvLeftt @{Label='HvLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node HvRight @{Label='HvRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge HvLeft,HvLeftt,DummyHyperVProxy,HvRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank HvLeft,HvLeftt,DummyHyperVProxy,HvRight
if ($Dir -eq "TB") {
node HvLeft @{Label='HvLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node HvLeftt @{Label='HvLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node HvRight @{Label='HvRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge HvLeft,HvLeftt,DummyHyperVProxy,HvRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank HvLeft,HvLeftt,DummyHyperVProxy,HvRight
}
foreach ($ProxyObj in $HyperVBackupProxy) {
$PROXYHASHTABLE = @{}
$ProxyObj.psobject.properties | ForEach-Object { $PROXYHASHTABLE[$_.Name] = $_.Value }
Expand Down
56 changes: 11 additions & 45 deletions Src/Private/Get-DiagBackupToRepo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToRepo {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.4
Version: 0.5.6
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -37,14 +37,16 @@ function Get-DiagBackupToRepo {
}

if ($BackupRepo) {
SubGraph MainRepos -Attributes @{Label=$DiagramLabel; fontsize=22; penwidth=1; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
SubGraph MainSubGraph -Attributes @{Label=$DiagramLabel; fontsize=22; penwidth=1; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
# Node used for subgraph centering
node BackupRepository @{Label=$DiagramDummyLabel; fontsize=22; fontname="Segoe Ui Black"; fontcolor='#005f4b'; shape='plain'}
node RepoLeft @{Label='RepoLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node RepoLeftt @{Label='RepoLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node RepoRight @{Label='RepoRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge RepoLeft,RepoLeftt,BackupRepository,RepoRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank RepoLeft,RepoLeftt,BackupRepository,RepoRight
if ($Dir -eq "TB") {
node RepoLeft @{Label='RepoLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node RepoLeftt @{Label='RepoLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node RepoRight @{Label='RepoRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge RepoLeft,RepoLeftt,BackupRepository,RepoRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank RepoLeft,RepoLeftt,BackupRepository,RepoRight
}
if ($LocalBackupRepo) {
SubGraph LocalRepos -Attributes @{Label='Local Repository'; fontsize=18; penwidth=1.5; labelloc='t'; style='dashed,rounded'} {
# Node used for subgraph centering
Expand All @@ -56,10 +58,6 @@ function Get-DiagBackupToRepo {
node $REPOOBJ -NodeScript {$_.Name} @{Label=$REPOHASHTABLE.Label; fontname="Segoe Ui"}
}

if ($Dir -eq 'LR') {
rank LocalReposDummy,$LocalBackupRepo.Name
}

edge -from LocalReposDummy -to $LocalBackupRepo.Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
}
else {
Expand All @@ -77,10 +75,6 @@ function Get-DiagBackupToRepo {
$Number++
}

if ($Dir -eq 'LR') {
rank LocalReposDummy,$Group[0].Name
}

edge -From LocalReposDummy -To $Group[0].Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
$Start = 0
$LocalRepoNum = 1
Expand All @@ -103,10 +97,6 @@ function Get-DiagBackupToRepo {
node $REPOOBJ -NodeScript {$_.Name} @{Label=$REPOHASHTABLE.Label; fontname="Segoe Ui"}
}

if ($Dir -eq 'LR') {
rank RemoteReposDummy,$RemoteBackupRepo.Name
}

edge -from RemoteReposDummy -to $RemoteBackupRepo.Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
}
else {
Expand All @@ -124,10 +114,6 @@ function Get-DiagBackupToRepo {
$Number++
}

if ($Dir -eq 'LR') {
rank RemoteReposDummy,$Group[0].Name
}

edge -From RemoteReposDummy -To $Group[0].Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
$Start = 0
$RemoteRepoNum = 1
Expand All @@ -151,9 +137,6 @@ function Get-DiagBackupToRepo {
node $STORAGEOBJ -NodeScript {$_.Name} @{Label=$OBJHASHTABLE.Label; fontname="Segoe Ui"}
}

if ($Dir -eq 'LR') {
rank ObjectStorageDummy,$ObjStorage.Name
}
edge -from ObjectStorageDummy -to $ObjStorage.Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
}
else {
Expand All @@ -171,10 +154,6 @@ function Get-DiagBackupToRepo {
$Number++
}

if ($Dir -eq 'LR') {
rank ObjectStorageDummy,$Group[0].Name
}

edge -From ObjectStorageDummy -To $Group[0].Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
$Start = 0
$ObjectStorageNum = 1
Expand All @@ -197,12 +176,7 @@ function Get-DiagBackupToRepo {
node $STORAGEArchiveOBJ -NodeScript {$_.Name} @{Label=$ARCHOBJHASHTABLE.Label; fontname="Segoe Ui"}
}

if ($Dir -eq 'LR') {
rank ArchiveObjectStorageDummy,$ArchiveObjStorage.Name
edge -from ArchiveObjectStorageDummy -to $ArchiveObjStorage.Name @{constraint="false";minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
} else {
edge -from ArchiveObjectStorageDummy -to $ArchiveObjStorage.Name @{constraint="true";minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
}
edge -from ArchiveObjectStorageDummy -to $ArchiveObjStorage.Name @{constraint="true";minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
}
else {
$Group = Split-array -inArray ($ArchiveObjStorage| Sort-Object -Property Name) -size 3
Expand All @@ -219,10 +193,6 @@ function Get-DiagBackupToRepo {
$Number++
}

if ($Dir -eq 'LR') {
rank ArchiveObjectStorageDummy,$Group[0].Name
}

edge -From ArchiveObjectStorageDummy -To $Group[0].Name @{minlen=1; style=$EdgeDebug.style; color=$EdgeDebug.color}
$Start = 0
$ArchiveObjectStorageNum = 1
Expand All @@ -238,11 +208,7 @@ function Get-DiagBackupToRepo {
}
}

if ($Dir -eq 'LR') {
edge -from $BackupServerInfo.Name -to BackupRepository @{minlen=3}
} else {
edge -from $BackupServerInfo.Name -to BackupRepository @{minlen=3}
}
edge -from $BackupServerInfo.Name -to BackupRepository @{minlen=3}
}
}
}
Expand Down
26 changes: 14 additions & 12 deletions Src/Private/Get-DiagBackupToSobr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToSobr {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.3
Version: 0.5.6
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -32,36 +32,38 @@ function Get-DiagBackupToSobr {
$DiagramDummyLabel = 'SOBR Repository'
}
if ($SobrRepo) {
SubGraph MainSOBR -Attributes @{Label=$DiagramLabel ; fontsize=22; penwidth=1.5; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
SubGraph MainSubGraph -Attributes @{Label=$DiagramLabel ; fontsize=22; penwidth=1.5; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
# Dummy Node used for subgraph centering
node DummySOBREPO @{Label=$DiagramDummyLabel; fontsize=22; fontname="Segoe Ui Black"; fontcolor='#005f4b'; shape='plain'}
node SobrRepoLeft @{Label='SobrRepoLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node SobrRepoLeftt @{Label='SobrRepoLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node SobrRepoRight @{Label='SobrRepoRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge SobrRepoLeft,SobrRepoLeftt,DummySOBREPO,SobrRepoRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank SobrRepoLeft,SobrRepoLeftt,DummySOBREPO,SobrRepoRight
if ($Dir -eq 'TB') {
node SobrRepoLeft @{Label='SobrRepoLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node SobrRepoLeftt @{Label='SobrRepoLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node SobrRepoRight @{Label='SobrRepoRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge SobrRepoLeft,SobrRepoLeftt,DummySOBREPO,SobrRepoRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank SobrRepoLeft,SobrRepoLeftt,DummySOBREPO,SobrRepoRight
}
foreach ($SOBROBJ in $SobrRepo) {
$SubGraphName = Remove-SpecialChars -String $SOBROBJ.Name -SpecialChars '\- '
SubGraph $SubGraphName -Attributes @{Label=$SOBROBJ.Name; fontsize=18; penwidth=1.5; labelloc='t'; style='dashed,rounded'} {
$SOBRHASHTABLE = @{}
$SOBROBJ.psobject.properties | ForEach-Object { $SOBRHASHTABLE[$_.Name] = $_.Value }
node $SOBROBJ -NodeScript {$_.Name} @{Label=$SOBRHASHTABLE.Label; fontname="Segoe Ui"}
node $SOBROBJ -NodeScript {$_.Name} @{Label=$SOBRHASHTABLE.Label; fontname="Segoe Ui"; shape="plain";}
if ($SOBROBJ.Performance) {
SubGraph "$($SubGraphName)Performance" -Attributes @{Label="Performance Extent"; fontsize=18; penwidth=1.5; labelloc='b'; style="dashed,rounded"} {
SubGraph "$($SubGraphName)Performance" -Attributes @{Label="Performance Extent"; fontsize=18; penwidth=1.5; labelloc='b'; style="dashed,rounded";} {

$SOBROBJ.Performance | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"}}
$SOBROBJ.Performance | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"; shape="plain"}}
}
}
if ($SOBROBJ.Capacity) {
SubGraph "$($SubGraphName)Capacity" -Attributes @{Label="Capacity Extent"; fontsize=18; penwidth=1.5; labelloc='b'; style="dashed,rounded"} {

$SOBROBJ.Capacity | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"}}
$SOBROBJ.Capacity | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"; shape="plain"}}
}
}
if ($SOBROBJ.Archive) {
SubGraph "$($SubGraphName)Archive" -Attributes @{Label="Archive Extent"; fontsize=18; penwidth=1.5; labelloc='b'; style="dashed,rounded"} {

$SOBROBJ.Archive | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"}}
$SOBROBJ.Archive | ForEach-Object {node $_.Name @{Label=Get-NodeIcon -Name $_.Name -Type $_.Icon -Align "Center" -Rows $_.Rows; fontname="Segoe Ui"; shape="plain"}}
}
}

Expand Down
16 changes: 9 additions & 7 deletions Src/Private/Get-DiagBackupToTape.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-DiagBackupToTape {
.DESCRIPTION
Build a diagram of the configuration of Veeam VBR in PDF/PNG/SVG formats using Psgraph.
.NOTES
Version: 0.5.4
Version: 0.5.6
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -34,15 +34,17 @@ function Get-DiagBackupToTape {
$DiagramDummyLabel = 'Tape Servers'
}
if ($BackupTapeServers) {
SubGraph MainTapeInfra -Attributes @{Label=$DiagramLabel; fontsize=22; penwidth=1; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
SubGraph MainSubGraph -Attributes @{Label=$DiagramLabel; fontsize=22; penwidth=1; labelloc='t'; style='dashed,rounded'; color=$SubGraphDebug.color} {
if ($BackupTapeServers) {
# Node used for subgraph centering
node TapeServersLabel @{Label=$DiagramDummyLabel; fontsize=22; fontname="Segoe Ui Black"; fontcolor='#005f4b'; shape='plain'}
node TapeLeft @{Label='TapeLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node TapeLeftt @{Label='TapeLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node TapeRight @{Label='TapeRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge TapeLeft,TapeLeftt,TapeServersLabel,TapeRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank TapeLeft,TapeLeftt,TapeServersLabel,TapeRight
if ($Dir -eq "TB") {
node TapeLeft @{Label='TapeLeft'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node TapeLeftt @{Label='TapeLeftt'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
node TapeRight @{Label='TapeRight'; style=$EdgeDebug.style; color=$EdgeDebug.color; shape='plain'; fillColor='transparent'}
edge TapeLeft,TapeLeftt,TapeServersLabel,TapeRight @{style=$EdgeDebug.style; color=$EdgeDebug.color}
rank TapeLeft,TapeLeftt,TapeServersLabel,TapeRight
}
SubGraph TapeServers -Attributes @{Label=' '; fontsize=18; penwidth=1.5; labelloc='t'; style=$SubGraphDebug.style; color=$SubGraphDebug.color} {
# Node used for subgraph centering
node TapeServerDummy @{Label=$DiagramDummyLabel; shape='plain'; style=$EdgeDebug.style; color=$EdgeDebug.color}
Expand Down
Loading

0 comments on commit 1c734ce

Please sign in to comment.