mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-18 20:54:25 +01:00
30 lines
775 B
C#
30 lines
775 B
C#
using System.Threading.Tasks;
|
|
using BTCPayServer.Models;
|
|
using BTCPayServer.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Components
|
|
{
|
|
public class RobotsMetaViewComponent : ViewComponent
|
|
{
|
|
private readonly SettingsRepository _SettingsRepository;
|
|
|
|
public RobotsMetaViewComponent(SettingsRepository settingsRepository)
|
|
{
|
|
_SettingsRepository = settingsRepository;
|
|
}
|
|
|
|
public async Task<IViewComponentResult> InvokeAsync()
|
|
{
|
|
var policies = await _SettingsRepository.GetSettingAsync<PoliciesSettings>();
|
|
|
|
return View(new RobotsMetaViewModel()
|
|
{
|
|
DiscourageSearchEngines = policies.DiscourageSearchEngines
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
}
|