btcpayserver/BTCPayServer/Services/ThemesSettings.cs
d11n 4ae1046571
Server Settings: Customize instance name and add contact URL (#5718)
* Server Settings: Customize instance name and add contact URL

- The custom instance name would improve #5563
- Added contact URL closes #4806

* Fix custom logo display
2024-02-21 20:54:39 +01:00

45 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace BTCPayServer.Services;
public enum ThemeExtension
{
[Display(Name = "Does not extend a BTCPay Server theme, fully custom")]
Custom,
[Display(Name = "Extends the BTCPay Server Light theme")]
Light,
[Display(Name = "Extends the BTCPay Server Dark theme")]
Dark
}
public class ThemeSettings
{
[Display(Name = "Use custom theme")]
public bool CustomTheme { get; set; }
[Display(Name = "Custom Theme Extension Type")]
public ThemeExtension CustomThemeExtension { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[MaxLength(500)]
[Display(Name = "Custom Theme CSS URL")]
public string CustomThemeCssUri { get; set; }
public string CustomThemeFileId { get; set; }
public string LogoFileId { get; set; }
public bool FirstRun { get; set; }
public override string ToString()
{
// no logs
return string.Empty;
}
public string CssUri
{
get => CustomTheme ? CustomThemeCssUri : "/main/themes/default.css";
}
}