-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Azure AI Search (Azure Cognitive Search) Module (#14925)
- Loading branch information
1 parent
d315de4
commit 42837c9
Showing
104 changed files
with
4,430 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/OrchardCore.Modules/OrchardCore.Search.AzureAI/AdminMenu.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Localization; | ||
using OrchardCore.Navigation; | ||
|
||
namespace OrchardCore.Search.AzureAI; | ||
|
||
public class AdminMenu(IStringLocalizer<AdminMenu> stringLocalizer) : INavigationProvider | ||
{ | ||
protected readonly IStringLocalizer S = stringLocalizer; | ||
|
||
public Task BuildNavigationAsync(string name, NavigationBuilder builder) | ||
{ | ||
if (!string.Equals(name, "admin", StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
|
||
builder | ||
.Add(S["Search"], NavigationConstants.AdminMenuSearchPosition, search => search | ||
.AddClass("azure-ai-service") | ||
.Id("azureaiservice") | ||
.Add(S["Indexing"], S["Indexing"].PrefixPosition(), indexing => indexing | ||
.Add(S["Azure AI Indices"], S["Azure AI Indices"].PrefixPosition(), indexes => indexes | ||
.Action("Index", "Admin", new { area = "OrchardCore.Search.AzureAI" }) | ||
.Permission(AzureAISearchIndexPermissionHelper.ManageAzureAISearchIndexes) | ||
.LocalNav() | ||
) | ||
) | ||
); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |
Oops, something went wrong.