Skip to content

Commit

Permalink
Fix for issue #101.
Browse files Browse the repository at this point in the history
  • Loading branch information
CraigHawker committed Apr 27, 2023
1 parent 44d62c6 commit f32f321
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,40 @@ public abstract partial class ConfigurableVaultApplicationBase<TSecureConfigurat
public override string GetDashboardContent(IConfigurationRequestContext context)
{
// Create a new dashboard.
var dashboard = this.CreateStatusDashboard();
if (null == dashboard)
return "";
StatusDashboard dashboard;
try
{
dashboard = this.CreateStatusDashboard();
if (null == dashboard)
return "";
}
catch(Exception e)
{
// Log the exception and render an exception panel.
var exception = new Exception("Could not create status dashboard", e);
FormattableString message = $"Could not create status dashboard.";
this.Logger?.Error(e, message);
return new ExceptionDashboardPanel(exception, $"Could not create status dashboard")?.ToString();
}

// Add all content in turn.
foreach (var content in this.GetStatusDashboardRootItems(context) ?? Enumerable.Empty<IDashboardContent>())
if (null != content)
dashboard.AddContent(content);

// Return the dashboard.
return dashboard.ToString();
try
{
return dashboard.ToString();
}
catch (Exception e)
{
// Log the exception and render an exception panel.
var exception = new Exception("Could not render dashboard to a string", e);
FormattableString message = $"Could not render dashboard to a string.";
this.Logger?.Error(e, message);
return new ExceptionDashboardPanel(exception, $"Could not render dashboard")?.ToString();
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ public virtual DashboardPanelEx GetApplicationDetailsDashboardContent()
row.AddCell(Resources.Licensing.ApplicationDetailsPanel_RowHeaders_Publisher, DashboardTableCellType.Header)
.HeaderStyles
.Remove("border-bottom");
row.AddCell(ApplicationDefinition.Publisher.ToString());
row.AddCell(ApplicationDefinition.Publisher.EscapeXmlForDashboard());
}
if (this.ShowCopyright && false == string.IsNullOrWhiteSpace(ApplicationDefinition.Copyright))
{
var row = table.AddRow();
row.AddCell(Resources.Licensing.ApplicationDetailsPanel_RowHeaders_Copyright, DashboardTableCellType.Header)
.HeaderStyles
.Remove("border-bottom");
row.AddCell($"&copy; {ApplicationDefinition.Copyright}");
row.AddCell($"&copy; {ApplicationDefinition.Copyright.EscapeXmlForDashboard()}");
}

innerContent.Add(table);
Expand Down

0 comments on commit f32f321

Please sign in to comment.