2023-03-26 13:42:38 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2023-02-22 03:47:02 +01:00
|
|
|
using BTCPayServer.Services;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Components.LabelManager
|
|
|
|
{
|
|
|
|
public class LabelManager : ViewComponent
|
|
|
|
{
|
2023-03-26 13:42:38 +02:00
|
|
|
public IViewComponentResult Invoke(WalletObjectId walletObjectId, string[] selectedLabels, bool excludeTypes = true, bool displayInline = false, Dictionary<string, RichLabelInfo> richLabelInfo = null, bool autoUpdate = true, string selectElement = null)
|
2023-02-22 03:47:02 +01:00
|
|
|
{
|
|
|
|
var vm = new LabelViewModel
|
|
|
|
{
|
2023-03-26 13:42:38 +02:00
|
|
|
ExcludeTypes = excludeTypes,
|
|
|
|
WalletObjectId = walletObjectId,
|
|
|
|
SelectedLabels = selectedLabels?? Array.Empty<string>(),
|
|
|
|
DisplayInline = displayInline,
|
|
|
|
RichLabelInfo = richLabelInfo,
|
|
|
|
AutoUpdate = autoUpdate,
|
|
|
|
SelectElement = selectElement
|
2023-02-22 03:47:02 +01:00
|
|
|
};
|
|
|
|
return View(vm);
|
|
|
|
}
|
|
|
|
}
|
2023-03-26 13:42:38 +02:00
|
|
|
|
|
|
|
public class RichLabelInfo
|
|
|
|
{
|
|
|
|
public string Link { get; set; }
|
|
|
|
public string Tooltip { get; set; }
|
|
|
|
}
|
2023-02-22 03:47:02 +01:00
|
|
|
}
|