mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
ad8f347989
Moves the `ViewsRazor` extension into Abstractions, so that it can be used by plugins. Separated out of #2701, prerequisite for the LNbank plugin integration.
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using BTCPayServer.Abstractions.Extensions;
|
|
using BTCPayServer.Services;
|
|
|
|
namespace BTCPayServer.Models.ServerViewModels
|
|
{
|
|
public class DynamicDnsViewModel
|
|
{
|
|
public class WellKnownService
|
|
{
|
|
public WellKnownService(string name, string url)
|
|
{
|
|
Name = name;
|
|
Url = url;
|
|
}
|
|
public string Name { get; set; }
|
|
public string Url { get; set; }
|
|
}
|
|
public bool Modify { get; set; }
|
|
public DynamicDnsService Settings { get; set; }
|
|
public string LastUpdated
|
|
{
|
|
get
|
|
{
|
|
if (Settings?.LastUpdated is DateTimeOffset date)
|
|
{
|
|
return ViewsRazor.ToTimeAgo(date);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
public WellKnownService[] KnownServices { get; set; } = new[]
|
|
{
|
|
new WellKnownService("noip", "https://dynupdate.no-ip.com/nic/update"),
|
|
new WellKnownService("dyndns", "https://members.dyndns.org/v3/update"),
|
|
new WellKnownService("duckdns", "https://www.duckdns.org/v3/update"),
|
|
new WellKnownService("google", "https://domains.google.com/nic/update"),
|
|
};
|
|
}
|
|
}
|