From 450a370bc4f494dd4d068ca1d64f3eb39cebebb1 Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Tue, 21 May 2024 07:52:36 -0500 Subject: [PATCH 01/10] 2024-05-21 - BryanSoltis - v4.2.0 Updates - Added support for Custom Welcome Content --- src/Components/Pages/Admin.razor | 46 ++++++++++++- src/Components/Pages/Index.razor | 101 +++++++++++++++------------- src/Models/ConfigurationData.cs | 5 ++ src/Models/SiteConfiguration.cs | 5 ++ src/Services/ImportExportService.cs | 5 ++ 5 files changed, 116 insertions(+), 46 deletions(-) diff --git a/src/Components/Pages/Admin.razor b/src/Components/Pages/Admin.razor index 20cd899..caf5e9c 100644 --- a/src/Components/Pages/Admin.razor +++ b/src/Components/Pages/Admin.razor @@ -552,6 +552,28 @@ + +
+ +
+
+

+ Use the form below to set the tool welcome text. +

+
+
+
Content
+ +
+
+ +
+
+
-
-
Global Admin Password
-

This section allows you to update the Global Admin password for the tool.

+
Customization
+
+

This section allows you to customize the Azure Naming Tool site with custom Home content, custom logos, and other configurations.

+
    +
  • + Custom Home Content +

    + You can enter custom Markdown content that will be displayed on the Home page. This can be used to provide additional information to users. +

    +
  • +
+
+
+
+
+
+
Security
+
+

This section allows for the configuration of the identity settings, if using an Identity provider for Authentication.

+
    +
  • + Global Admin Password +

    + This section allows you to update the Global Admin password for the tool. +

    +
  • +
  • + API Keys +

    + This section allows you to update the Full-Access and Read-Only API Keys for the tool. +

    +
  • +
+
@@ -58,14 +89,6 @@
-
-
-
API Keys
-

- The Azure Naming Tool provides a RESTful API. Each API function requires an API Key to be provided. This section provides the ability to view/update the API Key for the tool. -

-
-
Clear Cache
@@ -137,12 +160,6 @@ The Azure Naming Tool can post generated names to a webhook. This can be used to integrate with other systems. Enter a valid URL below to save the webhook setting.

-
  • - Custom Welcome Content -

    - This setting is used to enter custom Markdown content that will be displayed on the Home page. This can be used to provide additional information to users. -

    -
  • diff --git a/src/Components/Layout/NavMenu.razor b/src/Components/Layout/NavMenu.razor index dcbf3fe..c31592c 100644 --- a/src/Components/Layout/NavMenu.razor +++ b/src/Components/Layout/NavMenu.razor @@ -10,7 +10,7 @@ +
    +
    + +
    +
    +

    + This section allows you to customize the Azure Naming Tool site. +

    + @*
    + +
    +

    + You can enter custom Name for the tool that will be displayed within the site. +

    +
    +
    Name
    + +
    +
    + + + +
    +
    +
    *@ +
    + +
    +
    +

    + You can enter custom Markdown content that will be displayed on the Home page. This can be used to provide additional information to users. +

    +
    +
    +
    Content
    + +
    +
    + + + +
    +
    +
    + @*
    + + +
    *@ +
    +
    -
    +
    +

    + This section allows you to update the Global Admin password and API keys for the Azure Naming Tool site. +

    @if (currentuser == "GlobalAdmin") {
    @@ -193,15 +275,15 @@ Identity Provider Settings -
    +
    +

    + This section is used to configure the Identity Provider settings for the site if authentication is implemented. The Azure Naming Tool is designed to work with Azure App Service Authentication, by default. If the Azure Naming Tool is configured to identify users, the site will track user activity. Users can also be designated as Admins using the Admin Users configuration. +

    +

    + You can learn more about the new Identity Provider Integration HERE. +

    @if (currentuser == "GlobalAdmin") { -

    - This section is used to configure the Identity Provider settings for the site if authentication is implemented. The Azure Naming Tool is designed to work with Azure App Service Authentication, by default. If the Azure Naming Tool is configured to identify users, the site will track user activity. Users can also be designated as Admins using the Admin Users configuration. -

    -

    - You can learn more about the new Identity Provider Integration HERE. -

    @if (!String.IsNullOrEmpty(currentidentityprovider)) {
    @@ -335,15 +417,39 @@ Cache -
    +

    - The tool uses caching for data to improve performance. Click Clear to clear all cached data. + The tool uses caching for data to improve performance.

    -
    -

    - - -

    +
    + +
    +

    + Click View to view cached data. +

    +

    + +

    +
    +
    +
    + +
    +

    + Click Clear to clear all cached data. +

    +

    + +

    +
    @@ -353,7 +459,10 @@ Site Settings -
    +
    +

    + This section allows you to configure the site settings for the Azure Naming Tool. +

    -
    -
    -

    - You can enter custom Markdown content that will be displayed on the Home page. This can be used to provide additional information to users. -

    -
    -
    -
    -
    -
    -

    Content

    - -
    -
    -

    Preview

    - @((MarkupString)Markdown.ToHtml(currentcustomwelcomecontent)) -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -

    - You can enter custom Name for the tool that will be displayed within the site. -

    -
    -
    Name
    - -
    -
    - - - -
    -
    -
    *@ + +
    +

    + You can enter custom Name for the tool that will be displayed within the site. +

    +
    +
    Name
    + +
    +
    + + + +
    +
    +
    *@
    *@ +
    @@ -419,7 +433,7 @@

    - The tool uses caching for data to improve performance. + This section allows you to view/manage cached data for the tool.

    @@ -1439,9 +1453,10 @@ { var trustedFileName = Path.GetRandomFileName(); - await using FileStream fs = new(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings/" + e.File.Name), FileMode.Create); + await using FileStream fs = new(Path.Combine(Environment.CurrentDirectory, "wwwroot/images/" + e.File.Name), FileMode.Create); await e.File.OpenReadStream(maxFileSize).CopyToAsync(fs); - //ConfigurationHelper.SetAppSetting("CustomLogoPath", "settings/" + e.File.Name ?? ""); + ConfigurationHelper.SetAppSetting("CustomLogoPath", "images/" + e.File.Name ?? ""); + customlogopath = "images/" + e.File.Name; message.Message = "Custom Logo uploaded!"; } catch (Exception ex) @@ -1470,6 +1485,6 @@ } AdminLogService.PostItem(new AdminLogMessage() { Title = message.Type.ToString(), Message = message.Message, Source = currentuser }); } - + StateHasChanged(); } } From 419ed034e8c0c06314b547e9ed12987210faaa3a Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Fri, 24 May 2024 07:56:47 -0500 Subject: [PATCH 06/10] 2024-05-21 - BryanSoltis - v4.2.0 Updates ### FEATURES - Added support for Custom Welcome Content - Added support for Custom Logo - Added support to enbale/disable Reference and Configuration links - Updated Admin page layout - Updated Nuget packages ### BUG FIXES - Minor formatting updates - Minor grammar updates --- src/AzureNamingTool.csproj | 8 ++ src/Components/Layout/NavMenu.razor | 38 ++--- src/Components/Pages/Admin.razor | 209 +++++++++++++++++++--------- src/Models/ConfigurationData.cs | 10 ++ src/Models/SiteConfiguration.cs | 10 ++ src/Services/ImportExportService.cs | 10 ++ 6 files changed, 203 insertions(+), 82 deletions(-) diff --git a/src/AzureNamingTool.csproj b/src/AzureNamingTool.csproj index 6b730bc..31988a9 100644 --- a/src/AzureNamingTool.csproj +++ b/src/AzureNamingTool.csproj @@ -11,6 +11,14 @@ . + + + + + + + + diff --git a/src/Components/Layout/NavMenu.razor b/src/Components/Layout/NavMenu.razor index c31592c..a2e2a85 100644 --- a/src/Components/Layout/NavMenu.razor +++ b/src/Components/Layout/NavMenu.razor @@ -41,20 +41,26 @@ { + Instructions + +
    + } + @if (Convert.ToBoolean(config.ConfigurationEnabled) || admin) + { + + } + @if (Convert.ToBoolean(config.ReferenceEnabled) || admin) + { + } - - } @if (GeneralHelper.IsNotNull(PageType)) diff --git a/src/Components/Pages/Admin.razor b/src/Components/Pages/Admin.razor index b02314b..4553e06 100644 --- a/src/Components/Pages/Admin.razor +++ b/src/Components/Pages/Admin.razor @@ -181,7 +181,7 @@
    Upload
    - +
    + + +
    @@ -540,71 +659,7 @@
    -
    - -
    -
    -

    - Enable/Disable the Instructions page for non-admin users. (Documentation links will still be visible.) -

    -
    -
    - - Enable -
    -
    -
    -
    - -
    -
    -

    - Enable/Disable the Generated Names Log page for non-admin users. -

    -
    -
    - - Enable -
    -
    -
    -
    - -
    -
    -

    - Enable/Disable the Latest News for all users. -

    -
    -
    - - Enable -
    -
    -
    - +

    From d119847f4e108c6c62ad56c857d1a3faa687b0e4 Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Fri, 24 May 2024 13:11:21 -0500 Subject: [PATCH 10/10] - Updated admin messaging --- src/Components/Pages/Admin.razor | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Components/Pages/Admin.razor b/src/Components/Pages/Admin.razor index 6279119..18ff023 100644 --- a/src/Components/Pages/Admin.razor +++ b/src/Components/Pages/Admin.razor @@ -142,7 +142,7 @@

    - +
    @@ -182,9 +182,16 @@