Skip to content

Commit

Permalink
Merge branch 'dev' into SubgraphEnhacement
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux authored Nov 11, 2024
2 parents 7a923b0 + 0d3040d commit 3c5faef
Show file tree
Hide file tree
Showing 14 changed files with 272 additions and 107 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.12] - 2024-10-30

### Added

- Add code to properly display diskspace information

### Fixed

- Fix [#43](https://github.com/rebelinux/Veeam.Diagrammer/issues/43)

## [0.6.11] - 2024-10-20

### Changed

- Increase Diagrammer.Core minimum version requirement

### Fixed

- Fix bug in Service Provider section

## [0.6.10] - 2024-10-19

### Changed

- Enhance Diagram design
- Increase Diagrammer.Core minimum version requirement

## [0.6.9] - 2024-10-10

### Added

- Add DependaBot action

### Fixed

- Fix a issue on error handling
Expand Down
121 changes: 86 additions & 35 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.6.9
Version: 0.6.10
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -30,43 +30,94 @@ function Get-DiagBackupToSobr {

if ($SobrRepo) {
if ($SobrRepo) {
SubGraph MainSubGraph -Attributes @{Label = 'SOBR Repositories' ; fontsize = 22; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded'; color = $SubGraphDebug.color } {
foreach ($SOBROBJ in $SobrRepo) {
$SubGraphName = Remove-SpecialChar -String $SOBROBJ.Name -SpecialChars '\- '
SubGraph $SubGraphName -Attributes @{Label = $SOBROBJ.Name; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
$SOBROBJ | ForEach-Object { Node $_.Name @{Label = $_.Label; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
if ($SOBROBJ.Performance) {
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-DiaNodeIcon -Name $_.Name -IconType $_.IconType -Align "Center" -Rows $_.AditionalInfo -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}
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-DiaNodeIcon -Name $_.Name -IconType $_.IconType -Align "Center" -Rows $_.AditionalInfo -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}
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-DiaNodeIcon -Name $_.Name -IconType $_.Icon -Align "Center" -Rows $_.Rows -ImagesObj $Images -IconDebug $IconDebug; fontname = "Segoe Ui"; shape = "plain"; fillColor = 'transparent' } }
}
}

if ($SOBROBJ.Archive) {
$SOBROBJ.Performance | ForEach-Object { Edge -From $SOBROBJ.Name -To $SOBROBJ.Archive.Name, $SOBROBJ.Capacity.Name, $_.Name @{minlen = 2 } } | Select-Object -Unique

} else {
$SOBROBJ.Performance | ForEach-Object { Edge -From $SOBROBJ.Name -To $_.Name @{minlen = 2 } } | Select-Object -Unique
$SOBROBJ.Capacity | ForEach-Object { Edge -From $SOBROBJ.Name -To $_.Name @{minlen = 2 } } | Select-Object -Unique

}
$SOBRArray = @()
foreach ($SOBROBJ in $SobrRepo) {

$SOBRExtentNodesArray = @()
$SOBRNodesArray = @()

$SOBROBJNode = $SOBROBJ.Label

if ($SOBROBJNode) {
$SOBRNodesArray += $SOBROBJNode
}

if ($SOBROBJ.Performance) {

$Performance = try {
Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Performance.Name -Align "Center" -iconType $SOBROBJ.Performance.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Performance.AditionalInfo -Subgraph -SubgraphLabel "Performance Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1"
} catch {
Write-Verbose "Error: Unable to create SOBR Performance Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Performance) {
$SOBRExtentNodesArray += $Performance
}
}
if ($SOBROBJ.Capacity) {

$Capacity = try {
Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Capacity.Name -Align "Center" -iconType $SOBROBJ.Capacity.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Capacity.AditionalInfo -Subgraph -SubgraphLabel "Capacity Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1"
} catch {
Write-Verbose "Error: Unable to create SOBR Capacity Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Capacity) {
$SOBRExtentNodesArray += $Capacity
}
}
if ($SOBROBJ.Archive) {

$Archive = try {
Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SOBROBJ.Archive.Name -Align "Center" -iconType $SOBROBJ.Archive.IconType -columnSize 3 -IconDebug $IconDebug -MultiIcon -AditionalInfo $SOBROBJ.Archive.AditionalInfo -Subgraph -SubgraphLabel "Archive Extent" -SubgraphLabelPos "top" -SubgraphTableStyle "dashed,rounded" -fontColor $Fontcolor -TableBorderColor $Edgecolor -TableBorder "1"

} catch {
Write-Verbose "Error: Unable to create SOBR Archive Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($Archive) {
$SOBRExtentNodesArray += $Archive
}
Edge -From MainSubGraph:s -To $SOBROBJ.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}

$SOBRExtentSubgraphNode = try {
Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRExtentNodesArray -Align 'Center' -IconDebug $IconDebug -Label 'Extents' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3
} catch {
Write-Verbose "Error: Unable to create SOBR Extents SubGraph Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($SOBRExtentSubgraphNode) {
$SOBRNodesArray += $SOBRExtentSubgraphNode
}

$SOBRSubgraphNode = try {
Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRNodesArray -Align 'Center' -IconDebug $IconDebug -Label $SOBROBJ.Name -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 1
} catch {
Write-Verbose "Error: Unable to create SOBR SubGraph Nodes Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($SOBRSubgraphNode) {
$SOBRArray += $SOBRSubgraphNode
}
}

$SOBRSubgraph = try {
Node -Name SOBRRepo -Attributes @{Label = (Get-DiaHTMLSubGraph -ImagesObj $Images -TableArray $SOBRArray -Align 'Center' -IconDebug $IconDebug -Label 'SOBR Repositories' -LabelPos "top" -fontColor $Fontcolor -TableStyle "dashed,rounded" -TableBorderColor $Edgecolor -TableBorder "1" -columnSize 3); shape = 'plain'; fillColor = 'transparent'; fontsize = 14; fontname = "Segoe Ui" }
} catch {
Write-Verbose "Error: Unable to create SOBR SubGraph Objects. Disabling the section"
Write-Verbose "Error Message: $($_.Exception.Message)"
}

if ($SOBRSubgraph) {
$SOBRSubgraph
}
Edge -From $BackupServerInfo.Name -To MainSubGraph @{minlen = 3 }

Edge -From $BackupServerInfo.Name -To SOBRRepo @{minlen = 3 }

}
}
Expand Down
Loading

0 comments on commit 3c5faef

Please sign in to comment.